From a0c485ce8f07dbc98e314c26beea377f4ecd4f02 Mon Sep 17 00:00:00 2001 From: 100pah Date: Fri, 20 Nov 2020 23:37:11 +0800 Subject: [PATCH] release: 5.0.0-rc.3 --- dist/echarts.common.js | 28 ++++++++++++++++++---------- dist/echarts.common.js.map | 2 +- dist/echarts.common.min.js | 2 +- dist/echarts.esm.js | 30 +++++++++++++++++++----------- dist/echarts.esm.js.map | 2 +- dist/echarts.esm.min.js | 2 +- dist/echarts.js | 30 +++++++++++++++++++----------- dist/echarts.js.map | 2 +- dist/echarts.min.js | 2 +- dist/echarts.simple.js | 10 +++++----- dist/echarts.simple.js.map | 2 +- dist/echarts.simple.min.js | 2 +- package-lock.json | 6 +++--- package.json | 4 ++-- src/echarts.ts | 2 +- 15 files changed, 75 insertions(+), 51 deletions(-) diff --git a/dist/echarts.common.js b/dist/echarts.common.js index c8b3f99352..cfcb58eed3 100644 --- a/dist/echarts.common.js +++ b/dist/echarts.common.js @@ -189,7 +189,7 @@ } if (typeof console !== 'undefined') { - console.error.apply(args); + console.error.apply(console, args); } } @@ -3698,7 +3698,7 @@ this._target = target; this._loop = loop; - if (loop) { + if (loop && additiveTo) { logError('Can\' use additive animation on looped animation.'); return; } @@ -14046,7 +14046,7 @@ ZRender.prototype.refreshHoverImmediately = function () { this._needsRefreshHover = false; - if (this.painter.refreshHover) { + if (this.painter.refreshHover && this.painter.getType() === 'canvas') { this.painter.refreshHover(); } }; @@ -14150,7 +14150,7 @@ painterCtors[name] = Ctor; } - var version = '5.0.0'; + var version = '5.0.1'; var zrender = /*#__PURE__*/Object.freeze({ __proto__: null, init: init, @@ -17371,7 +17371,7 @@ var fullDayFormatter = '{yyyy}-{MM}-{dd}'; var fullLeveledFormatter = { year: '{yyyy}', - month: '{yyyy}:{MM}', + month: '{yyyy}-{MM}', day: fullDayFormatter, hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, @@ -26925,7 +26925,7 @@ var wmUniqueIndex = Math.round(Math.random() * 9); - var WeakMap$1 = function () { + var WeakMap = function () { function WeakMap() { this._id = '__ec_inner_' + wmUniqueIndex++; } @@ -27224,7 +27224,7 @@ return symbolPath; } - var decalMap = new WeakMap$1(); + var decalMap = new WeakMap(); var decalCache = new LRU(100); var decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'dashLineOffset', 'maxTileWidth', 'maxTileHeight']; @@ -27607,7 +27607,7 @@ var isObject$2 = isObject; var version$1 = '5.0.0'; var dependencies = { - zrender: '5.0.0' + zrender: '5.0.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_SERIES_FILTER = 800; @@ -52930,6 +52930,10 @@ return value.type === 'radial'; } + function isGradient(value) { + return value && (value.type === 'linear' || value.type === 'radial'); + } + var GradientManager = function (_super) { __extends(GradientManager, _super); @@ -52943,7 +52947,7 @@ each(['fill', 'stroke'], function (fillOrStroke) { var value = displayable.style[fillOrStroke]; - if (value && (value.type === 'linear' || value.type === 'radial')) { + if (isGradient(value)) { var gradient = value; var defs = that_1.getDefs(true); var dom = void 0; @@ -52986,6 +52990,10 @@ }; GradientManager.prototype.update = function (gradient) { + if (!isGradient(gradient)) { + return; + } + var that = this; this.doUpdate(gradient, function () { var dom = gradient.__dom; @@ -53211,7 +53219,7 @@ } if (isPattern(displayable.style.stroke)) { - _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill)); + _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke)); } } }; diff --git a/dist/echarts.common.js.map b/dist/echarts.common.js.map index c69b7761b9..d3b505b964 100644 --- a/dist/echarts.common.js.map +++ b/dist/echarts.common.js.map @@ -1 +1 @@ -{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","exec","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","fontSize","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","fontFamily","fontWeight","fontStyle","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","count","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","queryDataIndex","payload","dataIndexInside","dataIndex","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","method","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","dataIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getLayoutRect","positionInfo","containerRect","containerHeight","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","hvIdx","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","seriesId","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","evaluate","lval","rval","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","PI2$6","CMD$3","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","tan","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","getType","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap$1","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","url","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","to","finderOpt","fromResult","toResult","toSeries","dimension","dividingMethod","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","baseAxis","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","bandWidth","getBandWidth","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","axisKey","stackId","doCalBarWidthAndOffset","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","c2","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","polyline","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$7","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","inner$6","_nonShapeGraphicElements","compoundPath","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","els","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elOption","elExisting","parentId","targetElParent","elOptionStyle","textContentOption","convertResult","elOptionCleaned","getCleanedElOption","createEl","removeEl","textContentExisting","elInner","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","parentEl","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","graphicType","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","findPointFromSeries","getTooltipPosition","isStacked","inner$7","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showPointer","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysType","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$8","each$4","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","triggerOn","inner$9","clone$3","bind$1","BaseAxisPointer","_dragging","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","labelEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","ondragend","_onHandleDragEnd","handleSize","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xy","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","layoutInfo","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","CartesianAxisPointer","otherExtent","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","icon","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","tooltipModel","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","getSize","ratioX","ratioY","visibility","isShow","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$5","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_ecModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","vAlign","viewSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","lastItem","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","unSelect","toggleSelected","allSelect","inverseSelect","getOrient","itemGap","itemWidth","itemHeight","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","layout$2","viewportSize","makeBackground","curry$1","each$6","Group$1","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","contentGroup","legendDrawnMap","selectMode","legendSymbolType","itemGroup","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","onclick","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","dataName","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","horizontal","vertical","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","raw","Group$2","WH","XY","ScrollableLegendView","_currentIndex","_containerGroup","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","containerGroup","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","targetDataIndex","defaultIndex","legendDataIdx","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","fillLabel","inner$a","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","median","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","radiusAxis","angleAxis","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$b","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","createSymbol$1","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","inner$c","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","toCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","fromSymbol","toSymbolRotate","toSymbolSize","toSymbol","optData","dimValueGetter$1","MarkAreaModel","inner$d","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","dataZoomModel","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","axisModels","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_orient","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","getPercentRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","realtime","zoomLock","brushSelect","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","Rect$1","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrush","_onBrushEnd","_buildView","_updateView","thisGroup","_brushing","brushRect","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","ecSize","layoutParams","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","getShadowDim","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","getTargetSeriesModels","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","iconSize","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","minMaxSpan","getMinMaxSpan","percentExtent","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","calculateDataWindow","valueWindow","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","_dispatchZoomAction","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","mouseX","mouseY","brushStart","endPoint","dataZoomId","coordSysInfoList","each$7","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","axisMainType","_minMaxSpan","_dataExtent","percentWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","targetSeries","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","filterData","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","percentSpan","valueSpan","eachAxisModel","proxyList","percentRange","valueRange","InsideZoomModel","disabled","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","isDragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","inner$e","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","pixel","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","radiusExtent","getRadiusAxis","angleExtent","getAngleAxis","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemSize","showTitle","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","pathEmphasisState","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","RegExp","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","originalData","newVal","newValIsObject","shouldDeleteName","newSeriesOptList","BRUSH_PANEL_GLOBAL","mathMin$7","mathMax$7","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","getKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","nameSequence","updateBaseRect","localRange","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","getLinearBrushOtherExtent","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","geoModel","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","sizeOrigin","each$8","inner$f","newSnapshot","storedSnapshots","getStoreSnapshots","snapshot","clear$1","snapshots","SelectDataZoomModel","SelectDataZoomView","each$9","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers","eventParam","brushTargetManager","makeAxisFinder","setBatch","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","DEFAULT_OPTION","inner$g","decalPaletteScope","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","enableAriaDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesCount","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$7","PI2$8","degree","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","newLen","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","defs","getElementsByTagName","defs_1","contains","doUpdate","onUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,CAACD,MAAM,CAACO,OAAP,GAAiB,EAAlB,CADjC,CADA;AAGH,CAJA,EAIC,IAJD,EAIQ,UAAUL,OAAV,EAAmB;AAAE;AAE1B;;;;;;;;;;;;;AAcA;;AAEA,MAAIM,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,IAAAA,aAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,MAAAA,SAAS,EAAE;AAAb,iBAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,MAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAkB,KAD/D,IAEZ,UAAUD,CAAV,EAAaC,CAAb,EAAgB;A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CAACutJ,kBAAR,GAA6BA,kBAA7B;AACAvtJ,EAAAA,OAAO,CAACitJ,oBAAR,GAA+BA,oBAA/B;AACAjtJ,EAAAA,OAAO,CAACmtJ,iBAAR,GAA4BA,iBAA5B;AACAntJ,EAAAA,OAAO,CAACgtJ,aAAR,GAAwBA,aAAxB;AACAhtJ,EAAAA,OAAO,CAAC6uJ,iBAAR,GAA4BA,iBAA5B;AACA7uJ,EAAAA,OAAO,CAACguJ,cAAR,GAAyBA,cAAzB;AACAhuJ,EAAAA,OAAO,CAAC2uJ,gBAAR,GAA2BA,gBAA3B;AACA3uJ,EAAAA,OAAO,CAACgwH,QAAR,GAAmBA,QAAnB;AACAhwH,EAAAA,OAAO,CAACiwB,IAAR,GAAeA,IAAf;AACAjwB,EAAAA,OAAO,CAACg6P,IAAR,GAAep7E,MAAf;AACA5+K,EAAAA,OAAO,CAACsO,MAAR,GAAiBA,MAAjB;AACAtO,EAAAA,OAAO,CAAC8D,OAAR,GAAkB06I,SAAlB;AACAx+I,EAAAA,OAAO,CAACwlE,OAAR,GAAkBA,OAAlB;AAEA/kE,EAAAA,MAAM,CAAC8jC,cAAP,CAAsBvkC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEyH,IAAAA,KAAK,EAAE;AAAT,GAA7C;AAEH,CAxo7CA,CAAD","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n var zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n });\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n var length = len;\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n var lengthSquare = lenSquare;\r\n function mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n }\r\n function div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n }\r\n function dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n }\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n });\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n var _calcOut = [];\r\n function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n }\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut$1 = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\n function isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n }\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n function clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n }\n\n var matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n });\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n }\r\n function fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n }\r\n var fastMapToColor = fastLerp;\r\n function lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n }\r\n var mapToColor = lerp$1;\r\n function modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n }\r\n function modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\r\n function random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n }\n\n var color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n });\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n }\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\r\n function extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n }\r\n function mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n var instances = {};\r\n function delInstance(id) {\r\n delete instances[id];\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover) {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n }\r\n function dispose(zr) {\r\n zr.dispose();\r\n }\r\n function disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n }\r\n function getInstance(id) {\r\n return instances[id];\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\r\n var version = '5.0.0';\n\n var zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n });\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n }\r\n function getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n var MAX_SAFE_INTEGER = 9007199254740991;\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n }\r\n function reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n });\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n var MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n var mathMax$4 = Math.max;\r\n var mathMin$4 = Math.min;\r\n var _customShapeMap = {};\r\n function extendShape(opts) {\r\n return Path.extend(opts);\r\n }\r\n var extendPathFromString = extendFromString;\r\n function extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n }\r\n function registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n }\r\n function getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n }\r\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n var mergePath$1 = mergePath;\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n function subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n var subPixelOptimize$1 = subPixelOptimize;\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n }\r\n function applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n }\r\n function transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\r\n function clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n }\r\n function clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n }\r\n function createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n }\r\n function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n }\r\n function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n }\r\n function nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n }\r\n registerShape('circle', Circle);\r\n registerShape('ellipse', Ellipse);\r\n registerShape('sector', Sector);\r\n registerShape('ring', Ring);\r\n registerShape('polygon', Polygon);\r\n registerShape('polyline', Polyline);\r\n registerShape('rect', Rect);\r\n registerShape('line', Line);\r\n registerShape('bezierCurve', BezierCurve);\r\n registerShape('arc', Arc);\n\n var graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n });\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}:{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n function toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n function makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n }\r\n function getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n }\r\n function formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n }\r\n function capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\r\n function windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n }\n\n var formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n });\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var box = boxLayout;\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n }\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\r\n function normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n }\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\r\n var SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n }());\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n var TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\n var TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n };\r\n var TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\n var TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n };\r\n var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\n var HTML_GAPS = [0, 10, 20, 30];\r\n var RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n }\r\n var builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n };\r\n function buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n }\r\n function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n }\r\n function getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n }\r\n function wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n }\r\n function wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n }\r\n function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n }\r\n function wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n }\r\n function wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\r\n function getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n }\r\n var TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n }());\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n var ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\n var RATE = '\\0__throttleRate';\r\n var THROTTLE_TYPE = '\\0__throttleType';\r\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\r\n function createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n }\r\n function clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$6 = Math.PI * 2;\r\n var CMD$3 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$6;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$6;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$3.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$3.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$3.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap$1 = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap$1();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version$1 = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.0'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances$1 = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances$1[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n function createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n }\r\n var dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n };\r\n function createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n }\r\n function mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n }\n\n var helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n });\n\n var EPSILON$3 = 1e-8;\r\n function isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n }\r\n function contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n }\n\n var Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n }());\n\n function decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n }\r\n function decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n }\r\n function parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n }\n\n var inner$4 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var parseGeoJson = parseGeoJSON;\r\n var number = {};\r\n each([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n ], function (name) {\r\n number[name] = numberUtil[name];\r\n });\r\n var format$1 = {};\r\n each([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n ], function (name) {\r\n format$1[name] = formatUtil[name];\r\n });\r\n var time = {\r\n parse: parseDate,\r\n format: format\r\n };\r\n var ecUtil = {};\r\n each([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n ], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n });\r\n var GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n ];\r\n var graphic$1 = {};\r\n each(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n });\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$5 = Math.min;\r\n var mathMax$5 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n }\r\n function collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n }\r\n function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n }\r\n function collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n }\r\n function getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n }\r\n function checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n }\r\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$5 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$6 = Math.max;\r\n var mathMin$6 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$7 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$7;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$7 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$7 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$7 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ScatterSeriesModel);\n\n var BOOST_SIZE_THRESHOLD = 4;\r\n var LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n }());\r\n var LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n }(Path));\r\n var LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n }());\n\n var ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(ScatterView);\n\n registerLayout(pointsLayout('scatter'));\n\n function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n }\r\n function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n }\r\n function convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n }\n\n var inner$6 = makeInner();\r\n var _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n };\r\n registerPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n });\r\n var GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GraphicComponentModel);\r\n var GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$6(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$6(el);\r\n var parentElInner = inner$6(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$6(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GraphicComponentView);\r\n function createEl(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$6(el).__ecGraphicId = id;\r\n }\r\n function removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$6(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n }\r\n function getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n }\r\n function isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n }\r\n function setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n }\r\n function mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n }\r\n function setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n }\r\n function setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n }\n\n function findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n }\n\n var inner$7 = makeInner();\r\n function axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n }\r\n function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n }\r\n function buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n }\r\n function showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n }\r\n function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n }\r\n function updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n }\r\n function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n }\r\n function dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$7(zr)[highDownKey] || {};\r\n var newHighlights = inner$7(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n }\r\n function findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n }\r\n function makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n }\r\n function illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n }\n\n var inner$8 = makeInner();\r\n var each$4 = each;\r\n function register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$8(zr).records || (inner$8(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$8(zr).records[key] || (inner$8(zr).records[key] = {});\r\n record.handler = handler;\r\n }\r\n function initGlobalListeners(zr, api) {\r\n if (inner$8(zr).initialized) {\r\n return;\r\n }\r\n inner$8(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$4(inner$8(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n }\r\n function dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n }\r\n function onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n }\r\n function doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n }\r\n function makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n }\r\n function unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$8(zr).records || {})[key];\r\n if (record) {\r\n inner$8(zr).records[key] = null;\r\n }\r\n }\n\n var AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n }(ComponentView));\r\n ComponentView.registerClass(AxisPointerView);\n\n var inner$9 = makeInner();\r\n var clone$3 = clone;\r\n var bind$1 = bind;\r\n var BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$9(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$9(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$9(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$9(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$9(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n }());\r\n function updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$9(el).lastProp, props)) {\r\n inner$9(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n }\r\n function propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n }\r\n function updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n }\r\n function getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n }\r\n function updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n }\n\n function buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n }\r\n function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n }\r\n function confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n }\r\n function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n }\r\n function getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n }\r\n function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n }\r\n function makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n }\r\n function makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n }\n\n var CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n }(BaseAxisPointer));\r\n function getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n }\r\n var pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n }\r\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\n var AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n }(ComponentModel));\n\n ComponentModel.registerClass(AxisPointerModel);\r\n registerPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n });\r\n registerAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n }, axisTrigger);\n\n var TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TooltipModel);\n\n function shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n }\n\n var vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\n var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\n function mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n }\r\n function assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n }\r\n function assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n }\r\n function assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n }\r\n function assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n }\r\n function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\r\n var TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n }());\n\n var TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n }());\r\n function mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n }\r\n function calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n }\r\n function makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\n\n var bind$2 = bind;\r\n var each$5 = each;\r\n var parsePercent$3 = parsePercent$2;\r\n var proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n });\r\n var TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$5(dataByCoordSys, function (itemCoordSys) {\r\n each$5(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$5(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$5(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$5(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n }(ComponentView));\r\n function buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n }\r\n function makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n }\r\n function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n }\r\n function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n }\r\n function calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n }\r\n function isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n }\r\n ComponentView.registerClass(TooltipView);\n\n registerAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n }, function () { });\r\n registerAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n }, function () { });\n\n var getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n };\r\n var LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(LegendModel);\n\n function legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n }\r\n registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\n registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\n registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\n registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\n registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\n function layout$2(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n }\r\n function makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n }\n\n var curry$1 = curry;\r\n var each$6 = each;\r\n var Group$1 = Group;\r\n var LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$1());\r\n this.group.add(this._selectorGroup = new Group$1());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$6(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$1();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$6(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$1();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n }(ComponentView));\r\n function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n }\r\n function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n }\r\n function isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n }\r\n function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n ComponentView.registerClass(LegendView);\n\n function legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\n ComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n });\n\n var ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n }(LegendModel));\r\n function mergeAndNormalizeLayoutParams(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(ScrollableLegendModel);\n\n var Group$2 = Group;\r\n var WH = ['width', 'height'];\r\n var XY = ['x', 'y'];\r\n var ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$2());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$2());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH[orientIdx];\r\n var xy = XY[orientIdx];\r\n var hw = WH[1 - orientIdx];\r\n var yx = XY[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH[orientIdx];\r\n var xy = XY[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n }(LegendView));\r\n ComponentView.registerClass(ScrollableLegendView);\n\n registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n });\n\n var TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TitleModel);\r\n var TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n }(ComponentView));\r\n ComponentView.registerClass(TitleView);\n\n function fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n }\r\n var inner$a = makeInner();\r\n var MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$a(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$a(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$a(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$a(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n }(ComponentModel));\r\n mixin(MarkerModel, DataFormatMixin.prototype);\n\n var MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkPointModel);\n\n function hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n }\r\n function hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n }\r\n function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n }\r\n var markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n };\r\n function dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n }\r\n function getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n }\r\n function dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n }\r\n function dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n }\r\n function dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n }\r\n function numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n }\n\n var inner$b = makeInner();\r\n var MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$b(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$b(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$b(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n }(ComponentView));\n\n function updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n }\r\n var MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n }(MarkerView));\r\n function createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n }\r\n ComponentView.registerClass(MarkPointView);\n\n registerPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n });\n\n var MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkLineModel);\n\n var straightLineProto = Line.prototype;\r\n var bezierCurveProto = BezierCurve.prototype;\r\n var StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n }());\r\n var CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n }(StraightLineShape));\r\n function isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n }\r\n var ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n }(Path));\n\n var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\n function makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n }\r\n function createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n }\r\n function createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n }\r\n function setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n }\r\n var Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n }(Group));\n\n var LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n }());\r\n function isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n }\r\n function makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n }\r\n function isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n }\r\n function lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n }\n\n var inner$c = makeInner();\r\n var markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n };\r\n function isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n }\r\n function markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n }\r\n function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n }\r\n var MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$c(mlModel).from;\r\n var toData_1 = inner$c(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$c(mlModel).from = fromData;\r\n inner$c(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n }(MarkerView));\r\n function createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n }\r\n ComponentView.registerClass(MarkLineView);\n\n registerPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n });\n\n var MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkAreaModel);\n\n var inner$d = makeInner();\r\n var markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n };\r\n function isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n }\r\n function markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n }\r\n function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n }\r\n var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\n var MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$d(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$d(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$d(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$d(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n }(MarkerView));\r\n function createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n }\r\n ComponentView.registerClass(MarkAreaView);\n\n registerPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n });\n\n ComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n });\n\n var DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n ];\r\n var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\n function isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n }\r\n function getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n }\r\n function findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n }\r\n function collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n }\n\n var DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n }());\r\n var DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n }(ComponentModel));\r\n function retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n }\n\n var DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DataZoomView);\n\n var SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SliderZoomModel);\n\n function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n }\r\n function getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n }\r\n function restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n }\n\n var Rect$1 = Rect;\r\n var DEFAULT_LOCATION_EDGE_GAP = 7;\r\n var DEFAULT_FRAME_BORDER_WIDTH = 1;\r\n var DEFAULT_FILLER_SIZE = 30;\r\n var DEFAULT_MOVE_HANDLE_SIZE = 7;\r\n var HORIZONTAL = 'horizontal';\r\n var VERTICAL = 'vertical';\r\n var LABEL_GAP = 5;\r\n var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\n var REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n };\r\n var SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$1({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$1({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$1({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$1({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$1({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n }(DataZoomView));\r\n function getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n }\r\n function getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(SliderZoomView);\n\n var each$7 = each;\r\n var asc$1 = asc;\r\n var AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$7(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$7(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$7(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$7(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n }());\r\n function calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$7(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n });\n\n registerAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n });\n\n var InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(InsideZoomModel);\n\n var ATTR = '\\0_ec_interaction_mutex';\r\n function take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n }\r\n function release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n }\r\n function isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n }\r\n function getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n }\r\n registerAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\n var RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n }(Eventful));\r\n function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n }\r\n function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n }\r\n function isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n }\n\n var inner$e = makeInner();\r\n registerProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$e(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n });\r\n function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$e(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n }\r\n function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$e(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n }\r\n function createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n }\r\n function dispatchAction(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n }\r\n function containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n }\r\n function mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n }\n\n var InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n }(DataZoomView));\r\n var getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n };\r\n function makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n }\r\n var getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n };\r\n ComponentView.registerClass(InsideZoomView);\n\n var ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n }());\r\n var features = {};\r\n function registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n }\r\n function getFeature(name) {\r\n return features[name];\r\n }\n\n var ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ToolboxModel);\n\n var ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$2(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ToolboxView);\r\n function isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n }\n\n var SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n }(ToolboxFeature));\r\n SaveAsImage.prototype.unusable = !env.canvasSupported;\r\n registerFeature('saveAsImage', SaveAsImage);\n\n var INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\n var radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n ];\r\n var MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n }(ToolboxFeature));\r\n var seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n };\r\n registerAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n });\r\n registerFeature('magicType', MagicType);\n\n var BLOCK_SPLITER = new Array(60).join('-');\r\n var ITEM_SPLITER = '\\t';\r\n function groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n }\r\n function assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n }\r\n function trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n }\r\n function isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n }\r\n var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\n function parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n }\r\n function parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n }\r\n function parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n }\r\n var DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n }(ToolboxFeature));\r\n function tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n }\r\n registerFeature('dataView', DataView);\r\n registerAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n });\n\n var BRUSH_PANEL_GLOBAL = true;\r\n var mathMin$7 = Math.min;\r\n var mathMax$7 = Math.max;\r\n var mathPow$2 = Math.pow;\r\n var COVER_Z = 10000;\r\n var UNSELECT_THRESHOLD = 6;\r\n var MIN_RESIZE_LINE_WIDTH = 6;\r\n var MUTEX_RESOURCE_KEY = 'globalPan';\r\n var DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n };\r\n var CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n };\r\n var DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n };\r\n var baseUID = 0;\r\n var BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n }(Eventful));\r\n function createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n }\r\n function endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n }\r\n function updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n }\r\n function updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n }\r\n function updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n }\r\n function getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n }\r\n function getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n }\r\n function getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n }\r\n function clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n }\r\n function trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n }\r\n function shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n }\r\n function getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n }\r\n function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n }\r\n function updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$7(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n }\r\n function updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n }\r\n function updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n }\r\n function makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n }\r\n function formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$7(x, x2), mathMin$7(y, y2)];\r\n var max = [mathMax$7(x, x2), mathMax$7(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n }\r\n function getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n }\r\n function getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n }\r\n function getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n }\r\n function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n }\r\n function clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n }\r\n function pointsToRect(points) {\r\n var xmin = mathMin$7(points[0][0], points[1][0]);\r\n var ymin = mathMin$7(points[0][1], points[1][1]);\r\n var xmax = mathMax$7(points[0][0], points[1][0]);\r\n var ymax = mathMax$7(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n }\r\n function resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n }\r\n function preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n }\r\n function mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n }\r\n function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n }\r\n function determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n }\r\n var pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n };\r\n function handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n }\r\n function isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n }\r\n var coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n };\r\n function getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$7(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$7(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n }\n\n var IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\n function onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n }\n\n function makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n }\r\n function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n }\r\n function makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n }\r\n function normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n }\n\n var COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\n var INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n ];\r\n var BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n }());\r\n function formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n }\r\n function parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n }\r\n var targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n };\r\n var targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n ];\r\n var panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n };\r\n var coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n };\r\n function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n var diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n };\r\n function axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n }\r\n function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n }\r\n function getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n }\n\n var each$8 = each;\r\n var inner$f = makeInner();\r\n function push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$8(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n }\r\n function pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$8(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n }\r\n function clear$1(ecModel) {\r\n inner$f(ecModel).snapshots = null;\r\n }\r\n function count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n }\r\n function getStoreSnapshots(ecModel) {\r\n var store = inner$f(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n }\n\n var SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SelectDataZoomModel);\n\n var SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n }(DataZoomView));\r\n ComponentView.registerClass(SelectDataZoomView);\n\n var each$9 = each;\r\n var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\n var DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$9(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n }(ToolboxFeature));\r\n var handlers = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n };\r\n function makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n }\r\n function updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n }\r\n function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n }\r\n registerFeature('dataZoom', DataZoomFeature);\r\n registerInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$9(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$9(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n });\n\n var RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n }(ToolboxFeature));\r\n registerFeature('restore', RestoreOption);\r\n registerAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n });\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$g = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$g(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$g(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n function createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n }\n\n var NONE = 'none';\r\n var mathRound = Math.round;\r\n var mathSin$4 = Math.sin;\r\n var mathCos$4 = Math.cos;\r\n var PI$7 = Math.PI;\r\n var PI2$8 = Math.PI * 2;\r\n var degree = 180 / PI$7;\r\n var EPSILON$4 = 1e-4;\r\n function round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n }\r\n function round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n }\r\n function isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n }\r\n function pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n }\r\n function pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n }\r\n function setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n }\r\n function attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n }\r\n function attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n }\r\n function attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n }\r\n function bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n }\r\n var SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$8)\r\n || (clockwise ? dTheta >= PI2$8 : -dTheta >= PI2$8);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$8 : (dTheta % PI2$8 + PI2$8);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$7) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$8 - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$8 + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n }());\r\n var svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n };\r\n function adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n }\r\n var svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n };\n\n function diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n }\r\n function extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n }\r\n function pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n }\r\n function buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n }\r\n function clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n }\r\n function arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n }\n\n var MARK_UNUSED = '0';\r\n var MARK_USED = '1';\r\n var Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n }());\n\n function isLinearGradient(value) {\r\n return value.type === 'linear';\r\n }\r\n function isRadialGradient(value) {\r\n return value.type === 'radial';\r\n }\r\n var GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (value\r\n && (value.type === 'linear'\r\n || value.type === 'radial')) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n }(Definable));\n\n function isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n }\r\n var patternDomMap = new WeakMap();\r\n var PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n }(Definable));\n\n function generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n }\r\n function hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n }\r\n var ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n }(Definable));\n\n var ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n }(Definable));\r\n function hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n }\r\n function getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n }\n\n function parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n }\r\n function getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n }\r\n function checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n }\r\n function insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n }\r\n function removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n }\r\n function getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n }\r\n var SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n }());\r\n function createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n }\n\n registerPainter('svg', SVGPainter);\n\n exports.Axis = Axis;\n exports.List = List;\n exports.Model = Model;\n exports.PRIORITY = PRIORITY;\n exports.color = color;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose$1;\n exports.env = env;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.format = format$1;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.graphic = graphic$1;\n exports.helper = helper;\n exports.init = init$1;\n exports.innerDrawElementOnCanvas = brushSingle;\n exports.matrix = matrix;\n exports.number = number;\n exports.parseGeoJSON = parseGeoJSON;\n exports.parseGeoJson = parseGeoJson;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.throttle = throttle;\n exports.time = time;\n exports.util = ecUtil;\n exports.vector = vector;\n exports.version = version$1;\n exports.zrender = zrender;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file +{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","exec","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","fontSize","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","fontFamily","fontWeight","fontStyle","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","getType","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","count","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","queryDataIndex","payload","dataIndexInside","dataIndex","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","method","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","dataIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getLayoutRect","positionInfo","containerRect","containerHeight","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","hvIdx","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","seriesId","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","evaluate","lval","rval","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","PI2$6","CMD$3","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","tan","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","url","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","to","finderOpt","fromResult","toResult","toSeries","dimension","dividingMethod","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","baseAxis","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","bandWidth","getBandWidth","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","axisKey","stackId","doCalBarWidthAndOffset","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","c2","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","polyline","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$7","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","inner$6","_nonShapeGraphicElements","compoundPath","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","els","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elOption","elExisting","parentId","targetElParent","elOptionStyle","textContentOption","convertResult","elOptionCleaned","getCleanedElOption","createEl","removeEl","textContentExisting","elInner","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","parentEl","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","graphicType","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","findPointFromSeries","getTooltipPosition","isStacked","inner$7","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showPointer","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysType","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$8","each$4","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","triggerOn","inner$9","clone$3","bind$1","BaseAxisPointer","_dragging","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","labelEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","ondragend","_onHandleDragEnd","handleSize","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xy","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","layoutInfo","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","CartesianAxisPointer","otherExtent","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","icon","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","tooltipModel","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","getSize","ratioX","ratioY","visibility","isShow","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$5","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_ecModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","vAlign","viewSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","lastItem","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","unSelect","toggleSelected","allSelect","inverseSelect","getOrient","itemGap","itemWidth","itemHeight","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","layout$2","viewportSize","makeBackground","curry$1","each$6","Group$1","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","contentGroup","legendDrawnMap","selectMode","legendSymbolType","itemGroup","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","onclick","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","dataName","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","horizontal","vertical","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","raw","Group$2","WH","XY","ScrollableLegendView","_currentIndex","_containerGroup","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","containerGroup","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","targetDataIndex","defaultIndex","legendDataIdx","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","fillLabel","inner$a","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","median","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","radiusAxis","angleAxis","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$b","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","createSymbol$1","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","inner$c","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","toCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","fromSymbol","toSymbolRotate","toSymbolSize","toSymbol","optData","dimValueGetter$1","MarkAreaModel","inner$d","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","dataZoomModel","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","axisModels","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_orient","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","getPercentRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","realtime","zoomLock","brushSelect","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","Rect$1","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrush","_onBrushEnd","_buildView","_updateView","thisGroup","_brushing","brushRect","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","ecSize","layoutParams","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","getShadowDim","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","getTargetSeriesModels","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","iconSize","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","minMaxSpan","getMinMaxSpan","percentExtent","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","calculateDataWindow","valueWindow","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","_dispatchZoomAction","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","mouseX","mouseY","brushStart","endPoint","dataZoomId","coordSysInfoList","each$7","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","axisMainType","_minMaxSpan","_dataExtent","percentWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","targetSeries","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","filterData","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","percentSpan","valueSpan","eachAxisModel","proxyList","percentRange","valueRange","InsideZoomModel","disabled","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","isDragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","inner$e","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","pixel","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","radiusExtent","getRadiusAxis","angleExtent","getAngleAxis","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemSize","showTitle","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","pathEmphasisState","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","RegExp","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","originalData","newVal","newValIsObject","shouldDeleteName","newSeriesOptList","BRUSH_PANEL_GLOBAL","mathMin$7","mathMax$7","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","getKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","nameSequence","updateBaseRect","localRange","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","getLinearBrushOtherExtent","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","geoModel","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","sizeOrigin","each$8","inner$f","newSnapshot","storedSnapshots","getStoreSnapshots","snapshot","clear$1","snapshots","SelectDataZoomModel","SelectDataZoomView","each$9","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers","eventParam","brushTargetManager","makeAxisFinder","setBatch","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","DEFAULT_OPTION","inner$g","decalPaletteScope","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","enableAriaDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesCount","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$7","PI2$8","degree","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","newLen","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","defs","getElementsByTagName","defs_1","contains","doUpdate","onUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","isGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,CAACD,MAAM,CAACO,OAAP,GAAiB,EAAlB,CADjC,CADA;AAGH,CAJA,EAIC,IAJD,EAIQ,UAAUL,OAAV,EAAmB;AAAE;AAE1B;;;;;;;;;;;;;AAcA;;AAEA,MAAIM,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,IAAAA,aAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,MAAAA,SAAS,EAAE;AAAb,iBAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,MAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAkB,KAD/D,IAEZ,UAAUD,CAAV,EAAaC,CAAb,EAAgB;AAAE,WAAK,IAAIK,CAAT,IAAcL,CAAd,EAAiB,IAAIA,CAAC,CAACM,cAAF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GAAwBA,aAAxB;AACA/sJ,EAAAA,OAAO,CAAC4uJ,iBAAR,GAA4BA,iBAA5B;AACA5uJ,EAAAA,OAAO,CAAC+tJ,cAAR,GAAyBA,cAAzB;AACA/tJ,EAAAA,OAAO,CAAC0uJ,gBAAR,GAA2BA,gBAA3B;AACA1uJ,EAAAA,OAAO,CAACiwH,QAAR,GAAmBA,QAAnB;AACAjwH,EAAAA,OAAO,CAACiwB,IAAR,GAAeA,IAAf;AACAjwB,EAAAA,OAAO,CAACg6P,IAAR,GAAer7E,MAAf;AACA3+K,EAAAA,OAAO,CAACsO,MAAR,GAAiBA,MAAjB;AACAtO,EAAAA,OAAO,CAAC8D,OAAR,GAAkBy6I,SAAlB;AACAv+I,EAAAA,OAAO,CAACylE,OAAR,GAAkBA,OAAlB;AAEAhlE,EAAAA,MAAM,CAAC8jC,cAAP,CAAsBvkC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEyH,IAAAA,KAAK,EAAE;AAAT,GAA7C;AAEH,CA7o7CA,CAAD","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(console, args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n var zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n });\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n var length = len;\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n var lengthSquare = lenSquare;\r\n function mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n }\r\n function div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n }\r\n function dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n }\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n });\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n var _calcOut = [];\r\n function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n }\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut$1 = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\n function isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n }\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n function clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n }\n\n var matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n });\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n }\r\n function fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n }\r\n var fastMapToColor = fastLerp;\r\n function lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n }\r\n var mapToColor = lerp$1;\r\n function modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n }\r\n function modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\r\n function random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n }\n\n var color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n });\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop && additiveTo) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n }\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\r\n function extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n }\r\n function mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n var instances = {};\r\n function delInstance(id) {\r\n delete instances[id];\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n }\r\n function dispose(zr) {\r\n zr.dispose();\r\n }\r\n function disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n }\r\n function getInstance(id) {\r\n return instances[id];\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\r\n var version = '5.0.1';\n\n var zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n });\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n }\r\n function getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n var MAX_SAFE_INTEGER = 9007199254740991;\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n }\r\n function reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n });\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n var MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n var mathMax$4 = Math.max;\r\n var mathMin$4 = Math.min;\r\n var _customShapeMap = {};\r\n function extendShape(opts) {\r\n return Path.extend(opts);\r\n }\r\n var extendPathFromString = extendFromString;\r\n function extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n }\r\n function registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n }\r\n function getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n }\r\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n var mergePath$1 = mergePath;\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n function subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n var subPixelOptimize$1 = subPixelOptimize;\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n }\r\n function applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n }\r\n function transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\r\n function clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n }\r\n function clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n }\r\n function createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n }\r\n function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n }\r\n function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n }\r\n function nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n }\r\n registerShape('circle', Circle);\r\n registerShape('ellipse', Ellipse);\r\n registerShape('sector', Sector);\r\n registerShape('ring', Ring);\r\n registerShape('polygon', Polygon);\r\n registerShape('polyline', Polyline);\r\n registerShape('rect', Rect);\r\n registerShape('line', Line);\r\n registerShape('bezierCurve', BezierCurve);\r\n registerShape('arc', Arc);\n\n var graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n });\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}-{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n function toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n function makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n }\r\n function getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n }\r\n function formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n }\r\n function capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\r\n function windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n }\n\n var formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n });\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var box = boxLayout;\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n }\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\r\n function normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n }\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\r\n var SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n }());\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n var TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\n var TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n };\r\n var TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\n var TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n };\r\n var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\n var HTML_GAPS = [0, 10, 20, 30];\r\n var RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n }\r\n var builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n };\r\n function buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n }\r\n function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n }\r\n function getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n }\r\n function wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n }\r\n function wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n }\r\n function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n }\r\n function wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n }\r\n function wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\r\n function getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n }\r\n var TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n }());\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n var ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\n var RATE = '\\0__throttleRate';\r\n var THROTTLE_TYPE = '\\0__throttleType';\r\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\r\n function createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n }\r\n function clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$6 = Math.PI * 2;\r\n var CMD$3 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$6;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$6;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$3.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$3.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$3.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version$1 = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.1'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances$1 = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances$1[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n function createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n }\r\n var dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n };\r\n function createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n }\r\n function mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n }\n\n var helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n });\n\n var EPSILON$3 = 1e-8;\r\n function isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n }\r\n function contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n }\n\n var Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n }());\n\n function decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n }\r\n function decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n }\r\n function parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n }\n\n var inner$4 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var parseGeoJson = parseGeoJSON;\r\n var number = {};\r\n each([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n ], function (name) {\r\n number[name] = numberUtil[name];\r\n });\r\n var format$1 = {};\r\n each([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n ], function (name) {\r\n format$1[name] = formatUtil[name];\r\n });\r\n var time = {\r\n parse: parseDate,\r\n format: format\r\n };\r\n var ecUtil = {};\r\n each([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n ], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n });\r\n var GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n ];\r\n var graphic$1 = {};\r\n each(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n });\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$5 = Math.min;\r\n var mathMax$5 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n }\r\n function collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n }\r\n function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n }\r\n function collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n }\r\n function getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n }\r\n function checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n }\r\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$5 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$6 = Math.max;\r\n var mathMin$6 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$7 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$7;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$7 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$7 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$7 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ScatterSeriesModel);\n\n var BOOST_SIZE_THRESHOLD = 4;\r\n var LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n }());\r\n var LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n }(Path));\r\n var LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n }());\n\n var ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(ScatterView);\n\n registerLayout(pointsLayout('scatter'));\n\n function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n }\r\n function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n }\r\n function convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n }\n\n var inner$6 = makeInner();\r\n var _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n };\r\n registerPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n });\r\n var GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GraphicComponentModel);\r\n var GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$6(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$6(el);\r\n var parentElInner = inner$6(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$6(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GraphicComponentView);\r\n function createEl(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$6(el).__ecGraphicId = id;\r\n }\r\n function removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$6(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n }\r\n function getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n }\r\n function isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n }\r\n function setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n }\r\n function mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n }\r\n function setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n }\r\n function setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n }\n\n function findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n }\n\n var inner$7 = makeInner();\r\n function axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n }\r\n function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n }\r\n function buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n }\r\n function showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n }\r\n function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n }\r\n function updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n }\r\n function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n }\r\n function dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$7(zr)[highDownKey] || {};\r\n var newHighlights = inner$7(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n }\r\n function findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n }\r\n function makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n }\r\n function illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n }\n\n var inner$8 = makeInner();\r\n var each$4 = each;\r\n function register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$8(zr).records || (inner$8(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$8(zr).records[key] || (inner$8(zr).records[key] = {});\r\n record.handler = handler;\r\n }\r\n function initGlobalListeners(zr, api) {\r\n if (inner$8(zr).initialized) {\r\n return;\r\n }\r\n inner$8(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$4(inner$8(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n }\r\n function dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n }\r\n function onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n }\r\n function doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n }\r\n function makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n }\r\n function unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$8(zr).records || {})[key];\r\n if (record) {\r\n inner$8(zr).records[key] = null;\r\n }\r\n }\n\n var AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n }(ComponentView));\r\n ComponentView.registerClass(AxisPointerView);\n\n var inner$9 = makeInner();\r\n var clone$3 = clone;\r\n var bind$1 = bind;\r\n var BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$9(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$9(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$9(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$9(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$9(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n }());\r\n function updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$9(el).lastProp, props)) {\r\n inner$9(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n }\r\n function propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n }\r\n function updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n }\r\n function getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n }\r\n function updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n }\n\n function buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n }\r\n function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n }\r\n function confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n }\r\n function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n }\r\n function getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n }\r\n function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n }\r\n function makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n }\r\n function makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n }\n\n var CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n }(BaseAxisPointer));\r\n function getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n }\r\n var pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n }\r\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\n var AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n }(ComponentModel));\n\n ComponentModel.registerClass(AxisPointerModel);\r\n registerPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n });\r\n registerAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n }, axisTrigger);\n\n var TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TooltipModel);\n\n function shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n }\n\n var vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\n var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\n function mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n }\r\n function assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n }\r\n function assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n }\r\n function assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n }\r\n function assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n }\r\n function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\r\n var TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n }());\n\n var TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n }());\r\n function mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n }\r\n function calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n }\r\n function makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\n\n var bind$2 = bind;\r\n var each$5 = each;\r\n var parsePercent$3 = parsePercent$2;\r\n var proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n });\r\n var TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$5(dataByCoordSys, function (itemCoordSys) {\r\n each$5(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$5(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$5(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$5(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n }(ComponentView));\r\n function buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n }\r\n function makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n }\r\n function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n }\r\n function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n }\r\n function calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n }\r\n function isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n }\r\n ComponentView.registerClass(TooltipView);\n\n registerAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n }, function () { });\r\n registerAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n }, function () { });\n\n var getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n };\r\n var LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(LegendModel);\n\n function legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n }\r\n registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\n registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\n registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\n registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\n registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\n function layout$2(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n }\r\n function makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n }\n\n var curry$1 = curry;\r\n var each$6 = each;\r\n var Group$1 = Group;\r\n var LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$1());\r\n this.group.add(this._selectorGroup = new Group$1());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$6(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$1();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$6(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$1();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n }(ComponentView));\r\n function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n }\r\n function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n }\r\n function isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n }\r\n function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n ComponentView.registerClass(LegendView);\n\n function legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\n ComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n });\n\n var ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n }(LegendModel));\r\n function mergeAndNormalizeLayoutParams(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(ScrollableLegendModel);\n\n var Group$2 = Group;\r\n var WH = ['width', 'height'];\r\n var XY = ['x', 'y'];\r\n var ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$2());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$2());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH[orientIdx];\r\n var xy = XY[orientIdx];\r\n var hw = WH[1 - orientIdx];\r\n var yx = XY[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH[orientIdx];\r\n var xy = XY[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n }(LegendView));\r\n ComponentView.registerClass(ScrollableLegendView);\n\n registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n });\n\n var TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TitleModel);\r\n var TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n }(ComponentView));\r\n ComponentView.registerClass(TitleView);\n\n function fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n }\r\n var inner$a = makeInner();\r\n var MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$a(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$a(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$a(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$a(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n }(ComponentModel));\r\n mixin(MarkerModel, DataFormatMixin.prototype);\n\n var MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkPointModel);\n\n function hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n }\r\n function hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n }\r\n function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n }\r\n var markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n };\r\n function dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n }\r\n function getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n }\r\n function dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n }\r\n function dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n }\r\n function dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n }\r\n function numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n }\n\n var inner$b = makeInner();\r\n var MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$b(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$b(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$b(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n }(ComponentView));\n\n function updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n }\r\n var MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n }(MarkerView));\r\n function createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n }\r\n ComponentView.registerClass(MarkPointView);\n\n registerPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n });\n\n var MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkLineModel);\n\n var straightLineProto = Line.prototype;\r\n var bezierCurveProto = BezierCurve.prototype;\r\n var StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n }());\r\n var CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n }(StraightLineShape));\r\n function isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n }\r\n var ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n }(Path));\n\n var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\n function makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n }\r\n function createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n }\r\n function createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n }\r\n function setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n }\r\n var Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n }(Group));\n\n var LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n }());\r\n function isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n }\r\n function makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n }\r\n function isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n }\r\n function lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n }\n\n var inner$c = makeInner();\r\n var markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n };\r\n function isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n }\r\n function markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n }\r\n function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n }\r\n var MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$c(mlModel).from;\r\n var toData_1 = inner$c(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$c(mlModel).from = fromData;\r\n inner$c(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n }(MarkerView));\r\n function createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n }\r\n ComponentView.registerClass(MarkLineView);\n\n registerPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n });\n\n var MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkAreaModel);\n\n var inner$d = makeInner();\r\n var markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n };\r\n function isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n }\r\n function markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n }\r\n function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n }\r\n var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\n var MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$d(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$d(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$d(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$d(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n }(MarkerView));\r\n function createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n }\r\n ComponentView.registerClass(MarkAreaView);\n\n registerPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n });\n\n ComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n });\n\n var DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n ];\r\n var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\n function isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n }\r\n function getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n }\r\n function findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n }\r\n function collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n }\n\n var DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n }());\r\n var DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n }(ComponentModel));\r\n function retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n }\n\n var DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DataZoomView);\n\n var SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SliderZoomModel);\n\n function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n }\r\n function getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n }\r\n function restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n }\n\n var Rect$1 = Rect;\r\n var DEFAULT_LOCATION_EDGE_GAP = 7;\r\n var DEFAULT_FRAME_BORDER_WIDTH = 1;\r\n var DEFAULT_FILLER_SIZE = 30;\r\n var DEFAULT_MOVE_HANDLE_SIZE = 7;\r\n var HORIZONTAL = 'horizontal';\r\n var VERTICAL = 'vertical';\r\n var LABEL_GAP = 5;\r\n var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\n var REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n };\r\n var SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$1({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$1({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$1({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$1({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$1({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n }(DataZoomView));\r\n function getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n }\r\n function getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(SliderZoomView);\n\n var each$7 = each;\r\n var asc$1 = asc;\r\n var AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$7(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$7(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$7(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$7(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n }());\r\n function calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$7(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n });\n\n registerAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n });\n\n var InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(InsideZoomModel);\n\n var ATTR = '\\0_ec_interaction_mutex';\r\n function take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n }\r\n function release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n }\r\n function isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n }\r\n function getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n }\r\n registerAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\n var RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n }(Eventful));\r\n function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n }\r\n function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n }\r\n function isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n }\n\n var inner$e = makeInner();\r\n registerProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$e(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n });\r\n function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$e(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n }\r\n function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$e(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n }\r\n function createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n }\r\n function dispatchAction(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n }\r\n function containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n }\r\n function mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n }\n\n var InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n }(DataZoomView));\r\n var getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n };\r\n function makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n }\r\n var getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n };\r\n ComponentView.registerClass(InsideZoomView);\n\n var ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n }());\r\n var features = {};\r\n function registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n }\r\n function getFeature(name) {\r\n return features[name];\r\n }\n\n var ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ToolboxModel);\n\n var ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$2(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ToolboxView);\r\n function isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n }\n\n var SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n }(ToolboxFeature));\r\n SaveAsImage.prototype.unusable = !env.canvasSupported;\r\n registerFeature('saveAsImage', SaveAsImage);\n\n var INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\n var radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n ];\r\n var MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n }(ToolboxFeature));\r\n var seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n };\r\n registerAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n });\r\n registerFeature('magicType', MagicType);\n\n var BLOCK_SPLITER = new Array(60).join('-');\r\n var ITEM_SPLITER = '\\t';\r\n function groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n }\r\n function assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n }\r\n function trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n }\r\n function isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n }\r\n var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\n function parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n }\r\n function parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n }\r\n function parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n }\r\n var DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n }(ToolboxFeature));\r\n function tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n }\r\n registerFeature('dataView', DataView);\r\n registerAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n });\n\n var BRUSH_PANEL_GLOBAL = true;\r\n var mathMin$7 = Math.min;\r\n var mathMax$7 = Math.max;\r\n var mathPow$2 = Math.pow;\r\n var COVER_Z = 10000;\r\n var UNSELECT_THRESHOLD = 6;\r\n var MIN_RESIZE_LINE_WIDTH = 6;\r\n var MUTEX_RESOURCE_KEY = 'globalPan';\r\n var DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n };\r\n var CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n };\r\n var DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n };\r\n var baseUID = 0;\r\n var BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n }(Eventful));\r\n function createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n }\r\n function endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n }\r\n function updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n }\r\n function updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n }\r\n function updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n }\r\n function getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n }\r\n function getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n }\r\n function getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n }\r\n function clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n }\r\n function trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n }\r\n function shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n }\r\n function getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n }\r\n function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n }\r\n function updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$7(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n }\r\n function updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n }\r\n function updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n }\r\n function makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n }\r\n function formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$7(x, x2), mathMin$7(y, y2)];\r\n var max = [mathMax$7(x, x2), mathMax$7(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n }\r\n function getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n }\r\n function getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n }\r\n function getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n }\r\n function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n }\r\n function clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n }\r\n function pointsToRect(points) {\r\n var xmin = mathMin$7(points[0][0], points[1][0]);\r\n var ymin = mathMin$7(points[0][1], points[1][1]);\r\n var xmax = mathMax$7(points[0][0], points[1][0]);\r\n var ymax = mathMax$7(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n }\r\n function resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n }\r\n function preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n }\r\n function mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n }\r\n function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n }\r\n function determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n }\r\n var pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n };\r\n function handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n }\r\n function isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n }\r\n var coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n };\r\n function getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$7(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$7(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n }\n\n var IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\n function onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n }\n\n function makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n }\r\n function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n }\r\n function makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n }\r\n function normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n }\n\n var COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\n var INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n ];\r\n var BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n }());\r\n function formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n }\r\n function parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n }\r\n var targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n };\r\n var targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n ];\r\n var panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n };\r\n var coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n };\r\n function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n var diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n };\r\n function axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n }\r\n function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n }\r\n function getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n }\n\n var each$8 = each;\r\n var inner$f = makeInner();\r\n function push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$8(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n }\r\n function pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$8(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n }\r\n function clear$1(ecModel) {\r\n inner$f(ecModel).snapshots = null;\r\n }\r\n function count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n }\r\n function getStoreSnapshots(ecModel) {\r\n var store = inner$f(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n }\n\n var SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SelectDataZoomModel);\n\n var SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n }(DataZoomView));\r\n ComponentView.registerClass(SelectDataZoomView);\n\n var each$9 = each;\r\n var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\n var DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$9(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n }(ToolboxFeature));\r\n var handlers = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n };\r\n function makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n }\r\n function updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n }\r\n function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n }\r\n registerFeature('dataZoom', DataZoomFeature);\r\n registerInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$9(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$9(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n });\n\n var RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n }(ToolboxFeature));\r\n registerFeature('restore', RestoreOption);\r\n registerAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n });\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$g = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$g(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$g(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n function createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n }\n\n var NONE = 'none';\r\n var mathRound = Math.round;\r\n var mathSin$4 = Math.sin;\r\n var mathCos$4 = Math.cos;\r\n var PI$7 = Math.PI;\r\n var PI2$8 = Math.PI * 2;\r\n var degree = 180 / PI$7;\r\n var EPSILON$4 = 1e-4;\r\n function round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n }\r\n function round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n }\r\n function isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n }\r\n function pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n }\r\n function pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n }\r\n function setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n }\r\n function attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n }\r\n function attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n }\r\n function attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n }\r\n function bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n }\r\n var SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$8)\r\n || (clockwise ? dTheta >= PI2$8 : -dTheta >= PI2$8);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$8 : (dTheta % PI2$8 + PI2$8);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$7) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$8 - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$8 + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n }());\r\n var svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n };\r\n function adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n }\r\n var svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n };\n\n function diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n }\r\n function extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n }\r\n function pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n }\r\n function buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n }\r\n function clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n }\r\n function arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n }\n\n var MARK_UNUSED = '0';\r\n var MARK_USED = '1';\r\n var Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n }());\n\n function isLinearGradient(value) {\r\n return value.type === 'linear';\r\n }\r\n function isRadialGradient(value) {\r\n return value.type === 'radial';\r\n }\r\n function isGradient(value) {\r\n return value && (value.type === 'linear'\r\n || value.type === 'radial');\r\n }\r\n var GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (isGradient(value)) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n if (!isGradient(gradient)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n }(Definable));\n\n function isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n }\r\n var patternDomMap = new WeakMap();\r\n var PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n }(Definable));\n\n function generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n }\r\n function hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n }\r\n var ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n }(Definable));\n\n var ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n }(Definable));\r\n function hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n }\r\n function getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n }\n\n function parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n }\r\n function getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n }\r\n function checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n }\r\n function insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n }\r\n function removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n }\r\n function getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n }\r\n var SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n }());\r\n function createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n }\n\n registerPainter('svg', SVGPainter);\n\n exports.Axis = Axis;\n exports.List = List;\n exports.Model = Model;\n exports.PRIORITY = PRIORITY;\n exports.color = color;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose$1;\n exports.env = env;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.format = format$1;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.graphic = graphic$1;\n exports.helper = helper;\n exports.init = init$1;\n exports.innerDrawElementOnCanvas = brushSingle;\n exports.matrix = matrix;\n exports.number = number;\n exports.parseGeoJSON = parseGeoJSON;\n exports.parseGeoJson = parseGeoJson;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.throttle = throttle;\n exports.time = time;\n exports.util = ecUtil;\n exports.vector = vector;\n exports.version = version$1;\n exports.zrender = zrender;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file diff --git a/dist/echarts.common.min.js b/dist/echarts.common.min.js index e3dda70943..a18282312b 100644 --- a/dist/echarts.common.min.js +++ b/dist/echarts.common.min.js @@ -19,4 +19,4 @@ */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).echarts={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),o,r);if(r)return r(t,n,i),!0}return!1}function Wt(t){return"CANVAS"===t.nodeName.toUpperCase()}var Ut="undefined"!=typeof window&&!!window.addEventListener,Xt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Yt=[];function Zt(t,e,n,i){return n=n||{},i||!w.canvasSupported?jt(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):jt(t,e,n),n}function jt(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(Wt(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=r-e.top)}if(Gt(Yt,t,i,r))return n.zrX=Yt[0],void(n.zrY=Yt[1])}n.zrX=n.zrY=0}function qt(t){return t||window.event}function Kt(t,e,n){if(null!=(e=qt(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Zt(t,i,e,n):(Zt(t,e,e,n),r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function ge(){return[1,0,0,1,0,0]}function ye(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function me(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ve(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=e,t}function _e(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function xe(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=r*n+s*e,t[3]=-r*e+n*s,t[4]=n*o+e*l,t[5]=n*l-e*o,t}function be(t,e,n){var i=n[0],n=n[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function we(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],e=n*a-o*i;return e?(e=1/e,t[0]=a*e,t[1]=-o*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*r)*e,t[5]=(o*r-n*s)*e,t):null}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){pe.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=fe(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),$e(t,e),e):void Ze(e,0,0,0,1):7===r||9===r?0<=(o=parseInt(i.slice(1,7),16))&&o<=16777215?(Ze(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),$e(t,e),e):void Ze(e,0,0,0,1):void 0;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===r){r=i.substr(0,n),o=i.substr(n+1,o-(n+1)).split(","),n=1;switch(r){case"rgba":if(4!==o.length)return 3===o.length?Ze(e,+o[0],+o[1],+o[2],1):Ze(e,0,0,0,1);n=Ue(o.pop());case"rgb":return 3!==o.length?void Ze(e,0,0,0,1):(Ze(e,We(o[0]),We(o[1]),We(o[2]),n),$e(t,e),e);case"hsla":return 4!==o.length?void Ze(e,0,0,0,1):(o[3]=Ue(o[3]),Qe(o,e),$e(t,e),e);case"hsl":return 3!==o.length?void Ze(e,0,0,0,1):(Qe(o,e),$e(t,e),e);default:return}}Ze(e,0,0,0,1)}}function Qe(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Ue(t[1]),r=Ue(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return Ze(e=e||[],He(255*Xe(r,i,n+1/3)),He(255*Xe(r,i,n)),He(255*Xe(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function tn(t,e){var n=Je(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(P(e)){var r,o=P((o=e)&&o[0])?2:1;if(0e);u++);u=Math.min(u-1,o-2)}var h,c,p,d,f,g,y,m=r[u+1],v=r[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?_n:t[a],(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},En.prototype.clone=function(){return new En(this.x,this.y,this.width,this.height)},En.prototype.copy=function(t){En.copy(this,t)},En.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},En.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},En.prototype.isZero=function(){return 0===this.width||0===this.height},En.create=function(t){return new En(t.x,t.y,t.width,t.height)},En.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},En.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function gi(f,g){var o,a,y=hi,s=0,m=(f.length,[]);function e(t){var e=o[t],n=a[t],i=o[t+1],r=a[t+1];a[t]=n+r,t===s-3&&(o[t+1]=o[t+2],a[t+1]=a[t+2]),s--;t=fi(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(r=di(f[e+n-1],f,i,r,r-1,g))&&(n<=r?function(t,e,n,i){var r=0;for(r=0;ra[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=ci(t,n,i,e))this._ux||Yr(e-this._yi)>this._uy||this._len<5;return this.addData(Rr.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},to.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this.addData(Rr.C,t,e,n,i,r,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,o):this._ctx.bezierCurveTo(t,e,n,i,r,o)),this._xi=r,this._yi=o,this},to.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(Rr.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},to.prototype.arc=function(t,e,n,i,r,o){Kr[0]=i,Kr[1]=r,Jr(Kr,o),i=Kr[0];var a=(r=Kr[1])-i;return this.addData(Rr.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=Wr(r)*n+t,this._yi=Ur(r)*n+e,this},to.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},to.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Rr.R,t,e,n,i),this},to.prototype.closePath=function(){this.addData(Rr.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},to.prototype.fill=function(t){t&&t.fill(),this.toStatic()},to.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},to.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||Yr(y)>i||c===e-1)&&(f=Math.sqrt(C*C+y*y),r=g,o=_);break;case Rr.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],b=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=pr(t,n,r,a,f),y=pr(e,i,o,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(r,o,m,v,g,_,x,b,10),r=x,o=b;break;case Rr.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=vr(t,n,r,p),f=vr(e,i,o,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case Rr.A:var w=t[c++],S=t[c++],M=t[c++],T=t[c++],p=t[c++],x=t[c++],b=x+p;c+=1;t[c++];d&&(a=Wr(p)*M+w,s=Ur(p)*T+S),f=Gr(M,T)*Hr(jr,Math.abs(x)),r=Wr(b)*M+w,o=Ur(b)*T+S;break;case Rr.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case Rr.Z:var C=a-r,y=s-o;f=Math.sqrt(C*C+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},to.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||Yr(s-o)>p||m===d-1){if(f){if(u=uo[i=0]+t&&a<=uo[1]+t?l:0}rMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,_,x,x+b,f,g,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case ao.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(eo(c,p,w,p,e,i,r)||eo(w,p,w,S,e,i,r)||eo(w,S,c,S,e,i,r)||eo(c,S,c,p,e,i,r))return!0}else l+=oo(w,p,w,S,i,r),l+=oo(c,S,c,p,i,r);break;case ao.Z:if(n){if(eo(u,h,c,p,e,i,r))return!0}else l+=oo(u,h,c,p,i,r);u=c,h=p}}return n||(o=h,t=p,Math.abs(o-t)=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,n,i){for(var r=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),p=!0),i.accumWidth=s):(s=_s(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,o=s.lines)):o=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},Rl.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Rl.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Rl.prototype.addHover=function(t){},Rl.prototype.removeHover=function(t){},Rl.prototype.clearHover=function(){},Rl.prototype.refreshHover=function(){this._needsRefreshHover=!0},Rl.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},Rl.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Rl.prototype.clearAnimation=function(){this.animation.clear()},Rl.prototype.getWidth=function(){return this.painter.getWidth()},Rl.prototype.getHeight=function(){return this.painter.getHeight()},Rl.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Rl.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Rl.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Rl.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},Rl.prototype.off=function(t,e){this.handler.off(t,e)},Rl.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Rl.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function Vl(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Fl(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Hl(t){return t.sort(function(t,e){return t-e}),t}function Gl(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Wl(t){var e=t.toString(),t=e.indexOf("e");if(0u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/r}function Yl(t){var e=2*Math.PI;return(t%e+e)%e}function Zl(t){return-zlMath.abs(r[1])?0"'])/g,Sp={"&":"&","<":"<",">":">",'"':""","'":"'"};function Mp(t){return null==t?"":(t+"").replace(wp,function(t,e){return Sp[e]})}function Tp(t,e,n){function i(t){return t&&rt(t)?t:"-"}function r(t){return null!=t&&!isNaN(t)&&isFinite(t)}var o="time"===e,a=t instanceof Date;if(o||a){o=o?ql(t):t;if(!isNaN(+o))return ip(o,"yyyy-MM-dd hh:mm:ss",n);if(a)return"-"}if("ordinal"===e)return G(t)?i(t):W(t)&&r(t)?t+"":"-";e=Ql(t);return r(e)?_p(e):G(t)?i(t):"-"}function Cp(t,e){return"{"+t+(null==e?"":e)+"}"}var Ip=["a","b","c","d","e","f","g"];function Ap(t,e,n){V(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'':{renderMode:t,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function kp(t,e){return e=e||"transparent",H(t)?t:U(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Lp(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var Pp=Object.freeze({__proto__:null,addCommas:_p,toCamelCase:xp,normalizeCssArray:bp,encodeHTML:Mp,makeValueReadable:Tp,formatTpl:Ap,formatTplSimple:function(n,t,i){return E(t,function(t,e){n=n.replace("{"+e+"}",i?Mp(t):t)}),n},getTooltipMarker:Dp,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=ql(e),r=i["get"+(l=n?"UTC":"")+"FullYear"](),o=i["get"+l+"Month"]()+1,a=i["get"+l+"Date"](),s=i["get"+l+"Hours"](),e=i["get"+l+"Minutes"](),n=i["get"+l+"Seconds"](),l=i["get"+l+"Milliseconds"]();return t=t.replace("MM",ep(o,2)).replace("M",o).replace("yyyy",r).replace("yy",r%100+"").replace("dd",ep(a,2)).replace("d",a).replace("hh",ep(s,2)).replace("h",s).replace("mm",ep(e,2)).replace("m",e).replace("ss",ep(n,2)).replace("s",n).replace("SSS",ep(l,3))},capitalFirst:function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},convertToColorString:kp,windowOpen:Lp,truncateText:hs,getTextRect:function(t,e,n,i,r,o,a,s){return ou(),new Ss({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}}),Op=E,Rp=["left","right","top","bottom","width","height"],Ep=[["width","left","right"],["height","top","bottom"]];function Np(a,s,l,u,h){var c=0,p=0;null==u&&(u=1/0),null==h&&(h=1/0);var d=0;s.eachChild(function(t,e){var n,i,r=t.getBoundingRect(),o=s.childAt(e+1),e=o&&o.getBoundingRect();d="horizontal"===a?(o=r.width+(e?-e.x+r.x:0),u<(n=c+o)||t.newline?(c=0,n=o,p+=d+l,r.height):Math.max(d,r.height)):(e=r.height+(e?-e.y+r.y:0),h<(i=p+e)||t.newline?(c+=d+l,p=0,i=e,r.width):Math.max(d,r.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=i+l)})}var zp=Np;B(Np,"vertical"),B(Np,"horizontal");function Bp(t,e,n){n=bp(n||0);var i=e.width,r=e.height,o=Vl(t.left,i),a=Vl(t.top,r),s=Vl(t.right,i),l=Vl(t.bottom,r),u=Vl(t.width,i),h=Vl(t.height,r),c=n[2]+n[0],p=n[1]+n[3],e=t.aspect;switch(isNaN(u)&&(u=i-s-p-o),isNaN(h)&&(h=r-l-c-a),null!=e&&(isNaN(u)&&isNaN(h)&&(i/re)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return r&&(o[r]=n),e.paletteIdx=(t+1)%a.length,n}}var Td,Cd="\0_ec_inner",Id=(l(Ad,Td=Ec),Ad.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Ec(i),this._locale=new Ec(r),this._optionManager=o},Ad.prototype.setOption=function(t,e,n){it(!(Cd in t),"please use chart.getOption()");e=Ld(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},Ad.prototype.resetOption=function(t,e){return this._resetOption(t,Ld(e))},Ad.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):vd(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(r=r.getMediaOption(this)).length&&E(r,function(t){i=!0,this._mergeOption(t,e)},this),i},Ad.prototype.mergeOption=function(t){this._mergeOption(t,null)},Ad.prototype._mergeOption=function(i,t){var r=this.option,u=this._componentsMap,h=this._componentsCount,n=[],o=ht(),c=t&&t.replaceMergeMainTypeMap;ud(this).datasetMap=ht(),E(i,function(t,e){null!=t&&(qp.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?I(t):b(r[e],t,!0))}),c&&c.each(function(t,e){qp.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),qp.topologicalTravel(n,qp.getAllClassMainTypes(),function(o){var t=function(t,e,n){return(e=gd.get(e))&&(t=e(t))?n.concat(t):n}(this,o,uu(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",n=du(e,t,n);_u(n,o,qp),r[o]=null,u.set(o,null),h.set(o,0);var a=[],s=[],l=0;E(n,function(t,e){var n,i=t.existing,r=t.newOption;r?(n=qp.getClass(o,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1)):(e=A({componentIndex:e},t.keyInfo),A(i=new n(r,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&yd(this)},this),this._seriesIndices||yd(this)},Ad.prototype.getOption=function(){var a=I(this.option);return E(a,function(t,e){if(qp.hasClass(e)){for(var n=uu(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!vu(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[Cd],a},Ad.prototype.getTheme=function(){return this._theme},Ad.prototype.getLocaleModel=function(){return this._locale},Ad.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},Ad.prototype.setUpdatePayload=function(t){this._payload=t},Ad.prototype.getUpdatePayload=function(){return this._payload},Ad.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;i'+Mp(e)+""+o,n)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n){var i=t.renderMode,r=e.noName,o=e.noValue,a=!e.markerType,s=e.name,l=e.value,u=t.useUTC;if(!r||!o){var h=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),c=r?"":Tp(s,"ordinal",u),p=e.valueType,d=o?[]:V(l)?O(l,function(t,e){return Tp(t,V(p)?p[e]:p,u)}):[Tp(l,V(p)?p[0]:p,u)],f=!a||!r,s=!a&&r;return"richText"===i?(a?"":h)+(r?"":gg(t,c))+(o?"":(e=t,l=d,i=[og],t=(t=s)?10:20,f&&i.push({padding:[0,0,0,t],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(l.join(" "),i))):fg((a?"":h)+(r?"":''+Mp(c)+"")+(o?"":function(t,e,n){n=n?"10px":"20px";return''+O(t,Mp).join("  ")+""}(d,f,s)),n)}}}};function pg(t,e,n,i,r){if(t){var o=hg(t);o.planLayout(t);e={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e};return o.build(e,t,0)}}function dg(t){t=t.__gapLevelBetweenSubBlocks;return{html:sg[t],richText:lg[t]}}function fg(t,e){return'
'+t+'
'}function gg(t,e){return t.markupStyleCreator.wrapRichTextStyle(e,rg)}function yg(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}var mg=(vg.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},vg.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,n=Dp({color:e,type:t,renderMode:n,markerId:i});return H(n)?n:(this.richTextStyles[i]=n.style,n.content)},vg.prototype.wrapRichTextStyle=function(t,e){var n={};V(e)?E(e,function(t){return A(n,t)}):A(n,e);e=this._generateStyleName();return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"},vg);function vg(){this.richTextStyles={},this._nextStyleNameId=eu()}function _g(t){var e,n,i,r,o,a,s,l,u,h,c,p,d=t.series,f=t.dataIndex,g=t.multipleSeries,y=d.getData(),m=y.mapDimensionsAll("defaultedTooltip"),v=m.length,_=d.getRawValue(f),x=V(_),t=(e=f,kp((t=d).getData().getItemVisual(e,"style")[t.visualDrawType]));function b(t,e){e=l.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(u?p.push(ug("nameValue",{markerType:"subItem",markerColor:s,name:e.displayName,value:t,valueType:e.type})):(h.push(t),c.push(e.type)))}1this.getShallow("animationThreshold")&&(t=!1),!!t},Mg.prototype.restoreData=function(){this.dataTask.dirty()},Mg.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return bd.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Mg.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Mg.prototype.getProgressive=function(){return this.get("progressive")},Mg.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Mg.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Mg.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;re.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Dg(e,n){E(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,B(kg,n))})}function kg(t,e){t=Lg(t);return t&&t.setOutputEnd((e||this).count()),e}function Lg(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}T(Sg,Ca),T(Sg,bd),Ru(Sg,qp);var Pg=(Og.prototype.init=function(t,e){},Og.prototype.render=function(t,e,n,i){},Og.prototype.dispose=function(t,e){},Og.prototype.updateView=function(t,e,n,i){},Og.prototype.updateLayout=function(t,e,n,i){},Og.prototype.updateVisual=function(t,e,n,i){},Og.prototype.blurSeries=function(t,e){},Og);function Og(){this.group=new Ho,this.uid=Bc("viewComponent")}function Rg(){var o=bu();return function(t){var e=o(t),n=t.pipelineContext,i=!!e.large,r=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&r==n)&&"reset"}}Ou(Pg),Bu(Pg,{registerWhenExtend:!0});var Eg=bu(),Ng=Rg(),zg=(Bg.prototype.init=function(t,e){},Bg.prototype.render=function(t,e,n,i){},Bg.prototype.highlight=function(t,e,n,i){Fg(t.getData(),i,"emphasis")},Bg.prototype.downplay=function(t,e,n,i){Fg(t.getData(),i,"normal")},Bg.prototype.remove=function(t,e){this.group.removeAll()},Bg.prototype.dispose=function(t,e){},Bg.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},Bg.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},Bg.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Bg.markUpdateMethod=function(t,e){Eg(t).updateMethod=e},Bg.protoInitialize=void(Bg.prototype.type="chart"),Bg);function Bg(){this.group=new Ho,this.uid=Bc("viewChart"),this.renderTask=Df({plan:Hg,reset:Gg}),this.renderTask.context={view:this}}function Vg(t,e,n){t&&("emphasis"===e?xh:bh)(t,n)}function Fg(e,t,n){var i,r=xu(e,t),o=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=Uu[i])&&Wu<=32&&(t=Uu[i]=Wu++),t):null;null!=r?E(uu(r),function(t){Vg(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){Vg(t,n,o)})}function Hg(t){return Ng(t.model)}function Gg(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,t=r&&Eg(r).updateMethod,t=o?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,r),Wg[t]}Ou(zg),Bu(zg,{registerWhenExtend:!0});var Wg={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Ug="\0__throttleOriginMethod",Xg="\0__throttleRate",Yg="\0__throttleType";function Zg(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},iy.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},iy.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:i,large:e}},iy.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=ht();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},iy.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,r=this.api.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";it(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,r,o),t.overallReset&&this._createOverallStageTask(t,e,r,o)},this)},iy.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},iy.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},iy.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},iy.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}E(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(o=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=o.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},iy.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},iy.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},iy.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},iy.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=ht(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||Df({plan:ly,reset:uy,count:py}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,r).each(l)},iy.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Df({reset:ry});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=ht(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,Df({reset:oy,onDirty:sy})));e.context={model:t,overallProgress:h},e.agent=o,e.__block=h,r._pipe(t,e)}it(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,E(n.getSeries(),p)),c&&o.dirty()},iy.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},iy.wrapStageHandler=function(t,e){return F(t)&&(t={overallReset:t,seriesType:function(t){dy=null;try{t(fy,gy)}catch(t){}return dy}(t)}),t.uid=Bc("stageHandler"),e&&(t.visualType=e),t},iy);function iy(t,e,n,i){this._stageTaskMap=ht(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function ry(t){t.overallReset(t.ecModel,t.api,t.payload)}function oy(t){return t.overallProgress&&ay}function ay(){this.agent.dirty(),this.getDownstream().dirty()}function sy(){this.agent&&this.agent.dirty()}function ly(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function uy(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=uu(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else x("Layer of zlevel "+t+" is not valid")},Nm.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new oa({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),$m(p,function(t){t=new Yo({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},Rv.prototype.convertToPixel=function(t,e){return gv(this,"convertToPixel",t,e)},Rv.prototype.convertFromPixel=function(t,e){return gv(this,"convertFromPixel",t,e)},Rv.prototype.containPixel=function(t,r){var o;if(!this._disposed)return E(Su(this._model,t),function(t,i){0<=i.indexOf("Models")&&E(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?o=o||!!n.containPoint(r):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(o=o||e.containPoint(r,t))},this)},this),!!o;Fv(this.id)},Rv.prototype.getVisual=function(t,e){var n=Su(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:0}}(t,n,e):Ay(t,e)},Rv.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},Rv.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},Rv.prototype._initEvents=function(){var t,e,n,s=this;$m(Vv,function(a){function t(t){var n,e,i=s.getModel(),r=t.target,o="globalout"===a;o?n={}:r&&zm(r,function(t){var e=Gu(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=A({},e.eventData),1)},!0),n&&(e=n.componentType,o=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",o=n.seriesIndex),o=(e=e&&null!=o&&i.getComponent(e,o))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:e,view:o},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),$m(Gv,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),$m(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(am("map","selectchanged",e,n,t),am("pie","selectchanged",e,n,t)):"select"===t.fromAction?(am("map","selected",e,n,t),am("pie","selected",e,n,t)):"unselect"===t.fromAction&&(am("map","unselected",e,n,t),am("pie","unselected",e,n,t))})},Rv.prototype.isDisposed=function(){return this._disposed},Rv.prototype.clear=function(){this._disposed?Fv(this.id):this.setOption({series:[]},!0)},Rv.prototype.dispose=function(){var e,n;this._disposed?Fv(this.id):(this._disposed=!0,Iu(this.getDom(),t_,""),e=this._api,n=this._model,$m(this._componentsViews,function(t){t.dispose(n,e)}),$m(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete Kv[this.id])},Rv.prototype.resize=function(t){var e;this._disposed?Fv(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[tv]=!0,e&&cv(this),fv.update.call(this,{type:"resize",animation:{duration:0}}),this[tv]=!1,vv.call(this,t),_v.call(this,t)))},Rv.prototype.showLoading=function(t,e){this._disposed?Fv(this.id):(Qm(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),qv[t]&&(t=qv[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},Rv.prototype.hideLoading=function(){this._disposed?Fv(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Rv.prototype.makeActionFromEvent=function(t){var e=A({},t);return e.type=Gv[t.type],e},Rv.prototype.dispatchAction=function(t,e){var n;this._disposed?Fv(this.id):(Qm(e)||(e={silent:!!e}),Hv[t.type]&&this._model&&(this[tv]?this._pendingActions.push(t):(n=e.silent,mv.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),vv.call(this,n),_v.call(this,n))))},Rv.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},Rv.prototype.appendData=function(t){var e;this._disposed?Fv(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},Rv.internalField=(cv=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),pv(t,!0),pv(t,!1),e.plan()},pv=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},Cv=function(e,n){$m(Yv,function(t){t(e,n)})},kv=function(t){t[nv]=!0,t.getZr().wakeUp()},Lv=function(t){t[nv]&&(t.getZr().storage.traverse(function(t){Qh(t)||Ev(t)}),t[nv]=!1)},Iv=function(n){return l(t,e=Pd),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){xh(t,e),kv(n)},t.prototype.leaveEmphasis=function(t,e){bh(t,e),kv(n)},t.prototype.enterBlur=function(t){wh(t),kv(n)},t.prototype.leaveBlur=function(t){Sh(t),kv(n)},t.prototype.enterSelect=function(t){Mh(t),kv(n)},t.prototype.leaveSelect=function(t){Th(t),kv(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},Av=function(i){function r(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||T_(this,d))}this._rawCount=this._count=s,this._extent={},v_(this)},G_.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,r=this._storage,o=this.dimensions,a=o.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===td,p=0;px[1]&&(x[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=yu(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=yu(v,null))),this._dontMakeIdFromName||T_(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},v_(this)}},G_.prototype.count=function(){return this._count},G_.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},G_.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[T][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return l_[1]&&(_[1]=v)}}}return t},G_.prototype.downSample=function(t,e,n,i){for(var r=I_(this,[t]),o=r._storage,a=[],s=P_(1/e),l=o[t],u=this.count(),h=r._rawExtent[t],c=new(__(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r.getRawIndex=w_,r},G_.prototype.lttbDownSample=function(t,e){var n,i=I_(this,[]),r=i._storage[t],o=this.count(),a=new(__(this))(o),s=0,l=P_(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;he[1]&&(e[1]=t[1])},ex.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},ex.prototype.getExtent=function(){return this._extent.slice()},ex.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},ex.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},ex.prototype.isBlank=function(){return this._isBlank},ex.prototype.setBlank=function(t){this._isBlank=t},ex);function ex(t){this._setting=t||{},this._extent=[1/0,-1/0]}Bu(tx,{registerWhenExtend:!0});var nx=(ix.createByAxisModel=function(t){var e=t.option,t=e.data,t=t&&O(t,rx);return new ix({categories:t,needCollect:!t,deduplication:!1!==e.dedplication})},ix.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},ix.prototype.parseAndCollect=function(t){var e=this._needCollect;if("string"!=typeof t&&!e)return t;if(e&&!this._deduplication)return n=this.categories.length,this.categories[n]=t,n;var n,i=this._getOrCreateMap();return null==(n=i.get(t))&&(e?(n=this.categories.length,this.categories[n]=t,i.set(t,n)):n=NaN),n},ix.prototype._getOrCreateMap=function(){return this._map||(this._map=ht(this.categories))},ix);function ix(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}function rx(t){return U(t)&&null!=t.value?t.value:t+""}var ox=Fl;function ax(t,e,n,i){var r={},o=t[1]-t[0],e=r.interval=Jl(o/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),r}function sx(t){return Wl(t)+2}function lx(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function ux(t,e){return t>=e[0]&&t<=e[1]}function hx(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function cx(t,e){return t*(e[1]-e[0])+e[0]}var px,dx=(l(fx,px=tx),fx.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},fx.prototype.contain=function(t){return ux(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},fx.prototype.normalize=function(t){return hx(t=this.getCategoryIndex(this.parse(t)),this._extent)},fx.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(cx(t,this._extent))},fx.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},fx.prototype.getMinorTicks=function(t){},fx.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},fx.prototype.getCategorySortInfo=function(){return this._categorySortInfo},fx.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},fx.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},fx.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},fx.prototype.count=function(){return this._extent[1]-this._extent[0]+1},fx.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},fx.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},fx.prototype.getOrdinalMeta=function(){return this._ordinalMeta},fx.prototype.niceTicks=function(){},fx.prototype.niceExtent=function(){},fx.type="ordinal",fx);function fx(t){var e=px.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return V(t=t||new nx({}))&&(t=new nx({categories:O(t,function(t){return U(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}tx.registerClass(dx);var gx,yx=Fl,mx=(l(vx,gx=tx),vx.prototype.parse=function(t){return t},vx.prototype.contain=function(t){return ux(t,this._extent)},vx.prototype.normalize=function(t){return hx(t,this._extent)},vx.prototype.scale=function(t){return cx(t,this._extent)},vx.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},vx.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},vx.prototype.getInterval=function(){return this._interval},vx.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=sx(t)},vx.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]s&&(t?o.push({value:yx(s+e,r)}):o.push({value:n[1]})),o},vx.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=Ox.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]e[1]&&(e[1]=t[1])})}var ub=(hb.prototype.getNeedCrossZero=function(){return!this.option.scale},hb.prototype.getCoordSysModel=function(){},hb);function hb(){}Tc={isDimensionStacked:$_,enableDataStack:K_,getStackedDimension:J_};var Qa=Object.freeze({__proto__:null,createList:function(t){return Q_(t.getSource(),t)},getLayoutRect:Bp,dataStack:Tc,createScale:function(t,e){var n=e;return e instanceof Ec||(n=new Ec(e)),(e=eb(n)).setExtent(t[0],t[1]),tb(e,n),e},mixinAxisModelCommonMethods:function(t){T(t,ub)},getECData:Gu,createDimensions:Y_,createSymbol:Um}),cb=1e-8;function pb(t,e){return Math.abs(t-e)>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l),r=s+=r,o=l+=o;i.push([s/n,l/n])}return i}function mb(t,r){return O(R((t=function(t){if(!t.UTF8Encoding)return t;var e=(t=t).UTF8Scale;null==e&&(e=1024);for(var n=t.features,i=0;ia[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],o.coord)&&(i?o.coord=a[1]:e.pop());i&&u(o.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=Fl(t),e=Fl(e),l?ei)return!1;return!0}(n,e))){var r=e.mapDimension(n.dim),o={};return E(n.getViewLabels(),function(t){o[t.tickValue]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}}function bw(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";E(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Da(0,0,0,0,l,!0);return l[o]=c,l[o+"2"]=e,l}}}(a,r)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(D(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Ph(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;nl[1]?-1:1,o=["start"===u?l[0]-o*s:"end"===u?l[1]+o*s:(l[0]+l[1])/2,Gw(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*Nw/180),Gw(u)?c=zw.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var r,t=Yl(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=Zl(t-Nw/2)?(r=i?"bottom":"top","center"):Zl(t-1.5*Nw)?(r=i?"top":"bottom","center"):(r="middle",t<1.5*Nw&&Nw/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),rt[1]&&(t[1]=e)}Pg.registerClass(lS),Pg.registerClass($i),o_(Dc.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=ht();return t.eachSeries(function(t){Qw(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,C,n=[],i=ht();l=i,u=n,t.eachSeries(function(t){var e,n,i,r,o,a,s;Qw(t)&&(e=(s=tS(t)).xAxisModel,n=s.yAxisModel,i=e.axis,r=n.axis,o=i.scale.rawExtentInfo,a=r.scale.rawExtentInfo,s=t.getData(),o&&o.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),lb(pS(l,e).condExtent,s,i.dim),lb(pS(l,n).condExtent,s,r.dim)))}),C=i,E(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,r=n.axis,o=pS(C,e),a=pS(C,n);o.rawExtentInfo=$x(i.scale,e,o.condExtent),a.rawExtentInfo=$x(r.scale,n,a.condExtent),o.rawExtentResult=o.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]e[1]&&e.reverse(),e},IS.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},IS.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},IS);function IS(t,e,n,i,r){n=TS.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=r||"bottom",n}AS.prototype.getRect=function(){return this._rect},AS.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),E(n.x,function(t){tb(t.scale,t.model)}),E(n.y,function(t){tb(t.scale,t.model)});var i={};E(n.x,function(t){kS(n,"y",t,i)}),E(n.y,function(t){kS(n,"x",t,i)}),this.resize(this.model,e)},AS.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=Bp(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var r=this._axesList;function o(){E(r,function(t){var e,n,i=t.isHorizontal(),r=i?[0,a.width]:[0,a.height],o=t.inverse?1:0;t.setExtent(r[o],r[1-o]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}o(),t&&(E(r,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=rb(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),o()),E(this._coordsList,function(t){t.calcAffineTransform()})},AS.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},AS.prototype.getAxes=function(){return this._axesList.slice()},AS.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}U(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;ih?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(o=(r=e.label.x-u-e.len2*p)<(o=c+e.len)?Math.sqrt(i*i/(1-r*r/o/o)):o,n.rB=o,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},vM.type="pie",vM);function vM(){var t=null!==mM&&mM.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}zg.registerClass(Yh);var _M,xM,bM=2*Math.PI,wM=Math.PI/180;xM=a_,E([[(_M="pie")+"ToggleSelect","toggleSelect"],[_M+"Select","select"],[_M+"UnSelect","unselect"]],function(r){xM(r[0],function(t,e,n){var i;t=A({},t),n.dispatchAction(A(t,{type:r[1],seriesIndex:(t=t,i=[],e.eachComponent({mainType:"series",subType:_M,query:t},function(t){i.push(t.seriesIndex)}),i)}))})}),s_(B(function(t,e,I){e.eachSeriesByType(t,function(t){var r=t.getData(),e=r.mapDimension("value"),n=(l=I,Bp(t.getBoxLayoutParams(),{width:l.getWidth(),height:l.getHeight()})),i=t.get("center"),o=t.get("radius");V(o)||(o=[0,o]),V(i)||(i=[i,i]);var a=Vl(n.width,I.getWidth()),s=Vl(n.height,I.getHeight()),l=Math.min(a,s),u=Vl(i[0],a)+n.x,h=Vl(i[1],s)+n.y,c=Vl(o[0],l/2),p=Vl(o[1],l/2),d=-t.get("startAngle")*wM,f=t.get("minAngle")*wM,g=0;r.each(e,function(t){isNaN(t)||g++});var y=r.getSum(e),m=Math.PI/(y||g)*2,v=t.get("clockwise"),_=t.get("roseType"),x=t.get("stillShowZeroSum"),b=r.getDataExtent(e);b[0]=0;var w,S=bM,M=0,T=d,C=v?1:-1;r.setLayout({viewRect:n,r:p}),r.each(e,function(t,e){var n,i;isNaN(t)?r.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:u,cy:h,r0:c,r:_?NaN:p}):((n="area"!==_?0===y&&x?m:t*m:bM/g)n)return!0;if(e){t=Yw(t).seriesDataCount,i=i.getExtent();return Math.abs(i[0]-i[1])/t>n}return!1},sT.prototype.makeElOption=function(t,e,n,i,r){},sT.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;r&&(e=rT(t).pointerEl=new lc[r.type](oT(e.pointer)),t.add(e))},sT.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=rT(t).labelEl=new Ss(oT(e.label)),t.add(e),uT(e,i))},sT.prototype.updatePointerEl=function(t,e,n){t=rT(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},sT.prototype.updateLabelEl=function(t,e,n,i){t=rT(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),uT(t,i))},sT.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=ac(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Jt(t.event)},onmousedown:aT(this._onHandleDragMove,this,0,0),drift:aT(this._onHandleDragMove,this),ondragend:aT(this._onHandleDragEnd,this)}),i.add(r)),cT(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));n=o.get("size");V(n)||(n=[n,n]),r.scaleX=n[0]/2,r.scaleY=n[1]/2,jg(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},sT.prototype._moveHandleToValue=function(t,e){lT(this._axisPointerModel,!e&&this._moveAnimation,this._handle,hT(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},sT.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,e=this.updateHandleTransform(hT(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=e,n.stopAnimation(),n.attr(hT(e)),rT(n).lastProp=null,this._doDispatchAxisPointer())},sT.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},sT.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},sT.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,t=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),t&&e.remove(t),this._group=null,this._handle=null,this._payloadInfo=null)},sT.prototype.doClear=function(){},sT.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},sT);function sT(){this._dragging=!1,this.animationThreshold=15}function lT(t,e,n,i){!function n(i,t){{if(U(i)&&U(t)){var r=!0;return E(t,function(t,e){r=r&&n(i[e],t)}),!!r}return i===t}}(rT(n).lastProp,i)&&(rT(n).lastProp=i,e?jh(n,i,t):(n.stopAnimation(),n.attr(i)))}function uT(t,e){t[e.get(["label","show"])?"show":"hide"]()}function hT(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function cT(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}function pT(t,e,n,i,r){var o=dT(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=bp(a.get("padding")||0),l=a.getFont(),u=Wn(o,l),h=r.position,c=u.width+s[1]+s[3],n=u.height+s[0]+s[2],u=r.align;"right"===u&&(h[0]-=c),"center"===u&&(h[0]-=c/2);u=r.verticalAlign;"bottom"===u&&(h[1]-=n),"middle"===u&&(h[1]-=n/2),r=h,u=c,c=n,i=(n=i).getWidth(),n=n.getHeight(),r[0]=Math.min(r[0]+u,i)-u,r[1]=Math.min(r[1]+c,n)-c,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0);r=a.get("backgroundColor");r&&"auto"!==r||(r=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:fc(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:r}),z2:10}}function dT(t,e,n,i,r){t=e.scale.parse(t);var o,a=e.scale.getLabel({value:t},{precision:r.precision}),r=r.formatter;return r&&(o={value:ib(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},E(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,t=e&&e.getDataParams(t);t&&o.seriesData.push(t)}),H(r)?a=r.replace("{value}",a):F(r)&&(a=r(o))),a}function fT(t,e,n){var i=ge();return xe(i,i,n.rotation),_e(i,i,n.position),ec([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var gT,Yh=(l(yT,gT=Yh),yT.prototype.makeElOption=function(t,e,n,i,r){var o,a,s=n.axis,l=s.grid,u=i.get("type"),h=mT(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(e,!0));u&&"none"!==u&&(a=(o=i).get("type"),o=o.getModel(a+"Style"),"line"===a?(p=o.getLineStyle()).fill=null:"shadow"===a&&((p=o.getAreaStyle()).stroke=null),o=p,(p=vT[u](s,c,h)).style=o,t.graphicKey=p.type,t.pointer=p);var p=Jw(l.model,n);l=e,e=t,t=p,p=n,n=i,i=r,r=zw.innerTextLayout(t.rotation,0,t.labelDirection),t.labelMargin=n.get(["label","margin"]),pT(e,p,n,i,{position:fT(p.axis,l,t),align:r.textAlign,verticalAlign:r.textVerticalAlign})},yT.prototype.getHandleTransform=function(t,e,n){var i=Jw(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=fT(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},yT.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),n=mT(o,r).getOtherAxis(r).getGlobalExtent(),o="x"===r.dim?0:1,r=[t.x,t.y];r[o]+=e[o],r[o]=Math.min(a[1],r[o]),r[o]=Math.max(a[0],r[o]);n=(n[1]+n[0])/2,n=[n,n];n[o]=r[o];return{x:r[0],y:r[1],rotation:t.rotation,cursorPoint:n,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][o]}},yT);function yT(){return null!==gT&&gT.apply(this,arguments)||this}function mT(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var vT={line:function(t,e,n){var i;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],n=[e,n[1]],t=_T(t),{x1:i[t=t||0],y1:i[1-t],x2:n[t],y2:n[1-t]})}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:(n=[e-i/2,n[0]],r=[i,r],t=_T(t),{x:n[t=t||0],y:n[1-t],width:r[t],height:r[1-t]})}}};function _T(t){return"x"===t.dim?0:1}nl.registerAxisPointerClass("CartesianAxisPointer",Yh);var xT,nl=(l(bT,xT=qp),bT.type="axisPointer",bT.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},bT);function bT(){var t=null!==xT&&xT.apply(this,arguments)||this;return t.type=bT.type,t}qp.registerClass(nl),r_(function(t){var e;t&&(t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={}),(e=t.axisPointer.link)&&!V(e)&&(t.axisPointer.link=[e]))}),o_(Dc.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=Uw(t,e)}),a_({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||z(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){qM(o)&&(o=WM({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=qM(o),u=r.axesInfo,h=s.axesInfo,c="leave"===i||qM(o),p={},d={},r={list:[],map:{}},f={showPointer:B(YM,d),showTooltip:B(ZM,r)};E(s.coordSysMap,function(t,e){var r=l||t.containPoint(o);E(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);c||!r||u&&!i||(null!=(i=i&&i.value)||l||(i=n.pointToData(o)),null!=i&&XM(t,i,f,!1,p))})});var g,y,m={};return E(h,function(n,t){var i=n.linkGroup;i&&!d[t]&&E(i.axesInfo,function(t,e){e=d[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,jM(t),jM(n)))),m[n.key]=e)})}),E(m,function(t,e){XM(h[e],t,f,!0,p)}),g=d,i=h,y=p.axesInfo=[],E(i,function(t,e){var n=t.axisPointerModel.option,e=g[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&y.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),function(t,e,n,i){if(qM(e)||!t.list.length)return i({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(r,o,t,a),function(t,e){var n=e.getZr(),i="axisPointerLastHighlights",r=UM(n)[i]||{},o=UM(n)[i]={};E(t,function(t,e){t=t.axisPointerModel.option;"show"===t.status&&E(t.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;o[e]=t})});var a=[],s=[];E(r,function(t,e){o[e]||s.push(t)}),E(o,function(t,e){r[e]||a.push(t)}),s.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:s}),a.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(h,n),p}});var wT,Yh=(l(ST,wT=qp),ST.type="tooltip",ST.dependencies=["axisPointer"],ST.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderColor:"#333",borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},ST);function ST(){var t=null!==wT&&wT.apply(this,arguments)||this;return t.type=ST.type,t}function MT(t){var e=t.get("confine");return null!=e?e:"richText"===t.get("renderMode")}qp.registerClass(Yh);var TT=["-ms-","-moz-","-o-","-webkit-",""];function CT(i,t,e){var n,r=[],o=i.get("transitionDuration"),a=i.get("backgroundColor"),s=i.get("shadowBlur"),l=i.get("shadowColor"),u=i.get("shadowOffsetX"),h=i.get("shadowOffsetY"),c=i.getModel("textStyle"),p=yg(i,"html"),l=u+"px "+h+"px "+s+"px "+l;return r.push("box-shadow:"+l),t&&o&&r.push((n="opacity "+(t=o)/2+"s "+(o="cubic-bezier(0.23, 1, 0.32, 1)")+",visibility "+t/2+"s "+o,e||(n+=",left "+t+"s "+o+",top "+t+"s "+o),O(TT,function(t){return t+"transition:"+n}).join(";"))),a&&(w.canvasSupported?r.push("background-Color:"+a):(r.push("background-Color:#"+en(a)),r.push("filter:alpha(opacity=70)"))),E(["width","color","radius"],function(t){var e="border-"+t,n=xp(e),n=i.get(n);null!=n&&r.push(e+":"+n+("color"===t?"":"px"))}),r.push(function(n){var i=[],t=n.get("fontSize");(o=n.getTextColor())&&i.push("color:"+o),i.push("font:"+n.getFont()),t&&i.push("line-height:"+Math.round(3*t/2)+"px");var e=n.get("textShadowColor"),r=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,t=n.get("textShadowOffsetY")||0;return e&&r&&i.push("text-shadow:"+o+"px "+t+"px "+r+"px "+e),E(["decoration","align"],function(t){var e=n.get(t);e&&i.push("text-"+t+":"+e)}),i.join(";")}(c)),null!=p&&r.push("padding:"+bp(p).join("px ")+"px"),r.join(";")+";"}function IT(t,e,n,i,r){var o,a,s=e&&e.painter;n?(a=s&&s.getViewportRoot())&&(o=t,n=a,a=document.body,Gt(Ht,n,i,r,!0)&&Gt(o,a,Ht[0],Ht[1])):(t[0]=i,t[1]=r,(s=s&&s.getViewportRootOffset())&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)),t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var AT=(DT.prototype.update=function(t){var e=this._container,n=e.currentStyle||document.defaultView.getComputedStyle(e),e=e.style;"absolute"!==e.position&&"absolute"!==n.position&&(e.position="relative"),t.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=t.get("className")||""},DT.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=this._styleCoord,r=n.offsetHeight/2;e=kp(e),n.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+CT(t,!this._firstShow,this._longHide)+";left:"+i[0]+"px;top:"+(i[1]-r)+"px;border-color: "+e+";"+(t.get("extraCssText")||""),n.style.display=n.innerHTML?"block":"none",n.style.pointerEvents=this._enterable?"auto":"none",this._show=!0,this._firstShow=!1,this._longHide=!1},DT.prototype.setContent=function(t,e,n,i,r){if(null!=t){var o=this.el;if(H(r)&&"item"===n.get("trigger")&&!MT(n)&&(t+=function(t,e,n){if(!H(n)||"inside"===n)return"";e=kp(e);var n=i="left"===(i=n)?"right":"right"===i?"left":"top"===i?"bottom":"top",i="",r="",r=-1'}(n.get("backgroundColor"),i,r)),H(t))o.innerHTML=t;else if(t){o.innerHTML="",V(t)||(t=[t]);for(var a=0;a",a=p.join(e);this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(r,o,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(r,a,h,Math.random()+"",i[0],i[1],o,null,d)})},FT.prototype._showSeriesItemTooltip=function(t,e,n){var i,r,o,a,s=zm(e,function(t){return null!=Gu(t).dataIndex}),l=this._ecModel,u=Gu(s),h=u.seriesIndex,c=l.getSeriesByIndex(h),p=u.dataModel||c,d=u.dataIndex,e=u.dataType,s=p.getData(e),u=this._renderMode,f=HT([s.getItemModel(d),p,c&&(c.coordinateSystem||{}).model,this._tooltipModel]),c=f.get("trigger");null!=c&&"item"!==c||(i=p.getDataParams(d,e),r=new mg,i.marker=r.makeTooltipMarker("item",kp(i.color),u),c=Af(p.formatTooltip(d,!1,e)),e=f.get("order"),o=c.markupFragment?pg(c.markupFragment,r,u,e,l.get("useUTC")):c.markupText,a="item_"+p.name+"_"+d,this._showOrMove(f,function(){this._showTooltipContent(f,o,i,a,t.offsetX,t.offsetY,t.position,t.target,r)}),n({type:"showTip",dataIndexInside:d,dataIndex:s.getRawIndex(d),seriesIndex:h,from:this.uid}))},FT.prototype._showComponentItemTooltip=function(t,e,n){var i=e.tooltip;H(i)&&(i={content:i,formatter:i});var r=new Ec(i,this._tooltipModel,this._ecModel),o=r.get("content"),a=Math.random()+"",s=new mg;this._showOrMove(r,function(){this._showTooltipContent(r,o,r.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e,s)}),n({type:"showTip",from:this.uid})},FT.prototype._showTooltipContent=function(n,t,i,e,r,o,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&(u=this._tooltipContent,h=n.get("formatter"),a=a||n.get("position"),p=t,c=this._getNearestPoint([r,o],i,n.get("trigger")),h&&H(h)?(d=n.ecModel.get("useUTC"),p=h,(t=V(i)?i[0]:i)&&t.axisType&&0<=t.axisType.indexOf("time")&&(p=ip(t.axisValue,p,d)),p=Ap(p,i,!0)):F(h)&&(d=NT(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c.color,a),this._updatePosition(n,a,r,o,u,i,s))},this),this._ticket=e,p=h(i,e,d)),u.setContent(p,l,n,c.color,a),u.show(n,c.color),this._updatePosition(n,a,r,o,u,i,s))},FT.prototype._getNearestPoint=function(t,e,n){return"axis"===n||V(e)?{color:"html"===this._renderMode?"#fff":"none"}:V(e)?void 0:{color:e.color||e.borderColor}},FT.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u,h=r.getSize(),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),F(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:h.slice()})),V(e)?(n=BT(e[0],s),i=BT(e[1],l)):U(e)?((o=e).width=h[0],o.height=h[1],n=(o=Bp(o,{width:s,height:l})).x,i=o.y,p=c=null):i=(n=(u=H(e)&&a?function(t,e,n){var i=n[0],r=n[1],o=0,a=0,s=e.width,n=e.height;switch(t){case"inside":o=e.x+s/2-i/2,a=e.y+n/2-r/2;break;case"top":o=e.x+s/2-i/2,a=e.y-r-10;break;case"bottom":o=e.x+s/2-i/2,a=e.y+n+10;break;case"left":o=e.x-i-10-5,a=e.y+n/2-r/2;break;case"right":o=e.x+s+10+5,a=e.y+n/2-r/2}return[o,a]}(e,d,h):function(t,e,n,i,r,o,a){var s=n.getOuterSize(),n=s.width,s=s.height;null!=o&&(in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],e=[-p.x,-p.y],s=Q(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?e[i]+=n[r]-p[r]:g[i]+=p[r]+s),e[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(e);g={x:0,y:0};g[r]=(d?n:c)[r],g[o]=Math.max(c[o],p[o]),g[a]=Math.min(0,p[a]+e[1-i]),u.__rectSize=n[r],d?((i={x:0,y:0})[r]=Math.max(n[r]-p[r]-s,0),i[o]=g[o],u.setClipPath(new oa({shape:i})),u.__rectSize=i[r]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});h=this._getPageInfo(t);return null!=h.pageIndex&&jh(l,{x:h.contentPosition[0],y:h.contentPosition[1]},d?t:null),this._updatePageInfoView(t,h),g},cC.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},cC.prototype._updatePageInfoView=function(n,i){var r=this._controllerGroup;E(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=r.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")});var t=r.childOfName("pageText"),e=n.get("pageFormatter"),o=i.pageIndex,a=null!=o?o+1:0,o=i.pageCount;t&&e&&t.setStyle("text",H(e)?e.replace("{current}",null==a?"":a+"").replace("{total}",null==o?"":o+""):e({current:a,total:o}))},cC.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=uC[r],a=hC[r],s=this._findTargetItemIndex(e),l=n.children(),t=l[s],u=l.length,e=u?1:0,h={contentPosition:[n.x,n.y],pageCount:e,pageIndex:e-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!t)return h;t=g(t);h.contentPosition[r]=-t.s;for(var c=s+1,p=t,d=t,f=null;c<=u;++c)(!(f=g(l[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=s-1,p=t,d=t,f=null;-1<=c;--c)(f=g(l[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},cC.prototype._findTargetItemIndex=function(n){return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==r&&null!=t&&(r=e),t===n&&(i=e)}),null!=i?i:r):0;var i,r},cC.type="legend.scroll",cC);function cC(){var t=null!==sC&&sC.apply(this,arguments)||this;return t.type=cC.type,t.newlineDisabled=!0,t._currentIndex=0,t}Pg.registerClass(nl),a_("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})});var pC,nl=(l(dC,pC=qp),dC.type="title",dC.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},dC);function dC(){var t=null!==pC&&pC.apply(this,arguments)||this;return t.type=dC.type,t.layoutMode={type:"box",ignoreSize:!0},t}qp.registerClass(nl);var fC,nl=(l(gC,fC=Pg),gC.prototype.render=function(t,e,n){var i,r,o,a,s,l,u,h,c;this.group.removeAll(),t.get("show")&&(i=this.group,h=t.getModel("textStyle"),a=t.getModel("subtextStyle"),r=t.get("textAlign"),c=Q(t.get("textBaseline"),t.get("textVerticalAlign")),u=(o=new Ss({style:fc(h,{text:t.get("text"),fill:h.getTextColor()},{disableBox:!0}),z2:10})).getBoundingRect(),h=t.get("subtext"),a=new Ss({style:fc(a,{text:h,fill:a.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),s=t.get("link"),l=t.get("sublink"),u=t.get("triggerEvent",!0),o.silent=!s&&!u,a.silent=!l&&!u,s&&o.on("click",function(){Lp(s,"_"+t.get("target"))}),l&&a.on("click",function(){Lp(l,"_"+t.get("subtarget"))}),Gu(o).eventData=Gu(a).eventData=u?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(o),h&&i.add(a),u=i.getBoundingRect(),(h=t.getBoxLayoutParams()).width=u.width,h.height=u.height,n=Bp(h,{width:n.getWidth(),height:n.getHeight()},t.get("padding")),r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?n.x+=n.width:"center"===r&&(n.x+=n.width/2)),c||("center"===(c=t.get("top")||t.get("bottom"))&&(c="middle"),"bottom"===c?n.y+=n.height:"middle"===c&&(n.y+=n.height/2),c=c||"top"),i.x=n.x,i.y=n.y,i.markRedraw(),c={align:r,verticalAlign:c},o.setStyle(c),a.setStyle(c),u=i.getBoundingRect(),c=n.margin,(n=t.getItemStyle(["color","opacity"])).fill=t.get("backgroundColor"),n=new oa({shape:{x:u.x-c[3],y:u.y-c[0],width:u.width+c[1]+c[3],height:u.height+c[0]+c[2],r:t.get("borderRadius")},style:n,subPixelOptimize:!0,silent:!0}),i.add(n))},gC.type="title",gC);function gC(){var t=null!==fC&&fC.apply(this,arguments)||this;return t.type=gC.type,t}function yC(t){hu(t,"label",["show"])}Pg.registerClass(nl);var mC,vC=bu(),_C=(l(xC,mC=qp),xC.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},xC.prototype.isAnimationEnabled=function(){if(w.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},xC.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},xC.prototype._mergeOption=function(t,i,e,r){var o=this.mainType;e||i.eachSeries(function(t){var e=t.get(this.mainType,!0),n=vC(t)[o];e&&e.data?(n?n._mergeOption(e,i,!0):(r&&yC(e),E(e.data,function(t){t instanceof Array?(yC(t[0]),yC(t[1])):yC(t)}),A(n=this.createMarkerModelFromSeries(e,this,i),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),n.__hostSeries=t),vC(t)[o]=n):vC(t)[o]=null},this)},xC.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),t=i.getName(t);return ug("section",{header:this.name,blocks:[ug("nameValue",{name:t,value:r,noName:!t,noValue:null==r})]})},xC.prototype.getData=function(){return this._data},xC.prototype.setData=function(t){this._data=t},xC.getMarkerModelFromSeries=function(t,e){return vC(t)[e]},xC.type="marker",xC.dependencies=["series","grid","polar","geo"],xC);function xC(){var t=null!==mC&&mC.apply(this,arguments)||this;return t.type=xC.type,t.createdBySelf=!1,t}T(_C,Ca.prototype);var bC,nl=(l(wC,bC=_C),wC.prototype.createMarkerModelFromSeries=function(t,e,n){return new wC(t,e,n)},wC.type="markPoint",wC.defaultOption={zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},wC);function wC(){var t=null!==bC&&bC.apply(this,arguments)||this;return t.type=wC.type,t}function SC(t,e,n,i,r,o){var a=[],s=$_(e,i)?e.getCalculationInfo("stackResultDimension"):i,t=DC(e,s,t),t=e.indicesOfNearest(s,t)[0];a[r]=e.get(n,t),a[o]=e.get(s,t);s=e.get(i,t),t=Gl(e.get(i,t));return 0<=(t=Math.min(t,20))&&(a[o]=+a[o].toFixed(t)),[a,s]}qp.registerClass(nl);var MC={min:B(SC,"min"),max:B(SC,"max"),average:B(SC,"average"),median:B(SC,"median")};function TC(t,e){var n=t.getData(),i=t.coordinateSystem;if(e&&(o=e,isNaN(parseFloat(o.x))||isNaN(parseFloat(o.y)))&&!V(e.coord)&&i){var r=i.dimensions,o=CC(e,n,i,t);if((e=I(e)).type&&MC[e.type]&&o.baseAxis&&o.valueAxis){i=L(r,o.baseAxis.dim),t=L(r,o.valueAxis.dim),t=MC[e.type](n,o.baseDataDim,o.valueDataDim,i,t);e.coord=t[0],e.value=t[1]}else{for(var a=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],s=0;s<2;s++)MC[a[s]]&&(a[s]=DC(n,n.mapDimension(r[s]),a[s]));e.coord=a}}return e}function CC(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(function(t,e){var n=t.getData(),i=n.dimensions;e=n.getDimension(e);for(var r=0;ro&&(e[1-i]=e[i]+n.sign*o),e}function VI(t,e){t=t[e]-t[1-e];return{span:Math.abs(t),sign:0e[0]||t[1]<0||t[1]>e[1]||(e=((e=this._handleEnds)[0]+e[1])/2,e=this._updateInterval("all",t[0]-e),this._updateView(),e&&this._dispatchZoomAction(!1))},ZI.prototype._onBrushStart=function(t){var e=t.offsetX,t=t.offsetY;this._brushStart=new Mn(e,t),this._brushing=!0,this._brushStartTime=+new Date},ZI.prototype._onBrushEnd=function(t){var e,n,i;this._brushing&&(i=this._displayables.brushRect,this._brushing=!1,i&&(i.attr("ignore",!0),e=i.shape,+new Date-this._brushStartTime<200&&Math.abs(e.width)<5||(n=this._getViewExtent(),i=[0,100],this._range=Hl([Bl(e.x,n,i,!0),Bl(e.x+e.width,n,i,!0)]),this._handleEnds=[e.x,e.x+e.width],this._updateView(),this._dispatchZoomAction(!1))))},ZI.prototype._onBrush=function(t){this._brushing&&(Jt(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},ZI.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new GI({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);i=this._brushStart,n=this._displayables.sliderGroup,e=n.transformCoordToLocal(t,e),n=n.transformCoordToLocal(i.x,i.y),i=this._size;e[0]=Math.max(Math.min(i[0],e[0]),0),r.setShape({x:n[0],y:0,width:e[0]-n[0],height:i[1]})},ZI.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?YI:null,start:e[0],end:e[1]})},ZI.prototype._findCoordRect=function(){var t,e,n=AI(this.dataZoomModel).infoList;return!t&&n.length&&(t=(e=n[0].model.coordinateSystem).getRect&&e.getRect()),t||(t={x:.2*(n=this.api.getWidth()),y:.2*(e=this.api.getHeight()),width:.6*n,height:.6*e}),t},ZI.type="dataZoom.slider",ZI);function ZI(){var t=null!==HI&&HI.apply(this,arguments)||this;return t.type=ZI.type,t._displayables={},t}function jI(t){return"vertical"===t?"ns-resize":"ew-resize"}Pg.registerClass(nl);var qI=E,KI=Hl,$I=(JI.prototype.hostedBy=function(t){return this._dataZoomModel===t},JI.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},JI.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},JI.prototype.getTargetSeriesModels=function(){var n=[];return this.ecModel.eachSeries(function(t){var e;e=(e=t).get("coordinateSystem"),0<=L(TI,e)&&(e=CI(this._dimName),(e=t.getReferringComponents(e,Mu).models[0])&&this._axisIndex===e.componentIndex&&n.push(t))},this),n},JI.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},JI.prototype.getMinMaxSpan=function(){return I(this._minMaxSpan)},JI.prototype.calculateDataWindow=function(i){var r,o=this._dataExtent,s=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),l=[0,100],u=[],h=[];qI(["start","end"],function(t,e){var n=i[t],t=i[t+"Value"];"percent"===a[e]?(null==n&&(n=l[e]),t=s.parse(Bl(n,l,o))):(r=!0,n=Bl(t=null==t?o[e]:s.parse(t),o,l)),h[e]=t,u[e]=n}),KI(h),KI(u);var c=this._minMaxSpan;function t(t,e,n,i,r){var o=r?"Span":"ValueSpan";BI(0,t,n,"all",c["min"+o],c["max"+o]);for(var a=0;a<2;a++)e[a]=Bl(t[a],n,i,!0),r&&(e[a]=s.parse(e[a]))}return r?t(h,u,o,l,!1):t(u,h,l,o,!0),{valueWindow:h,percentWindow:u}},JI.prototype.reset=function(t){var e;t===this._dataZoomModel&&(e=this.getTargetSeriesModels(),this._dataExtent=function(t,e,n){var i=[1/0,-1/0];qI(n,function(t){lb(i,t.getData(),e)});t=t.getAxisModel(),t=$x(t.axis.scale,t,i).calculate();return[t.min,t.max]}(this,this._dimName,e),this._updateMinMaxSpan(),t=this.calculateDataWindow(t.settledOption),this._valueWindow=t.valueWindow,this._percentWindow=t.percentWindow,this._setAxisModel())},JI.prototype.filterData=function(t,e){var i,n,r,h;t===this._dataZoomModel&&(i=this._dimName,n=this.getTargetSeriesModels(),r=t.get("filterMode"),h=this._valueWindow,"none"!==r&&qI(n,function(n){var l=n.getData(),u=l.mapDimensionsAll(i);u.length&&("weakFilter"===r?l.filterSelf(function(t){for(var e,n,i,r=0;rh[1];if(a&&!s&&!o)return!0;a&&(i=!0),s&&(e=!0),o&&(n=!0)}return i&&e&&n}):qI(u,function(t){var e;"empty"===r?n.setData(l=l.map(t,function(t){return(e=t)>=h[0]&&e<=h[1]?t:NaN;var e})):((e={})[t]=h,l.selectRange(e))}),qI(u,function(t){l.setApproximateExtent(h,t)}))}))},JI.prototype._updateMinMaxSpan=function(){var i=this._minMaxSpan={},r=this._dataZoomModel,o=this._dataExtent;qI(["min","max"],function(t){var e=r.get(t+"Span"),n=r.get(t+"ValueSpan");null!=n&&(n=this.getAxisModel().axis.scale.parse(n)),null!=n?e=Bl(o[0]+n,o,[0,100],!0):null!=e&&(n=Bl(e,[0,100],o,!0)-o[0]),i[t+"Span"]=e,i[t+"ValueSpan"]=n},this)},JI.prototype._setAxisModel=function(){var t,e=this.getAxisModel(),n=this._percentWindow,i=this._valueWindow;n&&(t=Ul(i,[0,500]),t=Math.min(t,20),e=e.axis.scale.rawExtentInfo,0!==n[0]&&e.setDeterminedMinMax("min",+i[0].toFixed(t)),100!==n[1]&&e.setDeterminedMinMax("max",+i[1].toFixed(t)),e.freeze())},JI);function JI(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}o_(Dc.PROCESSOR.FILTER,{getTargetSeries:function(o){function t(r){o.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(t,e){var n=o.getComponent(CI(t),e);r(t,e,n,i)})})}t(function(t,e,n,i){n.__dzAxisProxy=null});var r=[];t(function(t,e,n,i){n.__dzAxisProxy||(n.__dzAxisProxy=new $I(t,e,i,o),r.push(n.__dzAxisProxy))});var e=ht();return E(r,function(t){E(t.getTargetSeriesModels(),function(t){e.set(t.uid,t)})}),e},overallReset:function(t,i){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).reset(n)}),n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).filterData(n,i)})}),t.eachComponent("dataZoom",function(t){var e,n=t.findRepresentativeAxisProxy();n&&(e=n.getDataPercentWindow(),n=n.getDataValueWindow(),t.setCalculatedRange({start:e[0],end:e[1],startValue:n[0],endValue:n[1]}))})}}),a_("dataZoom",function(e,t){E(II(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})});var QI,nl=(l(tA,QI=Fs),tA.type="dataZoom.inside",tA.defaultOption=Vc(Fs.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),tA);function tA(){var t=null!==QI&&QI.apply(this,arguments)||this;return t.type=tA.type,t}qp.registerClass(nl);var eA="\0_ec_interaction_mutex";function nA(t,e){return iA(t)[e]}function iA(t){return t[eA]||(t[eA]={})}a_({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){});var rA,oA=(l(aA,rA=Et),aA.prototype.isDragging=function(){return this._dragging},aA.prototype.isPinching=function(){return this._pinching},aA.prototype.setPointerChecker=function(t){this.pointerChecker=t},aA.prototype.dispose=function(){this.disable()},aA.prototype._mousedownHandler=function(t){var e,n;Qt(t)||t.target&&t.target.draggable||(e=t.offsetX,n=t.offsetY,this.pointerChecker&&this.pointerChecker(t,e,n)&&(this._x=e,this._y=n,this._dragging=!0))},aA.prototype._mousemoveHandler=function(t){var e,n,i,r,o,a;this._dragging&&uA("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!nA(this._zr,"globalPan")&&(e=t.offsetX,n=t.offsetY,o=e-(i=this._x),a=n-(r=this._y),this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&Jt(t.event),lA(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:i,oldY:r,newX:e,newY:n,isAvailableBehavior:null}))},aA.prototype._mouseupHandler=function(t){Qt(t)||(this._dragging=!1)},aA.prototype._mousewheelHandler=function(t){var e=uA("zoomOnMouseWheel",t,this._opt),n=uA("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,r=Math.abs(i),o=t.offsetX,a=t.offsetY;0!==i&&(e||n)&&(e&&(r=3p.getHeight()&&(i.position="top",e=!0),e=e?-5-r.height:d+8,o+r.width/2>p.getWidth()?(i.position=["100%",e],n.align="right"):o-r.width/2<0&&(i.position=[0,e],n.align="left"))}))},CA.prototype.updateView=function(t,e,n,i){E(this._features,function(t){t instanceof _A&&t.updateView&&t.updateView(t.model,e,n,i)})},CA.prototype.remove=function(e,n){E(this._features,function(t){t instanceof _A&&t.remove&&t.remove(e,n)}),this.group.removeAll()},CA.prototype.dispose=function(e,n){E(this._features,function(t){t instanceof _A&&t.dispose&&t.dispose(e,n)})},CA.type="toolbox",CA);function CA(){return null!==TA&&TA.apply(this,arguments)||this}Pg.registerClass(nl);var IA,nl=(l(AA,IA=_A),AA.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType()?"svg":n.get("type",!0)||"png",e=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||w.browser.ie||w.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(e.split(",")[1]),a=o.length,s=new Uint8Array(a);a--;)s[a]=o.charCodeAt(a);t=new Blob([s]);window.navigator.msSaveOrOpenBlob(t,i+"."+r)}else{var l=n.get("lang"),l='';window.open().document.write(l)}else{l=document.createElement("a");l.download=i+"."+r,l.target="_blank",l.href=e;e=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(e)}},AA.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:t.getLocale(["toolbox","saveAsImage","lang"])}},AA);function AA(){return null!==IA&&IA.apply(this,arguments)||this}nl.prototype.unusable=!w.canvasSupported,bA("saveAsImage",nl);var DA,kA="__ec_magicType_stack__",LA=[["line","bar"],["stack"]],nl=(l(PA,DA=_A),PA.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return E(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},PA.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},PA.prototype.onclick=function(t,e,a){var s,n,l=this.model,i=l.get(["seriesIndex",a]);OA[a]&&(s={series:[]},E(LA,function(t){0<=L(t,a)&&E(t,function(t){l.setIconStatus(t,"normal")})}),l.setIconStatus(a,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},function(t){var e=t.subType,n=t.id,n=OA[a](e,n,t,l);n&&(D(n,t.option),s.series.push(n));n=t.coordinateSystem;if(n&&"cartesian2d"===n.type&&("line"===a||"bar"===a)){n=n.getAxesByScale("ordinal")[0];if(n){var i=n.dim+"Axis",r=t.getReferringComponents(i,Mu).models[0].componentIndex;s[i]=s[i]||[];for(var o=0;o<=r;o++)s[i][r]=s[i][r]||{};s[i][r].boundaryGap="bar"===a}}}),"stack"===a&&(n=b({stack:l.option.title.tiled,tiled:l.option.title.stack},l.option.title)),e.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:n,featureName:"magicType"}))},PA);function PA(){return null!==DA&&DA.apply(this,arguments)||this}var OA={line:function(t,e,n,i){if("bar"===t)return b({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return b({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){n=n.get("stack")===kA;if("line"===t||"bar"===t)return i.setIconStatus("stack",n?"normal":"emphasis"),b({id:e,stack:n?"":kA},i.get(["option","stack"])||{},!0)}};a_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),bA("magicType",nl);var RA=new Array(60).join("-"),EA="\t";function NA(t){var r,o,a,h,t=(r={},o=[],a=[],t.eachRawSeries(function(t){var e,n,i=t.coordinateSystem;i&&("cartesian2d"===i.type||"polar"===i.type)&&"category"===(e=i.getBaseAxis()).type?(n=e.dim+"_"+e.index,r[n]||(r[n]={categoryAxis:e,valueAxis:i.getOtherAxis(e),series:[]},a.push({axisDim:e.dim,axisIndex:e.index})),r[n].series.push(t)):o.push(t)}),{seriesGroupByCategoryAxis:r,other:o,meta:a});return{value:R([(h=[],E(t.seriesGroupByCategoryAxis,function(t,e){var n=t.categoryAxis,i=t.valueAxis.dim,r=[" "].concat(O(t.series,function(t){return t.name})),o=[n.model.getCategories()];E(t.series,function(t){var e=t.getRawData();o.push(t.getRawData().mapArray(e.mapDimension(i),function(t){return t}))});for(var a=[r.join(EA)],s=0;st.getWidth()||n<0||n>t.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=uD(t,e,n);if(!t._dragging)for(var a=0;at[1]&&t.reverse(),t}function GD(t,e){return Su(t,e,{includeMainTypes:BD})}var WD={grid:function(t,i){var r=t.xAxisModels,o=t.yAxisModels,t=t.gridModels,e=ht(),a={},s={};(r||o||t)&&(E(r,function(t){t=t.axis.grid.model;e.set(t.id,t),a[t.id]=!0}),E(o,function(t){t=t.axis.grid.model;e.set(t.id,t),s[t.id]=!0}),E(t,function(t){e.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),e.each(function(t){var e=t.coordinateSystem,n=[];E(e.getCartesians(),function(t,e){(0<=L(r,t.getAxis("x").model)||0<=L(o,t.getAxis("y").model))&&n.push(t)}),i.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:n[0],coordSyses:n,getPanelRect:XD.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,n){E(t.geoModels,function(t){var e=t.coordinateSystem;n.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:XD.geo})})}},UD=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,t=t.gridModel;return!t&&n&&(t=n.axis.grid.model),!t&&i&&(t=i.axis.grid.model),t&&t===e.gridModel},function(t,e){t=t.geoModel;return t&&t===e.geoModel}],XD={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(tc(t)),e}},YD={lineX:B(ZD,0),lineY:B(ZD,1),rect:function(t,e,n){var i=e[zD[t]]([n[0][0],n[1][0]]),n=e[zD[t]]([n[0][1],n[1][1]]),n=[HD([i[0],n[0]]),HD([i[1],n[1]])];return{values:n,xyMinMax:n}},polygon:function(e,n,t){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:O(t,function(t){t=n[zD[e]](t);return i[0][0]=Math.min(i[0][0],t[0]),i[1][0]=Math.min(i[1][0],t[1]),i[0][1]=Math.max(i[0][1],t[0]),i[1][1]=Math.max(i[1][1],t[1]),t}),xyMinMax:i}}};function ZD(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=HD(O([0,1],function(t){return e?r.coordToData(r.toLocalCoord(i[t])):r.toGlobalCoord(r.dataToCoord(i[t]))})),n=[];return n[t]=o,n[1-t]=[NaN,NaN],{values:o,xyMinMax:n}}var jD={lineX:B(qD,0),lineY:B(qD,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,n,i){return O(t,function(t,e){return[t[0]-i[0]*n[e][0],t[1]-i[1]*n[e][1]]})}};function qD(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function KD(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var $D=E,JD=bu();function QD(t){t=JD(t);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var tk,Fs=(l(ek,tk=Fs),ek.type="dataZoom.select",ek);function ek(){var t=null!==tk&&tk.apply(this,arguments)||this;return t.type=ek.type,t}qp.registerClass(Fs);var nk,Ca=(l(ik,nk=Ca),ik.type="dataZoom.select",ik);function ik(){var t=null!==nk&&nk.apply(this,arguments)||this;return t.type=ik.type,t}Pg.registerClass(Ca);var rk,ok=E,ak=lu+"toolbox-dataZoom_",Ca=(l(sk,rk=_A),sk.prototype.render=function(t,e,n,i){this.brushController||(this.brushController=new eD(n.getZr()),this.brushController.on("brush",z(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n.isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");r=new VD(pk(t),e,{include:["grid"]}).makePanelOpts(r,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n.brushController.setPanels(r).enableBrush(!(!o||!r.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),e=e,t.setIconStatus("back",1c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var r,o,a,s=[],l=0;l=h&&c<=e+1){for(var n=[],i=0;i=h&&c<=r+1)return function(t){for(var e=0,n=t.length,i=0,r=0;e\n\r<"))},hL)),t.Axis=wl,t.List=H_,t.Model=Ec,t.PRIORITY=Dc,t.color=ln,t.connect=function(e){var t;return V(e)&&(t=e,e=null,$m(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+Qv++,$m(t,function(t){t.group=e})),$v[e]=!0,e},t.dataTool={},t.dependencies={zrender:"5.0.0"},t.disConnect=e_,t.disconnect=Lc,t.dispose=function(t){"string"==typeof t?t=Kv[t]:t instanceof Ov||(t=n_(t)),t instanceof Ov&&!t.isDisposed()&&t.dispose()},t.env=w,t.extendChartView=function(t){return zg.extend(t)},t.extendComponentModel=function(t){return qp.extend(t)},t.extendComponentView=function(t){return Pg.extend(t)},t.extendSeriesModel=function(t){return Sg.extend(t)},t.format=Lb,t.getCoordinateSystemDimensions=function(t){if(t=Ed.get(t))return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.getInstanceByDom=n_,t.getInstanceById=function(t){return Kv[t]},t.getMap=function(t){return(t=My(t))&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.graphic=Ob,t.helper=Qa,t.init=function(t,e,n){var i=n_(t);if(i)return i;var r=new Ov(t,e,n);return r.id="ec_"+Jv++,Kv[r.id]=r,Iu(t,t_,r.id),Av(r),$m(Xv,function(t){t(r)}),r},t.innerDrawElementOnCanvas=Im,t.matrix=Se,t.number=kb,t.parseGeoJSON=mb,t.parseGeoJson=qn,t.registerAction=a_,t.registerCoordinateSystem=function(t,e){Ed.register(t,e)},t.registerLayout=s_,t.registerLoading=h_,t.registerLocale=Yc,t.registerMap=function(t,e,n){Sy(t,e,n)},t.registerPostInit=function(t){t&&Xv.push(t)},t.registerPostUpdate=function(t){t&&Yv.push(t)},t.registerPreprocessor=r_,t.registerProcessor=o_,t.registerTheme=i_,t.registerTransform=Ic,t.registerVisual=l_,t.setCanvasCreator=function(t){m("createCanvas",t)},t.throttle=Zg,t.time=ua,t.util=Pb,t.vector=Lt,t.version="5.0.0",t.zrender=n,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).echarts={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),o,r);if(r)return r(t,n,i),!0}return!1}function Wt(t){return"CANVAS"===t.nodeName.toUpperCase()}var Ut="undefined"!=typeof window&&!!window.addEventListener,Xt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Yt=[];function Zt(t,e,n,i){return n=n||{},i||!w.canvasSupported?jt(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):jt(t,e,n),n}function jt(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(Wt(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=r-e.top)}if(Gt(Yt,t,i,r))return n.zrX=Yt[0],void(n.zrY=Yt[1])}n.zrX=n.zrY=0}function qt(t){return t||window.event}function Kt(t,e,n){if(null!=(e=qt(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Zt(t,i,e,n):(Zt(t,e,e,n),r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function ge(){return[1,0,0,1,0,0]}function ye(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function me(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ve(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=e,t}function _e(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function xe(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=r*n+s*e,t[3]=-r*e+n*s,t[4]=n*o+e*l,t[5]=n*l-e*o,t}function be(t,e,n){var i=n[0],n=n[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function we(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],e=n*a-o*i;return e?(e=1/e,t[0]=a*e,t[1]=-o*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*r)*e,t[5]=(o*r-n*s)*e,t):null}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){pe.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=fe(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),$e(t,e),e):void Ze(e,0,0,0,1):7===r||9===r?0<=(o=parseInt(i.slice(1,7),16))&&o<=16777215?(Ze(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),$e(t,e),e):void Ze(e,0,0,0,1):void 0;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===r){r=i.substr(0,n),o=i.substr(n+1,o-(n+1)).split(","),n=1;switch(r){case"rgba":if(4!==o.length)return 3===o.length?Ze(e,+o[0],+o[1],+o[2],1):Ze(e,0,0,0,1);n=Ue(o.pop());case"rgb":return 3!==o.length?void Ze(e,0,0,0,1):(Ze(e,We(o[0]),We(o[1]),We(o[2]),n),$e(t,e),e);case"hsla":return 4!==o.length?void Ze(e,0,0,0,1):(o[3]=Ue(o[3]),Qe(o,e),$e(t,e),e);case"hsl":return 3!==o.length?void Ze(e,0,0,0,1):(Qe(o,e),$e(t,e),e);default:return}}Ze(e,0,0,0,1)}}function Qe(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Ue(t[1]),r=Ue(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return Ze(e=e||[],He(255*Xe(r,i,n+1/3)),He(255*Xe(r,i,n)),He(255*Xe(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function tn(t,e){var n=Je(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(P(e)){var r,o=P((o=e)&&o[0])?2:1;if(0e);u++);u=Math.min(u-1,o-2)}var h,c,p,d,f,g,y,m=r[u+1],v=r[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?_n:t[a],(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},En.prototype.clone=function(){return new En(this.x,this.y,this.width,this.height)},En.prototype.copy=function(t){En.copy(this,t)},En.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},En.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},En.prototype.isZero=function(){return 0===this.width||0===this.height},En.create=function(t){return new En(t.x,t.y,t.width,t.height)},En.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},En.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function gi(f,g){var o,a,y=hi,s=0,m=(f.length,[]);function e(t){var e=o[t],n=a[t],i=o[t+1],r=a[t+1];a[t]=n+r,t===s-3&&(o[t+1]=o[t+2],a[t+1]=a[t+2]),s--;t=fi(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(r=di(f[e+n-1],f,i,r,r-1,g))&&(n<=r?function(t,e,n,i){var r=0;for(r=0;ra[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=ci(t,n,i,e))this._ux||Yr(e-this._yi)>this._uy||this._len<5;return this.addData(Rr.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},to.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this.addData(Rr.C,t,e,n,i,r,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,o):this._ctx.bezierCurveTo(t,e,n,i,r,o)),this._xi=r,this._yi=o,this},to.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(Rr.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},to.prototype.arc=function(t,e,n,i,r,o){Kr[0]=i,Kr[1]=r,Jr(Kr,o),i=Kr[0];var a=(r=Kr[1])-i;return this.addData(Rr.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=Wr(r)*n+t,this._yi=Ur(r)*n+e,this},to.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},to.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Rr.R,t,e,n,i),this},to.prototype.closePath=function(){this.addData(Rr.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},to.prototype.fill=function(t){t&&t.fill(),this.toStatic()},to.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},to.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||Yr(y)>i||c===e-1)&&(f=Math.sqrt(C*C+y*y),r=g,o=_);break;case Rr.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],b=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=pr(t,n,r,a,f),y=pr(e,i,o,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(r,o,m,v,g,_,x,b,10),r=x,o=b;break;case Rr.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=vr(t,n,r,p),f=vr(e,i,o,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case Rr.A:var w=t[c++],S=t[c++],M=t[c++],T=t[c++],p=t[c++],x=t[c++],b=x+p;c+=1;t[c++];d&&(a=Wr(p)*M+w,s=Ur(p)*T+S),f=Gr(M,T)*Hr(jr,Math.abs(x)),r=Wr(b)*M+w,o=Ur(b)*T+S;break;case Rr.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case Rr.Z:var C=a-r,y=s-o;f=Math.sqrt(C*C+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},to.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||Yr(s-o)>p||m===d-1){if(f){if(u=uo[i=0]+t&&a<=uo[1]+t?l:0}rMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,_,x,x+b,f,g,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case ao.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(eo(c,p,w,p,e,i,r)||eo(w,p,w,S,e,i,r)||eo(w,S,c,S,e,i,r)||eo(c,S,c,p,e,i,r))return!0}else l+=oo(w,p,w,S,i,r),l+=oo(c,S,c,p,i,r);break;case ao.Z:if(n){if(eo(u,h,c,p,e,i,r))return!0}else l+=oo(u,h,c,p,i,r);u=c,h=p}}return n||(o=h,t=p,Math.abs(o-t)=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,n,i){for(var r=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),p=!0),i.accumWidth=s):(s=_s(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,o=s.lines)):o=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},Rl.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Rl.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Rl.prototype.addHover=function(t){},Rl.prototype.removeHover=function(t){},Rl.prototype.clearHover=function(){},Rl.prototype.refreshHover=function(){this._needsRefreshHover=!0},Rl.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},Rl.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Rl.prototype.clearAnimation=function(){this.animation.clear()},Rl.prototype.getWidth=function(){return this.painter.getWidth()},Rl.prototype.getHeight=function(){return this.painter.getHeight()},Rl.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Rl.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Rl.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Rl.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},Rl.prototype.off=function(t,e){this.handler.off(t,e)},Rl.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Rl.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function Vl(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Fl(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Hl(t){return t.sort(function(t,e){return t-e}),t}function Gl(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Wl(t){var e=t.toString(),t=e.indexOf("e");if(0u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/r}function Yl(t){var e=2*Math.PI;return(t%e+e)%e}function Zl(t){return-zlMath.abs(r[1])?0"'])/g,Sp={"&":"&","<":"<",">":">",'"':""","'":"'"};function Mp(t){return null==t?"":(t+"").replace(wp,function(t,e){return Sp[e]})}function Tp(t,e,n){function i(t){return t&&rt(t)?t:"-"}function r(t){return null!=t&&!isNaN(t)&&isFinite(t)}var o="time"===e,a=t instanceof Date;if(o||a){o=o?ql(t):t;if(!isNaN(+o))return ip(o,"yyyy-MM-dd hh:mm:ss",n);if(a)return"-"}if("ordinal"===e)return G(t)?i(t):W(t)&&r(t)?t+"":"-";e=Ql(t);return r(e)?_p(e):G(t)?i(t):"-"}function Cp(t,e){return"{"+t+(null==e?"":e)+"}"}var Ip=["a","b","c","d","e","f","g"];function Ap(t,e,n){V(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'':{renderMode:t,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function kp(t,e){return e=e||"transparent",H(t)?t:U(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Lp(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var Pp=Object.freeze({__proto__:null,addCommas:_p,toCamelCase:xp,normalizeCssArray:bp,encodeHTML:Mp,makeValueReadable:Tp,formatTpl:Ap,formatTplSimple:function(n,t,i){return E(t,function(t,e){n=n.replace("{"+e+"}",i?Mp(t):t)}),n},getTooltipMarker:Dp,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=ql(e),r=i["get"+(l=n?"UTC":"")+"FullYear"](),o=i["get"+l+"Month"]()+1,a=i["get"+l+"Date"](),s=i["get"+l+"Hours"](),e=i["get"+l+"Minutes"](),n=i["get"+l+"Seconds"](),l=i["get"+l+"Milliseconds"]();return t=t.replace("MM",ep(o,2)).replace("M",o).replace("yyyy",r).replace("yy",r%100+"").replace("dd",ep(a,2)).replace("d",a).replace("hh",ep(s,2)).replace("h",s).replace("mm",ep(e,2)).replace("m",e).replace("ss",ep(n,2)).replace("s",n).replace("SSS",ep(l,3))},capitalFirst:function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},convertToColorString:kp,windowOpen:Lp,truncateText:hs,getTextRect:function(t,e,n,i,r,o,a,s){return ou(),new Ss({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}}),Op=E,Rp=["left","right","top","bottom","width","height"],Ep=[["width","left","right"],["height","top","bottom"]];function Np(a,s,l,u,h){var c=0,p=0;null==u&&(u=1/0),null==h&&(h=1/0);var d=0;s.eachChild(function(t,e){var n,i,r=t.getBoundingRect(),o=s.childAt(e+1),e=o&&o.getBoundingRect();d="horizontal"===a?(o=r.width+(e?-e.x+r.x:0),u<(n=c+o)||t.newline?(c=0,n=o,p+=d+l,r.height):Math.max(d,r.height)):(e=r.height+(e?-e.y+r.y:0),h<(i=p+e)||t.newline?(c+=d+l,p=0,i=e,r.width):Math.max(d,r.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=i+l)})}var zp=Np;B(Np,"vertical"),B(Np,"horizontal");function Bp(t,e,n){n=bp(n||0);var i=e.width,r=e.height,o=Vl(t.left,i),a=Vl(t.top,r),s=Vl(t.right,i),l=Vl(t.bottom,r),u=Vl(t.width,i),h=Vl(t.height,r),c=n[2]+n[0],p=n[1]+n[3],e=t.aspect;switch(isNaN(u)&&(u=i-s-p-o),isNaN(h)&&(h=r-l-c-a),null!=e&&(isNaN(u)&&isNaN(h)&&(i/re)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return r&&(o[r]=n),e.paletteIdx=(t+1)%a.length,n}}var Td,Cd="\0_ec_inner",Id=(l(Ad,Td=Ec),Ad.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Ec(i),this._locale=new Ec(r),this._optionManager=o},Ad.prototype.setOption=function(t,e,n){it(!(Cd in t),"please use chart.getOption()");e=Ld(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},Ad.prototype.resetOption=function(t,e){return this._resetOption(t,Ld(e))},Ad.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):vd(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(r=r.getMediaOption(this)).length&&E(r,function(t){i=!0,this._mergeOption(t,e)},this),i},Ad.prototype.mergeOption=function(t){this._mergeOption(t,null)},Ad.prototype._mergeOption=function(i,t){var r=this.option,u=this._componentsMap,h=this._componentsCount,n=[],o=ht(),c=t&&t.replaceMergeMainTypeMap;ud(this).datasetMap=ht(),E(i,function(t,e){null!=t&&(qp.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?I(t):b(r[e],t,!0))}),c&&c.each(function(t,e){qp.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),qp.topologicalTravel(n,qp.getAllClassMainTypes(),function(o){var t=function(t,e,n){return(e=gd.get(e))&&(t=e(t))?n.concat(t):n}(this,o,uu(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",n=du(e,t,n);_u(n,o,qp),r[o]=null,u.set(o,null),h.set(o,0);var a=[],s=[],l=0;E(n,function(t,e){var n,i=t.existing,r=t.newOption;r?(n=qp.getClass(o,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1)):(e=A({componentIndex:e},t.keyInfo),A(i=new n(r,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&yd(this)},this),this._seriesIndices||yd(this)},Ad.prototype.getOption=function(){var a=I(this.option);return E(a,function(t,e){if(qp.hasClass(e)){for(var n=uu(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!vu(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[Cd],a},Ad.prototype.getTheme=function(){return this._theme},Ad.prototype.getLocaleModel=function(){return this._locale},Ad.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},Ad.prototype.setUpdatePayload=function(t){this._payload=t},Ad.prototype.getUpdatePayload=function(){return this._payload},Ad.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;i'+Mp(e)+""+o,n)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n){var i=t.renderMode,r=e.noName,o=e.noValue,a=!e.markerType,s=e.name,l=e.value,u=t.useUTC;if(!r||!o){var h=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),c=r?"":Tp(s,"ordinal",u),p=e.valueType,d=o?[]:V(l)?O(l,function(t,e){return Tp(t,V(p)?p[e]:p,u)}):[Tp(l,V(p)?p[0]:p,u)],f=!a||!r,s=!a&&r;return"richText"===i?(a?"":h)+(r?"":gg(t,c))+(o?"":(e=t,l=d,i=[og],t=(t=s)?10:20,f&&i.push({padding:[0,0,0,t],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(l.join(" "),i))):fg((a?"":h)+(r?"":''+Mp(c)+"")+(o?"":function(t,e,n){n=n?"10px":"20px";return''+O(t,Mp).join("  ")+""}(d,f,s)),n)}}}};function pg(t,e,n,i,r){if(t){var o=hg(t);o.planLayout(t);e={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e};return o.build(e,t,0)}}function dg(t){t=t.__gapLevelBetweenSubBlocks;return{html:sg[t],richText:lg[t]}}function fg(t,e){return'
'+t+'
'}function gg(t,e){return t.markupStyleCreator.wrapRichTextStyle(e,rg)}function yg(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}var mg=(vg.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},vg.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,n=Dp({color:e,type:t,renderMode:n,markerId:i});return H(n)?n:(this.richTextStyles[i]=n.style,n.content)},vg.prototype.wrapRichTextStyle=function(t,e){var n={};V(e)?E(e,function(t){return A(n,t)}):A(n,e);e=this._generateStyleName();return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"},vg);function vg(){this.richTextStyles={},this._nextStyleNameId=eu()}function _g(t){var e,n,i,r,o,a,s,l,u,h,c,p,d=t.series,f=t.dataIndex,g=t.multipleSeries,y=d.getData(),m=y.mapDimensionsAll("defaultedTooltip"),v=m.length,_=d.getRawValue(f),x=V(_),t=(e=f,kp((t=d).getData().getItemVisual(e,"style")[t.visualDrawType]));function b(t,e){e=l.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(u?p.push(ug("nameValue",{markerType:"subItem",markerColor:s,name:e.displayName,value:t,valueType:e.type})):(h.push(t),c.push(e.type)))}1this.getShallow("animationThreshold")&&(t=!1),!!t},Mg.prototype.restoreData=function(){this.dataTask.dirty()},Mg.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return bd.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Mg.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Mg.prototype.getProgressive=function(){return this.get("progressive")},Mg.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Mg.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Mg.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;re.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Dg(e,n){E(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,B(kg,n))})}function kg(t,e){t=Lg(t);return t&&t.setOutputEnd((e||this).count()),e}function Lg(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}T(Sg,Ca),T(Sg,bd),Ru(Sg,qp);var Pg=(Og.prototype.init=function(t,e){},Og.prototype.render=function(t,e,n,i){},Og.prototype.dispose=function(t,e){},Og.prototype.updateView=function(t,e,n,i){},Og.prototype.updateLayout=function(t,e,n,i){},Og.prototype.updateVisual=function(t,e,n,i){},Og.prototype.blurSeries=function(t,e){},Og);function Og(){this.group=new Ho,this.uid=Bc("viewComponent")}function Rg(){var o=bu();return function(t){var e=o(t),n=t.pipelineContext,i=!!e.large,r=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&r==n)&&"reset"}}Ou(Pg),Bu(Pg,{registerWhenExtend:!0});var Eg=bu(),Ng=Rg(),zg=(Bg.prototype.init=function(t,e){},Bg.prototype.render=function(t,e,n,i){},Bg.prototype.highlight=function(t,e,n,i){Fg(t.getData(),i,"emphasis")},Bg.prototype.downplay=function(t,e,n,i){Fg(t.getData(),i,"normal")},Bg.prototype.remove=function(t,e){this.group.removeAll()},Bg.prototype.dispose=function(t,e){},Bg.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},Bg.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},Bg.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Bg.markUpdateMethod=function(t,e){Eg(t).updateMethod=e},Bg.protoInitialize=void(Bg.prototype.type="chart"),Bg);function Bg(){this.group=new Ho,this.uid=Bc("viewChart"),this.renderTask=Df({plan:Hg,reset:Gg}),this.renderTask.context={view:this}}function Vg(t,e,n){t&&("emphasis"===e?xh:bh)(t,n)}function Fg(e,t,n){var i,r=xu(e,t),o=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=Uu[i])&&Wu<=32&&(t=Uu[i]=Wu++),t):null;null!=r?E(uu(r),function(t){Vg(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){Vg(t,n,o)})}function Hg(t){return Ng(t.model)}function Gg(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,t=r&&Eg(r).updateMethod,t=o?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,r),Wg[t]}Ou(zg),Bu(zg,{registerWhenExtend:!0});var Wg={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Ug="\0__throttleOriginMethod",Xg="\0__throttleRate",Yg="\0__throttleType";function Zg(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},iy.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},iy.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:i,large:e}},iy.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=ht();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},iy.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,r=this.api.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";it(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,r,o),t.overallReset&&this._createOverallStageTask(t,e,r,o)},this)},iy.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},iy.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},iy.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},iy.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}E(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(o=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=o.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},iy.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},iy.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},iy.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},iy.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=ht(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||Df({plan:ly,reset:uy,count:py}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,r).each(l)},iy.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Df({reset:ry});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=ht(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,Df({reset:oy,onDirty:sy})));e.context={model:t,overallProgress:h},e.agent=o,e.__block=h,r._pipe(t,e)}it(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,E(n.getSeries(),p)),c&&o.dirty()},iy.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},iy.wrapStageHandler=function(t,e){return F(t)&&(t={overallReset:t,seriesType:function(t){dy=null;try{t(fy,gy)}catch(t){}return dy}(t)}),t.uid=Bc("stageHandler"),e&&(t.visualType=e),t},iy);function iy(t,e,n,i){this._stageTaskMap=ht(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function ry(t){t.overallReset(t.ecModel,t.api,t.payload)}function oy(t){return t.overallProgress&&ay}function ay(){this.agent.dirty(),this.getDownstream().dirty()}function sy(){this.agent&&this.agent.dirty()}function ly(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function uy(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=uu(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else x("Layer of zlevel "+t+" is not valid")},Nm.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new oa({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),$m(p,function(t){t=new Yo({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},Rv.prototype.convertToPixel=function(t,e){return gv(this,"convertToPixel",t,e)},Rv.prototype.convertFromPixel=function(t,e){return gv(this,"convertFromPixel",t,e)},Rv.prototype.containPixel=function(t,r){var o;if(!this._disposed)return E(Su(this._model,t),function(t,i){0<=i.indexOf("Models")&&E(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?o=o||!!n.containPoint(r):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(o=o||e.containPoint(r,t))},this)},this),!!o;Fv(this.id)},Rv.prototype.getVisual=function(t,e){var n=Su(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:0}}(t,n,e):Ay(t,e)},Rv.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},Rv.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},Rv.prototype._initEvents=function(){var t,e,n,s=this;$m(Vv,function(a){function t(t){var n,e,i=s.getModel(),r=t.target,o="globalout"===a;o?n={}:r&&zm(r,function(t){var e=Gu(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=A({},e.eventData),1)},!0),n&&(e=n.componentType,o=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",o=n.seriesIndex),o=(e=e&&null!=o&&i.getComponent(e,o))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:e,view:o},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),$m(Gv,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),$m(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(am("map","selectchanged",e,n,t),am("pie","selectchanged",e,n,t)):"select"===t.fromAction?(am("map","selected",e,n,t),am("pie","selected",e,n,t)):"unselect"===t.fromAction&&(am("map","unselected",e,n,t),am("pie","unselected",e,n,t))})},Rv.prototype.isDisposed=function(){return this._disposed},Rv.prototype.clear=function(){this._disposed?Fv(this.id):this.setOption({series:[]},!0)},Rv.prototype.dispose=function(){var e,n;this._disposed?Fv(this.id):(this._disposed=!0,Iu(this.getDom(),t_,""),e=this._api,n=this._model,$m(this._componentsViews,function(t){t.dispose(n,e)}),$m(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete Kv[this.id])},Rv.prototype.resize=function(t){var e;this._disposed?Fv(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[tv]=!0,e&&cv(this),fv.update.call(this,{type:"resize",animation:{duration:0}}),this[tv]=!1,vv.call(this,t),_v.call(this,t)))},Rv.prototype.showLoading=function(t,e){this._disposed?Fv(this.id):(Qm(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),qv[t]&&(t=qv[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},Rv.prototype.hideLoading=function(){this._disposed?Fv(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Rv.prototype.makeActionFromEvent=function(t){var e=A({},t);return e.type=Gv[t.type],e},Rv.prototype.dispatchAction=function(t,e){var n;this._disposed?Fv(this.id):(Qm(e)||(e={silent:!!e}),Hv[t.type]&&this._model&&(this[tv]?this._pendingActions.push(t):(n=e.silent,mv.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),vv.call(this,n),_v.call(this,n))))},Rv.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},Rv.prototype.appendData=function(t){var e;this._disposed?Fv(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},Rv.internalField=(cv=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),pv(t,!0),pv(t,!1),e.plan()},pv=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},Cv=function(e,n){$m(Yv,function(t){t(e,n)})},kv=function(t){t[nv]=!0,t.getZr().wakeUp()},Lv=function(t){t[nv]&&(t.getZr().storage.traverse(function(t){Qh(t)||Ev(t)}),t[nv]=!1)},Iv=function(n){return l(t,e=Pd),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){xh(t,e),kv(n)},t.prototype.leaveEmphasis=function(t,e){bh(t,e),kv(n)},t.prototype.enterBlur=function(t){wh(t),kv(n)},t.prototype.leaveBlur=function(t){Sh(t),kv(n)},t.prototype.enterSelect=function(t){Mh(t),kv(n)},t.prototype.leaveSelect=function(t){Th(t),kv(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},Av=function(i){function r(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||T_(this,d))}this._rawCount=this._count=s,this._extent={},v_(this)},G_.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,r=this._storage,o=this.dimensions,a=o.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===td,p=0;px[1]&&(x[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=yu(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=yu(v,null))),this._dontMakeIdFromName||T_(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},v_(this)}},G_.prototype.count=function(){return this._count},G_.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},G_.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[T][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return l_[1]&&(_[1]=v)}}}return t},G_.prototype.downSample=function(t,e,n,i){for(var r=I_(this,[t]),o=r._storage,a=[],s=P_(1/e),l=o[t],u=this.count(),h=r._rawExtent[t],c=new(__(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r.getRawIndex=w_,r},G_.prototype.lttbDownSample=function(t,e){var n,i=I_(this,[]),r=i._storage[t],o=this.count(),a=new(__(this))(o),s=0,l=P_(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;he[1]&&(e[1]=t[1])},ex.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},ex.prototype.getExtent=function(){return this._extent.slice()},ex.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},ex.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},ex.prototype.isBlank=function(){return this._isBlank},ex.prototype.setBlank=function(t){this._isBlank=t},ex);function ex(t){this._setting=t||{},this._extent=[1/0,-1/0]}Bu(tx,{registerWhenExtend:!0});var nx=(ix.createByAxisModel=function(t){var e=t.option,t=e.data,t=t&&O(t,rx);return new ix({categories:t,needCollect:!t,deduplication:!1!==e.dedplication})},ix.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},ix.prototype.parseAndCollect=function(t){var e=this._needCollect;if("string"!=typeof t&&!e)return t;if(e&&!this._deduplication)return n=this.categories.length,this.categories[n]=t,n;var n,i=this._getOrCreateMap();return null==(n=i.get(t))&&(e?(n=this.categories.length,this.categories[n]=t,i.set(t,n)):n=NaN),n},ix.prototype._getOrCreateMap=function(){return this._map||(this._map=ht(this.categories))},ix);function ix(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}function rx(t){return U(t)&&null!=t.value?t.value:t+""}var ox=Fl;function ax(t,e,n,i){var r={},o=t[1]-t[0],e=r.interval=Jl(o/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),r}function sx(t){return Wl(t)+2}function lx(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function ux(t,e){return t>=e[0]&&t<=e[1]}function hx(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function cx(t,e){return t*(e[1]-e[0])+e[0]}var px,dx=(l(fx,px=tx),fx.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},fx.prototype.contain=function(t){return ux(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},fx.prototype.normalize=function(t){return hx(t=this.getCategoryIndex(this.parse(t)),this._extent)},fx.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(cx(t,this._extent))},fx.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},fx.prototype.getMinorTicks=function(t){},fx.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},fx.prototype.getCategorySortInfo=function(){return this._categorySortInfo},fx.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},fx.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},fx.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},fx.prototype.count=function(){return this._extent[1]-this._extent[0]+1},fx.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},fx.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},fx.prototype.getOrdinalMeta=function(){return this._ordinalMeta},fx.prototype.niceTicks=function(){},fx.prototype.niceExtent=function(){},fx.type="ordinal",fx);function fx(t){var e=px.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return V(t=t||new nx({}))&&(t=new nx({categories:O(t,function(t){return U(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}tx.registerClass(dx);var gx,yx=Fl,mx=(l(vx,gx=tx),vx.prototype.parse=function(t){return t},vx.prototype.contain=function(t){return ux(t,this._extent)},vx.prototype.normalize=function(t){return hx(t,this._extent)},vx.prototype.scale=function(t){return cx(t,this._extent)},vx.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},vx.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},vx.prototype.getInterval=function(){return this._interval},vx.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=sx(t)},vx.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]s&&(t?o.push({value:yx(s+e,r)}):o.push({value:n[1]})),o},vx.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=Ox.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]e[1]&&(e[1]=t[1])})}var ub=(hb.prototype.getNeedCrossZero=function(){return!this.option.scale},hb.prototype.getCoordSysModel=function(){},hb);function hb(){}Tc={isDimensionStacked:$_,enableDataStack:K_,getStackedDimension:J_};var Qa=Object.freeze({__proto__:null,createList:function(t){return Q_(t.getSource(),t)},getLayoutRect:Bp,dataStack:Tc,createScale:function(t,e){var n=e;return e instanceof Ec||(n=new Ec(e)),(e=eb(n)).setExtent(t[0],t[1]),tb(e,n),e},mixinAxisModelCommonMethods:function(t){T(t,ub)},getECData:Gu,createDimensions:Y_,createSymbol:Um}),cb=1e-8;function pb(t,e){return Math.abs(t-e)>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l),r=s+=r,o=l+=o;i.push([s/n,l/n])}return i}function mb(t,r){return O(R((t=function(t){if(!t.UTF8Encoding)return t;var e=(t=t).UTF8Scale;null==e&&(e=1024);for(var n=t.features,i=0;ia[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],o.coord)&&(i?o.coord=a[1]:e.pop());i&&u(o.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=Fl(t),e=Fl(e),l?ei)return!1;return!0}(n,e))){var r=e.mapDimension(n.dim),o={};return E(n.getViewLabels(),function(t){o[t.tickValue]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}}function bw(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";E(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Da(0,0,0,0,l,!0);return l[o]=c,l[o+"2"]=e,l}}}(a,r)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(D(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Ph(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;nl[1]?-1:1,o=["start"===u?l[0]-o*s:"end"===u?l[1]+o*s:(l[0]+l[1])/2,Gw(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*Nw/180),Gw(u)?c=zw.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var r,t=Yl(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=Zl(t-Nw/2)?(r=i?"bottom":"top","center"):Zl(t-1.5*Nw)?(r=i?"top":"bottom","center"):(r="middle",t<1.5*Nw&&Nw/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),rt[1]&&(t[1]=e)}Pg.registerClass(lS),Pg.registerClass($i),o_(g.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=ht();return t.eachSeries(function(t){Qw(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,C,n=[],i=ht();l=i,u=n,t.eachSeries(function(t){var e,n,i,r,o,a,s;Qw(t)&&(e=(s=tS(t)).xAxisModel,n=s.yAxisModel,i=e.axis,r=n.axis,o=i.scale.rawExtentInfo,a=r.scale.rawExtentInfo,s=t.getData(),o&&o.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),lb(pS(l,e).condExtent,s,i.dim),lb(pS(l,n).condExtent,s,r.dim)))}),C=i,E(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,r=n.axis,o=pS(C,e),a=pS(C,n);o.rawExtentInfo=$x(i.scale,e,o.condExtent),a.rawExtentInfo=$x(r.scale,n,a.condExtent),o.rawExtentResult=o.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]e[1]&&e.reverse(),e},IS.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},IS.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},IS);function IS(t,e,n,i,r){n=TS.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=r||"bottom",n}AS.prototype.getRect=function(){return this._rect},AS.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),E(n.x,function(t){tb(t.scale,t.model)}),E(n.y,function(t){tb(t.scale,t.model)});var i={};E(n.x,function(t){kS(n,"y",t,i)}),E(n.y,function(t){kS(n,"x",t,i)}),this.resize(this.model,e)},AS.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=Bp(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var r=this._axesList;function o(){E(r,function(t){var e,n,i=t.isHorizontal(),r=i?[0,a.width]:[0,a.height],o=t.inverse?1:0;t.setExtent(r[o],r[1-o]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}o(),t&&(E(r,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=rb(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),o()),E(this._coordsList,function(t){t.calcAffineTransform()})},AS.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},AS.prototype.getAxes=function(){return this._axesList.slice()},AS.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}U(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;ih?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(o=(r=e.label.x-u-e.len2*p)<(o=c+e.len)?Math.sqrt(i*i/(1-r*r/o/o)):o,n.rB=o,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},vM.type="pie",vM);function vM(){var t=null!==mM&&mM.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}zg.registerClass(Yh);var _M,xM,bM=2*Math.PI,wM=Math.PI/180;xM=a_,E([[(_M="pie")+"ToggleSelect","toggleSelect"],[_M+"Select","select"],[_M+"UnSelect","unselect"]],function(r){xM(r[0],function(t,e,n){var i;t=A({},t),n.dispatchAction(A(t,{type:r[1],seriesIndex:(t=t,i=[],e.eachComponent({mainType:"series",subType:_M,query:t},function(t){i.push(t.seriesIndex)}),i)}))})}),s_(B(function(t,e,I){e.eachSeriesByType(t,function(t){var r=t.getData(),e=r.mapDimension("value"),n=(l=I,Bp(t.getBoxLayoutParams(),{width:l.getWidth(),height:l.getHeight()})),i=t.get("center"),o=t.get("radius");V(o)||(o=[0,o]),V(i)||(i=[i,i]);var a=Vl(n.width,I.getWidth()),s=Vl(n.height,I.getHeight()),l=Math.min(a,s),u=Vl(i[0],a)+n.x,h=Vl(i[1],s)+n.y,c=Vl(o[0],l/2),p=Vl(o[1],l/2),d=-t.get("startAngle")*wM,f=t.get("minAngle")*wM,g=0;r.each(e,function(t){isNaN(t)||g++});var y=r.getSum(e),m=Math.PI/(y||g)*2,v=t.get("clockwise"),_=t.get("roseType"),x=t.get("stillShowZeroSum"),b=r.getDataExtent(e);b[0]=0;var w,S=bM,M=0,T=d,C=v?1:-1;r.setLayout({viewRect:n,r:p}),r.each(e,function(t,e){var n,i;isNaN(t)?r.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:u,cy:h,r0:c,r:_?NaN:p}):((n="area"!==_?0===y&&x?m:t*m:bM/g)n)return!0;if(e){t=Yw(t).seriesDataCount,i=i.getExtent();return Math.abs(i[0]-i[1])/t>n}return!1},sT.prototype.makeElOption=function(t,e,n,i,r){},sT.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;r&&(e=rT(t).pointerEl=new lc[r.type](oT(e.pointer)),t.add(e))},sT.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=rT(t).labelEl=new Ss(oT(e.label)),t.add(e),uT(e,i))},sT.prototype.updatePointerEl=function(t,e,n){t=rT(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},sT.prototype.updateLabelEl=function(t,e,n,i){t=rT(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),uT(t,i))},sT.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=ac(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Jt(t.event)},onmousedown:aT(this._onHandleDragMove,this,0,0),drift:aT(this._onHandleDragMove,this),ondragend:aT(this._onHandleDragEnd,this)}),i.add(r)),cT(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));n=o.get("size");V(n)||(n=[n,n]),r.scaleX=n[0]/2,r.scaleY=n[1]/2,jg(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},sT.prototype._moveHandleToValue=function(t,e){lT(this._axisPointerModel,!e&&this._moveAnimation,this._handle,hT(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},sT.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,e=this.updateHandleTransform(hT(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=e,n.stopAnimation(),n.attr(hT(e)),rT(n).lastProp=null,this._doDispatchAxisPointer())},sT.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},sT.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},sT.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,t=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),t&&e.remove(t),this._group=null,this._handle=null,this._payloadInfo=null)},sT.prototype.doClear=function(){},sT.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},sT);function sT(){this._dragging=!1,this.animationThreshold=15}function lT(t,e,n,i){!function n(i,t){{if(U(i)&&U(t)){var r=!0;return E(t,function(t,e){r=r&&n(i[e],t)}),!!r}return i===t}}(rT(n).lastProp,i)&&(rT(n).lastProp=i,e?jh(n,i,t):(n.stopAnimation(),n.attr(i)))}function uT(t,e){t[e.get(["label","show"])?"show":"hide"]()}function hT(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function cT(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}function pT(t,e,n,i,r){var o=dT(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=bp(a.get("padding")||0),l=a.getFont(),u=Wn(o,l),h=r.position,c=u.width+s[1]+s[3],n=u.height+s[0]+s[2],u=r.align;"right"===u&&(h[0]-=c),"center"===u&&(h[0]-=c/2);u=r.verticalAlign;"bottom"===u&&(h[1]-=n),"middle"===u&&(h[1]-=n/2),r=h,u=c,c=n,i=(n=i).getWidth(),n=n.getHeight(),r[0]=Math.min(r[0]+u,i)-u,r[1]=Math.min(r[1]+c,n)-c,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0);r=a.get("backgroundColor");r&&"auto"!==r||(r=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:fc(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:r}),z2:10}}function dT(t,e,n,i,r){t=e.scale.parse(t);var o,a=e.scale.getLabel({value:t},{precision:r.precision}),r=r.formatter;return r&&(o={value:ib(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},E(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,t=e&&e.getDataParams(t);t&&o.seriesData.push(t)}),H(r)?a=r.replace("{value}",a):F(r)&&(a=r(o))),a}function fT(t,e,n){var i=ge();return xe(i,i,n.rotation),_e(i,i,n.position),ec([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var gT,Yh=(l(yT,gT=Yh),yT.prototype.makeElOption=function(t,e,n,i,r){var o,a,s=n.axis,l=s.grid,u=i.get("type"),h=mT(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(e,!0));u&&"none"!==u&&(a=(o=i).get("type"),o=o.getModel(a+"Style"),"line"===a?(p=o.getLineStyle()).fill=null:"shadow"===a&&((p=o.getAreaStyle()).stroke=null),o=p,(p=vT[u](s,c,h)).style=o,t.graphicKey=p.type,t.pointer=p);var p=Jw(l.model,n);l=e,e=t,t=p,p=n,n=i,i=r,r=zw.innerTextLayout(t.rotation,0,t.labelDirection),t.labelMargin=n.get(["label","margin"]),pT(e,p,n,i,{position:fT(p.axis,l,t),align:r.textAlign,verticalAlign:r.textVerticalAlign})},yT.prototype.getHandleTransform=function(t,e,n){var i=Jw(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=fT(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},yT.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),n=mT(o,r).getOtherAxis(r).getGlobalExtent(),o="x"===r.dim?0:1,r=[t.x,t.y];r[o]+=e[o],r[o]=Math.min(a[1],r[o]),r[o]=Math.max(a[0],r[o]);n=(n[1]+n[0])/2,n=[n,n];n[o]=r[o];return{x:r[0],y:r[1],rotation:t.rotation,cursorPoint:n,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][o]}},yT);function yT(){return null!==gT&&gT.apply(this,arguments)||this}function mT(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var vT={line:function(t,e,n){var i;return{type:"Line",subPixelOptimize:!0,shape:(i=[e,n[0]],n=[e,n[1]],t=_T(t),{x1:i[t=t||0],y1:i[1-t],x2:n[t],y2:n[1-t]})}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:(n=[e-i/2,n[0]],r=[i,r],t=_T(t),{x:n[t=t||0],y:n[1-t],width:r[t],height:r[1-t]})}}};function _T(t){return"x"===t.dim?0:1}nl.registerAxisPointerClass("CartesianAxisPointer",Yh);var xT,nl=(l(bT,xT=qp),bT.type="axisPointer",bT.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},bT);function bT(){var t=null!==xT&&xT.apply(this,arguments)||this;return t.type=bT.type,t}qp.registerClass(nl),r_(function(t){var e;t&&(t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={}),(e=t.axisPointer.link)&&!V(e)&&(t.axisPointer.link=[e]))}),o_(g.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=Uw(t,e)}),a_({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||z(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){qM(o)&&(o=WM({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=qM(o),u=r.axesInfo,h=s.axesInfo,c="leave"===i||qM(o),p={},d={},r={list:[],map:{}},f={showPointer:B(YM,d),showTooltip:B(ZM,r)};E(s.coordSysMap,function(t,e){var r=l||t.containPoint(o);E(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);c||!r||u&&!i||(null!=(i=i&&i.value)||l||(i=n.pointToData(o)),null!=i&&XM(t,i,f,!1,p))})});var g,y,m={};return E(h,function(n,t){var i=n.linkGroup;i&&!d[t]&&E(i.axesInfo,function(t,e){e=d[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,jM(t),jM(n)))),m[n.key]=e)})}),E(m,function(t,e){XM(h[e],t,f,!0,p)}),g=d,i=h,y=p.axesInfo=[],E(i,function(t,e){var n=t.axisPointerModel.option,e=g[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&y.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),function(t,e,n,i){if(qM(e)||!t.list.length)return i({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(r,o,t,a),function(t,e){var n=e.getZr(),i="axisPointerLastHighlights",r=UM(n)[i]||{},o=UM(n)[i]={};E(t,function(t,e){t=t.axisPointerModel.option;"show"===t.status&&E(t.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;o[e]=t})});var a=[],s=[];E(r,function(t,e){o[e]||s.push(t)}),E(o,function(t,e){r[e]||a.push(t)}),s.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:s}),a.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(h,n),p}});var wT,Yh=(l(ST,wT=qp),ST.type="tooltip",ST.dependencies=["axisPointer"],ST.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderColor:"#333",borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},ST);function ST(){var t=null!==wT&&wT.apply(this,arguments)||this;return t.type=ST.type,t}function MT(t){var e=t.get("confine");return null!=e?e:"richText"===t.get("renderMode")}qp.registerClass(Yh);var TT=["-ms-","-moz-","-o-","-webkit-",""];function CT(i,t,e){var n,r=[],o=i.get("transitionDuration"),a=i.get("backgroundColor"),s=i.get("shadowBlur"),l=i.get("shadowColor"),u=i.get("shadowOffsetX"),h=i.get("shadowOffsetY"),c=i.getModel("textStyle"),p=yg(i,"html"),l=u+"px "+h+"px "+s+"px "+l;return r.push("box-shadow:"+l),t&&o&&r.push((n="opacity "+(t=o)/2+"s "+(o="cubic-bezier(0.23, 1, 0.32, 1)")+",visibility "+t/2+"s "+o,e||(n+=",left "+t+"s "+o+",top "+t+"s "+o),O(TT,function(t){return t+"transition:"+n}).join(";"))),a&&(w.canvasSupported?r.push("background-Color:"+a):(r.push("background-Color:#"+en(a)),r.push("filter:alpha(opacity=70)"))),E(["width","color","radius"],function(t){var e="border-"+t,n=xp(e),n=i.get(n);null!=n&&r.push(e+":"+n+("color"===t?"":"px"))}),r.push(function(n){var i=[],t=n.get("fontSize");(o=n.getTextColor())&&i.push("color:"+o),i.push("font:"+n.getFont()),t&&i.push("line-height:"+Math.round(3*t/2)+"px");var e=n.get("textShadowColor"),r=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,t=n.get("textShadowOffsetY")||0;return e&&r&&i.push("text-shadow:"+o+"px "+t+"px "+r+"px "+e),E(["decoration","align"],function(t){var e=n.get(t);e&&i.push("text-"+t+":"+e)}),i.join(";")}(c)),null!=p&&r.push("padding:"+bp(p).join("px ")+"px"),r.join(";")+";"}function IT(t,e,n,i,r){var o,a,s=e&&e.painter;n?(a=s&&s.getViewportRoot())&&(o=t,n=a,a=document.body,Gt(Ht,n,i,r,!0)&&Gt(o,a,Ht[0],Ht[1])):(t[0]=i,t[1]=r,(s=s&&s.getViewportRootOffset())&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)),t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var AT=(DT.prototype.update=function(t){var e=this._container,n=e.currentStyle||document.defaultView.getComputedStyle(e),e=e.style;"absolute"!==e.position&&"absolute"!==n.position&&(e.position="relative"),t.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=t.get("className")||""},DT.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=this._styleCoord,r=n.offsetHeight/2;e=kp(e),n.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+CT(t,!this._firstShow,this._longHide)+";left:"+i[0]+"px;top:"+(i[1]-r)+"px;border-color: "+e+";"+(t.get("extraCssText")||""),n.style.display=n.innerHTML?"block":"none",n.style.pointerEvents=this._enterable?"auto":"none",this._show=!0,this._firstShow=!1,this._longHide=!1},DT.prototype.setContent=function(t,e,n,i,r){if(null!=t){var o=this.el;if(H(r)&&"item"===n.get("trigger")&&!MT(n)&&(t+=function(t,e,n){if(!H(n)||"inside"===n)return"";e=kp(e);var n=i="left"===(i=n)?"right":"right"===i?"left":"top"===i?"bottom":"top",i="",r="",r=-1'}(n.get("backgroundColor"),i,r)),H(t))o.innerHTML=t;else if(t){o.innerHTML="",V(t)||(t=[t]);for(var a=0;a",a=p.join(e);this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(r,o,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(r,a,h,Math.random()+"",i[0],i[1],o,null,d)})},FT.prototype._showSeriesItemTooltip=function(t,e,n){var i,r,o,a,s=zm(e,function(t){return null!=Gu(t).dataIndex}),l=this._ecModel,u=Gu(s),h=u.seriesIndex,c=l.getSeriesByIndex(h),p=u.dataModel||c,d=u.dataIndex,e=u.dataType,s=p.getData(e),u=this._renderMode,f=HT([s.getItemModel(d),p,c&&(c.coordinateSystem||{}).model,this._tooltipModel]),c=f.get("trigger");null!=c&&"item"!==c||(i=p.getDataParams(d,e),r=new mg,i.marker=r.makeTooltipMarker("item",kp(i.color),u),c=Af(p.formatTooltip(d,!1,e)),e=f.get("order"),o=c.markupFragment?pg(c.markupFragment,r,u,e,l.get("useUTC")):c.markupText,a="item_"+p.name+"_"+d,this._showOrMove(f,function(){this._showTooltipContent(f,o,i,a,t.offsetX,t.offsetY,t.position,t.target,r)}),n({type:"showTip",dataIndexInside:d,dataIndex:s.getRawIndex(d),seriesIndex:h,from:this.uid}))},FT.prototype._showComponentItemTooltip=function(t,e,n){var i=e.tooltip;H(i)&&(i={content:i,formatter:i});var r=new Ec(i,this._tooltipModel,this._ecModel),o=r.get("content"),a=Math.random()+"",s=new mg;this._showOrMove(r,function(){this._showTooltipContent(r,o,r.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e,s)}),n({type:"showTip",from:this.uid})},FT.prototype._showTooltipContent=function(n,t,i,e,r,o,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&(u=this._tooltipContent,h=n.get("formatter"),a=a||n.get("position"),p=t,c=this._getNearestPoint([r,o],i,n.get("trigger")),h&&H(h)?(d=n.ecModel.get("useUTC"),p=h,(t=V(i)?i[0]:i)&&t.axisType&&0<=t.axisType.indexOf("time")&&(p=ip(t.axisValue,p,d)),p=Ap(p,i,!0)):F(h)&&(d=NT(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c.color,a),this._updatePosition(n,a,r,o,u,i,s))},this),this._ticket=e,p=h(i,e,d)),u.setContent(p,l,n,c.color,a),u.show(n,c.color),this._updatePosition(n,a,r,o,u,i,s))},FT.prototype._getNearestPoint=function(t,e,n){return"axis"===n||V(e)?{color:"html"===this._renderMode?"#fff":"none"}:V(e)?void 0:{color:e.color||e.borderColor}},FT.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u,h=r.getSize(),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),F(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:h.slice()})),V(e)?(n=BT(e[0],s),i=BT(e[1],l)):U(e)?((o=e).width=h[0],o.height=h[1],n=(o=Bp(o,{width:s,height:l})).x,i=o.y,p=c=null):i=(n=(u=H(e)&&a?function(t,e,n){var i=n[0],r=n[1],o=0,a=0,s=e.width,n=e.height;switch(t){case"inside":o=e.x+s/2-i/2,a=e.y+n/2-r/2;break;case"top":o=e.x+s/2-i/2,a=e.y-r-10;break;case"bottom":o=e.x+s/2-i/2,a=e.y+n+10;break;case"left":o=e.x-i-10-5,a=e.y+n/2-r/2;break;case"right":o=e.x+s+10+5,a=e.y+n/2-r/2}return[o,a]}(e,d,h):function(t,e,n,i,r,o,a){var s=n.getOuterSize(),n=s.width,s=s.height;null!=o&&(in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],e=[-p.x,-p.y],s=Q(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?e[i]+=n[r]-p[r]:g[i]+=p[r]+s),e[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(e);g={x:0,y:0};g[r]=(d?n:c)[r],g[o]=Math.max(c[o],p[o]),g[a]=Math.min(0,p[a]+e[1-i]),u.__rectSize=n[r],d?((i={x:0,y:0})[r]=Math.max(n[r]-p[r]-s,0),i[o]=g[o],u.setClipPath(new oa({shape:i})),u.__rectSize=i[r]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});h=this._getPageInfo(t);return null!=h.pageIndex&&jh(l,{x:h.contentPosition[0],y:h.contentPosition[1]},d?t:null),this._updatePageInfoView(t,h),g},cC.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},cC.prototype._updatePageInfoView=function(n,i){var r=this._controllerGroup;E(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=r.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")});var t=r.childOfName("pageText"),e=n.get("pageFormatter"),o=i.pageIndex,a=null!=o?o+1:0,o=i.pageCount;t&&e&&t.setStyle("text",H(e)?e.replace("{current}",null==a?"":a+"").replace("{total}",null==o?"":o+""):e({current:a,total:o}))},cC.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=uC[r],a=hC[r],s=this._findTargetItemIndex(e),l=n.children(),t=l[s],u=l.length,e=u?1:0,h={contentPosition:[n.x,n.y],pageCount:e,pageIndex:e-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!t)return h;t=g(t);h.contentPosition[r]=-t.s;for(var c=s+1,p=t,d=t,f=null;c<=u;++c)(!(f=g(l[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=s-1,p=t,d=t,f=null;-1<=c;--c)(f=g(l[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},cC.prototype._findTargetItemIndex=function(n){return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==r&&null!=t&&(r=e),t===n&&(i=e)}),null!=i?i:r):0;var i,r},cC.type="legend.scroll",cC);function cC(){var t=null!==sC&&sC.apply(this,arguments)||this;return t.type=cC.type,t.newlineDisabled=!0,t._currentIndex=0,t}Pg.registerClass(nl),a_("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})});var pC,nl=(l(dC,pC=qp),dC.type="title",dC.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},dC);function dC(){var t=null!==pC&&pC.apply(this,arguments)||this;return t.type=dC.type,t.layoutMode={type:"box",ignoreSize:!0},t}qp.registerClass(nl);var fC,nl=(l(gC,fC=Pg),gC.prototype.render=function(t,e,n){var i,r,o,a,s,l,u,h,c;this.group.removeAll(),t.get("show")&&(i=this.group,h=t.getModel("textStyle"),a=t.getModel("subtextStyle"),r=t.get("textAlign"),c=Q(t.get("textBaseline"),t.get("textVerticalAlign")),u=(o=new Ss({style:fc(h,{text:t.get("text"),fill:h.getTextColor()},{disableBox:!0}),z2:10})).getBoundingRect(),h=t.get("subtext"),a=new Ss({style:fc(a,{text:h,fill:a.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),s=t.get("link"),l=t.get("sublink"),u=t.get("triggerEvent",!0),o.silent=!s&&!u,a.silent=!l&&!u,s&&o.on("click",function(){Lp(s,"_"+t.get("target"))}),l&&a.on("click",function(){Lp(l,"_"+t.get("subtarget"))}),Gu(o).eventData=Gu(a).eventData=u?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(o),h&&i.add(a),u=i.getBoundingRect(),(h=t.getBoxLayoutParams()).width=u.width,h.height=u.height,n=Bp(h,{width:n.getWidth(),height:n.getHeight()},t.get("padding")),r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?n.x+=n.width:"center"===r&&(n.x+=n.width/2)),c||("center"===(c=t.get("top")||t.get("bottom"))&&(c="middle"),"bottom"===c?n.y+=n.height:"middle"===c&&(n.y+=n.height/2),c=c||"top"),i.x=n.x,i.y=n.y,i.markRedraw(),c={align:r,verticalAlign:c},o.setStyle(c),a.setStyle(c),u=i.getBoundingRect(),c=n.margin,(n=t.getItemStyle(["color","opacity"])).fill=t.get("backgroundColor"),n=new oa({shape:{x:u.x-c[3],y:u.y-c[0],width:u.width+c[1]+c[3],height:u.height+c[0]+c[2],r:t.get("borderRadius")},style:n,subPixelOptimize:!0,silent:!0}),i.add(n))},gC.type="title",gC);function gC(){var t=null!==fC&&fC.apply(this,arguments)||this;return t.type=gC.type,t}function yC(t){hu(t,"label",["show"])}Pg.registerClass(nl);var mC,vC=bu(),_C=(l(xC,mC=qp),xC.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},xC.prototype.isAnimationEnabled=function(){if(w.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},xC.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},xC.prototype._mergeOption=function(t,i,e,r){var o=this.mainType;e||i.eachSeries(function(t){var e=t.get(this.mainType,!0),n=vC(t)[o];e&&e.data?(n?n._mergeOption(e,i,!0):(r&&yC(e),E(e.data,function(t){t instanceof Array?(yC(t[0]),yC(t[1])):yC(t)}),A(n=this.createMarkerModelFromSeries(e,this,i),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),n.__hostSeries=t),vC(t)[o]=n):vC(t)[o]=null},this)},xC.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),t=i.getName(t);return ug("section",{header:this.name,blocks:[ug("nameValue",{name:t,value:r,noName:!t,noValue:null==r})]})},xC.prototype.getData=function(){return this._data},xC.prototype.setData=function(t){this._data=t},xC.getMarkerModelFromSeries=function(t,e){return vC(t)[e]},xC.type="marker",xC.dependencies=["series","grid","polar","geo"],xC);function xC(){var t=null!==mC&&mC.apply(this,arguments)||this;return t.type=xC.type,t.createdBySelf=!1,t}T(_C,Ca.prototype);var bC,nl=(l(wC,bC=_C),wC.prototype.createMarkerModelFromSeries=function(t,e,n){return new wC(t,e,n)},wC.type="markPoint",wC.defaultOption={zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},wC);function wC(){var t=null!==bC&&bC.apply(this,arguments)||this;return t.type=wC.type,t}function SC(t,e,n,i,r,o){var a=[],s=$_(e,i)?e.getCalculationInfo("stackResultDimension"):i,t=DC(e,s,t),t=e.indicesOfNearest(s,t)[0];a[r]=e.get(n,t),a[o]=e.get(s,t);s=e.get(i,t),t=Gl(e.get(i,t));return 0<=(t=Math.min(t,20))&&(a[o]=+a[o].toFixed(t)),[a,s]}qp.registerClass(nl);var MC={min:B(SC,"min"),max:B(SC,"max"),average:B(SC,"average"),median:B(SC,"median")};function TC(t,e){var n=t.getData(),i=t.coordinateSystem;if(e&&(o=e,isNaN(parseFloat(o.x))||isNaN(parseFloat(o.y)))&&!V(e.coord)&&i){var r=i.dimensions,o=CC(e,n,i,t);if((e=I(e)).type&&MC[e.type]&&o.baseAxis&&o.valueAxis){i=L(r,o.baseAxis.dim),t=L(r,o.valueAxis.dim),t=MC[e.type](n,o.baseDataDim,o.valueDataDim,i,t);e.coord=t[0],e.value=t[1]}else{for(var a=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],s=0;s<2;s++)MC[a[s]]&&(a[s]=DC(n,n.mapDimension(r[s]),a[s]));e.coord=a}}return e}function CC(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(function(t,e){var n=t.getData(),i=n.dimensions;e=n.getDimension(e);for(var r=0;ro&&(e[1-i]=e[i]+n.sign*o),e}function VI(t,e){t=t[e]-t[1-e];return{span:Math.abs(t),sign:0e[0]||t[1]<0||t[1]>e[1]||(e=((e=this._handleEnds)[0]+e[1])/2,e=this._updateInterval("all",t[0]-e),this._updateView(),e&&this._dispatchZoomAction(!1))},ZI.prototype._onBrushStart=function(t){var e=t.offsetX,t=t.offsetY;this._brushStart=new Mn(e,t),this._brushing=!0,this._brushStartTime=+new Date},ZI.prototype._onBrushEnd=function(t){var e,n,i;this._brushing&&(i=this._displayables.brushRect,this._brushing=!1,i&&(i.attr("ignore",!0),e=i.shape,+new Date-this._brushStartTime<200&&Math.abs(e.width)<5||(n=this._getViewExtent(),i=[0,100],this._range=Hl([Bl(e.x,n,i,!0),Bl(e.x+e.width,n,i,!0)]),this._handleEnds=[e.x,e.x+e.width],this._updateView(),this._dispatchZoomAction(!1))))},ZI.prototype._onBrush=function(t){this._brushing&&(Jt(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},ZI.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new GI({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);i=this._brushStart,n=this._displayables.sliderGroup,e=n.transformCoordToLocal(t,e),n=n.transformCoordToLocal(i.x,i.y),i=this._size;e[0]=Math.max(Math.min(i[0],e[0]),0),r.setShape({x:n[0],y:0,width:e[0]-n[0],height:i[1]})},ZI.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?YI:null,start:e[0],end:e[1]})},ZI.prototype._findCoordRect=function(){var t,e,n=AI(this.dataZoomModel).infoList;return!t&&n.length&&(t=(e=n[0].model.coordinateSystem).getRect&&e.getRect()),t||(t={x:.2*(n=this.api.getWidth()),y:.2*(e=this.api.getHeight()),width:.6*n,height:.6*e}),t},ZI.type="dataZoom.slider",ZI);function ZI(){var t=null!==HI&&HI.apply(this,arguments)||this;return t.type=ZI.type,t._displayables={},t}function jI(t){return"vertical"===t?"ns-resize":"ew-resize"}Pg.registerClass(nl);var qI=E,KI=Hl,$I=(JI.prototype.hostedBy=function(t){return this._dataZoomModel===t},JI.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},JI.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},JI.prototype.getTargetSeriesModels=function(){var n=[];return this.ecModel.eachSeries(function(t){var e;e=(e=t).get("coordinateSystem"),0<=L(TI,e)&&(e=CI(this._dimName),(e=t.getReferringComponents(e,Mu).models[0])&&this._axisIndex===e.componentIndex&&n.push(t))},this),n},JI.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},JI.prototype.getMinMaxSpan=function(){return I(this._minMaxSpan)},JI.prototype.calculateDataWindow=function(i){var r,o=this._dataExtent,s=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),l=[0,100],u=[],h=[];qI(["start","end"],function(t,e){var n=i[t],t=i[t+"Value"];"percent"===a[e]?(null==n&&(n=l[e]),t=s.parse(Bl(n,l,o))):(r=!0,n=Bl(t=null==t?o[e]:s.parse(t),o,l)),h[e]=t,u[e]=n}),KI(h),KI(u);var c=this._minMaxSpan;function t(t,e,n,i,r){var o=r?"Span":"ValueSpan";BI(0,t,n,"all",c["min"+o],c["max"+o]);for(var a=0;a<2;a++)e[a]=Bl(t[a],n,i,!0),r&&(e[a]=s.parse(e[a]))}return r?t(h,u,o,l,!1):t(u,h,l,o,!0),{valueWindow:h,percentWindow:u}},JI.prototype.reset=function(t){var e;t===this._dataZoomModel&&(e=this.getTargetSeriesModels(),this._dataExtent=function(t,e,n){var i=[1/0,-1/0];qI(n,function(t){lb(i,t.getData(),e)});t=t.getAxisModel(),t=$x(t.axis.scale,t,i).calculate();return[t.min,t.max]}(this,this._dimName,e),this._updateMinMaxSpan(),t=this.calculateDataWindow(t.settledOption),this._valueWindow=t.valueWindow,this._percentWindow=t.percentWindow,this._setAxisModel())},JI.prototype.filterData=function(t,e){var i,n,r,h;t===this._dataZoomModel&&(i=this._dimName,n=this.getTargetSeriesModels(),r=t.get("filterMode"),h=this._valueWindow,"none"!==r&&qI(n,function(n){var l=n.getData(),u=l.mapDimensionsAll(i);u.length&&("weakFilter"===r?l.filterSelf(function(t){for(var e,n,i,r=0;rh[1];if(a&&!s&&!o)return!0;a&&(i=!0),s&&(e=!0),o&&(n=!0)}return i&&e&&n}):qI(u,function(t){var e;"empty"===r?n.setData(l=l.map(t,function(t){return(e=t)>=h[0]&&e<=h[1]?t:NaN;var e})):((e={})[t]=h,l.selectRange(e))}),qI(u,function(t){l.setApproximateExtent(h,t)}))}))},JI.prototype._updateMinMaxSpan=function(){var i=this._minMaxSpan={},r=this._dataZoomModel,o=this._dataExtent;qI(["min","max"],function(t){var e=r.get(t+"Span"),n=r.get(t+"ValueSpan");null!=n&&(n=this.getAxisModel().axis.scale.parse(n)),null!=n?e=Bl(o[0]+n,o,[0,100],!0):null!=e&&(n=Bl(e,[0,100],o,!0)-o[0]),i[t+"Span"]=e,i[t+"ValueSpan"]=n},this)},JI.prototype._setAxisModel=function(){var t,e=this.getAxisModel(),n=this._percentWindow,i=this._valueWindow;n&&(t=Ul(i,[0,500]),t=Math.min(t,20),e=e.axis.scale.rawExtentInfo,0!==n[0]&&e.setDeterminedMinMax("min",+i[0].toFixed(t)),100!==n[1]&&e.setDeterminedMinMax("max",+i[1].toFixed(t)),e.freeze())},JI);function JI(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}o_(g.PROCESSOR.FILTER,{getTargetSeries:function(o){function t(r){o.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(t,e){var n=o.getComponent(CI(t),e);r(t,e,n,i)})})}t(function(t,e,n,i){n.__dzAxisProxy=null});var r=[];t(function(t,e,n,i){n.__dzAxisProxy||(n.__dzAxisProxy=new $I(t,e,i,o),r.push(n.__dzAxisProxy))});var e=ht();return E(r,function(t){E(t.getTargetSeriesModels(),function(t){e.set(t.uid,t)})}),e},overallReset:function(t,i){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).reset(n)}),n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).filterData(n,i)})}),t.eachComponent("dataZoom",function(t){var e,n=t.findRepresentativeAxisProxy();n&&(e=n.getDataPercentWindow(),n=n.getDataValueWindow(),t.setCalculatedRange({start:e[0],end:e[1],startValue:n[0],endValue:n[1]}))})}}),a_("dataZoom",function(e,t){E(II(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})});var QI,nl=(l(tA,QI=Fs),tA.type="dataZoom.inside",tA.defaultOption=Vc(Fs.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),tA);function tA(){var t=null!==QI&&QI.apply(this,arguments)||this;return t.type=tA.type,t}qp.registerClass(nl);var eA="\0_ec_interaction_mutex";function nA(t,e){return iA(t)[e]}function iA(t){return t[eA]||(t[eA]={})}a_({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){});var rA,oA=(l(aA,rA=Et),aA.prototype.isDragging=function(){return this._dragging},aA.prototype.isPinching=function(){return this._pinching},aA.prototype.setPointerChecker=function(t){this.pointerChecker=t},aA.prototype.dispose=function(){this.disable()},aA.prototype._mousedownHandler=function(t){var e,n;Qt(t)||t.target&&t.target.draggable||(e=t.offsetX,n=t.offsetY,this.pointerChecker&&this.pointerChecker(t,e,n)&&(this._x=e,this._y=n,this._dragging=!0))},aA.prototype._mousemoveHandler=function(t){var e,n,i,r,o,a;this._dragging&&uA("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!nA(this._zr,"globalPan")&&(e=t.offsetX,n=t.offsetY,o=e-(i=this._x),a=n-(r=this._y),this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&Jt(t.event),lA(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:i,oldY:r,newX:e,newY:n,isAvailableBehavior:null}))},aA.prototype._mouseupHandler=function(t){Qt(t)||(this._dragging=!1)},aA.prototype._mousewheelHandler=function(t){var e=uA("zoomOnMouseWheel",t,this._opt),n=uA("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,r=Math.abs(i),o=t.offsetX,a=t.offsetY;0!==i&&(e||n)&&(e&&(r=3p.getHeight()&&(i.position="top",e=!0),e=e?-5-r.height:d+8,o+r.width/2>p.getWidth()?(i.position=["100%",e],n.align="right"):o-r.width/2<0&&(i.position=[0,e],n.align="left"))}))},CA.prototype.updateView=function(t,e,n,i){E(this._features,function(t){t instanceof _A&&t.updateView&&t.updateView(t.model,e,n,i)})},CA.prototype.remove=function(e,n){E(this._features,function(t){t instanceof _A&&t.remove&&t.remove(e,n)}),this.group.removeAll()},CA.prototype.dispose=function(e,n){E(this._features,function(t){t instanceof _A&&t.dispose&&t.dispose(e,n)})},CA.type="toolbox",CA);function CA(){return null!==TA&&TA.apply(this,arguments)||this}Pg.registerClass(nl);var IA,nl=(l(AA,IA=_A),AA.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType()?"svg":n.get("type",!0)||"png",e=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||w.browser.ie||w.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(e.split(",")[1]),a=o.length,s=new Uint8Array(a);a--;)s[a]=o.charCodeAt(a);t=new Blob([s]);window.navigator.msSaveOrOpenBlob(t,i+"."+r)}else{var l=n.get("lang"),l='';window.open().document.write(l)}else{l=document.createElement("a");l.download=i+"."+r,l.target="_blank",l.href=e;e=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(e)}},AA.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:t.getLocale(["toolbox","saveAsImage","lang"])}},AA);function AA(){return null!==IA&&IA.apply(this,arguments)||this}nl.prototype.unusable=!w.canvasSupported,bA("saveAsImage",nl);var DA,kA="__ec_magicType_stack__",LA=[["line","bar"],["stack"]],nl=(l(PA,DA=_A),PA.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return E(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},PA.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},PA.prototype.onclick=function(t,e,a){var s,n,l=this.model,i=l.get(["seriesIndex",a]);OA[a]&&(s={series:[]},E(LA,function(t){0<=L(t,a)&&E(t,function(t){l.setIconStatus(t,"normal")})}),l.setIconStatus(a,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},function(t){var e=t.subType,n=t.id,n=OA[a](e,n,t,l);n&&(D(n,t.option),s.series.push(n));n=t.coordinateSystem;if(n&&"cartesian2d"===n.type&&("line"===a||"bar"===a)){n=n.getAxesByScale("ordinal")[0];if(n){var i=n.dim+"Axis",r=t.getReferringComponents(i,Mu).models[0].componentIndex;s[i]=s[i]||[];for(var o=0;o<=r;o++)s[i][r]=s[i][r]||{};s[i][r].boundaryGap="bar"===a}}}),"stack"===a&&(n=b({stack:l.option.title.tiled,tiled:l.option.title.stack},l.option.title)),e.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:n,featureName:"magicType"}))},PA);function PA(){return null!==DA&&DA.apply(this,arguments)||this}var OA={line:function(t,e,n,i){if("bar"===t)return b({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return b({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){n=n.get("stack")===kA;if("line"===t||"bar"===t)return i.setIconStatus("stack",n?"normal":"emphasis"),b({id:e,stack:n?"":kA},i.get(["option","stack"])||{},!0)}};a_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),bA("magicType",nl);var RA=new Array(60).join("-"),EA="\t";function NA(t){var r,o,a,h,t=(r={},o=[],a=[],t.eachRawSeries(function(t){var e,n,i=t.coordinateSystem;i&&("cartesian2d"===i.type||"polar"===i.type)&&"category"===(e=i.getBaseAxis()).type?(n=e.dim+"_"+e.index,r[n]||(r[n]={categoryAxis:e,valueAxis:i.getOtherAxis(e),series:[]},a.push({axisDim:e.dim,axisIndex:e.index})),r[n].series.push(t)):o.push(t)}),{seriesGroupByCategoryAxis:r,other:o,meta:a});return{value:R([(h=[],E(t.seriesGroupByCategoryAxis,function(t,e){var n=t.categoryAxis,i=t.valueAxis.dim,r=[" "].concat(O(t.series,function(t){return t.name})),o=[n.model.getCategories()];E(t.series,function(t){var e=t.getRawData();o.push(t.getRawData().mapArray(e.mapDimension(i),function(t){return t}))});for(var a=[r.join(EA)],s=0;st.getWidth()||n<0||n>t.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=uD(t,e,n);if(!t._dragging)for(var a=0;at[1]&&t.reverse(),t}function GD(t,e){return Su(t,e,{includeMainTypes:BD})}var WD={grid:function(t,i){var r=t.xAxisModels,o=t.yAxisModels,t=t.gridModels,e=ht(),a={},s={};(r||o||t)&&(E(r,function(t){t=t.axis.grid.model;e.set(t.id,t),a[t.id]=!0}),E(o,function(t){t=t.axis.grid.model;e.set(t.id,t),s[t.id]=!0}),E(t,function(t){e.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),e.each(function(t){var e=t.coordinateSystem,n=[];E(e.getCartesians(),function(t,e){(0<=L(r,t.getAxis("x").model)||0<=L(o,t.getAxis("y").model))&&n.push(t)}),i.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:n[0],coordSyses:n,getPanelRect:XD.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,n){E(t.geoModels,function(t){var e=t.coordinateSystem;n.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:XD.geo})})}},UD=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,t=t.gridModel;return!t&&n&&(t=n.axis.grid.model),!t&&i&&(t=i.axis.grid.model),t&&t===e.gridModel},function(t,e){t=t.geoModel;return t&&t===e.geoModel}],XD={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(tc(t)),e}},YD={lineX:B(ZD,0),lineY:B(ZD,1),rect:function(t,e,n){var i=e[zD[t]]([n[0][0],n[1][0]]),n=e[zD[t]]([n[0][1],n[1][1]]),n=[HD([i[0],n[0]]),HD([i[1],n[1]])];return{values:n,xyMinMax:n}},polygon:function(e,n,t){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:O(t,function(t){t=n[zD[e]](t);return i[0][0]=Math.min(i[0][0],t[0]),i[1][0]=Math.min(i[1][0],t[1]),i[0][1]=Math.max(i[0][1],t[0]),i[1][1]=Math.max(i[1][1],t[1]),t}),xyMinMax:i}}};function ZD(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=HD(O([0,1],function(t){return e?r.coordToData(r.toLocalCoord(i[t])):r.toGlobalCoord(r.dataToCoord(i[t]))})),n=[];return n[t]=o,n[1-t]=[NaN,NaN],{values:o,xyMinMax:n}}var jD={lineX:B(qD,0),lineY:B(qD,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,n,i){return O(t,function(t,e){return[t[0]-i[0]*n[e][0],t[1]-i[1]*n[e][1]]})}};function qD(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function KD(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var $D=E,JD=bu();function QD(t){t=JD(t);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var tk,Fs=(l(ek,tk=Fs),ek.type="dataZoom.select",ek);function ek(){var t=null!==tk&&tk.apply(this,arguments)||this;return t.type=ek.type,t}qp.registerClass(Fs);var nk,Ca=(l(ik,nk=Ca),ik.type="dataZoom.select",ik);function ik(){var t=null!==nk&&nk.apply(this,arguments)||this;return t.type=ik.type,t}Pg.registerClass(Ca);var rk,ok=E,ak=lu+"toolbox-dataZoom_",Ca=(l(sk,rk=_A),sk.prototype.render=function(t,e,n,i){this.brushController||(this.brushController=new eD(n.getZr()),this.brushController.on("brush",z(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n.isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");r=new VD(pk(t),e,{include:["grid"]}).makePanelOpts(r,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n.brushController.setPanels(r).enableBrush(!(!o||!r.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),e=e,t.setIconStatus("back",1c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var r,o,a,s=[],l=0;l=h&&c<=e+1){for(var n=[],i=0;i=h&&c<=r+1)return function(t){for(var e=0,n=t.length,i=0,r=0;e\n\r<"))},cL)),t.Axis=wl,t.List=H_,t.Model=Ec,t.PRIORITY=g,t.color=ln,t.connect=function(e){var t;return V(e)&&(t=e,e=null,$m(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+Qv++,$m(t,function(t){t.group=e})),$v[e]=!0,e},t.dataTool={},t.dependencies={zrender:"5.0.1"},t.disConnect=e_,t.disconnect=Dc,t.dispose=function(t){"string"==typeof t?t=Kv[t]:t instanceof Ov||(t=n_(t)),t instanceof Ov&&!t.isDisposed()&&t.dispose()},t.env=w,t.extendChartView=function(t){return zg.extend(t)},t.extendComponentModel=function(t){return qp.extend(t)},t.extendComponentView=function(t){return Pg.extend(t)},t.extendSeriesModel=function(t){return Sg.extend(t)},t.format=Lb,t.getCoordinateSystemDimensions=function(t){if(t=Ed.get(t))return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.getInstanceByDom=n_,t.getInstanceById=function(t){return Kv[t]},t.getMap=function(t){return(t=My(t))&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.graphic=Ob,t.helper=Qa,t.init=function(t,e,n){var i=n_(t);if(i)return i;var r=new Ov(t,e,n);return r.id="ec_"+Jv++,Kv[r.id]=r,Iu(t,t_,r.id),Av(r),$m(Xv,function(t){t(r)}),r},t.innerDrawElementOnCanvas=Im,t.matrix=Se,t.number=kb,t.parseGeoJSON=mb,t.parseGeoJson=qn,t.registerAction=a_,t.registerCoordinateSystem=function(t,e){Ed.register(t,e)},t.registerLayout=s_,t.registerLoading=h_,t.registerLocale=Yc,t.registerMap=function(t,e,n){Sy(t,e,n)},t.registerPostInit=function(t){t&&Xv.push(t)},t.registerPostUpdate=function(t){t&&Yv.push(t)},t.registerPreprocessor=r_,t.registerProcessor=o_,t.registerTheme=i_,t.registerTransform=Lc,t.registerVisual=l_,t.setCanvasCreator=function(t){m("createCanvas",t)},t.throttle=Zg,t.time=ua,t.util=Pb,t.vector=Lt,t.version="5.0.0",t.zrender=n,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/dist/echarts.esm.js b/dist/echarts.esm.js index 5b3f6cc382..5fb7602bfa 100644 --- a/dist/echarts.esm.js +++ b/dist/echarts.esm.js @@ -186,7 +186,7 @@ function logError() { } if (typeof console !== 'undefined') { - console.error.apply(args); + console.error.apply(console, args); } } @@ -3695,7 +3695,7 @@ var Animator = function () { this._target = target; this._loop = loop; - if (loop) { + if (loop && additiveTo) { logError('Can\' use additive animation on looped animation.'); return; } @@ -15430,7 +15430,7 @@ var ZRender = function () { ZRender.prototype.refreshHoverImmediately = function () { this._needsRefreshHover = false; - if (this.painter.refreshHover) { + if (this.painter.refreshHover && this.painter.getType() === 'canvas') { this.painter.refreshHover(); } }; @@ -15534,7 +15534,7 @@ function registerPainter(name, Ctor) { painterCtors[name] = Ctor; } -var version = '5.0.0'; +var version = '5.0.1'; var zrender = /*#__PURE__*/Object.freeze({ __proto__: null, init: init, @@ -18819,7 +18819,7 @@ var defaultLeveledFormatter = { var fullDayFormatter = '{yyyy}-{MM}-{dd}'; var fullLeveledFormatter = { year: '{yyyy}', - month: '{yyyy}:{MM}', + month: '{yyyy}-{MM}', day: fullDayFormatter, hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, @@ -28492,7 +28492,7 @@ function findEventDispatcher(target, det, returnFirstMatch) { var wmUniqueIndex = Math.round(Math.random() * 9); -var WeakMap$1 = function () { +var WeakMap = function () { function WeakMap() { this._id = '__ec_inner_' + wmUniqueIndex++; } @@ -28791,7 +28791,7 @@ function createSymbol(symbolType, x, y, w, h, color, keepAspect) { return symbolPath; } -var decalMap = new WeakMap$1(); +var decalMap = new WeakMap(); var decalCache = new LRU(100); var decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'dashLineOffset', 'maxTileWidth', 'maxTileHeight']; @@ -29174,7 +29174,7 @@ var isFunction$1 = isFunction; var isObject$2 = isObject; var version$1 = '5.0.0'; var dependencies = { - zrender: '5.0.0' + zrender: '5.0.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_SERIES_FILTER = 800; @@ -65915,7 +65915,7 @@ var GeoView = function (_super) { var current = e.target; var eventData; - while ((eventData = getECData(current).eventData) == null) { + while (current && (eventData = getECData(current).eventData) == null) { current = current.__hostTarget || current.parent; } @@ -79410,6 +79410,10 @@ function isRadialGradient(value) { return value.type === 'radial'; } +function isGradient(value) { + return value && (value.type === 'linear' || value.type === 'radial'); +} + var GradientManager = function (_super) { __extends(GradientManager, _super); @@ -79423,7 +79427,7 @@ var GradientManager = function (_super) { each(['fill', 'stroke'], function (fillOrStroke) { var value = displayable.style[fillOrStroke]; - if (value && (value.type === 'linear' || value.type === 'radial')) { + if (isGradient(value)) { var gradient = value; var defs = that_1.getDefs(true); var dom = void 0; @@ -79466,6 +79470,10 @@ var GradientManager = function (_super) { }; GradientManager.prototype.update = function (gradient) { + if (!isGradient(gradient)) { + return; + } + var that = this; this.doUpdate(gradient, function () { var dom = gradient.__dom; @@ -79691,7 +79699,7 @@ var PatternManager = function (_super) { } if (isPattern(displayable.style.stroke)) { - _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill)); + _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke)); } } }; diff --git a/dist/echarts.esm.js.map b/dist/echarts.esm.js.map index a892d1cdad..26159d73ab 100644 --- a/dist/echarts.esm.js.map +++ b/dist/echarts.esm.js.map @@ -1 +1 @@ -{"version":3,"sources":["unknown"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","self","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","global","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DILIMITER_REG","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","nodeParsers","SVGParser","_defs","_root","_isDefine","_isText","xml","viewBox","getAttribute","parseAttributes","_parseNode","viewBoxRect","viewBoxTransform","viewBoxArr","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","defineParsers","def","_parseText","_textX","_textY","inheritStyle","textStyle","fontSize","fontFamily","fontStyle","fontWeight","internalField","circle","line","pointsStr","pointsArr","parsePoints","polygon","polyline","img","gradient","_parseGradientColorStops","offsetStr","stopColor","__inheritedStyle","pointsString","attributesMap","defs","onlyInlineStyle","zrStyle","parseTransformAttribute","parseStyleAttribute","svgAttrName","attrValue","getPaint","urlRegex","urlMatch","url","transformRegex","transformOps_1","valueArr","styleRegex","styleList","styleRegResult","exec","parseSVG","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CMD$3","PI2$6","PROP_XY","PROP_WH","tmpArr","aroundEqual","pathToBezierCurves","bezierArray","currentSubpath","createNewSubpath","addLine","addArc","tan","c1","s1","c2","s2","x4","y4","hx","hy","nextAngle","alignSubpath","subpath1","subpath2","shorterPath","shorterLen","shorterBezierCount","eachCurveSubDivCount","newSubpath","remained","tmpSegX","tmpSegY","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastX","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","centroid","signedArea","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","score","newArr","findBestMorphingRotation","fromArr","toArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","tmpArr_1","sa","ca","newX1","newY1","i_1","to","morphPath","fromPath","toPath","animationOpts","fromPathProxy","toPathProxy","isIndividualMorphingPath","__oldBuildPath","fromBezierCurves","toBezierCurves","morphingData","becomeIndividualMorphingPath","oldDone","oldAborted","oldDuring","__morphT","restoreIndividualMorphingPath","morphingPathBuildPath","__morphingData","newCp","item","morphT","updateIndividualMorphingPath","morphingPath","isCombiningPath","__combiningSubList","isInAnyMorphing","combine","fromPathList","copyPropsIfDivided","fromIndividuals","separateCount","fromCombiningSubList","dividingMethod","toPathSplittedList","divideShape","doneCount","abortedCalled","morphAnimationOpts","restoreCombiningPath","becomeCombiningPath","toIndividuals","count","combiningSubList","updateCombiningPathSubList","combiningPath","__oldAddSelfToZr","__oldRemoveSelfFromZr","combiningAddSelfToZr","combiningRemoveSelfFromZr","combiningChildrenRef","combiningPathSubListAddRemoveWithZr","method","separate","toPathList","toPathListLen","copyProps","duplicateShape","splitShape","resultPaths","toPathShape","splitPropIdx","propWH","propXY","subWH","xyCurr","subShape","splitted","endAngleNormalized","normalizeRadian$1","angleCurr","ctor","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","seriesIndices","airaOption","enabled","mergeTheme","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","define","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","setItemVisualFromData","PI2$7","CMD$4","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpArr$1","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","getType","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap$1","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","finderOpt","fromResult","toResult","toSeries","dimension","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","getLayoutOnAxis","baseAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","RegExp","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","getValue","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","dimLoose","sampleLog","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_1","errMsg_2","comparator","item0","item1","orderDef","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$8","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","IndicatorAxis","radiusExtent","Radar","radarModel","_indicatorAxes","getIndicatorModels","indicatorModel","indicatorAxis","getIndicatorAxes","indicatorIndex","coordToPoint","minRadianDiff","closestAxis","closestAxisIdx","viewSize","indicatorAxes","radarSeries","increaseInterval","fixedMin","fixedMax","nicedSplitNumber","pixel","radarList","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","indicator","axisBuilderAttrs$1","RadarView","_buildAxes","_buildSplitLineAndArea","axisBuilders","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","getColorIndex","areaOrLine","areaOrLineColorList","ticksRadius","realSplitNumber_1","axesTicksPoints","prevPoints","RadarSeriesModel","nameToDisplay","getTooltipPosition","radarIndex","normalizeSymbolSize","RadarView$1","createSymbol$1","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","radarLayout","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","polarIndex","geoCoord","points$1","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","geoCoordMap","fixGeoCoords","points$2","fixDiaoyuIsland","inner$6","geoJSONLoader","load","mapRecord","parsed","regionName","specialArea","getBoundingRect$1","regionRect","inner$7","geoSVGLoader","originRoot","buildGraphic","makeGraphic","hostKey","rootMap","originRootHostKey","removeGraphic","loaders","geoSourceManager","regionsMap","nameCoordMap","mapRecords","singleSource","results","mapNotExistsError","MapSeries","needsDrawMap","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","getMapType","getHostGeoModel","geoIndex","getRegionModel","seriesNames","otherIndex","originalData","setZoom","setCenter","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","areaColor","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","getFixedItemStyle","MapDraw","_controller","_controllerHost","_regionsGroup","mapOrGeoModel","fromView","isGeo","mapSeries","_updateBackground","regionsGroup","transformInfo","getTransformInfo","isFirstDraw","targetScaleX","targetScaleY","roamTransform","isVisualEncodedByVisualMap","regionGroup","compoundPath","regionModel","itemStyleModel","emphasisItemStyleModel","blurItemStyleModel","selectItemStyleModel","rawScaleX","rawScaleY","rawX","rawY","transformPoint","interior","points_1","showLabel","isDataNaN","centerPt","regionModel_1","groupRegions","__regions","_updateController","_updateMapSelectHandler","_mapName","getZoom","makeActionBase","_mouseDownFlag","getViewRectAfterRoam","mapDraw","MapView","mapModel","_mapDraw","_renderSymbols","originalDataIndex","fullData","mainSeries","fullIndex_1","updateCenterAndZoom","previousZoom","getCenter","fixX","fixY","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_viewRect","rawTransform","_updateTransform","centerCoord","_center","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","defaultCenter","roamTransformable","rawTransformable","_rawTransform","noRoam","getCoordSys","Geo","invertLongitute","_nameCoordMap","_regionsMap","_invertLongitute","containCoord","getRegionByCoord","addGeoCoord","getGeoCoord","getCoordSys$1","geoModel","resizeGeo","leftTop","rightBottom","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","inner$8","linkList","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","depth","viewChildren","isExpand","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","getAncestorsIndices","currNode","getDescendantIndices","childNode","getLevelModel","levelModels","isAncestorOf","isDescendantOf","Tree","_nodes","getNodeByDataIndex","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","addChild","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","getOrient","realRoot","edgeShape","edgeForkPosition","roam","nodeScaleRatio","curveness","init$2","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","getViewRect$1","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","symbolNeedsDraw$1","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","groupZoom","roamZoom","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","__radialOldRawX","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","rootLayout","isLeft","labelRotateRadian","focusDataIndices","drawEdge","__edge","parentEl","curvature","getEdgeShape","childLayout","removeAnimationOpt","sourceEdge","layoutOpt","radialCoor1","radialCoor2","radialCoor3","radialCoor4","eachAfter","eachBefore","treeLayout","commonLayout","separation$1","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","resetViewRoot","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","getViewRoot","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","normalStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","itemWidth","availableSize","itemNode","makeItemPoints","onclick","packEventData","itemHeight","selfType","AnimationWrap","_elExistsMap","_finishedCallback","checkTerminate","createWrap","Group$1","Rect$1","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z_BASE","Z_BG","Z_CONTENT","getStateItemStyle","getItemStyleNormal","inner$9","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","_doAnimation","renderFinally","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","els","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","renderContent","useUpperLabel","processInvisible","visualBorderColor","selectStyle","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","iconChar","isShow","addDrillDownIcon","textEmphasisState","lasts","prepareAnimationWhenHasOld","calculateZ","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","zInLevel","zb","noop$1","actionTypes","i$1","handleRootToNode","originViewRoot","each$4","isObject$4","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","inner$a","treemapVisual","travelTree","designatedVisual","viewRootAncestors","nodeLayout","nodeItemStyleModel","visuals","buildVisuals","thisNodeColor","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","mathMax$7","mathMin$7","each$5","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","treemapLayout","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","worst","orderBy","overLeafDepth","sort$1","statistic","filterByThreshold","orderedChildren","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","getNodeByIndex","addEdge","n1","n2","edgesMap","GraphEdge","outEdges","inEdges","getEdgeByIndex","getEdge","eachEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","degree","inDegree","outDegree","getAdjacentDataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getGraphicEl","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","GraphSeriesModel","getCategoriesData","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryIdx","categoryModel","oldGetModel","newGetModel","newPathArr","getGraph","getEdgeData","sourceName","nodeMarkup","categoriesData","circular","rotateLabel","initLayout","repulsion","gravity","friction","edgeLength","layoutAnimation","edgeSymbol","edgeSymbolSize","edgeLabel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","getNodeGlobalScale","v3","v2DistSquare","mathAbs$2","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide$1","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","forceLayout","_startForceLayoutIteration","warmUp","_layouting","setFixed","setUnfixed","circularRotateLabel","categoryFilter","graphSeries","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryStyle","visualList","normalize$2","graphEdgeVisual","simpleLayout","simpleLayoutEdge","graphSimpleLayout","PI$7","_symbolRadiansHalf","circularLayout","basedOn","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","graphCircularLayout","scaleAndAdd$1","inNodes","pp","initialFriction","beforeStepCallback","afterStepCallback","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","nodeDataExtent_1","edgeDataExtent_1","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getViewRect$2","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","GaugeSeriesModel","icon","PointerShape","PointerPath","parsePosition","formatLabel","PI2$9","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","FunnelSeriesModel","minSize","funnelAlign","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","getViewRect$3","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelIndex","parallelOption","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","each$6","mathMin$8","mathMax$8","mathFloor$2","mathCeil$1","round$2","PI$8","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","layoutExtent","axisCount","axisExpandWidth","restrict$1","axisExpandCount","axisExpandable","axisExpandWindow","winSize","axisExpandCenter","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","eachActiveState","dataDimensions","axisModels","hasActiveSet","hasAxisBrushed","activeState","getActiveState","axisLayout","getAxisLayout","getSlidedAxisExpandWindow","behavior","pointCoord","triggerArea","useJump","winSize2","create$2","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","defaultOption$1","areaSelectStyle","realtime","ParallelModel","_initDimensions","setAxisExpand","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","actionInfo$1","parallelAxisModel","BRUSH_PANEL_GLOBAL","mathMin$9","mathMax$9","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","parallelAxisId","CLICK_THRESHOLD","ParallelView","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","triggerOn","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","theActiveState","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","DEFAULT_SMOOTH","ParallelView$1","_dataGroup","dataGroup","makeSeriesScope$2","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","opacityAccessPath$1","parallelVisual","opacityMap","active","inactive","itemOpacity","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","localX","localY","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","sourceColor","targetColor","dragX","dragY","createGridClipShape$1","sankeyLayout","getViewRect$4","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","center$1","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","WhiskerBoxCommonMixin","xAxisType","yAxisType","addOrdinal","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotVisual","each$7","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","availableWidth","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","low","high","itemNameFormatter","outlier","boxplotTransform","CandlestickSeriesModel","getShadowDim","brushRect","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","createNormalBox$1","setBoxCommon","createLarge$1","NormalBoxPathShape","NormalBoxPath","__simpleBox","transInit$1","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","setLargeStyle$1","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","LargeArr$1","candlestickLayout","candleWidth","calculateCandleWidth","openDim","closeDim","lowestDim","highestDim","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","getSign","makeBrushRect","pmin","pmax","EffectScatterSeriesModel","effectType","showEffectOn","rippleEffect","period","EFFECT_RIPPLE_NUMBER","normalizeSymbolSize$1","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","EffectScatterView","effectSymbolDraw","_updateGroupTransform","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","getLineCoordsCount","getLineCoords","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","CoordSys","effect","constantSpeed","trailLength","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","delayExpr","_updateAnimationPoints","_getLineLength","_period","delayNum","__t","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt$1","__lastT","Polyline$1","_createPolyline","hoverLineStyle","lineEmphasisState","EffectPolyline","accLenArr","_length","_offsets","offsets","LargeLinesPathShape","LargeLinesPath","LargeLineDraw","lineEl","linesLayout","isPolyline","isLarge","lineCoords","totalCoordsCount","LinesView","_updateLineDraw","_lastZlevel","_showEffect","notInIndividual_1","otherSeriesModel","hasEffect","_hasEffet","_isPolyline","normalize$3","linesVisual","HeatmapSeriesModel","blurSize","pointSize","maxOpacity","minOpacity","GRADIENT_LEVELS","HeatmapLayer","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_incrementalDisplayable","_renderOnCartesianAndCalendar","_renderOnGeo","dataDimX","dataDimY","dataToRect","contentShape","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","PictorialBarSeriesModel","symbolPosition","symbolMargin","symbolRepeat","symbolRepeatDirection","symbolClip","symbolBoundingData","symbolPatternSize","BAR_BORDER_WIDTH_QUERY$1","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","updateCommon$1","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","categorySize","parsedSymbolSize","unitLength","pathLen","absBoundingLength","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","updateAttr","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","pathes","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","SingleAxis","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","getCoordSys$2","singleModel","create$3","singles","layout$2","positionMap","directionMap","axisBuilderAttrs$2","selfBuilderAttrs$1","SingleAxisView","axisElementBuilders$1","SingleAxisModel","findPointFromSeries","isStacked","inner$b","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$c","each$8","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","inner$d","clone$3","bind$1","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","elOption","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","XY","WH","SingleAxisPointer","getPointDimIndex","pointerShapeBuilder$1","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","getLayerSeries","lenCount","indexArr","timeDim","layerSeries","index1","index2","nearestIdx","pointNum","theValue","singleAxisIndex","ThemeRiverView","layersSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","layerGroup","createGridClipShape$2","themeRiverLayout","doThemeRiverLayout","layerPoints","singleLayer","computeBaseline","baseLine","baseY0","layerIndex","sums","temp","SunburstSeriesModel","completeTreeValue$1","renderLabelForZeroData","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_ecModel","labelMinAngle","isNormalShown","labelStateModel","isShown","getLabelAttr","sectorState","labelColor","labelPadding","rotateType","stateAttr","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","handleHighlight","UNHIGHLIGHT_ACTION","SunburstView","newRoot","newChildren","oldChildren","_oldChildren","renderRollUp","newNode","virtualPiece","targetFound","RADIAN$2","sunburstLayout","rootDepth","initChildren$1","renderRollupNode","rPerLevel","rStart","rEnd","siblingAngle_1","sortOrder","sort$2","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","dataToCoordSize$1","geoPrepareCustom","dataToCoordSize$2","singlePrepareCustom","dataToCoordSize$3","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","deprecatedLogs","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","warnDeprecated","deprecated","insteadApproach","inner$e","TRANSFORM_PROPS","transformPropNamesStr","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","GROUP_DIFF_PREFIX","attachedTxInfoTmp","LEGACY_TRANSFORM_PROPS","tmpTransformable","prepareCustoms","CustomSeriesModel","currentZLevel","currentZ","CustomSeriesView","customSeries","renderItem","makeRenderItem","doRemoveEl","createOrUpdateItem","morphPreparation_1","MorphPreparation","createGetKey","findAndAddFrom","hasFrom","removeElementDirectly","applyMorphing","oldIndices","newLen","setIncrementalAndHoverLayer","elementName","diffByDimName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","isMorphTo","styleOpt","attachedTxInfo","isTextContent","transFromProps","allPropsFinal","elDisplayable","prepareShapeOrExtraTransitionFrom","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareTransformAllPropsFinal","txCfgOpt","textOptionStyle","decalPattern","decalObj","isPath$1","__decalPattern","prepareStyleTransitionFrom","applyPropsFinal","applyTransitionFrom","originalDecalObj","userDuring","cfgDuringCall","duringCall","mainAttr","morphFromEl","attrOpt","elPropsInAttr","transFromPropsInAttr","enterFrom","enterFromKeys","transitionKeys","elVal","checkNonStyleTansitionRefer","elPropsInAttrKeys","isNonStyleTransitionEnabled","leaveTo","leaveToProps","getOrCreateLeaveToPropsFromEl","leaveToPropsInAttr","leaveToKeys","allProps","allPropsInAttr","keysInAttr","checkTransformPropRefer","fromTransformable","calcOldElLocalTransformBasedOnNewElParent","setTransformPropToTransitionFrom","setLagecyTransformProp","setTransformProp","fromEl","fromElStyle","transFromStyleProps","animationStyleProps","styleKeys","leaveToStyleProps","newEl","tmpM","oldGlobalTransform","newParent","optVal","usedIn","innerEl","tmpDuringScope","customDuringAPI","assertNotReserved","isShapeDirty","getShape","isStyleDirty","setExtra","getExtra","newstUserDuring","scopeUserDuring","updateElOnState","elStateOpt","isRoot","existingEmphasisState","updateZ$1","optZ2","updateZForEachState","retrieveStateOption","targetProps","legacyName","legacyArr","xyName","transitionFrom","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currDataIndexInside","currItemModel","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","morphPreparation","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","elIsNewCreated","canMorph","morph","thisElIsMorphTo","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","pendingAllPropsFinal","addTo","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","processAddUpdate","processRemove","childOption","_fromList","_toList","_toElOptionList","_allPropsFinalList","_toDataIndices","_morphConfigList","_transOpt","_type","fromList","toList","toListLen","fromListLen","toIdx","_oneToOneForSingleTo","fromSingleSegLen","fromIdxStart","fromCount","_manyToOneForSingleTo","toSingleSegLen","toIdxStart","fromIdx","toCount","_oneToManyForSingleFrom","toElOption","toDataIndex","elAnimationConfig","_getOrCreateMorphConfig","morphDuration","combineResult","copyPropsWhenDivided","_processResultIndividuals","morphFrom","combineFromList","separateToList","separateResult","combineSeparateResult","isSeparate","fromIndividual","toIndividual","morphConfigList","delayOption","srcPath","tarPath","willClone","getSeriesStackId$1","getAxisKey$1","barLayoutPolar","calRadialBar","clampLayout","radiusSpan","angleSpan","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","angleAxisExtraOption","radiusAxisExtraOption","RadiusAxis","radiusToData","inner$f","AngleAxis","angleToData","Polar","_radiusAxis","_angleAxis","maxAngle","getCoordSys$3","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","elementList$1","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","axisBuilderAttrs$3","selfBuilderAttrs$2","RadiusAxisView","newAxisGroup","axisAngle","layoutAxis","axisElementBuilders$2","prevRadius","PolarAxisPointer","coordValue","pointerShapeBuilder$2","getLabelPosition","GeoView","_handleRegionClick","updateSelectStatus","geoId","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","makeAction","PROXIMATE_ONE_DAY","Calendar","calendarModel","_rangeInfo","_sw","_sh","_orient","getFirstDayOfWeek","_firstDayOfWeek","getDateInfo","mStr","dStr","getDay","formatedDate","getNextNDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","cellSize","getCellSize","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tl","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","getCoordSys$4","normalizedRange","rangeStr","firstDay","setMonth","parsedRange","reversed","startDateNum","endDateNum","dateNum","fweek","lweek","nthDay","calendarList","calendarSeries","CalendarModel","mergeAndNormalizeLayoutParams","raw","cellSizeArr","MONTH_TEXT","EN","CN","WEEK_TEXT","CalendarView","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","weekText","inner$g","_nonShapeGraphicElements","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elExisting","parentId","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","createEl$1","removeEl","textContentExisting","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","layout$3","viewportSize","makeBackground","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","tooltipModel","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","each$9","inner$h","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","dataZoomModel","percentRange","getPercentRange","clear$1","snapshots","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SelectDataZoomModel","SelectDataZoomView","each$a","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","_dataExtent","percentExtent","percentWindow","valueWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","eachAxisModel","proxyList","valueRange","each$b","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers$1","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","ratioX","ratioY","visibility","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$c","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","each$d","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","PRIORITY_BRUSH","layoutCovers","brushModel","brushSelected","throttleDelay","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushView","$from","ICON_TYPES","BrushFeature","isBrushed","_brushMode","command","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","controlPosition","itemStyleEmphasis","labelNormal","excludeLabelAttr","currentIndex","setCurrentIndex","isIndexMax","setPlayState","playState","TimelineModel","_initData","autoPlay","getPlayState","dataArr","_names","processedDataArr","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","PI$9","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","labelPosOpt","getViewRect$5","parsedLabelPos","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","playPosition","prevBtnPosition","nextBtnPosition","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","createScaleByModel$1","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","makeBtn","_handlePlayClick","willRotate","iconSize","btn","makeControlIcon","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","fillLabel","inner$i","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$j","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","inner$k","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","toSymbolRotate","toSymbolSize","optData","dimValueGetter$1","MarkAreaModel","inner$l","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","allSelect","inverseSelect","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","curry$1","each$e","Group$2","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendSymbolType","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams$1","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","Group$3","WH$1","XY$1","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","zoomLock","brushSelect","Rect$2","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","InsideZoomModel","disabled","inner$m","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","dispatchAction$1","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","each$f","visualMapPreprocessor","has$1","pieces","splitList","calculable","VISUAL_PRIORITY","isTargetSeries","getDataDimension","getVisualMeta","getColorVisual","concreteDim","resultVisual","visualDefault","defaultOption$2","mapVisual$1","isArray$1","each$g","asc$2","linearMap$1","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getTargetSeriesIndices","optionSeriesIndex","is","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","optDim","listDimensions","completeSingle","completeInactive","completeController","stateExist","stateAbsent","optExist","optAbsent","defa","symbolExists","symbolSizeExists","max_1","setSelected","getSelected","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","linearMap$2","each$h","mathMin$a","mathMax$a","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","getCursor$1","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","currValue","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","hoverLinkDataSize","hoverLinkOnHandle","actionInfo$2","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","itemSymbol","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","DEFAULT_OPTION","inner$n","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$a","PI2$a","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","getElementsByTagName","defs_1","doUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAA;;;;;;;;;;;;;;;AAcA;AAEA,IAAIA,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/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0uB+uE,OAA1uB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nvar Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n}());\r\nvar Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n}());\r\nvar env = new Env();\r\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n}\r\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n}\r\nelse if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n}\r\nelse {\r\n detect(navigator.userAgent, env);\r\n}\r\nfunction detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n}\n\nvar BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n};\r\nvar TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n};\r\nvar objToString = Object.prototype.toString;\r\nvar arrayProto = Array.prototype;\r\nvar nativeForEach = arrayProto.forEach;\r\nvar nativeFilter = arrayProto.filter;\r\nvar nativeSlice = arrayProto.slice;\r\nvar nativeMap = arrayProto.map;\r\nvar ctorFunction = (function () { }).constructor;\r\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\nvar methods = {};\r\nfunction $override(name, fn) {\r\n methods[name] = fn;\r\n}\r\nvar idStart = 0x0907;\r\nfunction guid() {\r\n return idStart++;\r\n}\r\nfunction logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(args);\r\n }\r\n}\r\nfunction clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\nfunction merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n}\r\nfunction mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n}\r\nfunction extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n}\r\nfunction defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n}\r\nvar createCanvas = function () {\r\n return methods.createCanvas();\r\n};\r\nmethods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n};\r\nfunction indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n}\r\nfunction inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n}\r\nfunction mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n}\r\nfunction isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n}\r\nfunction each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n}\r\nfunction map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n}\r\nfunction reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n}\r\nfunction filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\nfunction find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n}\r\nfunction keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n}\r\nfunction bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n}\r\nvar bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\nfunction curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n}\r\nfunction isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n}\r\nfunction isFunction(value) {\r\n return typeof value === 'function';\r\n}\r\nfunction isString(value) {\r\n return typeof value === 'string';\r\n}\r\nfunction isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n}\r\nfunction isNumber(value) {\r\n return typeof value === 'number';\r\n}\r\nfunction isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n}\r\nfunction isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n}\r\nfunction isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n}\r\nfunction isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n}\r\nfunction isGradientObject(value) {\r\n return value.colorStops != null;\r\n}\r\nfunction isPatternObject(value) {\r\n return value.image != null;\r\n}\r\nfunction isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n}\r\nfunction eqNaN(value) {\r\n return value !== value;\r\n}\r\nfunction retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n}\r\nfunction retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n}\r\nfunction retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n}\r\nfunction slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n}\r\nfunction normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n}\r\nfunction assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n}\r\nfunction trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n}\r\nvar primitiveKey = '__ec_primitive__';\r\nfunction setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n}\r\nfunction isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n}\r\nvar HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n}());\r\nfunction createHashMap(obj) {\r\n return new HashMap(obj);\r\n}\r\nfunction concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n}\r\nfunction createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n}\r\nfunction hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n}\r\nfunction noop() { }\n\nvar zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n});\n\nfunction create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n}\r\nfunction copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n}\r\nfunction clone$1(v) {\r\n return [v[0], v[1]];\r\n}\r\nfunction set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n}\r\nfunction add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n}\r\nfunction scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n}\r\nfunction sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n}\r\nfunction len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n}\r\nvar length = len;\r\nfunction lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n}\r\nvar lengthSquare = lenSquare;\r\nfunction mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n}\r\nfunction div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n}\r\nfunction dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n}\r\nfunction scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n}\r\nfunction normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n}\r\nfunction distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n}\r\nvar dist = distance;\r\nfunction distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n}\r\nvar distSquare = distanceSquare;\r\nfunction negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n}\r\nfunction lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n}\r\nfunction applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n}\r\nfunction min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n}\r\nfunction max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n}\n\nvar vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n});\n\nvar Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n}());\r\nvar Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n}());\n\nvar Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n}());\n\nvar LN2 = Math.log(2);\r\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n}\r\nfunction buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n}\n\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\nvar _calcOut = [];\r\nfunction transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n}\r\nfunction transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n}\r\nfunction preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n}\r\nfunction isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n}\n\nvar isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\nvar _calcOut$1 = [];\r\nfunction clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n}\r\nfunction calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n}\r\nfunction getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n}\r\nfunction normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n}\r\nfunction getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n}\r\nfunction addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n}\r\nfunction removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n}\r\nvar stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\nfunction isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n}\n\nvar GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n}());\r\nfunction dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n}\r\nfunction center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n}\r\nvar recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n};\n\nvar SILENT = 'silent';\r\nfunction makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n}\r\nfunction stopEvent() {\r\n stop(this.event);\r\n}\r\nvar EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n}(Eventful));\r\nvar HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n}());\r\nvar handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n];\r\nvar Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n}(Eventful));\r\neach(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n});\r\nfunction isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n}\r\nfunction isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n}\n\nfunction create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n}\r\nfunction identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n}\r\nfunction copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n}\r\nfunction mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n}\r\nfunction translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n}\r\nfunction rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n}\r\nfunction scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n}\r\nfunction invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n}\r\nfunction clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n}\n\nvar matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n});\n\nvar mIdentity = identity;\r\nvar EPSILON = 5e-5;\r\nfunction isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n}\r\nvar scaleTmp = [];\r\nvar tmpTransform = [];\r\nvar originTransform = create$1();\r\nvar abs = Math.abs;\r\nvar Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n}());\n\nvar easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n};\n\nvar Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n}());\n\nvar Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n}());\r\nvar LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n}());\r\nvar LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n}());\n\nvar kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n};\r\nfunction clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n}\r\nfunction clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n}\r\nfunction clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n}\r\nfunction parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n}\r\nfunction parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n}\r\nfunction cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n}\r\nfunction lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n}\r\nfunction setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n}\r\nfunction copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n}\r\nvar colorCache = new LRU(20);\r\nvar lastRemovedArr = null;\r\nfunction putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n}\r\nfunction parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n}\r\nfunction hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n}\r\nfunction rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n}\r\nfunction lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n}\r\nfunction toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n}\r\nfunction fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n}\r\nvar fastMapToColor = fastLerp;\r\nfunction lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n}\r\nvar mapToColor = lerp$1;\r\nfunction modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n}\r\nfunction modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n}\r\nfunction stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n}\r\nfunction lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n}\r\nfunction random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n}\n\nvar color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n});\n\nvar arraySlice = Array.prototype.slice;\r\nfunction interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n}\r\nfunction step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n}\r\nfunction interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n}\r\nfunction interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n}\r\nfunction add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n}\r\nfunction add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n}\r\nfunction fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n}\r\nfunction catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n}\r\nfunction catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n}\r\nfunction cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n}\r\nfunction rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n}\r\nfunction guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n}\r\nvar tmpRgba = [0, 0, 0, 0];\r\nvar Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n}());\r\nvar Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n}());\n\nvar Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n}());\n\nvar mathMin = Math.min;\r\nvar mathMax = Math.max;\r\nvar lt = new Point();\r\nvar rb = new Point();\r\nvar lb = new Point();\r\nvar rt = new Point();\r\nvar minTv = new Point();\r\nvar maxTv = new Point();\r\nvar BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n}());\n\nvar textWidthCache = {};\r\nvar DEFAULT_FONT = '12px sans-serif';\r\nvar _ctx;\r\nvar _cachedFont;\r\nfunction defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n}\r\nvar methods$1 = {\r\n measureText: defaultMeasureText\r\n};\r\nfunction getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n}\r\nfunction innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n}\r\nfunction getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n}\r\nfunction adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n}\r\nfunction adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n}\r\nfunction getLineHeight(font) {\r\n return getWidth('国', font);\r\n}\r\nfunction parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n}\r\nfunction calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n}\n\nvar dpr = 1;\r\nif (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n}\r\nvar devicePixelRatio = dpr;\r\nvar DARK_MODE_THRESHOLD = 0.4;\r\nvar DARK_LABEL_COLOR = '#333';\r\nvar LIGHT_LABEL_COLOR = '#ccc';\r\nvar LIGHTER_LABEL_COLOR = '#eee';\n\nvar PRESERVED_NORMAL_STATE = '__zr_normal__';\r\nvar PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\nvar DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n};\r\nvar tmpTextPosCalcRes = {};\r\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\nvar Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n}());\r\nmixin(Element, Eventful);\r\nmixin(Element, Transformable);\r\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n}\r\nfunction copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n}\r\nfunction is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n}\r\nfunction copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n}\r\nfunction animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n}\n\nvar DEFAULT_MIN_MERGE = 32;\r\nvar DEFAULT_MIN_GALLOPING = 7;\r\nfunction minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n}\r\nfunction makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n}\r\nfunction reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n}\r\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n}\r\nfunction gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n}\r\nfunction gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n}\r\nfunction TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n}\r\nfunction sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n}\n\nvar invalidZErrorLogged = false;\r\nfunction logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n}\r\nfunction shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n}\r\nvar Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n}());\n\nvar requestAnimationFrame;\r\nrequestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n};\r\nvar requestAnimationFrame$1 = requestAnimationFrame;\n\nvar Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n}(Eventful));\n\nvar TOUCH_CLICK_DELAY = 300;\r\nvar globalEventSupported = env.domSupported;\r\nvar localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n})();\r\nvar globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n};\r\nvar wheelEventSupported = false;\r\nfunction isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n}\r\nfunction setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n}\r\nfunction markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n}\r\nfunction normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n}\r\nfunction isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n}\r\nvar FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n}());\r\nvar localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n};\r\neach(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n});\r\nvar globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n};\r\nfunction mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n}\r\nfunction mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n}\r\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n}\r\nfunction unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n}\r\nvar DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n}());\r\nvar HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n}(Eventful));\n\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\nvar DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n};\r\nvar DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n};\r\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\nvar PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\nvar Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n}(Element));\r\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\r\nvar viewRect = new BoundingRect(0, 0, 0, 0);\r\nfunction isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n}\n\nvar mathPow = Math.pow;\r\nvar mathSqrt = Math.sqrt;\r\nvar EPSILON$1 = 1e-8;\r\nvar EPSILON_NUMERIC = 1e-4;\r\nvar THREE_SQRT = mathSqrt(3);\r\nvar ONE_THIRD = 1 / 3;\r\nvar _v0 = create();\r\nvar _v1 = create();\r\nvar _v2 = create();\r\nfunction isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n}\r\nfunction isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n}\r\nfunction cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n}\r\nfunction cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n}\r\nfunction cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n}\r\nfunction cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n}\r\nfunction cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n}\r\nfunction quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n}\r\nfunction quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n}\r\nfunction quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n}\r\nfunction quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n}\r\nfunction quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n}\r\nfunction quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n}\n\nvar mathMin$1 = Math.min;\r\nvar mathMax$1 = Math.max;\r\nvar mathSin = Math.sin;\r\nvar mathCos = Math.cos;\r\nvar PI2 = Math.PI * 2;\r\nvar start = create();\r\nvar end = create();\r\nvar extremity = create();\r\nfunction fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n}\r\nfunction fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n}\r\nvar xDim = [];\r\nvar yDim = [];\r\nfunction fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n}\r\nfunction fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n}\r\nfunction fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n}\n\nvar CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n};\r\nvar tmpOutX = [];\r\nvar tmpOutY = [];\r\nvar min$1 = [];\r\nvar max$1 = [];\r\nvar min2 = [];\r\nvar max2 = [];\r\nvar mathMin$2 = Math.min;\r\nvar mathMax$2 = Math.max;\r\nvar mathCos$1 = Math.cos;\r\nvar mathSin$1 = Math.sin;\r\nvar mathSqrt$1 = Math.sqrt;\r\nvar mathAbs = Math.abs;\r\nvar PI = Math.PI;\r\nvar PI2$1 = PI * 2;\r\nvar hasTypedArray = typeof Float32Array !== 'undefined';\r\nvar tmpAngles = [];\r\nfunction modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n}\r\nfunction normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n}\r\nvar PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n}());\n\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n}\n\nfunction containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n}\n\nfunction containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n}\n\nvar PI2$2 = Math.PI * 2;\r\nfunction normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n}\n\nvar PI2$3 = Math.PI * 2;\r\nfunction containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n}\n\nfunction windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n}\n\nvar CMD$1 = PathProxy.CMD;\r\nvar PI2$4 = Math.PI * 2;\r\nvar EPSILON$2 = 1e-4;\r\nfunction isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n}\r\nvar roots = [-1, -1, -1];\r\nvar extrema = [-1, -1];\r\nfunction swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n}\r\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n}\r\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n}\r\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n}\r\nfunction containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n}\r\nfunction contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n}\r\nfunction containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n}\n\nvar DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n}, DEFAULT_COMMON_STYLE);\r\nvar DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nvar pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n];\r\nvar Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n}(Displayable));\n\nvar CMD$2 = PathProxy.CMD;\r\nvar points = [[], [], []];\r\nvar mathSqrt$2 = Math.sqrt;\r\nvar mathAtan2 = Math.atan2;\r\nfunction transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n}\n\nvar mathSqrt$3 = Math.sqrt;\r\nvar mathSin$2 = Math.sin;\r\nvar mathCos$2 = Math.cos;\r\nvar PI$1 = Math.PI;\r\nfunction vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n}\r\nfunction vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n}\r\nfunction vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n}\r\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n}\r\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\nfunction createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n}\r\nvar SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n}(Path));\r\nfunction isPathProxy(path) {\r\n return path.setData != null;\r\n}\r\nfunction createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n}\r\nfunction createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n}\r\nfunction extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n}\r\nfunction mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n}\n\nvar Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n}(Element));\r\nGroup.prototype.type = 'group';\n\nvar DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n}, DEFAULT_COMMON_STYLE);\r\nvar DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nfunction isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n}\r\nvar ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n}(Displayable));\r\nZRImage.prototype.type = 'image';\n\nvar CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n}());\r\nvar Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n}(Path));\r\nCircle.prototype.type = 'circle';\n\nfunction buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n}\n\nvar round = Math.round;\r\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n}\r\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n}\r\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n}\n\nvar RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n}());\r\nvar subPixelOptimizeOutputShape = {};\r\nvar Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n}(Path));\r\nRect.prototype.type = 'rect';\n\nvar EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n}());\r\nvar Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n}(Path));\r\nEllipse.prototype.type = 'ellipse';\n\nvar subPixelOptimizeOutputShape$1 = {};\r\nvar LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n}());\r\nvar Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n}(Path));\r\nLine.prototype.type = 'line';\n\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n}\r\nfunction smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n}\n\nfunction smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n}\n\nfunction buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n}\n\nvar PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n}());\r\nvar Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n}(Path));\r\nPolygon.prototype.type = 'polygon';\n\nvar PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n}());\r\nvar Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n}(Path));\r\nPolyline.prototype.type = 'polyline';\n\nvar Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n}());\n\nvar LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n}(Gradient));\n\nvar DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n}, DEFAULT_PATH_STYLE);\r\nvar TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n}(Displayable));\r\nTSpan.prototype.type = 'tspan';\n\nvar DILIMITER_REG = /[\\s,]+/;\r\nfunction parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n}\r\nvar nodeParsers;\r\nvar SVGParser = (function () {\r\n function SVGParser() {\r\n this._defs = {};\r\n this._root = null;\r\n this._isDefine = false;\r\n this._isText = false;\r\n }\r\n SVGParser.prototype.parse = function (xml, opt) {\r\n opt = opt || {};\r\n var svg = parseXML(xml);\r\n if (!svg) {\r\n throw new Error('Illegal svg');\r\n }\r\n var root = new Group();\r\n this._root = root;\r\n var viewBox = svg.getAttribute('viewBox') || '';\r\n var width = parseFloat((svg.getAttribute('width') || opt.width));\r\n var height = parseFloat((svg.getAttribute('height') || opt.height));\r\n isNaN(width) && (width = null);\r\n isNaN(height) && (height = null);\r\n parseAttributes(svg, root, null, true);\r\n var child = svg.firstChild;\r\n while (child) {\r\n this._parseNode(child, root);\r\n child = child.nextSibling;\r\n }\r\n var viewBoxRect;\r\n var viewBoxTransform;\r\n if (viewBox) {\r\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG);\r\n if (viewBoxArr.length >= 4) {\r\n viewBoxRect = {\r\n x: parseFloat((viewBoxArr[0] || 0)),\r\n y: parseFloat((viewBoxArr[1] || 0)),\r\n width: parseFloat(viewBoxArr[2]),\r\n height: parseFloat(viewBoxArr[3])\r\n };\r\n }\r\n }\r\n if (viewBoxRect && width != null && height != null) {\r\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\r\n if (!opt.ignoreViewBox) {\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n }\r\n if (!opt.ignoreRootClip && width != null && height != null) {\r\n root.setClipPath(new Rect({\r\n shape: { x: 0, y: 0, width: width, height: height }\r\n }));\r\n }\r\n return {\r\n root: root,\r\n width: width,\r\n height: height,\r\n viewBoxRect: viewBoxRect,\r\n viewBoxTransform: viewBoxTransform\r\n };\r\n };\r\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\r\n var nodeName = xmlNode.nodeName.toLowerCase();\r\n if (nodeName === 'defs') {\r\n this._isDefine = true;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = true;\r\n }\r\n var el;\r\n if (this._isDefine) {\r\n var parser = defineParsers[nodeName];\r\n if (parser) {\r\n var def = parser.call(this, xmlNode);\r\n var id = xmlNode.getAttribute('id');\r\n if (id) {\r\n this._defs[id] = def;\r\n }\r\n }\r\n }\r\n else {\r\n var parser = nodeParsers[nodeName];\r\n if (parser) {\r\n el = parser.call(this, xmlNode, parentGroup);\r\n parentGroup.add(el);\r\n }\r\n }\r\n if (el) {\r\n var child = xmlNode.firstChild;\r\n while (child) {\r\n if (child.nodeType === 1) {\r\n this._parseNode(child, el);\r\n }\r\n if (child.nodeType === 3 && this._isText) {\r\n this._parseText(child, el);\r\n }\r\n child = child.nextSibling;\r\n }\r\n }\r\n if (nodeName === 'defs') {\r\n this._isDefine = false;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = false;\r\n }\r\n };\r\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\r\n if (xmlNode.nodeType === 1) {\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n this._textX += parseFloat(dx);\r\n this._textY += parseFloat(dy);\r\n }\r\n var text = new TSpan({\r\n style: {\r\n text: xmlNode.textContent\r\n },\r\n x: this._textX || 0,\r\n y: this._textY || 0\r\n });\r\n inheritStyle(parentGroup, text);\r\n parseAttributes(xmlNode, text, this._defs);\r\n var textStyle = text.style;\r\n var fontSize = textStyle.fontSize;\r\n if (fontSize && fontSize < 9) {\r\n textStyle.fontSize = 9;\r\n text.scaleX *= fontSize / 9;\r\n text.scaleY *= fontSize / 9;\r\n }\r\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\r\n textStyle.fontStyle,\r\n textStyle.fontWeight,\r\n (textStyle.fontSize || 12) + 'px',\r\n textStyle.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n textStyle.font = font;\r\n var rect = text.getBoundingRect();\r\n this._textX += rect.width;\r\n parentGroup.add(text);\r\n return text;\r\n };\r\n SVGParser.internalField = (function () {\r\n nodeParsers = {\r\n 'g': function (xmlNode, parentGroup) {\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'rect': function (xmlNode, parentGroup) {\r\n var rect = new Rect();\r\n inheritStyle(parentGroup, rect);\r\n parseAttributes(xmlNode, rect, this._defs);\r\n rect.setShape({\r\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\r\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\r\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\r\n height: parseFloat(xmlNode.getAttribute('height') || '0')\r\n });\r\n return rect;\r\n },\r\n 'circle': function (xmlNode, parentGroup) {\r\n var circle = new Circle();\r\n inheritStyle(parentGroup, circle);\r\n parseAttributes(xmlNode, circle, this._defs);\r\n circle.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n r: parseFloat(xmlNode.getAttribute('r') || '0')\r\n });\r\n return circle;\r\n },\r\n 'line': function (xmlNode, parentGroup) {\r\n var line = new Line();\r\n inheritStyle(parentGroup, line);\r\n parseAttributes(xmlNode, line, this._defs);\r\n line.setShape({\r\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\r\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\r\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\r\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\r\n });\r\n return line;\r\n },\r\n 'ellipse': function (xmlNode, parentGroup) {\r\n var ellipse = new Ellipse();\r\n inheritStyle(parentGroup, ellipse);\r\n parseAttributes(xmlNode, ellipse, this._defs);\r\n ellipse.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\r\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\r\n });\r\n return ellipse;\r\n },\r\n 'polygon': function (xmlNode, parentGroup) {\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polygon = new Polygon({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n inheritStyle(parentGroup, polygon);\r\n parseAttributes(xmlNode, polygon, this._defs);\r\n return polygon;\r\n },\r\n 'polyline': function (xmlNode, parentGroup) {\r\n var path = new Path();\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polyline = new Polyline({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n return polyline;\r\n },\r\n 'image': function (xmlNode, parentGroup) {\r\n var img = new ZRImage();\r\n inheritStyle(parentGroup, img);\r\n parseAttributes(xmlNode, img, this._defs);\r\n img.setStyle({\r\n image: xmlNode.getAttribute('xlink:href'),\r\n x: +xmlNode.getAttribute('x'),\r\n y: +xmlNode.getAttribute('y'),\r\n width: +xmlNode.getAttribute('width'),\r\n height: +xmlNode.getAttribute('height')\r\n });\r\n return img;\r\n },\r\n 'text': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x') || '0';\r\n var y = xmlNode.getAttribute('y') || '0';\r\n var dx = xmlNode.getAttribute('dx') || '0';\r\n var dy = xmlNode.getAttribute('dy') || '0';\r\n this._textX = parseFloat(x) + parseFloat(dx);\r\n this._textY = parseFloat(y) + parseFloat(dy);\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'tspan': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x');\r\n var y = xmlNode.getAttribute('y');\r\n if (x != null) {\r\n this._textX = parseFloat(x);\r\n }\r\n if (y != null) {\r\n this._textY = parseFloat(y);\r\n }\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n this._textX += dx;\r\n this._textY += dy;\r\n return g;\r\n },\r\n 'path': function (xmlNode, parentGroup) {\r\n var d = xmlNode.getAttribute('d') || '';\r\n var path = createFromString(d);\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n return path;\r\n }\r\n };\r\n })();\r\n return SVGParser;\r\n}());\r\nvar defineParsers = {\r\n 'lineargradient': function (xmlNode) {\r\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\r\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\r\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\r\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\r\n var gradient = new LinearGradient(x1, y1, x2, y2);\r\n _parseGradientColorStops(xmlNode, gradient);\r\n return gradient;\r\n }\r\n};\r\nfunction _parseGradientColorStops(xmlNode, gradient) {\r\n var stop = xmlNode.firstChild;\r\n while (stop) {\r\n if (stop.nodeType === 1) {\r\n var offsetStr = stop.getAttribute('offset');\r\n var offset = void 0;\r\n if (offsetStr.indexOf('%') > 0) {\r\n offset = parseInt(offsetStr, 10) / 100;\r\n }\r\n else if (offsetStr) {\r\n offset = parseFloat(offsetStr);\r\n }\r\n else {\r\n offset = 0;\r\n }\r\n var stopColor = stop.getAttribute('stop-color') || '#000000';\r\n gradient.colorStops.push({\r\n offset: offset,\r\n color: stopColor\r\n });\r\n }\r\n stop = stop.nextSibling;\r\n }\r\n}\r\nfunction inheritStyle(parent, child) {\r\n if (parent && parent.__inheritedStyle) {\r\n if (!child.__inheritedStyle) {\r\n child.__inheritedStyle = {};\r\n }\r\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\r\n }\r\n}\r\nfunction parsePoints(pointsString) {\r\n var list = trim(pointsString).split(DILIMITER_REG);\r\n var points = [];\r\n for (var i = 0; i < list.length; i += 2) {\r\n var x = parseFloat(list[i]);\r\n var y = parseFloat(list[i + 1]);\r\n points.push([x, y]);\r\n }\r\n return points;\r\n}\r\nvar attributesMap = {\r\n 'fill': 'fill',\r\n 'stroke': 'stroke',\r\n 'stroke-width': 'lineWidth',\r\n 'opacity': 'opacity',\r\n 'fill-opacity': 'fillOpacity',\r\n 'stroke-opacity': 'strokeOpacity',\r\n 'stroke-dasharray': 'lineDash',\r\n 'stroke-dashoffset': 'lineDashOffset',\r\n 'stroke-linecap': 'lineCap',\r\n 'stroke-linejoin': 'lineJoin',\r\n 'stroke-miterlimit': 'miterLimit',\r\n 'font-family': 'fontFamily',\r\n 'font-size': 'fontSize',\r\n 'font-style': 'fontStyle',\r\n 'font-weight': 'fontWeight',\r\n 'text-align': 'textAlign',\r\n 'alignment-baseline': 'textBaseline'\r\n};\r\nfunction parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\r\n var disp = el;\r\n var zrStyle = disp.__inheritedStyle || {};\r\n if (xmlNode.nodeType === 1) {\r\n parseTransformAttribute(xmlNode, el);\r\n extend(zrStyle, parseStyleAttribute(xmlNode));\r\n if (!onlyInlineStyle) {\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName)) {\r\n var attrValue = xmlNode.getAttribute(svgAttrName);\r\n if (attrValue != null) {\r\n zrStyle[attributesMap[svgAttrName]] = attrValue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n disp.style = disp.style || {};\r\n zrStyle.fill != null && (disp.style.fill = getPaint(zrStyle.fill, defs));\r\n zrStyle.stroke != null && (disp.style.stroke = getPaint(zrStyle.stroke, defs));\r\n each([\r\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = parseFloat(zrStyle[propName]));\r\n });\r\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\r\n zrStyle.textBaseline = 'alphabetic';\r\n }\r\n if (zrStyle.textBaseline === 'alphabetic') {\r\n zrStyle.textBaseline = 'bottom';\r\n }\r\n if (zrStyle.textAlign === 'start') {\r\n zrStyle.textAlign = 'left';\r\n }\r\n if (zrStyle.textAlign === 'end') {\r\n zrStyle.textAlign = 'right';\r\n }\r\n each(['lineDashOffset', 'lineCap', 'lineJoin',\r\n 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = zrStyle[propName]);\r\n });\r\n if (zrStyle.lineDash) {\r\n disp.style.lineDash = map(trim(zrStyle.lineDash).split(DILIMITER_REG), function (str) {\r\n return parseFloat(str);\r\n });\r\n }\r\n disp.__inheritedStyle = zrStyle;\r\n}\r\nvar urlRegex = /url\\(\\s*#(.*?)\\)/;\r\nfunction getPaint(str, defs) {\r\n var urlMatch = defs && str && str.match(urlRegex);\r\n if (urlMatch) {\r\n var url = trim(urlMatch[1]);\r\n var def = defs[url];\r\n return def;\r\n }\r\n return str;\r\n}\r\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\r\nfunction parseTransformAttribute(xmlNode, node) {\r\n var transform = xmlNode.getAttribute('transform');\r\n if (transform) {\r\n transform = transform.replace(/,/g, ' ');\r\n var transformOps_1 = [];\r\n var m = null;\r\n transform.replace(transformRegex, function (str, type, value) {\r\n transformOps_1.push(type, value);\r\n return '';\r\n });\r\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\r\n var value = transformOps_1[i];\r\n var type = transformOps_1[i - 1];\r\n var valueArr = void 0;\r\n m = m || create$1();\r\n switch (type) {\r\n case 'translate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n translate(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\r\n break;\r\n case 'scale':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n scale$1(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\r\n break;\r\n case 'rotate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n rotate(m, m, parseFloat(valueArr[0]));\r\n break;\r\n case 'skew':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n console.warn('Skew transform is not supported yet');\r\n break;\r\n case 'matrix':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n m[0] = parseFloat(valueArr[0]);\r\n m[1] = parseFloat(valueArr[1]);\r\n m[2] = parseFloat(valueArr[2]);\r\n m[3] = parseFloat(valueArr[3]);\r\n m[4] = parseFloat(valueArr[4]);\r\n m[5] = parseFloat(valueArr[5]);\r\n break;\r\n }\r\n }\r\n node.setLocalTransform(m);\r\n }\r\n}\r\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\r\nfunction parseStyleAttribute(xmlNode) {\r\n var style = xmlNode.getAttribute('style');\r\n var result = {};\r\n if (!style) {\r\n return result;\r\n }\r\n var styleList = {};\r\n styleRegex.lastIndex = 0;\r\n var styleRegResult;\r\n while ((styleRegResult = styleRegex.exec(style)) != null) {\r\n styleList[styleRegResult[1]] = styleRegResult[2];\r\n }\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\r\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\r\n }\r\n }\r\n return result;\r\n}\r\nfunction makeViewBoxTransform(viewBoxRect, width, height) {\r\n var scaleX = width / viewBoxRect.width;\r\n var scaleY = height / viewBoxRect.height;\r\n var scale = Math.min(scaleX, scaleY);\r\n return {\r\n scale: scale,\r\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2,\r\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2\r\n };\r\n}\r\nfunction parseSVG(xml, opt) {\r\n var parser = new SVGParser();\r\n return parser.parse(xml, opt);\r\n}\n\nvar PI$2 = Math.PI;\r\nvar PI2$5 = PI$2 * 2;\r\nvar mathSin$3 = Math.sin;\r\nvar mathCos$3 = Math.cos;\r\nvar mathACos = Math.acos;\r\nvar mathATan2 = Math.atan2;\r\nvar mathAbs$1 = Math.abs;\r\nvar mathSqrt$4 = Math.sqrt;\r\nvar mathMax$3 = Math.max;\r\nvar mathMin$3 = Math.min;\r\nvar e = 1e-4;\r\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n}\r\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n}\r\nfunction buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n}\n\nvar SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n}());\r\nvar Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n}(Path));\r\nSector.prototype.type = 'sector';\n\nvar CMD$3 = PathProxy.CMD;\r\nvar PI2$6 = Math.PI * 2;\r\nvar PROP_XY = ['x', 'y'];\r\nvar PROP_WH = ['width', 'height'];\r\nvar tmpArr = [];\r\nfunction aroundEqual(a, b) {\r\n return Math.abs(a - b) < 1e-5;\r\n}\r\nfunction pathToBezierCurves(path) {\r\n var data = path.data;\r\n var len = path.len();\r\n var bezierArray = [];\r\n var currentSubpath;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n function createNewSubpath(x, y) {\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n currentSubpath = [x, y];\r\n }\r\n function addLine(x0, y0, x1, y1) {\r\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\r\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\r\n }\r\n }\r\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\r\n var delta = Math.abs(endAngle - startAngle);\r\n var len = Math.tan(delta / 4) * 4 / 3;\r\n var dir = endAngle < startAngle ? -1 : 1;\r\n var c1 = Math.cos(startAngle);\r\n var s1 = Math.sin(startAngle);\r\n var c2 = Math.cos(endAngle);\r\n var s2 = Math.sin(endAngle);\r\n var x1 = c1 * rx + cx;\r\n var y1 = s1 * ry + cy;\r\n var x4 = c2 * rx + cx;\r\n var y4 = s2 * ry + cy;\r\n var hx = rx * len * dir;\r\n var hy = ry * len * dir;\r\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\r\n }\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n if (cmd === CMD$3.L || cmd === CMD$3.C || cmd === CMD$3.Q) {\r\n currentSubpath = [x0, y0];\r\n }\r\n }\r\n switch (cmd) {\r\n case CMD$3.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n createNewSubpath(x0, y0);\r\n break;\r\n case CMD$3.L:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n addLine(xi, yi, x1, y1);\r\n xi = x1;\r\n yi = y1;\r\n break;\r\n case CMD$3.C:\r\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\r\n break;\r\n case CMD$3.Q:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n x1 = Math.cos(startAngle) * rx + cx;\r\n y1 = Math.sin(startAngle) * ry + cy;\r\n if (isFirst) {\r\n x0 = x1;\r\n y0 = y1;\r\n createNewSubpath(x0, y0);\r\n }\r\n else {\r\n addLine(xi, yi, x1, y1);\r\n }\r\n xi = Math.cos(endAngle) * rx + cx;\r\n yi = Math.sin(endAngle) * ry + cy;\r\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\r\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\r\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\r\n : Math.min(angle + step, endAngle);\r\n addArc(angle, nextAngle, cx, cy, rx, ry);\r\n }\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n x1 = x0 + data[i++];\r\n y1 = y0 + data[i++];\r\n createNewSubpath(x1, y0);\r\n addLine(x1, y0, x1, y1);\r\n addLine(x1, y1, x0, y1);\r\n addLine(x0, y1, x0, y0);\r\n addLine(x0, y0, x1, y0);\r\n break;\r\n case CMD$3.Z:\r\n currentSubpath && addLine(xi, yi, x0, y0);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n return bezierArray;\r\n}\r\nfunction alignSubpath(subpath1, subpath2) {\r\n var len1 = subpath1.length;\r\n var len2 = subpath2.length;\r\n if (len1 === len2) {\r\n return [subpath1, subpath2];\r\n }\r\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\r\n var shorterLen = Math.min(len1, len2);\r\n var diff = Math.abs(len2 - len1) / 6;\r\n var shorterBezierCount = (shorterLen - 2) / 6;\r\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\r\n var newSubpath = [shorterPath[0], shorterPath[1]];\r\n var remained = diff;\r\n var tmpSegX = [];\r\n var tmpSegY = [];\r\n for (var i = 2; i < shorterLen;) {\r\n var x0 = shorterPath[i - 2];\r\n var y0 = shorterPath[i - 1];\r\n var x1 = shorterPath[i++];\r\n var y1 = shorterPath[i++];\r\n var x2 = shorterPath[i++];\r\n var y2 = shorterPath[i++];\r\n var x3 = shorterPath[i++];\r\n var y3 = shorterPath[i++];\r\n if (remained <= 0) {\r\n newSubpath.push(x1, y1, x2, y2, x3, y3);\r\n continue;\r\n }\r\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\r\n for (var k = 1; k <= actualSubDivCount; k++) {\r\n var p = k / actualSubDivCount;\r\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\r\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\r\n x0 = tmpSegX[3];\r\n y0 = tmpSegY[3];\r\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\r\n x1 = tmpSegX[5];\r\n y1 = tmpSegY[5];\r\n x2 = tmpSegX[6];\r\n y2 = tmpSegY[6];\r\n }\r\n remained -= actualSubDivCount - 1;\r\n }\r\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\r\n}\r\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\r\n var len = lastSubpathSubpath.length;\r\n var lastX = lastSubpathSubpath[len - 2];\r\n var lastY = lastSubpathSubpath[len - 1];\r\n var newSubpath = [];\r\n for (var i = 0; i < otherSubpath.length;) {\r\n newSubpath[i++] = lastX;\r\n newSubpath[i++] = lastY;\r\n }\r\n return newSubpath;\r\n}\r\nfunction alignBezierCurves(array1, array2) {\r\n var _a;\r\n var lastSubpath1;\r\n var lastSubpath2;\r\n var newArray1 = [];\r\n var newArray2 = [];\r\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\r\n var subpath1 = array1[i];\r\n var subpath2 = array2[i];\r\n var newSubpath1 = void 0;\r\n var newSubpath2 = void 0;\r\n if (!subpath1) {\r\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\r\n newSubpath2 = subpath2;\r\n }\r\n else if (!subpath2) {\r\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\r\n newSubpath1 = subpath1;\r\n }\r\n else {\r\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\r\n lastSubpath1 = newSubpath1;\r\n lastSubpath2 = newSubpath2;\r\n }\r\n newArray1.push(newSubpath1);\r\n newArray2.push(newSubpath2);\r\n }\r\n return [newArray1, newArray2];\r\n}\r\nfunction centroid(array) {\r\n var signedArea = 0;\r\n var cx = 0;\r\n var cy = 0;\r\n var len = array.length;\r\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\r\n var x0 = array[j];\r\n var y0 = array[j + 1];\r\n var x1 = array[i];\r\n var y1 = array[i + 1];\r\n var a = x0 * y1 - x1 * y0;\r\n signedArea += a;\r\n cx += (x0 + x1) * a;\r\n cy += (y0 + y1) * a;\r\n }\r\n if (signedArea === 0) {\r\n return [array[0] || 0, array[1] || 0];\r\n }\r\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\r\n}\r\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\r\n var bezierCount = (fromSubBeziers.length - 2) / 6;\r\n var bestScore = Infinity;\r\n var bestOffset = 0;\r\n var len = fromSubBeziers.length;\r\n var len2 = len - 2;\r\n for (var offset = 0; offset < bezierCount; offset++) {\r\n var cursorOffset = offset * 6;\r\n var score = 0;\r\n for (var k = 0; k < len; k += 2) {\r\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\r\n var x0 = fromSubBeziers[idx] - fromCp[0];\r\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\r\n var x1 = toSubBeziers[k] - toCp[0];\r\n var y1 = toSubBeziers[k + 1] - toCp[1];\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestOffset = offset;\r\n }\r\n }\r\n return bestOffset;\r\n}\r\nfunction reverse(array) {\r\n var newArr = [];\r\n var len = array.length;\r\n for (var i = 0; i < len; i += 2) {\r\n newArr[i] = array[len - i - 2];\r\n newArr[i + 1] = array[len - i - 1];\r\n }\r\n return newArr;\r\n}\r\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\r\n var result = [];\r\n var fromNeedsReverse;\r\n for (var i = 0; i < fromArr.length; i++) {\r\n var fromSubpathBezier = fromArr[i];\r\n var toSubpathBezier = toArr[i];\r\n var fromCp = centroid(fromSubpathBezier);\r\n var toCp = centroid(toSubpathBezier);\r\n if (fromNeedsReverse == null) {\r\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\r\n }\r\n var newFromSubpathBezier = [];\r\n var newToSubpathBezier = [];\r\n var bestAngle = 0;\r\n var bestScore = Infinity;\r\n var tmpArr_1 = [];\r\n var len = fromSubpathBezier.length;\r\n if (fromNeedsReverse) {\r\n fromSubpathBezier = reverse(fromSubpathBezier);\r\n }\r\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\r\n var len2 = len - 2;\r\n for (var k = 0; k < len2; k += 2) {\r\n var idx = (offset + k) % len2 + 2;\r\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\r\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\r\n }\r\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\r\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\r\n if (searchAngleIteration > 0) {\r\n var step = searchAngleRange / searchAngleIteration;\r\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n var score = 0;\r\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\r\n var x0 = newFromSubpathBezier[k];\r\n var y0 = newFromSubpathBezier[k + 1];\r\n var x1 = toSubpathBezier[k] - toCp[0];\r\n var y1 = toSubpathBezier[k + 1] - toCp[1];\r\n var newX1 = x1 * ca - y1 * sa;\r\n var newY1 = x1 * sa + y1 * ca;\r\n tmpArr_1[k] = newX1;\r\n tmpArr_1[k + 1] = newY1;\r\n var dx = newX1 - x0;\r\n var dy = newY1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestAngle = angle;\r\n for (var m = 0; m < tmpArr_1.length; m++) {\r\n newToSubpathBezier[m] = tmpArr_1[m];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\r\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\r\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\r\n }\r\n }\r\n result.push({\r\n from: newFromSubpathBezier,\r\n to: newToSubpathBezier,\r\n fromCp: fromCp,\r\n toCp: toCp,\r\n rotation: -bestAngle\r\n });\r\n }\r\n return result;\r\n}\r\nfunction morphPath(fromPath, toPath, animationOpts) {\r\n var fromPathProxy;\r\n var toPathProxy;\r\n if (!fromPath || !toPath) {\r\n return toPath;\r\n }\r\n !fromPath.path && fromPath.createPathProxy();\r\n fromPathProxy = fromPath.path;\r\n fromPathProxy.beginPath();\r\n fromPath.buildPath(fromPathProxy, fromPath.shape);\r\n !toPath.path && toPath.createPathProxy();\r\n toPathProxy = toPath.path;\r\n toPathProxy === fromPathProxy && (toPathProxy = new PathProxy(false));\r\n toPathProxy.beginPath();\r\n if (isIndividualMorphingPath(toPath)) {\r\n toPath.__oldBuildPath(toPathProxy, toPath.shape);\r\n }\r\n else {\r\n toPath.buildPath(toPathProxy, toPath.shape);\r\n }\r\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\r\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\r\n becomeIndividualMorphingPath(toPath, morphingData, 0);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n toPath.animateTo({\r\n __morphT: 1\r\n }, defaults({\r\n during: function (p) {\r\n toPath.dirtyShape();\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n restoreIndividualMorphingPath(toPath);\r\n toPath.createPathProxy();\r\n toPath.dirtyShape();\r\n oldDone && oldDone();\r\n },\r\n aborted: function () {\r\n oldAborted && oldAborted();\r\n }\r\n }, animationOpts));\r\n return toPath;\r\n}\r\nfunction morphingPathBuildPath(path) {\r\n var morphingData = this.__morphingData;\r\n var t = this.__morphT;\r\n var onet = 1 - t;\r\n var newCp = [];\r\n for (var i = 0; i < morphingData.length; i++) {\r\n var item = morphingData[i];\r\n var from = item.from;\r\n var to = item.to;\r\n var angle = item.rotation * t;\r\n var fromCp = item.fromCp;\r\n var toCp = item.toCp;\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n lerp(newCp, fromCp, toCp, t);\r\n for (var m = 0; m < from.length; m += 2) {\r\n var x0 = from[m];\r\n var y0 = from[m + 1];\r\n var x1 = to[m];\r\n var y1 = to[m + 1];\r\n var x = x0 * onet + x1 * t;\r\n var y = y0 * onet + y1 * t;\r\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\r\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\r\n }\r\n for (var m = 0; m < from.length;) {\r\n if (m === 0) {\r\n path.moveTo(tmpArr[m++], tmpArr[m++]);\r\n }\r\n path.bezierCurveTo(tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++]);\r\n }\r\n }\r\n}\r\nfunction becomeIndividualMorphingPath(path, morphingData, morphT) {\r\n if (isIndividualMorphingPath(path)) {\r\n updateIndividualMorphingPath(path, morphingData, morphT);\r\n return;\r\n }\r\n var morphingPath = path;\r\n morphingPath.__oldBuildPath = morphingPath.buildPath;\r\n morphingPath.buildPath = morphingPathBuildPath;\r\n updateIndividualMorphingPath(morphingPath, morphingData, morphT);\r\n}\r\nfunction updateIndividualMorphingPath(morphingPath, morphingData, morphT) {\r\n morphingPath.__morphingData = morphingData;\r\n morphingPath.__morphT = morphT;\r\n}\r\nfunction restoreIndividualMorphingPath(path) {\r\n if (isIndividualMorphingPath(path)) {\r\n path.buildPath = path.__oldBuildPath;\r\n path.__oldBuildPath = path.__morphingData = null;\r\n }\r\n}\r\nfunction isIndividualMorphingPath(path) {\r\n return path.__oldBuildPath != null;\r\n}\r\nfunction isCombiningPath(path) {\r\n return !!path.__combiningSubList;\r\n}\r\nfunction isInAnyMorphing(path) {\r\n return isIndividualMorphingPath(path) || isCombiningPath(path);\r\n}\r\nfunction combine(fromPathList, toPath, animationOpts, copyPropsIfDivided) {\r\n var fromIndividuals = [];\r\n var separateCount = 0;\r\n for (var i = 0; i < fromPathList.length; i++) {\r\n var fromPath = fromPathList[i];\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n for (var j = 0; j < fromCombiningSubList.length; j++) {\r\n fromIndividuals.push(fromCombiningSubList[j]);\r\n }\r\n separateCount += fromCombiningSubList.length;\r\n }\r\n else {\r\n fromIndividuals.push(fromPath);\r\n separateCount++;\r\n }\r\n }\r\n if (!separateCount) {\r\n return;\r\n }\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var toPathSplittedList = divideShape(toPath, separateCount, dividingMethod);\r\n assert(toPathSplittedList.length === separateCount);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n var doneCount = 0;\r\n var abortedCalled = false;\r\n var morphAnimationOpts = defaults({\r\n during: function (p) {\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n doneCount++;\r\n if (doneCount === toPathSplittedList.length) {\r\n restoreCombiningPath(toPath);\r\n oldDone && oldDone();\r\n }\r\n },\r\n aborted: function () {\r\n if (!abortedCalled) {\r\n abortedCalled = true;\r\n oldAborted && oldAborted();\r\n }\r\n }\r\n }, animationOpts);\r\n for (var i = 0; i < separateCount; i++) {\r\n var from = fromIndividuals[i];\r\n var to = toPathSplittedList[i];\r\n copyPropsIfDivided && copyPropsIfDivided(toPath, to, true);\r\n morphPath(from, to, morphAnimationOpts);\r\n }\r\n becomeCombiningPath(toPath, toPathSplittedList);\r\n return {\r\n fromIndividuals: fromIndividuals,\r\n toIndividuals: toPathSplittedList,\r\n count: separateCount\r\n };\r\n}\r\nfunction becomeCombiningPath(path, combiningSubList) {\r\n if (isCombiningPath(path)) {\r\n updateCombiningPathSubList(path, combiningSubList);\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, combiningSubList);\r\n combiningPath.__oldAddSelfToZr = path.addSelfToZr;\r\n combiningPath.__oldRemoveSelfFromZr = path.removeSelfFromZr;\r\n combiningPath.addSelfToZr = combiningAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningRemoveSelfFromZr;\r\n combiningPath.__oldBuildPath = combiningPath.buildPath;\r\n combiningPath.buildPath = noop;\r\n combiningPath.childrenRef = combiningChildrenRef;\r\n}\r\nfunction restoreCombiningPath(path) {\r\n if (!isCombiningPath(path)) {\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, null);\r\n combiningPath.addSelfToZr = combiningPath.__oldAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningPath.__oldRemoveSelfFromZr;\r\n combiningPath.buildPath = combiningPath.__oldBuildPath;\r\n combiningPath.childrenRef =\r\n combiningPath.__combiningSubList =\r\n combiningPath.__oldAddSelfToZr =\r\n combiningPath.__oldRemoveSelfFromZr =\r\n combiningPath.__oldBuildPath = null;\r\n}\r\nfunction updateCombiningPathSubList(combiningPath, combiningSubList) {\r\n if (combiningPath.__combiningSubList !== combiningSubList) {\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'removeSelfFromZr');\r\n combiningPath.__combiningSubList = combiningSubList;\r\n if (combiningSubList) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n combiningSubList[i].parent = combiningPath;\r\n }\r\n }\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'addSelfToZr');\r\n }\r\n}\r\nfunction combiningAddSelfToZr(zr) {\r\n this.__oldAddSelfToZr(zr);\r\n combiningPathSubListAddRemoveWithZr(this, 'addSelfToZr');\r\n}\r\nfunction combiningPathSubListAddRemoveWithZr(path, method) {\r\n var combiningSubList = path.__combiningSubList;\r\n var zr = path.__zr;\r\n if (combiningSubList && zr) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child[method](zr);\r\n }\r\n }\r\n}\r\nfunction combiningRemoveSelfFromZr(zr) {\r\n this.__oldRemoveSelfFromZr(zr);\r\n var combiningSubList = this.__combiningSubList;\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n}\r\nfunction combiningChildrenRef() {\r\n return this.__combiningSubList;\r\n}\r\nfunction separate(fromPath, toPathList, animationOpts, copyPropsIfDivided) {\r\n var toPathListLen = toPathList.length;\r\n var fromPathList;\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var copyProps = false;\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n if (fromCombiningSubList.length === toPathListLen) {\r\n fromPathList = fromCombiningSubList;\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n assert(fromPathList.length === toPathListLen);\r\n for (var i = 0; i < toPathListLen; i++) {\r\n if (copyProps && copyPropsIfDivided) {\r\n copyPropsIfDivided(fromPath, fromPathList[i], false);\r\n }\r\n morphPath(fromPathList[i], toPathList[i], animationOpts);\r\n }\r\n return {\r\n fromIndividuals: fromPathList,\r\n toIndividuals: toPathList,\r\n count: toPathListLen\r\n };\r\n}\r\nfunction divideShape(path, separateCount, dividingMethod) {\r\n return dividingMethod === 'duplicate'\r\n ? duplicateShape(path, separateCount)\r\n : splitShape(path, separateCount);\r\n}\r\nfunction splitShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n if (separateCount === 1) {\r\n return duplicateShape(path, separateCount);\r\n }\r\n if (path instanceof Rect) {\r\n var toPathShape = path.shape;\r\n var splitPropIdx = toPathShape.height > toPathShape.width ? 1 : 0;\r\n var propWH = PROP_WH[splitPropIdx];\r\n var propXY = PROP_XY[splitPropIdx];\r\n var subWH = toPathShape[propWH] / separateCount;\r\n var xyCurr = toPathShape[propXY];\r\n for (var i = 0; i < separateCount; i++, xyCurr += subWH) {\r\n var subShape = {\r\n x: toPathShape.x,\r\n y: toPathShape.y,\r\n width: toPathShape.width,\r\n height: toPathShape.height\r\n };\r\n subShape[propXY] = xyCurr;\r\n subShape[propWH] = i < separateCount - 1\r\n ? subWH\r\n : toPathShape[propXY] + toPathShape[propWH] - xyCurr;\r\n var splitted = new Rect({ shape: subShape });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else if (path instanceof Sector) {\r\n var toPathShape = path.shape;\r\n var clockwise = toPathShape.clockwise;\r\n var startAngle = toPathShape.startAngle;\r\n var endAngle = toPathShape.endAngle;\r\n var endAngleNormalized = normalizeRadian$1(startAngle, toPathShape.endAngle, clockwise);\r\n var step = (endAngleNormalized - startAngle) / separateCount;\r\n var angleCurr = startAngle;\r\n for (var i = 0; i < separateCount; i++, angleCurr += step) {\r\n var splitted = new Sector({\r\n shape: {\r\n cx: toPathShape.cx,\r\n cy: toPathShape.cy,\r\n r: toPathShape.r,\r\n r0: toPathShape.r0,\r\n clockwise: clockwise,\r\n startAngle: angleCurr,\r\n endAngle: i === separateCount - 1 ? endAngle : angleCurr + step\r\n }\r\n });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else {\r\n return duplicateShape(path, separateCount);\r\n }\r\n return resultPaths;\r\n}\r\nfunction duplicateShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n var ctor = path.constructor;\r\n for (var i = 0; i < separateCount; i++) {\r\n var sub = new ctor({\r\n shape: clone(path.shape)\r\n });\r\n resultPaths.push(sub);\r\n }\r\n return resultPaths;\r\n}\r\nfunction normalizeRadian$1(start, end, clockwise) {\r\n return end + PI2$6 * (Math[clockwise ? 'ceil' : 'floor']((start - end) / PI2$6));\r\n}\n\nvar CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n}(Path));\n\nvar m = [];\r\nvar IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n}(Displayable));\n\nvar globalImageCache = new LRU(50);\r\nfunction findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n}\r\nfunction createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n}\r\nfunction imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n}\r\nfunction isImageReady(image) {\r\n return image && image.width && image.height;\r\n}\n\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\nfunction truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n}\r\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n}\r\nfunction truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n}\r\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n}\r\nfunction parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n}\r\nvar RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n}());\r\nvar RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n}());\r\nvar RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n}());\r\nfunction parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n}\r\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n}\r\nfunction isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n}\r\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n}, {});\r\nfunction isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n}\r\nfunction parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n}\n\nvar DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n};\r\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\r\nvar DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nvar ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n}(Displayable));\r\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\nfunction normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n}\r\nfunction normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n}\r\nfunction getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n}\r\nfunction getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n}\r\nfunction getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n}\r\nfunction getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n}\r\nfunction needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n}\n\nvar ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n}());\r\nvar Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n}(Path));\r\nArc.prototype.type = 'arc';\n\nvar out = [];\r\nvar BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n}());\r\nfunction someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n}\r\nvar BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n}(Path));\r\nBezierCurve.prototype.type = 'bezier-curve';\n\nvar DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n}());\r\nvar Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n}(Path));\r\nDroplet.prototype.type = 'droplet';\n\nvar HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n}());\r\nvar Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n}(Path));\r\nHeart.prototype.type = 'heart';\n\nvar PI$3 = Math.PI;\r\nvar sin = Math.sin;\r\nvar cos = Math.cos;\r\nvar IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n}());\r\nvar Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n}(Path));\r\nIsogon.prototype.type = 'isogon';\n\nvar RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n}());\r\nvar Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n}(Path));\r\nRing.prototype.type = 'ring';\n\nvar sin$1 = Math.sin;\r\nvar cos$1 = Math.cos;\r\nvar radian = Math.PI / 180;\r\nvar RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n}());\r\nvar Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n}(Path));\r\nRose.prototype.type = 'rose';\n\nvar PI$4 = Math.PI;\r\nvar cos$2 = Math.cos;\r\nvar sin$2 = Math.sin;\r\nvar StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n}());\r\nvar Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n}(Path));\r\nStar.prototype.type = 'star';\n\nvar cos$3 = Math.cos;\r\nvar sin$3 = Math.sin;\r\nvar TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n}());\r\nvar Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n}(Path));\r\nTrochoid.prototype.type = 'trochoid';\n\nvar RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n}(Gradient));\n\nvar extent = [0, 0];\r\nvar extent2 = [0, 0];\r\nvar minTv$1 = new Point();\r\nvar maxTv$1 = new Point();\r\nvar OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n}());\n\n/*!\r\n* ZRender, a high performance 2d drawing library.\r\n*\r\n* Copyright (c) 2013, Baidu Inc.\r\n* All rights reserved.\r\n*\r\n* LICENSE\r\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n*/\r\nvar useVML = !env.canvasSupported;\r\nvar painterCtors = {};\r\nvar instances = {};\r\nfunction delInstance(id) {\r\n delete instances[id];\r\n}\r\nfunction isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n}\r\nvar ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover) {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n}());\r\nfunction init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n}\r\nfunction dispose(zr) {\r\n zr.dispose();\r\n}\r\nfunction disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n}\r\nfunction getInstance(id) {\r\n return instances[id];\r\n}\r\nfunction registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n}\r\nvar version = '5.0.0';\n\nvar zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n});\n\nvar RADIAN_EPSILON = 1e-4;\r\nfunction _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\nfunction linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n}\r\nfunction parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n}\r\nfunction round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n}\r\nfunction asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n}\r\nfunction getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n}\r\nfunction getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n}\r\nfunction getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n}\r\nfunction getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n}\r\nvar MAX_SAFE_INTEGER = 9007199254740991;\r\nfunction remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n}\r\nfunction isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n}\r\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\nfunction parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n}\r\nfunction quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n}\r\nfunction quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n}\r\nfunction nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n}\r\nfunction quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n}\r\nfunction reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n}\r\nfunction numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n}\r\nfunction isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n}\r\nfunction getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n}\r\nfunction getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n}\r\nfunction getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n}\n\nvar numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n});\n\nvar ECHARTS_PREFIX = '[ECharts] ';\r\nvar storedLogs = {};\r\nvar hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\nfunction warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n}\r\nfunction error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n}\r\nfunction deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n}\r\nfunction deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n}\r\nfunction consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n}\r\nfunction makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n}\r\nfunction throwError(msg) {\r\n throw new Error(msg);\r\n}\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\nfunction normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n}\r\nfunction defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n}\r\nvar TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n];\r\nfunction getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n}\r\nfunction isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n}\r\nfunction mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n}\r\nfunction prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n}\r\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n}\r\nfunction mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n}\r\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n}\r\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n}\r\nfunction makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n}\r\nfunction keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n}\r\nfunction makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n}\r\nfunction convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n}\r\nfunction warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n}\r\nfunction isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n}\r\nfunction isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n}\r\nfunction isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n}\r\nfunction makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n}\r\nfunction setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n}\r\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n}\r\nfunction compressBatches(batchA, batchB) {\r\n var mapA = {};\r\n var mapB = {};\r\n makeMap(batchA || [], mapA);\r\n makeMap(batchB || [], mapB, mapA);\r\n return [mapToArray(mapA), mapToArray(mapB)];\r\n function makeMap(sourceBatch, map, otherMap) {\r\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\r\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\r\n if (seriesId == null) {\r\n return;\r\n }\r\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\r\n var otherDataIndices = otherMap && otherMap[seriesId];\r\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\r\n var dataIndex = dataIndices[j];\r\n if (otherDataIndices && otherDataIndices[dataIndex]) {\r\n otherDataIndices[dataIndex] = null;\r\n }\r\n else {\r\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\r\n }\r\n }\r\n }\r\n }\r\n function mapToArray(map, isData) {\r\n var result = [];\r\n for (var i in map) {\r\n if (map.hasOwnProperty(i) && map[i] != null) {\r\n if (isData) {\r\n result.push(+i);\r\n }\r\n else {\r\n var dataIndices = mapToArray(map[i], true);\r\n dataIndices.length && result.push({ seriesId: i, dataIndex: dataIndices });\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\nfunction queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n}\r\nfunction makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n}\r\nvar innerUniqueIndex = getRandomIdBase();\r\nfunction parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n}\r\nvar SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\nvar MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\nfunction queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n}\r\nfunction setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n}\r\nfunction getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n}\r\nfunction getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n}\r\nfunction groupData(array, getKey) {\r\n var buckets = createHashMap();\r\n var keys = [];\r\n each(array, function (item) {\r\n var key = getKey(item);\r\n (buckets.get(key)\r\n || (keys.push(key), buckets.set(key, []))).push(item);\r\n });\r\n return {\r\n keys: keys,\r\n buckets: buckets\r\n };\r\n}\r\nfunction interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n}\n\nvar TYPE_DELIMITER = '.';\r\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\nfunction parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n}\r\nfunction checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n}\r\nfunction isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n}\r\nfunction enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n}\r\nfunction isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n}\r\nfunction mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n}\r\nvar classBase = Math.round(Math.random() * 10);\r\nfunction enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n}\r\nfunction superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\nfunction superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\nfunction enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n}\n\nfunction makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n}\n\nvar AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n];\r\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\nvar AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n}());\n\nvar getECData = makeInner();\n\nvar _highlightNextDigit = 1;\r\nvar _highlightKeyMap = {};\r\nvar getSavedStates = makeInner();\r\nvar HOVER_STATE_NORMAL = 0;\r\nvar HOVER_STATE_BLUR = 1;\r\nvar HOVER_STATE_EMPHASIS = 2;\r\nvar SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\nvar DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\nvar Z2_EMPHASIS_LIFT = 10;\r\nvar Z2_SELECT_LIFT = 9;\r\nvar HIGHLIGHT_ACTION_TYPE = 'highlight';\r\nvar DOWNPLAY_ACTION_TYPE = 'downplay';\r\nvar SELECT_ACTION_TYPE = 'select';\r\nvar UNSELECT_ACTION_TYPE = 'unselect';\r\nvar TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\nfunction hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n}\r\nvar liftedColorCache = new LRU(100);\r\nfunction liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n}\r\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n}\r\nfunction singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n}\r\nfunction singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\nfunction singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n}\r\nfunction singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\nfunction singleEnterSelect(el) {\r\n el.selected = true;\r\n}\r\nfunction singleLeaveSelect(el) {\r\n el.selected = false;\r\n}\r\nfunction updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n}\r\nfunction traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n}\r\nfunction setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n}\r\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n}\r\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n}\r\nfunction elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n}\r\nfunction enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n}\r\nfunction leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n}\r\nfunction enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n}\r\nfunction leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n}\r\nfunction enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n}\r\nfunction leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n}\r\nfunction enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n}\r\nfunction leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n}\r\nfunction shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n}\r\nfunction allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n}\r\nfunction toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n}\r\nfunction toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n}\r\nfunction toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n}\r\nfunction updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n}\r\nfunction getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n}\r\nfunction enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n}\r\nfunction enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n}\r\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\r\nvar defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n};\r\nfunction setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n}\r\nfunction setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n}\r\nfunction isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n}\r\nfunction getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n}\r\nfunction isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n}\r\nfunction isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n}\r\nfunction savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n}\n\nvar mathMax$4 = Math.max;\r\nvar mathMin$4 = Math.min;\r\nvar _customShapeMap = {};\r\nfunction extendShape(opts) {\r\n return Path.extend(opts);\r\n}\r\nvar extendPathFromString = extendFromString;\r\nfunction extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n}\r\nfunction registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n}\r\nfunction getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n}\r\nfunction makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n}\r\nfunction makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n}\r\nfunction centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n}\r\nvar mergePath$1 = mergePath;\r\nfunction resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n}\r\nfunction subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n}\r\nfunction subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n}\r\nvar subPixelOptimize$1 = subPixelOptimize;\r\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n}\r\nfunction updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n}\r\nfunction removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n}\r\nfunction isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n}\r\nfunction applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n}\r\nfunction transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n}\r\nfunction isNotGroup(el) {\r\n return !el.isGroup;\r\n}\r\nfunction isPath(el) {\r\n return el.shape != null;\r\n}\r\nfunction groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n}\r\nfunction clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n}\r\nfunction clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n}\r\nfunction createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n}\r\nfunction linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n}\r\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n}\r\nfunction nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n}\r\nregisterShape('circle', Circle);\r\nregisterShape('ellipse', Ellipse);\r\nregisterShape('sector', Sector);\r\nregisterShape('ring', Ring);\r\nregisterShape('polygon', Polygon);\r\nregisterShape('polyline', Polyline);\r\nregisterShape('rect', Rect);\r\nregisterShape('line', Line);\r\nregisterShape('bezierCurve', BezierCurve);\r\nregisterShape('arc', Arc);\n\nvar graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n});\n\nvar EMPTY_OBJ = {};\r\nfunction setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n}\r\nfunction getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n}\r\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n}\r\nfunction getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n}\r\nfunction createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n}\r\nfunction createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n}\r\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n}\r\nfunction getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n}\r\nvar TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n];\r\nvar TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n];\r\nvar TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n];\r\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n}\r\nfunction getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n}\r\nvar labelInner = makeInner();\r\nfunction setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n}\r\nfunction animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n}\n\nvar PATH_COLOR = ['textStyle', 'color'];\r\nvar tmpRichText = new ZRText();\r\nvar TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n}());\n\nvar LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n];\r\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\nvar LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n}());\n\nvar ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n];\r\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\nvar ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n}());\n\nvar Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n}());\r\nenableClassExtend(Model);\r\nenableClassCheck(Model);\r\nmixin(Model, LineStyleMixin);\r\nmixin(Model, ItemStyleMixin);\r\nmixin(Model, AreaStyleMixin);\r\nmixin(Model, TextStyleMixin);\n\nvar base = Math.round(Math.random() * 10);\r\nfunction getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n}\r\nfunction enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n}\r\nfunction enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n}\r\nfunction inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n}\n\nvar langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n};\n\nvar langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n};\n\nvar LOCALE_ZH = 'ZH';\r\nvar LOCALE_EN = 'EN';\r\nvar DEFAULT_LOCALE = LOCALE_EN;\r\nvar localeStorage = {};\r\nvar localeModels = {};\r\nvar SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n})();\r\nfunction registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n}\r\nfunction createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n}\r\nfunction getLocaleModel(lang) {\r\n return localeModels[lang];\r\n}\r\nfunction getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n}\r\nregisterLocale(LOCALE_EN, langEN);\r\nregisterLocale(LOCALE_ZH, langZH);\n\nvar ONE_SECOND = 1000;\r\nvar ONE_MINUTE = ONE_SECOND * 60;\r\nvar ONE_HOUR = ONE_MINUTE * 60;\r\nvar ONE_DAY = ONE_HOUR * 24;\r\nvar ONE_YEAR = ONE_DAY * 365;\r\nvar defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n};\r\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\nvar fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}:{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n};\r\nvar primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\nvar timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\nfunction pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n}\r\nfunction getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n}\r\nfunction isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n}\r\nfunction getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n}\r\nfunction format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n}\r\nfunction leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n}\r\nfunction getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n}\r\nfunction getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n}\r\nfunction fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n}\r\nfunction monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n}\r\nfunction dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n}\r\nfunction hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n}\r\nfunction minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n}\r\nfunction secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n}\r\nfunction millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n}\r\nfunction fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n}\r\nfunction monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n}\r\nfunction dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n}\r\nfunction hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n}\r\nfunction minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n}\r\nfunction secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n}\r\nfunction millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n}\n\nfunction getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n}\n\nfunction addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n}\r\nfunction toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n}\r\nvar normalizeCssArray$1 = normalizeCssArray;\r\nvar replaceReg = /([&<>\"'])/g;\r\nvar replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n};\r\nfunction encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n}\r\nfunction makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n}\r\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\nvar wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n};\r\nfunction formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n}\r\nfunction formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n}\r\nfunction getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n}\r\nfunction formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n}\r\nfunction capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n}\r\nfunction convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n}\r\nfunction windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n}\n\nvar formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n});\n\nvar each$1 = each;\r\nvar LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n];\r\nvar HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n];\r\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n}\r\nvar box = boxLayout;\r\nvar vbox = curry(boxLayout, 'vertical');\r\nvar hbox = curry(boxLayout, 'horizontal');\r\nfunction getAvailableSize(positionInfo, containerRect, margin) {\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var x = parsePercent$2(positionInfo.left, containerWidth);\r\n var y = parsePercent$2(positionInfo.top, containerHeight);\r\n var x2 = parsePercent$2(positionInfo.right, containerWidth);\r\n var y2 = parsePercent$2(positionInfo.bottom, containerHeight);\r\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\r\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\r\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\r\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\r\n margin = normalizeCssArray$1(margin || 0);\r\n return {\r\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\r\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\r\n };\r\n}\r\nfunction getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n}\r\nfunction positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n}\r\nfunction sizeCalculable(option, hvIdx) {\r\n return option[HV_NAMES[hvIdx][0]] != null\r\n || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null);\r\n}\r\nfunction fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n}\r\nfunction mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n}\r\nfunction getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n}\r\nfunction copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n}\n\nvar inner = makeInner();\r\nvar ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n}(Model));\r\nmountExtend(ComponentModel, Model);\r\nenableClassManagement(ComponentModel, { registerWhenExtend: true });\r\nenableSubTypeDefaulter(ComponentModel);\r\nenableTopologicalTravel(ComponentModel, getDependencies);\r\nfunction getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n}\n\nvar platform = '';\r\nif (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n}\r\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\r\nvar globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n};\n\nvar VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n]);\r\nvar SOURCE_FORMAT_ORIGINAL = 'original';\r\nvar SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\nvar SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\nvar SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\nvar SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\nvar SOURCE_FORMAT_UNKNOWN = 'unknown';\r\nvar SERIES_LAYOUT_BY_COLUMN = 'column';\r\nvar SERIES_LAYOUT_BY_ROW = 'row';\n\nvar BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n};\r\nvar innerGlobalModel = makeInner();\r\nfunction resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n}\r\nfunction inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n}\r\nfunction makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n}\r\nfunction makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n}\r\nfunction querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n}\r\nfunction queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n}\r\nfunction guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n}\r\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n}\n\nvar internalOptionCreatorMap = createHashMap();\r\nfunction registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n}\r\nfunction concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n}\n\nvar innerColor = makeInner();\r\nvar innerDecal = makeInner();\r\nvar PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n}());\r\nfunction getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n}\r\nfunction getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n}\r\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n}\r\nfunction clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n}\n\nvar reCreateSeriesIndices;\r\nvar assertSeriesInitialized;\r\nvar initBase;\r\nvar OPTION_INNER_KEY = '\\0_ec_inner';\r\nvar GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n}(Model));\r\nfunction isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n}\r\nfunction mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n}\r\nfunction queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n}\r\nfunction filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n}\r\nfunction normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n}\r\nmixin(GlobalModel, PaletteMixin);\n\nvar availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n];\r\nvar ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n}());\n\nvar coordinateSystemCreators = {};\r\nvar CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n}());\n\nvar QUERY_REG = /^(min|max)?(.+)$/;\r\nvar OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n}());\r\nfunction parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n}\r\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n}\r\nfunction compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n}\r\nfunction indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n}\n\nvar each$2 = each;\r\nvar isObject$1 = isObject;\r\nvar POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n];\r\nfunction compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n}\r\nfunction convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n}\r\nfunction removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n}\r\nfunction compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n}\r\nfunction compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n}\r\nfunction processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n}\r\nfunction toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n}\r\nfunction toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n}\r\nfunction globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n}\n\nfunction get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n}\r\nfunction set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n}\r\nfunction compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n}\r\nvar LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n];\r\nvar COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n];\r\nvar BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n];\r\nfunction compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n}\r\nfunction compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n}\r\nfunction compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n}\r\nfunction traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n}\r\nfunction globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n}\n\nfunction dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n}\r\nfunction calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n}\n\nvar SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n}());\r\nfunction isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n}\r\nfunction createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n}\r\nfunction createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n}\r\nfunction cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n}\r\nfunction makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n}\r\nfunction detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n}\r\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n}\r\nfunction objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n}\r\nfunction normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n}\r\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n}\n\nvar _a, _b, _c;\r\nvar providerMethods;\r\nvar mountMethods;\r\nvar DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n}());\r\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n};\r\nvar rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\nfunction getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\nvar countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n};\r\nvar rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\nfunction getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\nvar getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n};\r\nvar rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\nfunction getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n}\r\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n}\r\nfunction retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n}\n\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\nvar DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n}());\r\nfunction normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n}\n\nfunction createTask(define) {\r\n return new Task(define);\r\n}\r\nvar Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n}());\r\nvar iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n})();\n\nfunction parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n}\r\nvar valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n});\r\nfunction getRawValueParser(type) {\r\n return valueParserMap.get(type);\r\n}\r\nvar ORDER_COMPARISON_OP_MAP = {\r\n lt: function (lval, rval) { return lval < rval; },\r\n lte: function (lval, rval) { return lval <= rval; },\r\n gt: function (lval, rval) { return lval > rval; },\r\n gte: function (lval, rval) { return lval >= rval; }\r\n};\r\nvar FilterOrderComparator = (function () {\r\n function FilterOrderComparator(op, rval) {\r\n if (typeof rval !== 'number') {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\r\n }\r\n throwError(errMsg);\r\n }\r\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterOrderComparator.prototype.evaluate = function (lval) {\r\n return typeof lval === 'number'\r\n ? this._opFn(lval, this._rvalFloat)\r\n : this._opFn(numericToNumber(lval), this._rvalFloat);\r\n };\r\n return FilterOrderComparator;\r\n}());\r\nvar SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n}());\r\nvar FilterEqualityComparator = (function () {\r\n function FilterEqualityComparator(isEq, rval) {\r\n this._rval = rval;\r\n this._isEQ = isEq;\r\n this._rvalTypeof = typeof rval;\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterEqualityComparator.prototype.evaluate = function (lval) {\r\n var eqResult = lval === this._rval;\r\n if (!eqResult) {\r\n var lvalTypeof = typeof lval;\r\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\r\n eqResult = numericToNumber(lval) === this._rvalFloat;\r\n }\r\n }\r\n return this._isEQ ? eqResult : !eqResult;\r\n };\r\n return FilterEqualityComparator;\r\n}());\r\nfunction createFilterComparator(op, rval) {\r\n return (op === 'eq' || op === 'ne')\r\n ? new FilterEqualityComparator(op === 'eq', rval)\r\n : hasOwn(ORDER_COMPARISON_OP_MAP, op)\r\n ? new FilterOrderComparator(op, rval)\r\n : null;\r\n}\n\nvar ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n}());\r\nfunction createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n}\r\nfunction getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n}\r\nfunction cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n}\r\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n}\r\nfunction cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n}\r\nvar externalTransformMap = createHashMap();\r\nfunction registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n}\r\nfunction applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n}\r\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n}\n\nvar SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n}());\r\nfunction disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n}\r\nfunction isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n}\r\nfunction doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n}\n\nvar TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\nvar TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n};\r\nvar TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\nvar TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n};\r\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\nvar HTML_GAPS = [0, 10, 20, 30];\r\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\nfunction createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n}\r\nfunction getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n}\r\nvar builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n};\r\nfunction buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n}\r\nfunction buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n}\r\nfunction getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n}\r\nfunction wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n}\r\nfunction wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n}\r\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n}\r\nfunction wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n}\r\nfunction wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n}\r\nfunction retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n}\r\nfunction getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n}\r\nvar TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n}());\n\nfunction defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n}\r\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n}\n\nvar inner$1 = makeInner();\r\nfunction getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n}\r\nvar SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n}(ComponentModel));\r\nmixin(SeriesModel, DataFormatMixin);\r\nmixin(SeriesModel, PaletteMixin);\r\nmountExtend(SeriesModel, ComponentModel);\r\nfunction autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n}\r\nfunction getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n}\r\nfunction dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n}\r\nfunction dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n}\r\nfunction dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n}\r\nfunction wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n}\r\nfunction onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n}\r\nfunction getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n}\n\nvar ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n}());\r\nenableClassExtend(ComponentView);\r\nenableClassManagement(ComponentView, { registerWhenExtend: true });\n\nfunction createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n}\n\nvar inner$2 = makeInner();\r\nvar renderPlanner = createRenderPlanner();\r\nvar ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n}());\r\nfunction elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n}\r\nfunction toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n}\r\nenableClassExtend(ChartView, ['dispose']);\r\nenableClassManagement(ChartView, { registerWhenExtend: true });\r\nfunction renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n}\r\nfunction renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n}\r\nvar progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n};\n\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\nvar RATE = '\\0__throttleRate';\r\nvar THROTTLE_TYPE = '\\0__throttleType';\r\nfunction throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n}\r\nfunction createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n}\r\nfunction clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n}\n\nvar inner$3 = makeInner();\r\nvar defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n};\r\nvar defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n};\r\nfunction getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n}\r\nfunction getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n}\r\nvar seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n};\r\nvar sharedModel = new Model();\r\nvar dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n};\r\nvar dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n};\n\nvar PI$5 = Math.PI;\r\nfunction defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n}\n\nvar Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n}());\r\nfunction overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n}\r\nfunction stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n}\r\nfunction stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n}\r\nfunction stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n}\r\nfunction seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n}\r\nfunction seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n}\r\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\nfunction makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n}\r\nfunction seriesTaskCount(context) {\r\n return context.data.count();\r\n}\r\nfunction detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n}\r\nvar ecModelMock = {};\r\nvar apiMock = {};\r\nvar seriesType;\r\nmockMethods(ecModelMock, GlobalModel);\r\nmockMethods(apiMock, ExtensionAPI);\r\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n};\r\necModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n};\r\nfunction mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n}\n\nvar colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n];\r\nvar lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n};\n\nvar contrastColor = '#B9B8CE';\r\nvar backgroundColor = '#100C2A';\r\nvar axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n};\r\nvar colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n];\r\nvar theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n};\r\ntheme.categoryAxis.splitLine.show = false;\n\nvar DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(DatasetModel);\r\nvar DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n}(ComponentView));\r\nComponentView.registerClass(DatasetView);\n\nvar storage = createHashMap();\r\nvar mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n};\r\nvar parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n};\n\nvar ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n}());\n\nvar seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n};\r\nvar dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n};\n\nfunction getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\r\nfunction getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\r\nfunction setItemVisualFromData(data, dataIndex, key, value) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n style[data.getVisual('drawType')] = value;\r\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\r\n break;\r\n case 'opacity':\r\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\r\n break;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n data.setItemVisual(dataIndex, key, value);\r\n break;\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\n\nvar PI2$7 = Math.PI * 2;\r\nvar CMD$4 = PathProxy.CMD;\r\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n}\r\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$7 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$7;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$7;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$7 >= startAngle && angle + PI2$7 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n}\r\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\nvar tmpPt = [];\r\nfunction nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n}\r\nfunction nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$4.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$4.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$4.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$4.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n}\r\nvar pt0 = new Point();\r\nvar pt1 = new Point();\r\nvar pt2 = new Point();\r\nvar dir = new Point();\r\nvar dir2 = new Point();\r\nfunction updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n}\r\nvar tmpArr$1 = [];\r\nvar tmpProjPoint = new Point();\r\nfunction limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\nfunction limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n}\r\nfunction buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n}\r\nfunction setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n}\r\nfunction getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n}\n\nfunction prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n}\r\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n}\r\nfunction shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n}\r\nfunction shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n}\r\nfunction hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n}\n\nfunction cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n}\r\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n}\r\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\nvar dummyTransformable = new Transformable();\r\nvar labelLayoutInnerStore = makeInner();\r\nvar labelLineAnimationStore = makeInner();\r\nfunction extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n}\r\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\nvar LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n}());\n\nfunction createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n}\r\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n}\r\nfunction handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n}\n\nfunction createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n}\r\nfunction createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n}\r\nfunction getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n}\r\nfunction isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\nfunction normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n}\n\nvar pathProxyForDraw = new PathProxy(true);\r\nfunction styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n}\r\nfunction styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n}\r\nfunction doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n}\r\nfunction doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n}\r\nfunction createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n}\r\nfunction brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n}\r\nfunction brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n}\r\nfunction brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n}\r\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\nvar STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n];\r\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n}\r\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n}\r\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n}\r\nfunction setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n}\r\nfunction updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n}\r\nfunction isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar DRAW_TYPE_PATH = 1;\r\nvar DRAW_TYPE_IMAGE = 2;\r\nvar DRAW_TYPE_TEXT = 3;\r\nvar DRAW_TYPE_INCREMENTAL = 4;\r\nfunction canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n}\r\nfunction flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n}\r\nfunction getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n}\r\nfunction brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n}\r\nfunction brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n}\r\nfunction brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n}\n\nfunction returnFalse() {\r\n return false;\r\n}\r\nfunction createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n}\r\nvar Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n}(Eventful));\n\nvar HOVER_LAYER_ZLEVEL = 1e5;\r\nvar CANVAS_ZLEVEL = 314159;\r\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\r\nvar INCREMENTAL_INC = 0.001;\r\nfunction parseInt10(val) {\r\n return parseInt(val, 10);\r\n}\r\nfunction isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n}\r\nvar CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n}());\n\nregisterPainter('canvas', CanvasPainter);\n\nfunction findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n}\n\nvar wmUniqueIndex = Math.round(Math.random() * 9);\r\nvar WeakMap$1 = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n}());\n\nvar Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n});\r\nvar Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n});\r\nvar Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n});\r\nvar Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n});\r\nvar symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n};\r\nvar symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n};\r\nvar symbolBuildProxies = {};\r\neach(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n});\r\nvar SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n});\r\nfunction symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n}\r\nfunction createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n}\n\nvar decalMap = new WeakMap$1();\r\nvar decalCache = new LRU(100);\r\nvar decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n];\r\nfunction createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n}\r\nfunction normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\nfunction normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n}\r\nfunction getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n}\r\nfunction getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n}\n\nfunction decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n}\n\nvar assert$1 = assert;\r\nvar each$3 = each;\r\nvar isFunction$1 = isFunction;\r\nvar isObject$2 = isObject;\r\nvar version$1 = '5.0.0';\r\nvar dependencies = {\r\n zrender: '5.0.0'\r\n};\r\nvar TEST_FRAME_REMAIN_TIME = 1;\r\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\nvar PRIORITY_PROCESSOR_DATASTACK = 900;\r\nvar PRIORITY_PROCESSOR_FILTER = 1000;\r\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\r\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\r\nvar PRIORITY_VISUAL_LAYOUT = 1000;\r\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\nvar PRIORITY_VISUAL_GLOBAL = 2000;\r\nvar PRIORITY_VISUAL_CHART = 3000;\r\nvar PRIORITY_VISUAL_COMPONENT = 4000;\r\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\nvar PRIORITY_VISUAL_BRUSH = 5000;\r\nvar PRIORITY_VISUAL_ARIA = 6000;\r\nvar PRIORITY_VISUAL_DECAL = 7000;\r\nvar PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n};\r\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\nvar OPTION_UPDATED_KEY = '__optionUpdated';\r\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\nvar CONNECT_STATUS_PENDING = 0;\r\nvar CONNECT_STATUS_UPDATING = 1;\r\nvar CONNECT_STATUS_UPDATED = 2;\r\nfunction createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n}\r\nvar MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n}(Eventful));\r\nvar messageCenterProto = MessageCenter.prototype;\r\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\nvar prepare;\r\nvar prepareView;\r\nvar updateDirectly;\r\nvar updateMethods;\r\nvar doConvertPixel;\r\nvar updateStreamModes;\r\nvar doDispatchAction;\r\nvar flushPendingActions;\r\nvar triggerUpdatedEvent;\r\nvar bindRenderedEvent;\r\nvar bindMouseEvent;\r\nvar clearColorPalette;\r\nvar render;\r\nvar renderComponents;\r\nvar renderSeries;\r\nvar performPostUpdateFuncs;\r\nvar createExtensionAPI;\r\nvar enableConnect;\r\nvar setTransitionOpt;\r\nvar markStatusToUpdate;\r\nvar applyChangedStates;\r\nvar ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n}(Eventful));\r\nvar echartsProto = ECharts.prototype;\r\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\nechartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n};\r\nvar MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n];\r\nfunction disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n}\r\nvar actions = {};\r\nvar eventActionMap = {};\r\nvar dataProcessorFuncs = [];\r\nvar optionPreprocessorFuncs = [];\r\nvar postInitFuncs = [];\r\nvar postUpdateFuncs = [];\r\nvar visualFuncs = [];\r\nvar themeStorage = {};\r\nvar loadingEffects = {};\r\nvar instances$1 = {};\r\nvar connectedGroups = {};\r\nvar idBase = +(new Date()) - 0;\r\nvar groupIdBase = +(new Date()) - 0;\r\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\nfunction init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n}\r\nfunction connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n}\r\nfunction disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n}\r\nvar disconnect = disConnect;\r\nfunction dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n}\r\nfunction getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n}\r\nfunction getInstanceById(key) {\r\n return instances$1[key];\r\n}\r\nfunction registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n}\r\nfunction registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n}\r\nfunction registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n}\r\nfunction registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n}\r\nfunction registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n}\r\nfunction registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n}\r\nfunction registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n}\r\nfunction getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n}\r\nfunction registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n}\r\nfunction registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n}\r\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n}\r\nfunction registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n}\r\nfunction extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n}\r\nfunction extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n}\r\nfunction extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n}\r\nfunction extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n}\r\nfunction setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n}\r\nfunction registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n}\r\nfunction getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n}\r\nvar registerTransform = registerExternalTransform;\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\nregisterVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\nregisterPreprocessor(globalBackwardCompat);\r\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\nregisterLoading('default', defaultLoading);\r\nregisterAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n}, noop);\r\nregisterTheme('light', lightTheme);\r\nregisterTheme('dark', theme);\r\nvar dataTool = {};\n\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n}\r\nfunction defaultKeyGetter(item) {\r\n return item;\r\n}\r\nvar DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n}());\n\nfunction summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n}\r\nfunction getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n}\r\nfunction getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n}\r\nfunction mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n}\n\nvar DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n}());\n\nvar mathFloor = Math.floor;\r\nvar isObject$3 = isObject;\r\nvar map$1 = map;\r\nvar UNDEFINED = 'undefined';\r\nvar INDEX_NOT_FOUND = -1;\r\nvar ID_PREFIX = 'e\\0\\0';\r\nvar dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n};\r\nvar CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\nvar CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\nvar CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\nvar TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n];\r\nvar CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n];\r\nvar defaultDimValueGetters;\r\nvar prepareInvertedIndex;\r\nvar getIndicesCtor;\r\nvar prepareStorage;\r\nvar getRawIndexWithoutIndices;\r\nvar getRawIndexWithIndices;\r\nvar getId;\r\nvar getIdNameFromStore;\r\nvar makeIdFromName;\r\nvar normalizeDimensions;\r\nvar validateDimensions;\r\nvar cloneListForMapAndSample;\r\nvar getInitialExtent;\r\nvar setItemDataAndSeriesIndex;\r\nvar transferProperties;\r\nvar List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n}());\n\nfunction completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n}\r\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n}\r\nfunction genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n}\n\nfunction createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n}\n\nvar CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n}());\r\nfunction getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n}\r\nvar fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n};\r\nfunction isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n}\n\nfunction enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n}\r\nfunction isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n}\r\nfunction getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n}\n\nfunction createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n}\r\nfunction isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n}\r\nfunction firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n}\n\nvar Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n}());\r\nenableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n});\n\nvar OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n}());\r\nfunction getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n}\n\nvar roundNumber = round$1;\r\nfunction intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n}\r\nfunction getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n}\r\nfunction clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n}\r\nfunction fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n}\r\nfunction contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n}\r\nfunction normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n}\r\nfunction scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n}\n\nvar OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n}(Scale));\r\nScale.registerClass(OrdinalScale);\n\nvar roundNumber$1 = round$1;\r\nvar IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n}(Scale));\r\nScale.registerClass(IntervalScale);\n\nvar STACK_PREFIX = '__ec_stack_';\r\nvar LARGE_BAR_MIN_WIDTH = 0.5;\r\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\nfunction getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n}\r\nfunction getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n}\r\nfunction getLayoutOnAxis(opt) {\r\n var params = [];\r\n var baseAxis = opt.axis;\r\n var axisKey = 'axis0';\r\n if (baseAxis.type !== 'category') {\r\n return;\r\n }\r\n var bandWidth = baseAxis.getBandWidth();\r\n for (var i = 0; i < opt.count || 0; i++) {\r\n params.push(defaults({\r\n bandWidth: bandWidth,\r\n axisKey: axisKey,\r\n stackId: STACK_PREFIX + i\r\n }, opt));\r\n }\r\n var widthAndOffsets = doCalBarWidthAndOffset(params);\r\n var result = [];\r\n for (var i = 0; i < opt.count; i++) {\r\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\r\n item.offsetCenter = item.offset + item.width / 2;\r\n result.push(item);\r\n }\r\n return result;\r\n}\r\nfunction prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n}\r\nfunction getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n}\r\nfunction makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n}\r\nfunction doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n}\r\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n}\r\nfunction layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n}\r\nvar largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n};\r\nfunction isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n}\r\nfunction isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n}\r\nfunction getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n}\n\nvar bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n};\r\nvar TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n}(IntervalScale));\r\nvar scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n];\r\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n}\r\nfunction getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n}\r\nfunction getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n}\r\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n}\r\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n}\r\nScale.registerClass(TimeScale);\n\nvar scaleProto = Scale.prototype;\r\nvar intervalScaleProto = IntervalScale.prototype;\r\nvar getPrecisionSafe$1 = getPrecisionSafe;\r\nvar roundingErrorFix = round$1;\r\nvar mathFloor$1 = Math.floor;\r\nvar mathCeil = Math.ceil;\r\nvar mathPow$1 = Math.pow;\r\nvar mathLog = Math.log;\r\nvar LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n}(Scale));\r\nvar proto = LogScale.prototype;\r\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\nproto.getLabel = intervalScaleProto.getLabel;\r\nfunction fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n}\r\nScale.registerClass(LogScale);\n\nvar ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n}());\r\nvar DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\nvar DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\nfunction ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n}\r\nfunction parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n}\n\nfunction getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n}\r\nfunction adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n}\r\nfunction niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n}\r\nfunction createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n}\r\nfunction ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n}\r\nfunction makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n}\r\nfunction getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n}\r\nfunction estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n}\r\nfunction rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n}\r\nfunction getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n}\r\nfunction shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n}\r\nfunction getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n}\r\nfunction unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n}\n\nvar AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n}());\n\nfunction createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n}\r\nvar dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n};\r\nfunction createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n}\r\nfunction mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n}\n\nvar helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n});\n\nvar EPSILON$3 = 1e-8;\r\nfunction isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n}\r\nfunction contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n}\n\nvar Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n}());\n\nfunction decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n}\r\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n}\r\nfunction parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n}\n\nvar inner$4 = makeInner();\r\nfunction createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n}\r\nfunction createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n}\r\nfunction makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n}\r\nfunction makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n}\r\nfunction makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n}\r\nfunction makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n}\r\nfunction getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n}\r\nfunction listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n}\r\nfunction listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n}\r\nfunction makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n}\r\nfunction calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n}\r\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n}\r\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n}\r\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n}\n\nvar NORMALIZED_EXTENT = [0, 1];\r\nvar Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n}());\r\nfunction fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n}\r\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n}\n\nvar parseGeoJson = parseGeoJSON;\r\nvar number = {};\r\neach([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n], function (name) {\r\n number[name] = numberUtil[name];\r\n});\r\nvar format$1 = {};\r\neach([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n], function (name) {\r\n format$1[name] = formatUtil[name];\r\n});\r\nvar time = {\r\n parse: parseDate,\r\n format: format\r\n};\r\nvar ecUtil = {};\r\neach([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n});\r\nvar GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n];\r\nvar graphic$1 = {};\r\neach(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n});\n\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\r\n value: 'eq',\r\n '<': 'lt',\r\n '<=': 'lte',\r\n '>': 'gt',\r\n '>=': 'gte',\r\n '=': 'eq',\r\n '!=': 'ne',\r\n '<>': 'ne'\r\n};\r\nvar RegExpEvaluator = (function () {\r\n function RegExpEvaluator(rVal) {\r\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal)\r\n : isRegExp(rVal) ? rVal\r\n : null;\r\n if (condValue == null) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n RegExpEvaluator.prototype.evaluate = function (lVal) {\r\n var type = typeof lVal;\r\n return type === 'string' ? this._condVal.test(lVal)\r\n : type === 'number' ? this._condVal.test(lVal + '')\r\n : false;\r\n };\r\n return RegExpEvaluator;\r\n}());\r\nvar ConstConditionInternal = (function () {\r\n function ConstConditionInternal() {\r\n }\r\n ConstConditionInternal.prototype.evaluate = function () {\r\n return this.value;\r\n };\r\n return ConstConditionInternal;\r\n}());\r\nvar AndConditionInternal = (function () {\r\n function AndConditionInternal() {\r\n }\r\n AndConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (!children[i].evaluate()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return AndConditionInternal;\r\n}());\r\nvar OrConditionInternal = (function () {\r\n function OrConditionInternal() {\r\n }\r\n OrConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].evaluate()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return OrConditionInternal;\r\n}());\r\nvar NotConditionInternal = (function () {\r\n function NotConditionInternal() {\r\n }\r\n NotConditionInternal.prototype.evaluate = function () {\r\n return !this.child.evaluate();\r\n };\r\n return NotConditionInternal;\r\n}());\r\nvar RelationalConditionInternal = (function () {\r\n function RelationalConditionInternal() {\r\n }\r\n RelationalConditionInternal.prototype.evaluate = function () {\r\n var needParse = !!this.valueParser;\r\n var getValue = this.getValue;\r\n var tarValRaw = getValue(this.valueGetterParam);\r\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\r\n for (var i = 0; i < this.subCondList.length; i++) {\r\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return RelationalConditionInternal;\r\n}());\r\nfunction parseOption(exprOption, getters) {\r\n if (exprOption === true || exprOption === false) {\r\n var cond = new ConstConditionInternal();\r\n cond.value = exprOption;\r\n return cond;\r\n }\r\n var errMsg = '';\r\n if (!isObjectNotArray(exprOption)) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n if (exprOption.and) {\r\n return parseAndOrOption('and', exprOption, getters);\r\n }\r\n else if (exprOption.or) {\r\n return parseAndOrOption('or', exprOption, getters);\r\n }\r\n else if (exprOption.not) {\r\n return parseNotOption(exprOption, getters);\r\n }\r\n return parseRelationalOption(exprOption, getters);\r\n}\r\nfunction parseAndOrOption(op, exprOption, getters) {\r\n var subOptionArr = exprOption[op];\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isArray(subOptionArr)) {\r\n throwError(errMsg);\r\n }\r\n if (!subOptionArr.length) {\r\n throwError(errMsg);\r\n }\r\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\r\n cond.children = map(subOptionArr, function (subOption) { return parseOption(subOption, getters); });\r\n if (!cond.children.length) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\nfunction parseNotOption(exprOption, getters) {\r\n var subOption = exprOption.not;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isObjectNotArray(subOption)) {\r\n throwError(errMsg);\r\n }\r\n var cond = new NotConditionInternal();\r\n cond.child = parseOption(subOption, getters);\r\n if (!cond.child) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\nfunction parseRelationalOption(exprOption, getters) {\r\n var errMsg = '';\r\n var valueGetterParam = getters.prepareGetValue(exprOption);\r\n var subCondList = [];\r\n var exprKeys = keys(exprOption);\r\n var parserName = exprOption.parser;\r\n var valueParser = parserName ? getRawValueParser(parserName) : null;\r\n for (var i = 0; i < exprKeys.length; i++) {\r\n var keyRaw = exprKeys[i];\r\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\r\n continue;\r\n }\r\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw)\r\n ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw]\r\n : keyRaw;\r\n var condValueRaw = exprOption[keyRaw];\r\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\r\n var evaluator = createFilterComparator(op, condValueParsed)\r\n || (op === 'reg' && new RegExpEvaluator(condValueParsed));\r\n if (!evaluator) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n subCondList.push(evaluator);\r\n }\r\n if (!subCondList.length) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var cond = new RelationalConditionInternal();\r\n cond.valueGetterParam = valueGetterParam;\r\n cond.valueParser = valueParser;\r\n cond.getValue = getters.getValue;\r\n cond.subCondList = subCondList;\r\n return cond;\r\n}\r\nfunction isObjectNotArray(val) {\r\n return isObject(val) && !isArrayLike(val);\r\n}\r\nvar ConditionalExpressionParsed = (function () {\r\n function ConditionalExpressionParsed(exprOption, getters) {\r\n this._cond = parseOption(exprOption, getters);\r\n }\r\n ConditionalExpressionParsed.prototype.evaluate = function () {\r\n return this._cond.evaluate();\r\n };\r\n return ConditionalExpressionParsed;\r\n}());\r\nfunction parseConditionalExpression(exprOption, getters) {\r\n return new ConditionalExpressionParsed(exprOption, getters);\r\n}\n\nvar filterTransform = {\r\n type: 'echarts:filter',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var rawItem;\r\n var condition = parseConditionalExpression(params.config, {\r\n valueGetterAttrMap: createHashMap({ dimension: true }),\r\n prepareGetValue: function (exprOption) {\r\n var errMsg = '';\r\n var dimLoose = exprOption.dimension;\r\n if (!hasOwn(exprOption, 'dimension')) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n return { dimIdx: dimInfo.index };\r\n },\r\n getValue: function (param) {\r\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\r\n }\r\n });\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n rawItem = upstream.getRawDataItem(i);\r\n if (condition.evaluate()) {\r\n resultData.push(rawItem);\r\n }\r\n }\r\n return {\r\n data: resultData\r\n };\r\n }\r\n};\n\nvar sampleLog = '';\r\nif (__DEV__) {\r\n sampleLog = [\r\n 'Valid config is like:',\r\n '{ dimension: \"age\", order: \"asc\" }',\r\n 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'\r\n ].join(' ');\r\n}\r\nvar sortTransform = {\r\n type: 'echarts:sort',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var config = params.config;\r\n var errMsg = '';\r\n var orderExprList = normalizeToArray(config);\r\n if (!orderExprList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Empty `config` in sort transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var orderDefList = [];\r\n each(orderExprList, function (orderExpr) {\r\n var dimLoose = orderExpr.dimension;\r\n var order = orderExpr.order;\r\n var parserName = orderExpr.parser;\r\n var incomparable = orderExpr.incomparable;\r\n if (dimLoose == null) {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (incomparable && (incomparable !== 'min' && incomparable !== 'max')) {\r\n var errMsg_1 = '';\r\n if (__DEV__) {\r\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\r\n }\r\n throwError(errMsg_1);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n var errMsg_2 = '';\r\n if (__DEV__) {\r\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\r\n }\r\n throwError(errMsg_2);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n var parser = parserName ? getRawValueParser(parserName) : null;\r\n if (parserName && !parser) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n orderDefList.push({\r\n dimIdx: dimInfo.index,\r\n parser: parser,\r\n comparator: new SortOrderComparator(order, incomparable)\r\n });\r\n });\r\n var sourceFormat = upstream.sourceFormat;\r\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (__DEV__) {\r\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n resultData.push(upstream.getRawDataItem(i));\r\n }\r\n resultData.sort(function (item0, item1) {\r\n for (var i = 0; i < orderDefList.length; i++) {\r\n var orderDef = orderDefList[i];\r\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\r\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\r\n if (orderDef.parser) {\r\n val0 = orderDef.parser(val0);\r\n val1 = orderDef.parser(val1);\r\n }\r\n var result = orderDef.comparator.evaluate(val0, val1);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n return 0;\r\n });\r\n return {\r\n data: resultData\r\n };\r\n }\r\n};\n\nregisterTransform(filterTransform);\r\nregisterTransform(sortTransform);\n\nvar LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(LineSeriesModel);\n\nfunction getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n}\r\nfunction getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n}\n\nvar Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n}(Group));\r\nfunction driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n}\n\nfunction symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n}\r\nfunction normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n}\r\nfunction makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n}\r\nvar SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n}());\n\nfunction prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n}\r\nfunction getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n}\r\nfunction getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n}\n\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\r\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\nfunction createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n}\n\nfunction diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n}\r\nfunction lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n}\n\nvar mathMin$5 = Math.min;\r\nvar mathMax$5 = Math.max;\r\nfunction isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n}\r\nvar ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n}());\r\nvar ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n}(Path));\r\nvar ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n}(ECPolylineShape));\r\nvar ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n}(Path));\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n}\r\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n}\r\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n}\n\nfunction isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n}\n\nfunction isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n}\r\nfunction getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n}\r\nfunction getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n}\r\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n}\r\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n}\r\nfunction getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n}\r\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n}\r\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\nfunction getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n}\r\nfunction getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n}\r\nfunction getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n}\r\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n}\r\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n}\r\nvar LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n}(ChartView));\r\nChartView.registerClass(LineView);\n\nfunction pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n}\n\nvar samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n};\r\nvar indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n};\r\nfunction dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\n\nvar defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n};\r\nvar categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n}, defaultOption);\r\nvar valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n}, defaultOption);\r\nvar timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n}, valueAxis);\r\nvar logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n}, valueAxis);\r\nvar axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n};\n\nvar AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\nfunction axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n}\r\nfunction getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n}\n\nvar CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n}(ComponentModel));\r\nmixin(CartesianAxisModel, AxisModelCommonMixin);\r\nvar extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n};\r\naxisModelCreator('x', CartesianAxisModel, extraOption);\r\naxisModelCreator('y', CartesianAxisModel, extraOption);\n\nvar PI$6 = Math.PI;\r\nvar AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n}());\r\nvar builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n};\r\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n}\r\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n}\r\nfunction ignoreEl(el) {\r\n el && (el.ignore = true);\r\n}\r\nfunction isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n}\r\nfunction isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n}\r\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n}\r\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n}\r\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n}\r\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n}\n\nfunction collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n}\r\nfunction collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n}\r\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n}\r\nfunction collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n}\r\nfunction getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n}\r\nfunction checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n}\r\nfunction fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n}\r\nfunction getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n}\r\nfunction getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n}\r\nfunction isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n}\r\nfunction makeKey(model) {\r\n return model.type + '||' + model.id;\r\n}\n\nvar axisPointerClazz = {};\r\nvar AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n}(ComponentView));\n\nfunction layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n}\r\nfunction isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n}\r\nfunction findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n}\n\nvar inner$5 = makeInner();\r\nfunction rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n}\r\nfunction rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n}\n\nvar axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n];\r\nvar CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n};\r\nvar CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n}(CartesianAxisView));\r\nvar CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n}(CartesianAxisView));\r\nComponentView.registerClass(CartesianXAxisView);\r\nComponentView.registerClass(CartesianYAxisView);\n\nregisterProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n});\r\nfunction prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n}\r\nfunction calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n}\r\nfunction shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n}\r\nfunction prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n}\r\nfunction initExtent() {\r\n return [Infinity, -Infinity];\r\n}\r\nfunction unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n}\n\nvar GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n}(ComponentModel));\n\nvar GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n}(ComponentView));\r\nComponentView.registerClass(GridView);\r\nComponentModel.registerClass(GridModel);\r\nregisterPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n});\n\nregisterLayout(pointsLayout('line', true));\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\nvar Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n}());\n\nvar cartesian2DDimensions = ['x', 'y'];\r\nfunction canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n}\r\nvar Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n}(Cartesian));\n\nvar Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n}(Axis));\n\nvar Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n}());\r\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n}\r\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n}\r\nfunction canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n}\r\nfunction updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n}\r\nCoordinateSystemManager.register('cartesian2d', Grid);\n\nvar BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(BaseBarSeriesModel);\n\nvar BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n}(BaseBarSeriesModel));\r\nSeriesModel.registerClass(BarSeriesModel);\n\nvar SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n}());\r\nvar SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n}(Path));\n\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\nvar BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\nvar _eventPos = [0, 0];\r\nvar mathMax$6 = Math.max;\r\nvar mathMin$6 = Math.min;\r\nfunction getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n}\r\nvar BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n}(ChartView));\r\nvar clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n};\r\nvar elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n};\r\nfunction updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n}\r\nvar getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n};\r\nfunction isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n}\r\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n}\r\nfunction getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n}\r\nvar LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n}());\r\nvar LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n}(Path));\r\nfunction createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n}\r\nvar largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n}, 30, false);\r\nfunction largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n}\r\nfunction setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n}\r\nfunction setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n}\r\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n}\r\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n}\r\nChartView.registerClass(BarView);\n\nregisterAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n});\n\nregisterLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\nregisterLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\nregisterVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n});\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\nfunction createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n}\n\nvar LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n}());\n\nvar PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(PieSeriesModel);\n\nvar RADIAN = Math.PI / 180;\r\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n}\r\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n}\r\nfunction isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n}\r\nfunction pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n}\n\nfunction getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n}\n\nvar PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n}(Sector));\r\nvar PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n}(ChartView));\r\nChartView.registerClass(PieView);\n\nvar PI2$8 = Math.PI * 2;\r\nvar RADIAN$1 = Math.PI / 180;\r\nfunction getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$8;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$8 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$8 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$8 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n}\n\nfunction dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n}\n\ncreateLegacyDataSelectAction('pie', registerAction);\r\nregisterLayout(curry(pieLayout, 'pie'));\r\nregisterProcessor(dataFilter('pie'));\n\nvar ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ScatterSeriesModel);\n\nvar BOOST_SIZE_THRESHOLD = 4;\r\nvar LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n}());\r\nvar LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n}(Path));\r\nvar LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n}());\n\nvar ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n}(ChartView));\r\nChartView.registerClass(ScatterView);\n\nregisterLayout(pointsLayout('scatter'));\n\nvar IndicatorAxis = (function (_super) {\r\n __extends(IndicatorAxis, _super);\r\n function IndicatorAxis(dim, scale, radiusExtent) {\r\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\r\n _this.type = 'value';\r\n _this.angle = 0;\r\n _this.name = '';\r\n return _this;\r\n }\r\n return IndicatorAxis;\r\n}(Axis));\n\nvar Radar = (function () {\r\n function Radar(radarModel, ecModel, api) {\r\n this.dimensions = [];\r\n this._model = radarModel;\r\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\r\n var dim = 'indicator_' + idx;\r\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());\r\n indicatorAxis.name = indicatorModel.get('name');\r\n indicatorAxis.model = indicatorModel;\r\n indicatorModel.axis = indicatorAxis;\r\n this.dimensions.push(dim);\r\n return indicatorAxis;\r\n }, this);\r\n this.resize(radarModel, api);\r\n }\r\n Radar.prototype.getIndicatorAxes = function () {\r\n return this._indicatorAxes;\r\n };\r\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\r\n };\r\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n var angle = indicatorAxis.angle;\r\n var x = this.cx + coord * Math.cos(angle);\r\n var y = this.cy - coord * Math.sin(angle);\r\n return [x, y];\r\n };\r\n Radar.prototype.pointToData = function (pt) {\r\n var dx = pt[0] - this.cx;\r\n var dy = pt[1] - this.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx);\r\n var minRadianDiff = Infinity;\r\n var closestAxis;\r\n var closestAxisIdx = -1;\r\n for (var i = 0; i < this._indicatorAxes.length; i++) {\r\n var indicatorAxis = this._indicatorAxes[i];\r\n var diff = Math.abs(radian - indicatorAxis.angle);\r\n if (diff < minRadianDiff) {\r\n closestAxis = indicatorAxis;\r\n closestAxisIdx = i;\r\n minRadianDiff = diff;\r\n }\r\n }\r\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\r\n };\r\n Radar.prototype.resize = function (radarModel, api) {\r\n var center = radarModel.get('center');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\r\n this.cx = parsePercent$2(center[0], viewWidth);\r\n this.cy = parsePercent$2(center[1], viewHeight);\r\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\r\n var radius = radarModel.get('radius');\r\n if (typeof radius === 'string' || typeof radius === 'number') {\r\n radius = [0, radius];\r\n }\r\n this.r0 = parsePercent$2(radius[0], viewSize);\r\n this.r = parsePercent$2(radius[1], viewSize);\r\n each(this._indicatorAxes, function (indicatorAxis, idx) {\r\n indicatorAxis.setExtent(this.r0, this.r);\r\n var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);\r\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\r\n indicatorAxis.angle = angle;\r\n }, this);\r\n };\r\n Radar.prototype.update = function (ecModel, api) {\r\n var indicatorAxes = this._indicatorAxes;\r\n var radarModel = this._model;\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\r\n if (radarSeries.get('coordinateSystem') !== 'radar'\r\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\r\n return;\r\n }\r\n var data = radarSeries.getData();\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\r\n });\r\n }, this);\r\n var splitNumber = radarModel.get('splitNumber');\r\n function increaseInterval(interval) {\r\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10));\r\n var f = interval / exp10;\r\n if (f === 2) {\r\n f = 5;\r\n }\r\n else {\r\n f *= 2;\r\n }\r\n return f * exp10;\r\n }\r\n each(indicatorAxes, function (indicatorAxis, idx) {\r\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\r\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\r\n var axisModel = indicatorAxis.model;\r\n var scale = indicatorAxis.scale;\r\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\r\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\r\n var interval = scale.getInterval();\r\n if (fixedMin != null && fixedMax != null) {\r\n scale.setExtent(+fixedMin, +fixedMax);\r\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\r\n }\r\n else if (fixedMin != null) {\r\n var max = void 0;\r\n do {\r\n max = fixedMin + interval * splitNumber;\r\n scale.setExtent(+fixedMin, max);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\r\n }\r\n else if (fixedMax != null) {\r\n var min = void 0;\r\n do {\r\n min = fixedMax - interval * splitNumber;\r\n scale.setExtent(min, +fixedMax);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\r\n }\r\n else {\r\n var nicedSplitNumber = scale.getTicks().length - 1;\r\n if (nicedSplitNumber > splitNumber) {\r\n interval = increaseInterval(interval);\r\n }\r\n var max = Math.ceil(rawExtent[1] / interval) * interval;\r\n var min = round$1(max - interval * splitNumber);\r\n scale.setExtent(min, max);\r\n scale.setInterval(interval);\r\n }\r\n });\r\n };\r\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Radar.create = function (ecModel, api) {\r\n var radarList = [];\r\n ecModel.eachComponent('radar', function (radarModel) {\r\n var radar = new Radar(radarModel, ecModel, api);\r\n radarList.push(radar);\r\n radarModel.coordinateSystem = radar;\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries) {\r\n if (radarSeries.get('coordinateSystem') === 'radar') {\r\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\r\n }\r\n });\r\n return radarList;\r\n };\r\n Radar.dimensions = [];\r\n return Radar;\r\n}());\r\nCoordinateSystemManager.register('radar', Radar);\n\nvar valueAxisDefault = axisDefault.value;\r\nfunction defaultsShow(opt, show) {\r\n return defaults({\r\n show: show\r\n }, opt);\r\n}\r\nvar RadarModel = (function (_super) {\r\n __extends(RadarModel, _super);\r\n function RadarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarModel.type;\r\n return _this;\r\n }\r\n RadarModel.prototype.optionUpdated = function () {\r\n var boundaryGap = this.get('boundaryGap');\r\n var splitNumber = this.get('splitNumber');\r\n var scale = this.get('scale');\r\n var axisLine = this.get('axisLine');\r\n var axisTick = this.get('axisTick');\r\n var axisLabel = this.get('axisLabel');\r\n var nameTextStyle = this.get('axisName');\r\n var showName = this.get(['axisName', 'show']);\r\n var nameFormatter = this.get(['axisName', 'formatter']);\r\n var nameGap = this.get('axisNameGap');\r\n var triggerEvent = this.get('triggerEvent');\r\n var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) {\r\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\r\n indicatorOpt.min = 0;\r\n }\r\n else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\r\n indicatorOpt.max = 0;\r\n }\r\n var iNameTextStyle = nameTextStyle;\r\n if (indicatorOpt.color != null) {\r\n iNameTextStyle = defaults({\r\n color: indicatorOpt.color\r\n }, nameTextStyle);\r\n }\r\n var innerIndicatorOpt = merge(clone(indicatorOpt), {\r\n boundaryGap: boundaryGap,\r\n splitNumber: splitNumber,\r\n scale: scale,\r\n axisLine: axisLine,\r\n axisTick: axisTick,\r\n axisLabel: axisLabel,\r\n name: indicatorOpt.text,\r\n nameLocation: 'end',\r\n nameGap: nameGap,\r\n nameTextStyle: iNameTextStyle,\r\n triggerEvent: triggerEvent\r\n }, false);\r\n if (!showName) {\r\n innerIndicatorOpt.name = '';\r\n }\r\n if (typeof nameFormatter === 'string') {\r\n var indName = innerIndicatorOpt.name;\r\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\r\n }\r\n else if (typeof nameFormatter === 'function') {\r\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\r\n }\r\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\r\n mixin(model, AxisModelCommonMixin.prototype);\r\n model.mainType = 'radar';\r\n model.componentIndex = this.componentIndex;\r\n return model;\r\n }, this);\r\n this._indicatorModels = indicatorModels;\r\n };\r\n RadarModel.prototype.getIndicatorModels = function () {\r\n return this._indicatorModels;\r\n };\r\n RadarModel.type = 'radar';\r\n RadarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '75%',\r\n startAngle: 90,\r\n axisName: {\r\n show: true\r\n },\r\n boundaryGap: [0, 0],\r\n splitNumber: 5,\r\n axisNameGap: 15,\r\n scale: false,\r\n shape: 'polygon',\r\n axisLine: merge({\r\n lineStyle: {\r\n color: '#bbb'\r\n }\r\n }, valueAxisDefault.axisLine),\r\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\r\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\r\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\r\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\r\n indicator: []\r\n };\r\n return RadarModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(RadarModel);\n\nvar axisBuilderAttrs$1 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar RadarView = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (radarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n this._buildAxes(radarModel);\r\n this._buildSplitLineAndArea(radarModel);\r\n };\r\n RadarView.prototype._buildAxes = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n var axisBuilders = map(indicatorAxes, function (indicatorAxis) {\r\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\r\n position: [radar.cx, radar.cy],\r\n rotation: indicatorAxis.angle,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1\r\n });\r\n return axisBuilder;\r\n });\r\n each(axisBuilders, function (axisBuilder) {\r\n each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder);\r\n this.group.add(axisBuilder.getGroup());\r\n }, this);\r\n };\r\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n if (!indicatorAxes.length) {\r\n return;\r\n }\r\n var shape = radarModel.get('shape');\r\n var splitLineModel = radarModel.getModel('splitLine');\r\n var splitAreaModel = radarModel.getModel('splitArea');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var showSplitLine = splitLineModel.get('show');\r\n var showSplitArea = splitAreaModel.get('show');\r\n var splitLineColors = lineStyleModel.get('color');\r\n var splitAreaColors = areaStyleModel.get('color');\r\n var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors];\r\n var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\r\n var splitLines = [];\r\n var splitAreas = [];\r\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\r\n var colorIndex = idx % areaOrLineColorList.length;\r\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\r\n return colorIndex;\r\n }\r\n if (shape === 'circle') {\r\n var ticksRadius = indicatorAxes[0].getTicksCoords();\r\n var cx = radar.cx;\r\n var cy = radar.cy;\r\n for (var i = 0; i < ticksRadius.length; i++) {\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r: ticksRadius[i].coord\r\n }\r\n }));\r\n }\r\n if (showSplitArea && i < ticksRadius.length - 1) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\r\n splitAreas[colorIndex].push(new Ring({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r0: ticksRadius[i].coord,\r\n r: ticksRadius[i + 1].coord\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n else {\r\n var realSplitNumber_1;\r\n var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) {\r\n var ticksCoords = indicatorAxis.getTicksCoords();\r\n realSplitNumber_1 = realSplitNumber_1 == null\r\n ? ticksCoords.length - 1\r\n : Math.min(ticksCoords.length - 1, realSplitNumber_1);\r\n return map(ticksCoords, function (tickCoord) {\r\n return radar.coordToPoint(tickCoord.coord, idx);\r\n });\r\n });\r\n var prevPoints = [];\r\n for (var i = 0; i <= realSplitNumber_1; i++) {\r\n var points = [];\r\n for (var j = 0; j < indicatorAxes.length; j++) {\r\n points.push(axesTicksPoints[j][i]);\r\n }\r\n if (points[0]) {\r\n points.push(points[0].slice());\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.error('Can\\'t draw value axis ' + i);\r\n }\r\n }\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n }\r\n if (showSplitArea && prevPoints) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\r\n splitAreas[colorIndex].push(new Polygon({\r\n shape: {\r\n points: points.concat(prevPoints)\r\n }\r\n }));\r\n }\r\n prevPoints = points.slice().reverse();\r\n }\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n each(splitAreas, function (splitAreas, idx) {\r\n this.group.add(mergePath$1(splitAreas, {\r\n style: defaults({\r\n stroke: 'none',\r\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\r\n }, areaStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n each(splitLines, function (splitLines, idx) {\r\n this.group.add(mergePath$1(splitLines, {\r\n style: defaults({\r\n fill: 'none',\r\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n}(ComponentView));\r\nComponentView.registerClass(RadarView);\n\nvar RadarSeriesModel = (function (_super) {\r\n __extends(RadarSeriesModel, _super);\r\n function RadarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n RadarSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n generateCoord: 'indicator_',\r\n generateCoordCount: Infinity\r\n });\r\n };\r\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n var name = this.getData().getName(dataIndex);\r\n var nameToDisplay = name === '' ? this.name : name;\r\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: nameToDisplay,\r\n sortBlocks: true,\r\n blocks: map(indicatorAxes, function (axis) {\r\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\r\n return createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: markerColor,\r\n name: axis.name,\r\n value: val,\r\n sortParam: val\r\n });\r\n })\r\n });\r\n };\r\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var data_1 = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var values = data_1.getValues(map(coordSys.dimensions, function (dim) {\r\n return data_1.mapDimension(dim);\r\n }), dataIndex);\r\n for (var i = 0, len = values.length; i < len; i++) {\r\n if (!isNaN(values[i])) {\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\r\n }\r\n }\r\n }\r\n };\r\n RadarSeriesModel.type = 'series.radar';\r\n RadarSeriesModel.dependencies = ['radar'];\r\n RadarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'radar',\r\n legendHoverLink: true,\r\n radarIndex: 0,\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n label: {\r\n position: 'top'\r\n },\r\n symbol: 'emptyCircle',\r\n symbolSize: 4\r\n };\r\n return RadarSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(RadarSeriesModel);\n\nfunction normalizeSymbolSize(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n}\r\nvar RadarView$1 = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var polar = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n function createSymbol$1(data, idx) {\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n if (symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2);\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\r\n symbolPath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 100,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2,\r\n rotation: symbolRotate * Math.PI / 180 || 0\r\n });\r\n return symbolPath;\r\n }\r\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\r\n symbolGroup.removeAll();\r\n for (var i = 0; i < newPoints.length - 1; i++) {\r\n var symbolPath = createSymbol$1(data, idx);\r\n if (symbolPath) {\r\n symbolPath.__dimIdx = i;\r\n if (oldPoints[i]) {\r\n symbolPath.setPosition(oldPoints[i]);\r\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\r\n x: newPoints[i][0],\r\n y: newPoints[i][1]\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n symbolPath.setPosition(newPoints[i]);\r\n }\r\n symbolGroup.add(symbolPath);\r\n }\r\n }\r\n }\r\n function getInitialPoints(points) {\r\n return map(points, function (pt) {\r\n return [polar.cx, polar.cy];\r\n });\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var points = data.getItemLayout(idx);\r\n if (!points) {\r\n return;\r\n }\r\n var polygon = new Polygon();\r\n var polyline = new Polyline();\r\n var target = {\r\n shape: {\r\n points: points\r\n }\r\n };\r\n polygon.shape.points = getInitialPoints(points);\r\n polyline.shape.points = getInitialPoints(points);\r\n initProps(polygon, target, seriesModel, idx);\r\n initProps(polyline, target, seriesModel, idx);\r\n var itemGroup = new Group();\r\n var symbolGroup = new Group();\r\n itemGroup.add(polyline);\r\n itemGroup.add(polygon);\r\n itemGroup.add(symbolGroup);\r\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\r\n data.setItemGraphicEl(idx, itemGroup);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var target = {\r\n shape: {\r\n points: data.getItemLayout(newIdx)\r\n }\r\n };\r\n if (!target.shape.points) {\r\n return;\r\n }\r\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\r\n updateProps(polyline, target, seriesModel);\r\n updateProps(polygon, target, seriesModel);\r\n data.setItemGraphicEl(newIdx, itemGroup);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n data.eachItemGraphicEl(function (itemGroup, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var itemStyle = data.getItemVisual(idx, 'style');\r\n var color = itemStyle.fill;\r\n group.add(itemGroup);\r\n polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), {\r\n fill: 'none',\r\n stroke: color\r\n }));\r\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\r\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\r\n var areaStyleModel = itemModel.getModel('areaStyle');\r\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\r\n polygon.ignore = polygonIgnore;\r\n each(['emphasis', 'select', 'blur'], function (stateName) {\r\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\r\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\r\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\r\n });\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: color,\r\n opacity: 0.7,\r\n decal: itemStyle.decal\r\n }));\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n symbolGroup.eachChild(function (symbolPath) {\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, itemStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(itemStyle);\r\n symbolPath.setColor(color);\r\n }\r\n var pathEmphasisState = symbolPath.ensureState('emphasis');\r\n pathEmphasisState.style = clone(itemHoverStyle);\r\n var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);\r\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\r\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n labelDimIndex: symbolPath.__dimIdx,\r\n defaultText: defaultText,\r\n inheritColor: color,\r\n defaultOpacity: itemStyle.opacity\r\n });\r\n });\r\n enableHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n });\r\n this._data = data;\r\n };\r\n RadarView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n}(ChartView));\r\nChartView.registerClass(RadarView$1);\n\nfunction radarLayout(ecModel) {\r\n ecModel.eachSeriesByType('radar', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var axes = coordSys.getIndicatorAxes();\r\n each(axes, function (axis, axisIndex) {\r\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\r\n points[dataIndex] = points[dataIndex] || [];\r\n var point = coordSys.dataToPoint(val, axisIndex);\r\n points[dataIndex][axisIndex] = isValidPoint(point)\r\n ? point : getValueMissingPoint(coordSys);\r\n });\r\n });\r\n data.each(function (idx) {\r\n var firstPoint = find(points[idx], function (point) {\r\n return isValidPoint(point);\r\n }) || getValueMissingPoint(coordSys);\r\n points[idx].push(firstPoint.slice());\r\n data.setItemLayout(idx, points[idx]);\r\n });\r\n });\r\n}\r\nfunction isValidPoint(point) {\r\n return !isNaN(point[0]) && !isNaN(point[1]);\r\n}\r\nfunction getValueMissingPoint(coordSys) {\r\n return [coordSys.cx, coordSys.cy];\r\n}\n\nfunction radarBackwardCompat(option) {\r\n var polarOptArr = option.polar;\r\n if (polarOptArr) {\r\n if (!isArray(polarOptArr)) {\r\n polarOptArr = [polarOptArr];\r\n }\r\n var polarNotRadar_1 = [];\r\n each(polarOptArr, function (polarOpt, idx) {\r\n if (polarOpt.indicator) {\r\n if (polarOpt.type && !polarOpt.shape) {\r\n polarOpt.shape = polarOpt.type;\r\n }\r\n option.radar = option.radar || [];\r\n if (!isArray(option.radar)) {\r\n option.radar = [option.radar];\r\n }\r\n option.radar.push(polarOpt);\r\n }\r\n else {\r\n polarNotRadar_1.push(polarOpt);\r\n }\r\n });\r\n option.polar = polarNotRadar_1;\r\n }\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\r\n seriesOpt.radarIndex = seriesOpt.polarIndex;\r\n }\r\n });\r\n}\n\nregisterLayout(radarLayout);\r\nregisterProcessor(dataFilter('radar'));\r\nregisterPreprocessor(radarBackwardCompat);\n\nvar geoCoord = [126, 25];\r\nvar points$1 = [\r\n [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7],\r\n [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]],\r\n [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]],\r\n [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]],\r\n [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]],\r\n [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]],\r\n [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]],\r\n [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]],\r\n [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]],\r\n [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]],\r\n [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]],\r\n [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]],\r\n [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4],\r\n [1, 92.4], [1, 3.5], [0, 3.5]]\r\n];\r\nfor (var i = 0; i < points$1.length; i++) {\r\n for (var k = 0; k < points$1[i].length; k++) {\r\n points$1[i][k][0] /= 10.5;\r\n points$1[i][k][1] /= -10.5 / 0.75;\r\n points$1[i][k][0] += geoCoord[0];\r\n points$1[i][k][1] += geoCoord[1];\r\n }\r\n}\r\nfunction fixNanhai(mapType, regions) {\r\n if (mapType === 'china') {\r\n regions.push(new Region('南海诸岛', map(points$1, function (exterior) {\r\n return {\r\n type: 'polygon',\r\n exterior: exterior\r\n };\r\n }), geoCoord));\r\n }\r\n}\n\nvar coordsOffsetMap = {\r\n '南海诸岛': [32, 80],\r\n '广东': [0, -10],\r\n '香港': [10, 5],\r\n '澳门': [-10, 10],\r\n '天津': [5, 5]\r\n};\r\nfunction fixTextCoords(mapType, region) {\r\n if (mapType === 'china') {\r\n var coordFix = coordsOffsetMap[region.name];\r\n if (coordFix) {\r\n var cp = region.center;\r\n cp[0] += coordFix[0] / 10.5;\r\n cp[1] += -coordFix[1] / (10.5 / 0.75);\r\n }\r\n }\r\n}\n\nvar geoCoordMap = {\r\n 'Russia': [100, 60],\r\n 'United States': [-99, 38],\r\n 'United States of America': [-99, 38]\r\n};\r\nfunction fixGeoCoords(mapType, region) {\r\n if (mapType === 'world') {\r\n var geoCoord = geoCoordMap[region.name];\r\n if (geoCoord) {\r\n var cp = region.center;\r\n cp[0] = geoCoord[0];\r\n cp[1] = geoCoord[1];\r\n }\r\n }\r\n}\n\nvar points$2 = [\r\n [\r\n [123.45165252685547, 25.73527164402261],\r\n [123.49731445312499, 25.73527164402261],\r\n [123.49731445312499, 25.750734064600884],\r\n [123.45165252685547, 25.750734064600884],\r\n [123.45165252685547, 25.73527164402261]\r\n ]\r\n];\r\nfunction fixDiaoyuIsland(mapType, region) {\r\n if (mapType === 'china' && region.name === '台湾') {\r\n region.geometries.push({\r\n type: 'polygon',\r\n exterior: points$2[0]\r\n });\r\n }\r\n}\n\nvar inner$6 = makeInner();\r\nvar geoJSONLoader = {\r\n load: function (mapName, mapRecord, nameProperty) {\r\n var parsed = inner$6(mapRecord).parsed;\r\n if (parsed) {\r\n return parsed;\r\n }\r\n var specialAreas = mapRecord.specialAreas || {};\r\n var geoJSON = mapRecord.geoJSON;\r\n var regions;\r\n try {\r\n regions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];\r\n }\r\n catch (e) {\r\n throw new Error('Invalid geoJson format\\n' + e.message);\r\n }\r\n fixNanhai(mapName, regions);\r\n each(regions, function (region) {\r\n var regionName = region.name;\r\n fixTextCoords(mapName, region);\r\n fixGeoCoords(mapName, region);\r\n fixDiaoyuIsland(mapName, region);\r\n var specialArea = specialAreas[regionName];\r\n if (specialArea) {\r\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\r\n }\r\n });\r\n return (inner$6(mapRecord).parsed = {\r\n regions: regions,\r\n boundingRect: getBoundingRect$1(regions)\r\n });\r\n }\r\n};\r\nfunction getBoundingRect$1(regions) {\r\n var rect;\r\n for (var i = 0; i < regions.length; i++) {\r\n var regionRect = regions[i].getBoundingRect();\r\n rect = rect || regionRect.clone();\r\n rect.union(regionRect);\r\n }\r\n return rect;\r\n}\n\nvar inner$7 = makeInner();\r\nvar geoSVGLoader = {\r\n load: function (mapName, mapRecord) {\r\n var originRoot = inner$7(mapRecord).originRoot;\r\n if (originRoot) {\r\n return {\r\n root: originRoot,\r\n boundingRect: inner$7(mapRecord).boundingRect\r\n };\r\n }\r\n var graphic = buildGraphic(mapRecord);\r\n inner$7(mapRecord).originRoot = graphic.root;\r\n inner$7(mapRecord).boundingRect = graphic.boundingRect;\r\n return graphic;\r\n },\r\n makeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap || (field.rootMap = createHashMap());\r\n var root = rootMap.get(hostKey);\r\n if (root) {\r\n return root;\r\n }\r\n var originRoot = field.originRoot;\r\n var boundingRect = field.boundingRect;\r\n if (!field.originRootHostKey) {\r\n field.originRootHostKey = hostKey;\r\n root = originRoot;\r\n }\r\n else {\r\n root = buildGraphic(mapRecord, boundingRect).root;\r\n }\r\n return rootMap.set(hostKey, root);\r\n },\r\n removeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap;\r\n rootMap && rootMap.removeKey(hostKey);\r\n if (hostKey === field.originRootHostKey) {\r\n field.originRootHostKey = null;\r\n }\r\n }\r\n};\r\nfunction buildGraphic(mapRecord, boundingRect) {\r\n var svgXML = mapRecord.svgXML;\r\n var result;\r\n var root;\r\n try {\r\n result = svgXML && parseSVG(svgXML, {\r\n ignoreViewBox: true,\r\n ignoreRootClip: true\r\n }) || {};\r\n root = result.root;\r\n assert(root != null);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid svg format\\n' + e.message);\r\n }\r\n var svgWidth = result.width;\r\n var svgHeight = result.height;\r\n var viewBoxRect = result.viewBoxRect;\r\n if (!boundingRect) {\r\n boundingRect = (svgWidth == null || svgHeight == null)\r\n ? root.getBoundingRect()\r\n : new BoundingRect(0, 0, 0, 0);\r\n if (svgWidth != null) {\r\n boundingRect.width = svgWidth;\r\n }\r\n if (svgHeight != null) {\r\n boundingRect.height = svgHeight;\r\n }\r\n }\r\n if (viewBoxRect) {\r\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height);\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n root.setClipPath(new Rect({\r\n shape: boundingRect.plain()\r\n }));\r\n return {\r\n root: root,\r\n boundingRect: boundingRect\r\n };\r\n}\n\nvar loaders = {\r\n geoJSON: geoJSONLoader,\r\n svg: geoSVGLoader\r\n};\r\nvar geoSourceManager = {\r\n load: function (mapName, nameMap, nameProperty) {\r\n var regions = [];\r\n var regionsMap = createHashMap();\r\n var nameCoordMap = createHashMap();\r\n var boundingRect;\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var singleSource = loaders[record.type].load(mapName, record, nameProperty);\r\n each(singleSource.regions, function (region) {\r\n var regionName = region.name;\r\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\r\n region = region.cloneShallow(regionName = nameMap[regionName]);\r\n }\r\n regions.push(region);\r\n regionsMap.set(regionName, region);\r\n nameCoordMap.set(regionName, region.center);\r\n });\r\n var rect = singleSource.boundingRect;\r\n if (rect) {\r\n boundingRect\r\n ? boundingRect.union(rect)\r\n : (boundingRect = rect.clone());\r\n }\r\n });\r\n return {\r\n regions: regions,\r\n regionsMap: regionsMap,\r\n nameCoordMap: nameCoordMap,\r\n boundingRect: boundingRect || new BoundingRect(0, 0, 0, 0)\r\n };\r\n },\r\n makeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n var results = [];\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && results.push(method(mapName, record, hostKey));\r\n });\r\n return results;\r\n },\r\n removeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && method(mapName, record, hostKey);\r\n });\r\n }\r\n};\r\nfunction mapNotExistsError(mapName) {\r\n if (__DEV__) {\r\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\r\n }\r\n}\r\nfunction retrieveMap(mapName) {\r\n var mapRecords = mapDataStorage.retrieveMap(mapName) || [];\r\n if (__DEV__) {\r\n if (!mapRecords.length) {\r\n mapNotExistsError(mapName);\r\n }\r\n }\r\n return mapRecords;\r\n}\n\nvar MapSeries = (function (_super) {\r\n __extends(MapSeries, _super);\r\n function MapSeries() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapSeries.type;\r\n _this.needsDrawMap = false;\r\n _this.seriesGroup = [];\r\n _this.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var name_1 = this.getData().getName(dataIndex);\r\n var geo = this.coordinateSystem;\r\n var region = geo.getRegion(name_1);\r\n return region && geo.dataToPoint(region.center);\r\n }\r\n };\r\n return _this;\r\n }\r\n MapSeries.prototype.getInitialData = function (option) {\r\n var data = createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n var dataNameMap = createHashMap();\r\n var toAppendNames = [];\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n var name_2 = data.getName(i);\r\n dataNameMap.set(name_2, true);\r\n }\r\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\r\n each(geoSource.regions, function (region) {\r\n var name = region.name;\r\n if (!dataNameMap.get(name)) {\r\n toAppendNames.push(name);\r\n }\r\n });\r\n data.appendValues([], toAppendNames);\r\n return data;\r\n };\r\n MapSeries.prototype.getHostGeoModel = function () {\r\n var geoIndex = this.option.geoIndex;\r\n return geoIndex != null\r\n ? this.ecModel.getComponent('geo', geoIndex)\r\n : null;\r\n };\r\n MapSeries.prototype.getMapType = function () {\r\n return (this.getHostGeoModel() || this).option.map;\r\n };\r\n MapSeries.prototype.getRawValue = function (dataIndex) {\r\n var data = this.getData();\r\n return data.get(data.mapDimension('value'), dataIndex);\r\n };\r\n MapSeries.prototype.getRegionModel = function (regionName) {\r\n var data = this.getData();\r\n return data.getItemModel(data.indexOfName(regionName));\r\n };\r\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var seriesGroup = this.seriesGroup;\r\n var seriesNames = [];\r\n for (var i = 0; i < seriesGroup.length; i++) {\r\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\r\n var valueDim = data.mapDimension('value');\r\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\r\n seriesNames.push(seriesGroup[i].name);\r\n }\r\n }\r\n return createTooltipMarkup('section', {\r\n header: seriesNames.join(', '),\r\n noHeader: !seriesNames.length,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: name, value: value\r\n })]\r\n });\r\n };\r\n MapSeries.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n MapSeries.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n MapSeries.type = 'series.map';\r\n MapSeries.dependencies = ['geo'];\r\n MapSeries.layoutMode = 'box';\r\n MapSeries.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'geo',\r\n map: '',\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: 0.75,\r\n showLegendSymbol: true,\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n selectedMode: true,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n areaColor: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n areaColor: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n nameProperty: 'name'\r\n };\r\n return MapSeries;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(MapSeries);\n\nvar ATTR = '\\0_ec_interaction_mutex';\r\nfunction take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n}\r\nfunction release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n}\r\nfunction isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n}\r\nfunction getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n}\r\nregisterAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\nvar RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n}(Eventful));\r\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n}\r\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n}\r\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n}\n\nfunction updateViewOnPan(controllerHost, dx, dy) {\r\n var target = controllerHost.target;\r\n target.x += dx;\r\n target.y += dy;\r\n target.dirty();\r\n}\r\nfunction updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\r\n var target = controllerHost.target;\r\n var zoomLimit = controllerHost.zoomLimit;\r\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\r\n }\r\n var zoomScale = newZoom / controllerHost.zoom;\r\n controllerHost.zoom = newZoom;\r\n target.x -= (zoomX - target.x) * (zoomScale - 1);\r\n target.y -= (zoomY - target.y) * (zoomScale - 1);\r\n target.scaleX *= zoomScale;\r\n target.scaleY *= zoomScale;\r\n target.dirty();\r\n}\n\nvar IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\nfunction onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n}\n\nfunction getFixedItemStyle(model) {\r\n var itemStyle = model.getItemStyle();\r\n var areaColor = model.get('areaColor');\r\n if (areaColor != null) {\r\n itemStyle.fill = areaColor;\r\n }\r\n return itemStyle;\r\n}\r\nvar MapDraw = (function () {\r\n function MapDraw(api) {\r\n var group = new Group();\r\n this.uid = getUID('ec_map_draw');\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = { target: group };\r\n this.group = group;\r\n group.add(this._regionsGroup = new Group());\r\n group.add(this._backgroundGroup = new Group());\r\n }\r\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\r\n var isGeo = mapOrGeoModel.mainType === 'geo';\r\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\r\n isGeo && ecModel.eachComponent({ mainType: 'series', subType: 'map' }, function (mapSeries) {\r\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\r\n data = mapSeries.getData();\r\n }\r\n });\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n this._updateBackground(geo);\r\n var regionsGroup = this._regionsGroup;\r\n var group = this.group;\r\n var transformInfo = geo.getTransformInfo();\r\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\r\n var targetScaleX;\r\n var targetScaleY;\r\n if (isFirstDraw) {\r\n group.transform = transformInfo.roamTransform;\r\n group.decomposeTransform();\r\n group.dirty();\r\n }\r\n else {\r\n var target = new Transformable();\r\n target.transform = transformInfo.roamTransform;\r\n target.decomposeTransform();\r\n var props = {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n x: target.x,\r\n y: target.y\r\n };\r\n targetScaleX = target.scaleX;\r\n targetScaleY = target.scaleY;\r\n updateProps(group, props, mapOrGeoModel);\r\n }\r\n regionsGroup.removeAll();\r\n var nameMap = createHashMap();\r\n var isVisualEncodedByVisualMap = data\r\n && data.getVisual('visualMeta')\r\n && data.getVisual('visualMeta').length > 0;\r\n each(geo.regions, function (region) {\r\n var regionGroup = nameMap.get(region.name)\r\n || nameMap.set(region.name, new Group());\r\n var compoundPath = new CompoundPath({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n paths: []\r\n }\r\n });\r\n regionGroup.add(compoundPath);\r\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\r\n var itemStyleModel = regionModel.getModel('itemStyle');\r\n var emphasisModel = regionModel.getModel('emphasis');\r\n var emphasisItemStyleModel = emphasisModel.getModel('itemStyle');\r\n var blurItemStyleModel = regionModel.getModel(['blur', 'itemStyle']);\r\n var selectItemStyleModel = regionModel.getModel(['select', 'itemStyle']);\r\n var itemStyle = getFixedItemStyle(itemStyleModel);\r\n var emphasisItemStyle = getFixedItemStyle(emphasisItemStyleModel);\r\n var blurItemStyle = getFixedItemStyle(blurItemStyleModel);\r\n var selectItemStyle = getFixedItemStyle(selectItemStyleModel);\r\n var dataIdx;\r\n if (data) {\r\n dataIdx = data.indexOfName(region.name);\r\n var style = data.getItemVisual(dataIdx, 'style');\r\n var decal = data.getItemVisual(dataIdx, 'decal');\r\n if (isVisualEncodedByVisualMap && style.fill) {\r\n itemStyle.fill = style.fill;\r\n }\r\n if (decal) {\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n }\r\n var sx = transformInfo.rawScaleX;\r\n var sy = transformInfo.rawScaleY;\r\n var offsetX = transformInfo.rawX;\r\n var offsetY = transformInfo.rawY;\r\n var transformPoint = function (point) {\r\n return [\r\n point[0] * sx + offsetX,\r\n point[1] * sy + offsetY\r\n ];\r\n };\r\n each(region.geometries, function (geometry) {\r\n if (geometry.type !== 'polygon') {\r\n return;\r\n }\r\n var points = [];\r\n for (var i = 0; i < geometry.exterior.length; ++i) {\r\n points.push(transformPoint(geometry.exterior[i]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\r\n var interior = geometry.interiors[i];\r\n var points_1 = [];\r\n for (var j = 0; j < interior.length; ++j) {\r\n points_1.push(transformPoint(interior[j]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points_1\r\n }\r\n }));\r\n }\r\n });\r\n compoundPath.setStyle(itemStyle);\r\n compoundPath.style.strokeNoScale = true;\r\n compoundPath.culling = true;\r\n compoundPath.ensureState('emphasis').style = emphasisItemStyle;\r\n compoundPath.ensureState('blur').style = blurItemStyle;\r\n compoundPath.ensureState('select').style = selectItemStyle;\r\n var showLabel = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n if (regionModel.get(stateName === 'normal' ? ['label', 'show'] : [stateName, 'label', 'show'])) {\r\n showLabel = true;\r\n break;\r\n }\r\n }\r\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\r\n var itemLayout = data && data.getItemLayout(dataIdx);\r\n if ((isGeo || isDataNaN && (showLabel))\r\n || (itemLayout && itemLayout.showLabel)) {\r\n var query = !isGeo ? dataIdx : region.name;\r\n var labelFetcher = void 0;\r\n if (!data || dataIdx >= 0) {\r\n labelFetcher = mapOrGeoModel;\r\n }\r\n var centerPt = transformPoint(region.center);\r\n var textEl = new ZRText({\r\n x: centerPt[0],\r\n y: centerPt[1],\r\n scaleX: 1 / group.scaleX,\r\n scaleY: 1 / group.scaleY,\r\n z2: 10,\r\n silent: true\r\n });\r\n setLabelStyle(textEl, getLabelStatesModels(regionModel), {\r\n labelFetcher: labelFetcher,\r\n labelDataIndex: query,\r\n defaultText: region.name\r\n }, { normal: {\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n } });\r\n compoundPath.setTextContent(textEl);\r\n compoundPath.setTextConfig({\r\n local: true\r\n });\r\n compoundPath.disableLabelAnimation = true;\r\n if (!isFirstDraw) {\r\n updateProps(textEl, {\r\n scaleX: 1 / targetScaleX,\r\n scaleY: 1 / targetScaleY\r\n }, mapOrGeoModel);\r\n }\r\n }\r\n if (data) {\r\n data.setItemGraphicEl(dataIdx, regionGroup);\r\n }\r\n else {\r\n var regionModel_1 = mapOrGeoModel.getRegionModel(region.name);\r\n getECData(compoundPath).eventData = {\r\n componentType: 'geo',\r\n componentIndex: mapOrGeoModel.componentIndex,\r\n geoIndex: mapOrGeoModel.componentIndex,\r\n name: region.name,\r\n region: (regionModel_1 && regionModel_1.option) || {}\r\n };\r\n }\r\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\r\n groupRegions.push(region);\r\n regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\r\n enableHoverEmphasis(regionGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n regionsGroup.add(regionGroup);\r\n });\r\n this._updateController(mapOrGeoModel, ecModel, api);\r\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\r\n };\r\n MapDraw.prototype.remove = function () {\r\n this._regionsGroup.removeAll();\r\n this._backgroundGroup.removeAll();\r\n this._controller.dispose();\r\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\r\n this._mapName = null;\r\n this._controllerHost = null;\r\n };\r\n MapDraw.prototype._updateBackground = function (geo) {\r\n var mapName = geo.map;\r\n if (this._mapName !== mapName) {\r\n each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\r\n this._backgroundGroup.add(root);\r\n }, this);\r\n }\r\n this._mapName = mapName;\r\n };\r\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\r\n controllerHost.zoom = geo.getZoom();\r\n controller.enable(mapOrGeoModel.get('roam') || false);\r\n var mainType = mapOrGeoModel.mainType;\r\n function makeActionBase() {\r\n var action = {\r\n type: 'geoRoam',\r\n componentType: mainType\r\n };\r\n action[mainType + 'Id'] = mapOrGeoModel.id;\r\n return action;\r\n }\r\n controller.off('pan').on('pan', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n dx: e.dx,\r\n dy: e.dy\r\n }));\r\n }, this);\r\n controller.off('zoom').on('zoom', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n }));\r\n var group = this.group;\r\n this._regionsGroup.traverse(function (el) {\r\n var textContent = el.getTextContent();\r\n if (textContent) {\r\n textContent.scaleX = 1 / group.scaleX;\r\n textContent.scaleY = 1 / group.scaleY;\r\n textContent.markRedraw();\r\n }\r\n });\r\n }, this);\r\n controller.setPointerChecker(function (e, x, y) {\r\n return geo.getViewRectAfterRoam().contain(x, y)\r\n && !onIrrelevantElement(e, api, mapOrGeoModel);\r\n });\r\n };\r\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\r\n var mapDraw = this;\r\n regionsGroup.off('mousedown');\r\n if (mapOrGeoModel.get('selectedMode')) {\r\n regionsGroup.on('mousedown', function () {\r\n mapDraw._mouseDownFlag = true;\r\n });\r\n regionsGroup.on('click', function (e) {\r\n if (!mapDraw._mouseDownFlag) {\r\n return;\r\n }\r\n mapDraw._mouseDownFlag = false;\r\n });\r\n }\r\n };\r\n return MapDraw;\r\n}());\n\nvar MapView = (function (_super) {\r\n __extends(MapView, _super);\r\n function MapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapView.type;\r\n return _this;\r\n }\r\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\r\n if (payload && payload.type === 'mapToggleSelect'\r\n && payload.from === this.uid) {\r\n return;\r\n }\r\n var group = this.group;\r\n group.removeAll();\r\n if (mapModel.getHostGeoModel()) {\r\n return;\r\n }\r\n if (!(payload && payload.type === 'geoRoam'\r\n && payload.componentType === 'series'\r\n && payload.seriesId === mapModel.id)) {\r\n if (mapModel.needsDrawMap) {\r\n var mapDraw = this._mapDraw || new MapDraw(api);\r\n group.add(mapDraw.group);\r\n mapDraw.draw(mapModel, ecModel, api, this, payload);\r\n this._mapDraw = mapDraw;\r\n }\r\n else {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n }\r\n else {\r\n var mapDraw = this._mapDraw;\r\n mapDraw && group.add(mapDraw.group);\r\n }\r\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')\r\n && this._renderSymbols(mapModel, ecModel, api);\r\n };\r\n MapView.prototype.remove = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n this.group.removeAll();\r\n };\r\n MapView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n };\r\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\r\n var originalData = mapModel.originalData;\r\n var group = this.group;\r\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n var layout = originalData.getItemLayout(originalDataIndex);\r\n if (!layout || !layout.point) {\r\n return;\r\n }\r\n var point = layout.point;\r\n var offset = layout.offset;\r\n var circle = new Circle({\r\n style: {\r\n fill: mapModel.getData().getVisual('style').fill\r\n },\r\n shape: {\r\n cx: point[0] + offset * 9,\r\n cy: point[1],\r\n r: 3\r\n },\r\n silent: true,\r\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\r\n });\r\n if (!offset) {\r\n var fullData = mapModel.mainSeries.getData();\r\n var name_1 = originalData.getName(originalDataIndex);\r\n var fullIndex_1 = fullData.indexOfName(name_1);\r\n var itemModel = originalData.getItemModel(originalDataIndex);\r\n var labelModel = itemModel.getModel('label');\r\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\r\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\r\n labelFetcher: {\r\n getFormattedLabel: function (idx, state) {\r\n return mapModel.getFormattedLabel(fullIndex_1, state);\r\n }\r\n }\r\n });\r\n circle.disableLabelAnimation = true;\r\n if (!labelModel.get('position')) {\r\n circle.setTextConfig({\r\n position: 'bottom'\r\n });\r\n }\r\n regionGroup.onHoverStateChange = function (toState) {\r\n circle.useState(toState);\r\n };\r\n }\r\n group.add(circle);\r\n });\r\n };\r\n MapView.type = 'map';\r\n return MapView;\r\n}(ChartView));\r\nChartView.registerClass(MapView);\n\nfunction updateCenterAndZoom(view, payload, zoomLimit) {\r\n var previousZoom = view.getZoom();\r\n var center = view.getCenter();\r\n var zoom = payload.zoom;\r\n var point = view.dataToPoint(center);\r\n if (payload.dx != null && payload.dy != null) {\r\n point[0] -= payload.dx;\r\n point[1] -= payload.dy;\r\n view.setCenter(view.pointToData(point));\r\n }\r\n if (zoom != null) {\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\r\n }\r\n view.scaleX *= zoom;\r\n view.scaleY *= zoom;\r\n var fixX = (payload.originX - view.x) * (zoom - 1);\r\n var fixY = (payload.originY - view.y) * (zoom - 1);\r\n view.x -= fixX;\r\n view.y -= fixY;\r\n view.updateTransform();\r\n view.setCenter(view.pointToData(point));\r\n view.setZoom(zoom * previousZoom);\r\n }\r\n return {\r\n center: view.getCenter(),\r\n zoom: view.getZoom()\r\n };\r\n}\n\nregisterAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n}, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n var geo = componentModel.coordinateSystem;\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\r\n componentModel.setCenter\r\n && componentModel.setCenter(res.center);\r\n componentModel.setZoom\r\n && componentModel.setZoom(res.zoom);\r\n if (componentType === 'series') {\r\n each(componentModel.seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n });\r\n});\n\nvar v2ApplyTransform = applyTransform;\r\nvar View = (function (_super) {\r\n __extends(View, _super);\r\n function View(name) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'view';\r\n _this.dimensions = ['x', 'y'];\r\n _this._roamTransformable = new Transformable();\r\n _this._rawTransformable = new Transformable();\r\n _this.name = name;\r\n return _this;\r\n }\r\n View.prototype.setBoundingRect = function (x, y, width, height) {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n };\r\n View.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n View.prototype.setViewRect = function (x, y, width, height) {\r\n this.transformTo(x, y, width, height);\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n };\r\n View.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var rawTransform = this._rawTransformable;\r\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransform.decomposeTransform();\r\n this._updateTransform();\r\n };\r\n View.prototype.setCenter = function (centerCoord) {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n this._center = centerCoord;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.setZoom = function (zoom) {\r\n zoom = zoom || 1;\r\n var zoomLimit = this.zoomLimit;\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n this._zoom = zoom;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.getDefaultCenter = function () {\r\n var rawRect = this.getBoundingRect();\r\n var cx = rawRect.x + rawRect.width / 2;\r\n var cy = rawRect.y + rawRect.height / 2;\r\n return [cx, cy];\r\n };\r\n View.prototype.getCenter = function () {\r\n return this._center || this.getDefaultCenter();\r\n };\r\n View.prototype.getZoom = function () {\r\n return this._zoom || 1;\r\n };\r\n View.prototype.getRoamTransform = function () {\r\n return this._roamTransformable.getLocalTransform();\r\n };\r\n View.prototype._updateCenterAndZoom = function () {\r\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n var roamTransform = this._roamTransformable;\r\n var defaultCenter = this.getDefaultCenter();\r\n var center = this.getCenter();\r\n var zoom = this.getZoom();\r\n center = applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix);\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n this._updateTransform();\r\n };\r\n View.prototype._updateTransform = function () {\r\n var roamTransformable = this._roamTransformable;\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1());\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n this.invTransform = this.invTransform || [];\r\n invert(this.invTransform, this.transform);\r\n this.decomposeTransform();\r\n };\r\n View.prototype.getTransformInfo = function () {\r\n var roamTransform = this._roamTransformable.transform;\r\n var rawTransformable = this._rawTransformable;\r\n return {\r\n roamTransform: roamTransform ? slice(roamTransform) : create$1(),\r\n rawScaleX: rawTransformable.scaleX,\r\n rawScaleY: rawTransformable.scaleY,\r\n rawX: rawTransformable.x,\r\n rawY: rawTransformable.y\r\n };\r\n };\r\n View.prototype.getViewRect = function () {\r\n return this._viewRect;\r\n };\r\n View.prototype.getViewRectAfterRoam = function () {\r\n var rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n };\r\n View.prototype.dataToPoint = function (data, noRoam, out) {\r\n var transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform\r\n ? v2ApplyTransform(out, data, transform)\r\n : copy(out, data);\r\n };\r\n View.prototype.pointToData = function (point) {\r\n var invTransform = this.invTransform;\r\n return invTransform\r\n ? v2ApplyTransform([], point, invTransform)\r\n : [point[0], point[1]];\r\n };\r\n View.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n View.prototype.containPoint = function (point) {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n };\r\n View.dimensions = ['x', 'y'];\r\n return View;\r\n}(Transformable));\r\nfunction getCoordSys(finder) {\r\n var seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem : null;\r\n}\n\nvar Geo = (function (_super) {\r\n __extends(Geo, _super);\r\n function Geo(name, map, nameMap, invertLongitute) {\r\n var _this = _super.call(this, name) || this;\r\n _this.dimensions = ['lng', 'lat'];\r\n _this.type = 'geo';\r\n _this.map = map;\r\n var source = geoSourceManager.load(map, nameMap);\r\n _this._nameCoordMap = source.nameCoordMap;\r\n _this._regionsMap = source.regionsMap;\r\n _this._invertLongitute = invertLongitute == null ? true : invertLongitute;\r\n _this.regions = source.regions;\r\n _this._rect = source.boundingRect;\r\n return _this;\r\n }\r\n Geo.prototype.containCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Geo.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var invertLongitute = this._invertLongitute;\r\n rect = rect.clone();\r\n if (invertLongitute) {\r\n rect.y = -rect.y - rect.height;\r\n }\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransformable.decomposeTransform();\r\n if (invertLongitute) {\r\n rawTransformable.scaleY = -rawTransformable.scaleY;\r\n }\r\n rawTransformable.updateTransform();\r\n this._updateTransform();\r\n };\r\n Geo.prototype.getRegion = function (name) {\r\n return this._regionsMap.get(name);\r\n };\r\n Geo.prototype.getRegionByCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return regions[i];\r\n }\r\n }\r\n };\r\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\r\n this._nameCoordMap.set(name, geoCoord);\r\n };\r\n Geo.prototype.getGeoCoord = function (name) {\r\n return this._nameCoordMap.get(name);\r\n };\r\n Geo.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\r\n if (typeof data === 'string') {\r\n data = this.getGeoCoord(data);\r\n }\r\n if (data) {\r\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\r\n }\r\n };\r\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n return Geo;\r\n}(View));\r\nmixin(Geo, View);\r\nfunction getCoordSys$1(finder) {\r\n var geoModel = finder.geoModel;\r\n var seriesModel = finder.seriesModel;\r\n return geoModel\r\n ? geoModel.coordinateSystem\r\n : seriesModel\r\n ? (seriesModel.coordinateSystem\r\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem)\r\n : null;\r\n}\n\nfunction resizeGeo(geoModel, api) {\r\n var boundingCoords = geoModel.get('boundingCoords');\r\n if (boundingCoords != null) {\r\n var leftTop = boundingCoords[0];\r\n var rightBottom = boundingCoords[1];\r\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\r\n if (__DEV__) {\r\n console.error('Invalid boundingCoords');\r\n }\r\n }\r\n else {\r\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\r\n }\r\n }\r\n var rect = this.getBoundingRect();\r\n var centerOption = geoModel.get('layoutCenter');\r\n var sizeOption = geoModel.get('layoutSize');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var aspect = rect.width / rect.height * this.aspectScale;\r\n var useCenterAndSize = false;\r\n var center;\r\n var size;\r\n if (centerOption && sizeOption) {\r\n center = [\r\n parsePercent$2(centerOption[0], viewWidth),\r\n parsePercent$2(centerOption[1], viewHeight)\r\n ];\r\n size = parsePercent$2(sizeOption, Math.min(viewWidth, viewHeight));\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n var viewRect;\r\n if (useCenterAndSize) {\r\n viewRect = {};\r\n if (aspect > 1) {\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n }\r\n else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n }\r\n else {\r\n var boxLayoutOption = geoModel.getBoxLayoutParams();\r\n boxLayoutOption.aspect = aspect;\r\n viewRect = getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n this.setCenter(geoModel.get('center'));\r\n this.setZoom(geoModel.get('zoom'));\r\n}\r\nfunction setGeoCoords(geo, model) {\r\n each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n}\r\nvar GeoCreator = (function () {\r\n function GeoCreator() {\r\n this.dimensions = Geo.prototype.dimensions;\r\n }\r\n GeoCreator.prototype.create = function (ecModel, api) {\r\n var geoList = [];\r\n ecModel.eachComponent('geo', function (geoModel, idx) {\r\n var name = geoModel.get('map');\r\n var aspectScale = geoModel.get('aspectScale');\r\n var invertLongitute = true;\r\n var mapRecords = mapDataStorage.retrieveMap(name);\r\n if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') {\r\n aspectScale == null && (aspectScale = 1);\r\n invertLongitute = false;\r\n }\r\n else {\r\n aspectScale == null && (aspectScale = 0.75);\r\n }\r\n var geo = new Geo(name + idx, name, geoModel.get('nameMap'), invertLongitute);\r\n geo.aspectScale = aspectScale;\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo);\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel;\r\n geo.resize = resizeGeo;\r\n geo.resize(geoModel, api);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n if (coordSys === 'geo') {\r\n var geoIndex = seriesModel.get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n });\r\n var mapModelGroupBySeries = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n var mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n var nameMapList = map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n var geo = new Geo(mapType, mapType, mergeAll(nameMapList));\r\n geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo);\r\n geo.resize = resizeGeo;\r\n geo.aspectScale = mapSeries[0].get('aspectScale');\r\n geo.resize(mapSeries[0], api);\r\n each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n return geoList;\r\n };\r\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap) {\r\n var regionsArr = (originRegionArr || []).slice();\r\n var dataNameMap = createHashMap();\r\n for (var i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n var source = geoSourceManager.load(mapName, nameMap);\r\n each(source.regions, function (region) {\r\n var name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({ name: name });\r\n });\r\n return regionsArr;\r\n };\r\n return GeoCreator;\r\n}());\r\nvar geoCreator = new GeoCreator();\r\nregisterCoordinateSystem('geo', geoCreator);\n\nfunction mapSymbolLayout(ecModel) {\r\n var processedMapType = {};\r\n ecModel.eachSeriesByType('map', function (mapSeries) {\r\n var mapType = mapSeries.getMapType();\r\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\r\n return;\r\n }\r\n var mapSymbolOffsets = {};\r\n each(mapSeries.seriesGroup, function (subMapSeries) {\r\n var geo = subMapSeries.coordinateSystem;\r\n var data = subMapSeries.originalData;\r\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var name = data.getName(idx);\r\n var region = geo.getRegion(name);\r\n if (!region || isNaN(value)) {\r\n return;\r\n }\r\n var offset = mapSymbolOffsets[name] || 0;\r\n var point = geo.dataToPoint(region.center);\r\n mapSymbolOffsets[name] = offset + 1;\r\n data.setItemLayout(idx, {\r\n point: point,\r\n offset: offset\r\n });\r\n });\r\n }\r\n });\r\n var data = mapSeries.getData();\r\n data.each(function (idx) {\r\n var name = data.getName(idx);\r\n var layout = data.getItemLayout(idx) || {};\r\n layout.showLabel = !mapSymbolOffsets[name];\r\n data.setItemLayout(idx, layout);\r\n });\r\n processedMapType[mapType] = true;\r\n });\r\n}\n\nfunction dataStatistics(datas, statisticType) {\r\n var dataNameMap = {};\r\n each(datas, function (data) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + data.getName(idx);\r\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\r\n if (!isNaN(value)) {\r\n dataNameMap[mapKey].push(value);\r\n }\r\n });\r\n });\r\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + datas[0].getName(idx);\r\n var sum = 0;\r\n var min = Infinity;\r\n var max = -Infinity;\r\n var len = dataNameMap[mapKey].length;\r\n for (var i = 0; i < len; i++) {\r\n min = Math.min(min, dataNameMap[mapKey][i]);\r\n max = Math.max(max, dataNameMap[mapKey][i]);\r\n sum += dataNameMap[mapKey][i];\r\n }\r\n var result;\r\n if (statisticType === 'min') {\r\n result = min;\r\n }\r\n else if (statisticType === 'max') {\r\n result = max;\r\n }\r\n else if (statisticType === 'average') {\r\n result = sum / len;\r\n }\r\n else {\r\n result = sum;\r\n }\r\n return len === 0 ? NaN : result;\r\n });\r\n}\r\nfunction mapDataStatistic(ecModel) {\r\n var seriesGroups = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n var hostGeoModel = seriesModel.getHostGeoModel();\r\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\r\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\r\n });\r\n each(seriesGroups, function (seriesList, key) {\r\n var data = dataStatistics(map(seriesList, function (seriesModel) {\r\n return seriesModel.getData();\r\n }), seriesList[0].get('mapValueCalculation'));\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].originalData = seriesList[i].getData();\r\n }\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].seriesGroup = seriesList;\r\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\r\n seriesList[i].setData(data.cloneShallow());\r\n seriesList[i].mainSeries = seriesList[0];\r\n }\r\n });\r\n}\n\nregisterLayout(mapSymbolLayout);\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\r\ncreateLegacyDataSelectAction('map', registerAction);\n\nvar inner$8 = makeInner();\r\nfunction linkList(opt) {\r\n var mainData = opt.mainData;\r\n var datas = opt.datas;\r\n if (!datas) {\r\n datas = { main: mainData };\r\n opt.datasAttr = { main: 'data' };\r\n }\r\n opt.datas = opt.mainData = null;\r\n linkAll(mainData, datas, opt);\r\n each(datas, function (data) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n });\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n });\r\n assert(datas[mainData.dataType] === mainData);\r\n}\r\nfunction transferInjection(opt, res) {\r\n if (isMainData(this)) {\r\n var datas = extend({}, inner$8(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n }\r\n else {\r\n linkSingle(res, this.dataType, inner$8(this).mainData, opt);\r\n }\r\n return res;\r\n}\r\nfunction changeInjection(opt, res) {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n}\r\nfunction cloneShallowInjection(opt, res) {\r\n each(inner$8(res).datas, function (data, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n}\r\nfunction getLinkedData(dataType) {\r\n var mainData = inner$8(this).mainData;\r\n return (dataType == null || mainData == null)\r\n ? mainData\r\n : inner$8(mainData).datas[dataType];\r\n}\r\nfunction getLinkedDataAll() {\r\n var mainData = inner$8(this).mainData;\r\n return (mainData == null)\r\n ? [{ data: mainData }]\r\n : map(keys(inner$8(mainData).datas), function (type) {\r\n return {\r\n type: type,\r\n data: inner$8(mainData).datas[type]\r\n };\r\n });\r\n}\r\nfunction isMainData(data) {\r\n return inner$8(data).mainData === data;\r\n}\r\nfunction linkAll(mainData, datas, opt) {\r\n inner$8(mainData).datas = {};\r\n each(datas, function (data, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n}\r\nfunction linkSingle(data, dataType, mainData, opt) {\r\n inner$8(mainData).datas[dataType] = data;\r\n inner$8(data).mainData = mainData;\r\n data.dataType = dataType;\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n }\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n}\n\nvar TreeNode = (function () {\r\n function TreeNode(name, hostTree) {\r\n this.depth = 0;\r\n this.height = 0;\r\n this.dataIndex = -1;\r\n this.children = [];\r\n this.viewChildren = [];\r\n this.isExpand = false;\r\n this.name = name || '';\r\n this.hostTree = hostTree;\r\n }\r\n TreeNode.prototype.isRemoved = function () {\r\n return this.dataIndex < 0;\r\n };\r\n TreeNode.prototype.eachNode = function (options, cb, context) {\r\n if (typeof options === 'function') {\r\n context = cb;\r\n cb = options;\r\n options = null;\r\n }\r\n options = options || {};\r\n if (isString(options)) {\r\n options = { order: options };\r\n }\r\n var order = options.order || 'preorder';\r\n var children = this[options.attr || 'children'];\r\n var suppressVisitSub;\r\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\r\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\r\n children[i].eachNode(options, cb, context);\r\n }\r\n order === 'postorder' && cb.call(context, this);\r\n };\r\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\r\n var height = 0;\r\n this.depth = depth;\r\n for (var i = 0; i < this.children.length; i++) {\r\n var child = this.children[i];\r\n child.updateDepthAndHeight(depth + 1);\r\n if (child.height > height) {\r\n height = child.height;\r\n }\r\n }\r\n this.height = height + 1;\r\n };\r\n TreeNode.prototype.getNodeById = function (id) {\r\n if (this.getId() === id) {\r\n return this;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].getNodeById(id);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.contains = function (node) {\r\n if (node === this) {\r\n return true;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].contains(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.getAncestors = function (includeSelf) {\r\n var ancestors = [];\r\n var node = includeSelf ? this : this.parentNode;\r\n while (node) {\r\n ancestors.push(node);\r\n node = node.parentNode;\r\n }\r\n ancestors.reverse();\r\n return ancestors;\r\n };\r\n TreeNode.prototype.getAncestorsIndices = function () {\r\n var indices = [];\r\n var currNode = this;\r\n while (currNode) {\r\n indices.push(currNode.dataIndex);\r\n currNode = currNode.parentNode;\r\n }\r\n indices.reverse();\r\n return indices;\r\n };\r\n TreeNode.prototype.getDescendantIndices = function () {\r\n var indices = [];\r\n this.eachNode(function (childNode) {\r\n indices.push(childNode.dataIndex);\r\n });\r\n return indices;\r\n };\r\n TreeNode.prototype.getValue = function (dimension) {\r\n var data = this.hostTree.data;\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n };\r\n TreeNode.prototype.setLayout = function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\r\n };\r\n TreeNode.prototype.getLayout = function () {\r\n return this.hostTree.data.getItemLayout(this.dataIndex);\r\n };\r\n TreeNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var hostTree = this.hostTree;\r\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n TreeNode.prototype.getLevelModel = function () {\r\n return (this.hostTree.levelModels || [])[this.depth];\r\n };\r\n TreeNode.prototype.setVisual = function (key, value) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\r\n };\r\n TreeNode.prototype.getVisual = function (key) {\r\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\r\n };\r\n TreeNode.prototype.getRawIndex = function () {\r\n return this.hostTree.data.getRawIndex(this.dataIndex);\r\n };\r\n TreeNode.prototype.getId = function () {\r\n return this.hostTree.data.getId(this.dataIndex);\r\n };\r\n TreeNode.prototype.isAncestorOf = function (node) {\r\n var parent = node.parentNode;\r\n while (parent) {\r\n if (parent === this) {\r\n return true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return false;\r\n };\r\n TreeNode.prototype.isDescendantOf = function (node) {\r\n return node !== this && node.isAncestorOf(this);\r\n };\r\n return TreeNode;\r\n}());\r\nvar Tree = (function () {\r\n function Tree(hostModel) {\r\n this.type = 'tree';\r\n this._nodes = [];\r\n this.hostModel = hostModel;\r\n }\r\n Tree.prototype.eachNode = function (options, cb, context) {\r\n this.root.eachNode(options, cb, context);\r\n };\r\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\r\n var rawIndex = this.data.getRawIndex(dataIndex);\r\n return this._nodes[rawIndex];\r\n };\r\n Tree.prototype.getNodeById = function (name) {\r\n return this.root.getNodeById(name);\r\n };\r\n Tree.prototype.update = function () {\r\n var data = this.data;\r\n var nodes = this._nodes;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Tree.prototype.clearLayouts = function () {\r\n this.data.clearItemLayouts();\r\n };\r\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\r\n var tree = new Tree(hostModel);\r\n var listData = [];\r\n var dimMax = 1;\r\n buildHierarchy(dataRoot);\r\n function buildHierarchy(dataNode, parentNode) {\r\n var value = dataNode.value;\r\n dimMax = Math.max(dimMax, isArray(value) ? value.length : 1);\r\n listData.push(dataNode);\r\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\r\n parentNode\r\n ? addChild(node, parentNode)\r\n : (tree.root = node);\r\n tree._nodes.push(node);\r\n var children = dataNode.children;\r\n if (children) {\r\n for (var i = 0; i < children.length; i++) {\r\n buildHierarchy(children[i], node);\r\n }\r\n }\r\n }\r\n tree.root.updateDepthAndHeight(0);\r\n var dimensionsInfo = createDimensions(listData, {\r\n coordDimensions: ['value'],\r\n dimensionsCount: dimMax\r\n });\r\n var list = new List(dimensionsInfo, hostModel);\r\n list.initData(listData);\r\n beforeLink && beforeLink(list);\r\n linkList({\r\n mainData: list,\r\n struct: tree,\r\n structAttr: 'tree'\r\n });\r\n tree.update();\r\n return tree;\r\n };\r\n return Tree;\r\n}());\r\nfunction addChild(child, node) {\r\n var children = node.children;\r\n if (child.parentNode === node) {\r\n return;\r\n }\r\n children.push(child);\r\n child.parentNode = node;\r\n}\n\nvar TreeSeriesModel = (function (_super) {\r\n __extends(TreeSeriesModel, _super);\r\n function TreeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.hasSymbolVisual = true;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n TreeSeriesModel.prototype.getInitialData = function (option) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n var leaves = option.leaves || {};\r\n var leavesModel = new Model(leaves, this, this.ecModel);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n if (!node.children.length || !node.isExpand) {\r\n model.parentModel = leavesModel;\r\n }\r\n return model;\r\n });\r\n }\r\n var treeDepth = 0;\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n var expandAndCollapse = option.expandAndCollapse;\r\n var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0)\r\n ? option.initialTreeDepth : treeDepth;\r\n tree.root.eachNode('preorder', function (node) {\r\n var item = node.hostTree.data.getRawDataItem(node.dataIndex);\r\n node.isExpand = (item && item.collapsed != null)\r\n ? !item.collapsed\r\n : node.depth <= expandTreeDepth;\r\n });\r\n return tree.data;\r\n };\r\n TreeSeriesModel.prototype.getOrient = function () {\r\n var orient = this.get('orient');\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n }\r\n else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n return orient;\r\n };\r\n TreeSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n TreeSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var tree = this.getData().tree;\r\n var realRoot = tree.root.children[0];\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n var value = node.getValue();\r\n var name = node.name;\r\n while (node && (node !== realRoot)) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value) || value == null\r\n });\r\n };\r\n TreeSeriesModel.type = 'series.tree';\r\n TreeSeriesModel.layoutMode = 'box';\r\n TreeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n layout: 'orthogonal',\r\n edgeShape: 'curve',\r\n edgeForkPosition: '50%',\r\n roam: false,\r\n nodeScaleRatio: 0.4,\r\n center: null,\r\n zoom: 1,\r\n orient: 'LR',\r\n symbol: 'emptyCircle',\r\n symbolSize: 7,\r\n expandAndCollapse: true,\r\n initialTreeDepth: 2,\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n label: {\r\n show: true\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 700,\r\n animationDurationUpdate: 500\r\n };\r\n return TreeSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(TreeSeriesModel);\n\nfunction init$2(inRoot) {\r\n var root = inRoot;\r\n root.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: root,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: 0,\r\n thread: null\r\n };\r\n var nodes = [root];\r\n var node;\r\n var children;\r\n while (node = nodes.pop()) {\r\n children = node.children;\r\n if (node.isExpand && children.length) {\r\n var n = children.length;\r\n for (var i = n - 1; i >= 0; i--) {\r\n var child = children[i];\r\n child.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: child,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: i,\r\n thread: null\r\n };\r\n nodes.push(child);\r\n }\r\n }\r\n }\r\n}\r\nfunction firstWalk(node, separation) {\r\n var children = node.isExpand ? node.children : [];\r\n var siblings = node.parentNode.children;\r\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\r\n if (children.length) {\r\n executeShifts(node);\r\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\r\n if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\r\n }\r\n else {\r\n node.hierNode.prelim = midPoint;\r\n }\r\n }\r\n else if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n }\r\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\r\n}\r\nfunction secondWalk(node) {\r\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\r\n node.setLayout({ x: nodeX }, true);\r\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\r\n}\r\nfunction separation(cb) {\r\n return arguments.length ? cb : defaultSeparation;\r\n}\r\nfunction radialCoordinate(rad, r) {\r\n rad -= Math.PI / 2;\r\n return {\r\n x: r * Math.cos(rad),\r\n y: r * Math.sin(rad)\r\n };\r\n}\r\nfunction getViewRect$1(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction executeShifts(node) {\r\n var children = node.children;\r\n var n = children.length;\r\n var shift = 0;\r\n var change = 0;\r\n while (--n >= 0) {\r\n var child = children[n];\r\n child.hierNode.prelim += shift;\r\n child.hierNode.modifier += shift;\r\n change += child.hierNode.change;\r\n shift += child.hierNode.shift + change;\r\n }\r\n}\r\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\r\n if (subtreeW) {\r\n var nodeOutRight = subtreeV;\r\n var nodeInRight = subtreeV;\r\n var nodeOutLeft = nodeInRight.parentNode.children[0];\r\n var nodeInLeft = subtreeW;\r\n var sumOutRight = nodeOutRight.hierNode.modifier;\r\n var sumInRight = nodeInRight.hierNode.modifier;\r\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\r\n var sumInLeft = nodeInLeft.hierNode.modifier;\r\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\r\n nodeOutRight = nextRight(nodeOutRight);\r\n nodeOutLeft = nextLeft(nodeOutLeft);\r\n nodeOutRight.hierNode.ancestor = subtreeV;\r\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim\r\n - sumInRight + separation(nodeInLeft, nodeInRight);\r\n if (shift > 0) {\r\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\r\n sumInRight += shift;\r\n sumOutRight += shift;\r\n }\r\n sumInLeft += nodeInLeft.hierNode.modifier;\r\n sumInRight += nodeInRight.hierNode.modifier;\r\n sumOutRight += nodeOutRight.hierNode.modifier;\r\n sumOutLeft += nodeOutLeft.hierNode.modifier;\r\n }\r\n if (nodeInLeft && !nextRight(nodeOutRight)) {\r\n nodeOutRight.hierNode.thread = nodeInLeft;\r\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\r\n }\r\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\r\n nodeOutLeft.hierNode.thread = nodeInRight;\r\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\r\n ancestor = subtreeV;\r\n }\r\n }\r\n return ancestor;\r\n}\r\nfunction nextRight(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\r\n}\r\nfunction nextLeft(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\r\n}\r\nfunction nextAncestor(nodeInLeft, node, ancestor) {\r\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode\r\n ? nodeInLeft.hierNode.ancestor : ancestor;\r\n}\r\nfunction moveSubtree(wl, wr, shift) {\r\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\r\n wr.hierNode.change -= change;\r\n wr.hierNode.shift += shift;\r\n wr.hierNode.modifier += shift;\r\n wr.hierNode.prelim += shift;\r\n wl.hierNode.change += change;\r\n}\r\nfunction defaultSeparation(node1, node2) {\r\n return node1.parentNode === node2.parentNode ? 1 : 2;\r\n}\n\nvar TreeEdgeShape = (function () {\r\n function TreeEdgeShape() {\r\n this.parentPoint = [];\r\n this.childPoints = [];\r\n }\r\n return TreeEdgeShape;\r\n}());\r\nvar TreePath = (function (_super) {\r\n __extends(TreePath, _super);\r\n function TreePath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n TreePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n TreePath.prototype.getDefaultShape = function () {\r\n return new TreeEdgeShape();\r\n };\r\n TreePath.prototype.buildPath = function (ctx, shape) {\r\n var childPoints = shape.childPoints;\r\n var childLen = childPoints.length;\r\n var parentPoint = shape.parentPoint;\r\n var firstChildPos = childPoints[0];\r\n var lastChildPos = childPoints[childLen - 1];\r\n if (childLen === 1) {\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\r\n return;\r\n }\r\n var orient = shape.orient;\r\n var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;\r\n var otherDim = 1 - forkDim;\r\n var forkPosition = parsePercent$2(shape.forkPosition, 1);\r\n var tmpPoint = [];\r\n tmpPoint[forkDim] = parentPoint[forkDim];\r\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\r\n tmpPoint[forkDim] = firstChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n tmpPoint[forkDim] = lastChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\r\n for (var i = 1; i < childLen - 1; i++) {\r\n var point = childPoints[i];\r\n ctx.moveTo(point[0], point[1]);\r\n tmpPoint[forkDim] = point[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n }\r\n };\r\n return TreePath;\r\n}(Path));\r\nvar TreeView = (function (_super) {\r\n __extends(TreeView, _super);\r\n function TreeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreeView.type;\r\n _this._mainGroup = new Group();\r\n return _this;\r\n }\r\n TreeView.prototype.init = function (ecModel, api) {\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: this.group\r\n };\r\n this.group.add(this._mainGroup);\r\n };\r\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var group = this._mainGroup;\r\n var layout = seriesModel.get('layout');\r\n if (layout === 'radial') {\r\n group.x = layoutInfo.x + layoutInfo.width / 2;\r\n group.y = layoutInfo.y + layoutInfo.height / 2;\r\n }\r\n else {\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n }\r\n this._updateViewCoordSys(seriesModel);\r\n this._updateController(seriesModel, ecModel, api);\r\n var oldData = this._data;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (symbolNeedsDraw$1(data, newIdx)) {\r\n updateNode(data, newIdx, null, group, seriesModel);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!symbolNeedsDraw$1(data, newIdx)) {\r\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n return;\r\n }\r\n updateNode(data, newIdx, symbolEl, group, seriesModel);\r\n })\r\n .remove(function (oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (symbolEl) {\r\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n }\r\n })\r\n .execute();\r\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\r\n this._updateNodeAndLinkScale(seriesModel);\r\n if (seriesModel.get('expandAndCollapse') === true) {\r\n data.eachItemGraphicEl(function (el, dataIndex) {\r\n el.off('click').on('click', function () {\r\n api.dispatchAction({\r\n type: 'treeExpandAndCollapse',\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndex\r\n });\r\n });\r\n });\r\n }\r\n this._data = data;\r\n };\r\n TreeView.prototype._updateViewCoordSys = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n data.each(function (idx) {\r\n var layout = data.getItemLayout(idx);\r\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\r\n points.push([+layout.x, +layout.y]);\r\n }\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(points, min, max);\r\n var oldMin = this._min;\r\n var oldMax = this._max;\r\n if (max[0] - min[0] === 0) {\r\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\r\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\r\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\r\n }\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n this.group.attr({\r\n x: viewCoordSys.x,\r\n y: viewCoordSys.y,\r\n scaleX: viewCoordSys.scaleX,\r\n scaleY: viewCoordSys.scaleY\r\n });\r\n this._min = min;\r\n this._max = max;\r\n };\r\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale(seriesModel);\r\n api.updateLabelLayout();\r\n });\r\n };\r\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var nodeScale = this._getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = this._nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX || 1;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n };\r\n TreeView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n TreeView.prototype.remove = function () {\r\n this._mainGroup.removeAll();\r\n this._data = null;\r\n };\r\n TreeView.type = 'tree';\r\n return TreeView;\r\n}(ChartView));\r\nfunction symbolNeedsDraw$1(data, dataIndex) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return layout\r\n && !isNaN(layout.x) && !isNaN(layout.y);\r\n}\r\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var isInit = !symbolEl;\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var itemModel = node.getModel();\r\n var visualColor = node.getVisual('style').fill;\r\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0\r\n ? visualColor : '#fff';\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceLayout = source.getLayout();\r\n var sourceOldLayout = sourceSymbolEl\r\n ? {\r\n x: sourceSymbolEl.__oldX,\r\n y: sourceSymbolEl.__oldY,\r\n rawX: sourceSymbolEl.__radialOldRawX,\r\n rawY: sourceSymbolEl.__radialOldRawY\r\n }\r\n : sourceLayout;\r\n var targetLayout = node.getLayout();\r\n if (isInit) {\r\n symbolEl = new Symbol(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n symbolEl.x = sourceOldLayout.x;\r\n symbolEl.y = sourceOldLayout.y;\r\n }\r\n else {\r\n symbolEl.updateData(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n }\r\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\r\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\r\n symbolEl.__radialRawX = targetLayout.rawX;\r\n symbolEl.__radialRawY = targetLayout.rawY;\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(dataIndex, symbolEl);\r\n symbolEl.__oldX = symbolEl.x;\r\n symbolEl.__oldY = symbolEl.y;\r\n updateProps(symbolEl, {\r\n x: targetLayout.x,\r\n y: targetLayout.y\r\n }, seriesModel);\r\n var symbolPath = symbolEl.getSymbolPath();\r\n if (seriesModel.get('layout') === 'radial') {\r\n var realRoot = virtualRoot.children[0];\r\n var rootLayout = realRoot.getLayout();\r\n var length_1 = realRoot.children.length;\r\n var rad = void 0;\r\n var isLeft = void 0;\r\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\r\n var center = {\r\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\r\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\r\n };\r\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n isLeft = center.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {\r\n isLeft = targetLayout.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n isLeft = targetLayout.x > rootLayout.x;\r\n if (!isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n var normalLabelModel = itemModel.getModel('label');\r\n var rotate = normalLabelModel.get('rotate');\r\n var labelRotateRadian = rotate * (Math.PI / 180);\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n symbolPath.setTextConfig({\r\n position: normalLabelModel.get('position') || textPosition,\r\n rotation: rotate == null ? -rad : labelRotateRadian,\r\n origin: 'center'\r\n });\r\n textContent.setStyle('verticalAlign', 'middle');\r\n }\r\n }\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n if (focusDataIndices) {\r\n getECData(symbolEl).focus = focusDataIndices;\r\n }\r\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\r\n if (symbolEl.__edge) {\r\n symbolEl.onHoverStateChange = function (toState) {\r\n if (toState !== 'blur') {\r\n var parentEl = node.parentNode\r\n && data.getItemGraphicEl(node.parentNode.dataIndex);\r\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\r\n setStatesFlag(symbolEl.__edge, toState);\r\n }\r\n }\r\n };\r\n }\r\n}\r\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\r\n var itemModel = node.getModel();\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layout = seriesModel.get('layout');\r\n var orient = seriesModel.getOrient();\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\r\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\r\n var edge = symbolEl.__edge;\r\n if (edgeShape === 'curve') {\r\n if (node.parentNode && node.parentNode !== virtualRoot) {\r\n if (!edge) {\r\n edge = symbolEl.__edge = new BezierCurve({\r\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\r\n }, seriesModel);\r\n }\r\n }\r\n else if (edgeShape === 'polyline') {\r\n if (layout === 'orthogonal') {\r\n if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {\r\n var children = node.children;\r\n var childPoints = [];\r\n for (var i = 0; i < children.length; i++) {\r\n var childLayout = children[i].getLayout();\r\n childPoints.push([childLayout.x, childLayout.y]);\r\n }\r\n if (!edge) {\r\n edge = symbolEl.__edge = new TreePath({\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: [[targetLayout.x, targetLayout.y]],\r\n orient: orient,\r\n forkPosition: edgeForkPosition\r\n }\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: childPoints\r\n }\r\n }, seriesModel);\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\r\n }\r\n }\r\n }\r\n if (edge) {\r\n edge.useStyle(defaults({\r\n strokeNoScale: true, fill: null\r\n }, lineStyle));\r\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\r\n setDefaultStateProxy(edge);\r\n group.add(edge);\r\n }\r\n}\r\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceLayout;\r\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\r\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\r\n }\r\n var removeAnimationOpt = {\r\n duration: seriesModel.get('animationDurationUpdate'),\r\n easing: seriesModel.get('animationEasingUpdate')\r\n };\r\n removeElement(symbolEl, {\r\n x: sourceLayout.x + 1,\r\n y: sourceLayout.y + 1\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(symbolEl);\r\n data.setItemGraphicEl(dataIndex, null);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n symbolEl.fadeOut(null, {\r\n fadeLabel: true,\r\n animation: removeAnimationOpt\r\n });\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceEdge = sourceSymbolEl.__edge;\r\n var edge = symbolEl.__edge\r\n || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layoutOpt = seriesModel.get('layout');\r\n var orient = seriesModel.get('orient');\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n if (edge) {\r\n if (edgeShape === 'curve') {\r\n removeElement(edge, {\r\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\r\n removeElement(edge, {\r\n shape: {\r\n parentPoint: [sourceLayout.x, sourceLayout.y],\r\n childPoints: [[sourceLayout.x, sourceLayout.y]]\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n }\r\n}\r\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n var x1;\r\n var x2;\r\n var y1;\r\n var y2;\r\n if (layoutOpt === 'radial') {\r\n x1 = sourceLayout.rawX;\r\n y1 = sourceLayout.rawY;\r\n x2 = targetLayout.rawX;\r\n y2 = targetLayout.rawY;\r\n var radialCoor1 = radialCoordinate(x1, y1);\r\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\r\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\r\n var radialCoor4 = radialCoordinate(x2, y2);\r\n return {\r\n x1: radialCoor1.x || 0,\r\n y1: radialCoor1.y || 0,\r\n x2: radialCoor4.x || 0,\r\n y2: radialCoor4.y || 0,\r\n cpx1: radialCoor2.x || 0,\r\n cpy1: radialCoor2.y || 0,\r\n cpx2: radialCoor3.x || 0,\r\n cpy2: radialCoor3.y || 0\r\n };\r\n }\r\n else {\r\n x1 = sourceLayout.x;\r\n y1 = sourceLayout.y;\r\n x2 = targetLayout.x;\r\n y2 = targetLayout.y;\r\n if (orient === 'LR' || orient === 'RL') {\r\n cpx1 = x1 + (x2 - x1) * curvature;\r\n cpy1 = y1;\r\n cpx2 = x2 + (x1 - x2) * curvature;\r\n cpy2 = y2;\r\n }\r\n if (orient === 'TB' || orient === 'BT') {\r\n cpx1 = x1;\r\n cpy1 = y1 + (y2 - y1) * curvature;\r\n cpx2 = x2;\r\n cpy2 = y2 + (y1 - y2) * curvature;\r\n }\r\n }\r\n return {\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n };\r\n}\r\nChartView.registerClass(TreeView);\n\nregisterAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var dataIndex = payload.dataIndex;\r\n var tree = seriesModel.getData().tree;\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n});\r\nregisterAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n update: 'none'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n});\n\nfunction eachAfter(root, callback, separation) {\r\n var nodes = [root];\r\n var next = [];\r\n var node;\r\n while (node = nodes.pop()) {\r\n next.push(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = 0; i < children.length; i++) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n while (node = next.pop()) {\r\n callback(node, separation);\r\n }\r\n}\r\nfunction eachBefore(root, callback) {\r\n var nodes = [root];\r\n var node;\r\n while (node = nodes.pop()) {\r\n callback(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n}\n\nfunction treeLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n commonLayout(seriesModel, api);\r\n });\r\n}\r\nfunction commonLayout(seriesModel, api) {\r\n var layoutInfo = getViewRect$1(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var layout = seriesModel.get('layout');\r\n var width = 0;\r\n var height = 0;\r\n var separation$1 = null;\r\n if (layout === 'radial') {\r\n width = 2 * Math.PI;\r\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\r\n separation$1 = separation(function (node1, node2) {\r\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\r\n });\r\n }\r\n else {\r\n width = layoutInfo.width;\r\n height = layoutInfo.height;\r\n separation$1 = separation();\r\n }\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var realRoot = virtualRoot.children[0];\r\n if (realRoot) {\r\n init$2(virtualRoot);\r\n eachAfter(realRoot, firstWalk, separation$1);\r\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\r\n eachBefore(realRoot, secondWalk);\r\n var left_1 = realRoot;\r\n var right_1 = realRoot;\r\n var bottom_1 = realRoot;\r\n eachBefore(realRoot, function (node) {\r\n var x = node.getLayout().x;\r\n if (x < left_1.getLayout().x) {\r\n left_1 = node;\r\n }\r\n if (x > right_1.getLayout().x) {\r\n right_1 = node;\r\n }\r\n if (node.depth > bottom_1.depth) {\r\n bottom_1 = node;\r\n }\r\n });\r\n var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2;\r\n var tx_1 = delta - left_1.getLayout().x;\r\n var kx_1 = 0;\r\n var ky_1 = 0;\r\n var coorX_1 = 0;\r\n var coorY_1 = 0;\r\n if (layout === 'radial') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = (node.depth - 1) * ky_1;\r\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\r\n node.setLayout({ x: finalCoor.x, y: finalCoor.y, rawX: coorX_1, rawY: coorY_1 }, true);\r\n });\r\n }\r\n else {\r\n var orient_1 = seriesModel.getOrient();\r\n if (orient_1 === 'RL' || orient_1 === 'LR') {\r\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\r\n kx_1 = width / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\r\n coorX_1 = orient_1 === 'LR'\r\n ? (node.depth - 1) * kx_1\r\n : width - (node.depth - 1) * kx_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n else if (orient_1 === 'TB' || orient_1 === 'BT') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = orient_1 === 'TB'\r\n ? (node.depth - 1) * ky_1\r\n : height - (node.depth - 1) * ky_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n }\r\n }\r\n}\n\nfunction treeVisual(ecModel) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\n\nregisterLayout(treeLayout);\r\nregisterVisual(treeVisual);\n\nfunction retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\r\n if (payload && indexOf(validPayloadTypes, payload.type) >= 0) {\r\n var root = seriesModel.getData().tree.root;\r\n var targetNode = payload.targetNode;\r\n if (typeof targetNode === 'string') {\r\n targetNode = root.getNodeById(targetNode);\r\n }\r\n if (targetNode && root.contains(targetNode)) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n var targetNodeId = payload.targetNodeId;\r\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n }\r\n}\r\nfunction getPathToRoot(node) {\r\n var path = [];\r\n while (node) {\r\n node = node.parentNode;\r\n node && path.push(node);\r\n }\r\n return path.reverse();\r\n}\r\nfunction aboveViewRoot(viewRoot, node) {\r\n var viewPath = getPathToRoot(viewRoot);\r\n return indexOf(viewPath, node) >= 0;\r\n}\r\nfunction wrapTreePathInfo(node, seriesModel) {\r\n var treePathInfo = [];\r\n while (node) {\r\n var nodeDataIndex = node.dataIndex;\r\n treePathInfo.push({\r\n name: node.name,\r\n dataIndex: nodeDataIndex,\r\n value: seriesModel.getRawValue(nodeDataIndex)\r\n });\r\n node = node.parentNode;\r\n }\r\n treePathInfo.reverse();\r\n return treePathInfo;\r\n}\n\nfunction enableAriaDecalForTree(seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n var decalPaletteScope = {};\r\n tree.eachNode(function (node) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\r\n node.setVisual('decal', decal);\r\n });\r\n}\n\nvar TreemapSeriesModel = (function (_super) {\r\n __extends(TreemapSeriesModel, _super);\r\n function TreemapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapSeriesModel.type;\r\n _this.preventUsingHoverLayer = true;\r\n return _this;\r\n }\r\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n completeTreeValue(root);\r\n var levels = option.levels || [];\r\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\r\n var designatedVisualModel = new Model({ itemStyle: designatedVisualItemStyle }, this, ecModel);\r\n levels = option.levels = setDefault(levels, ecModel);\r\n var levelModels = map(levels || [], function (levelDefine) {\r\n return new Model(levelDefine, designatedVisualModel, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n model.parentModel = levelModel || designatedVisualModel;\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n TreemapSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\r\n this.layoutInfo = this.layoutInfo || {};\r\n extend(this.layoutInfo, layoutInfo);\r\n };\r\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\r\n var idIndexMap = this._idIndexMap;\r\n if (!idIndexMap) {\r\n idIndexMap = this._idIndexMap = createHashMap();\r\n this._idIndexMapCount = 0;\r\n }\r\n var index = idIndexMap.get(id);\r\n if (index == null) {\r\n idIndexMap.set(id, index = this._idIndexMapCount++);\r\n }\r\n return index;\r\n };\r\n TreemapSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n TreemapSeriesModel.type = 'series.treemap';\r\n TreemapSeriesModel.layoutMode = 'box';\r\n TreemapSeriesModel.defaultOption = {\r\n progressive: 0,\r\n left: 'center',\r\n top: 'middle',\r\n width: '80%',\r\n height: '80%',\r\n sort: true,\r\n clipWindow: 'origin',\r\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\r\n leafDepth: null,\r\n drillDownIcon: '▶',\r\n zoomToNodeRatio: 0.32 * 0.32,\r\n roam: true,\r\n nodeClick: 'zoomToNode',\r\n animation: true,\r\n animationDurationUpdate: 900,\r\n animationEasing: 'quinticInOut',\r\n breadcrumb: {\r\n show: true,\r\n height: 22,\r\n left: 'center',\r\n top: 'bottom',\r\n emptyItemWidth: 25,\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.7)',\r\n textStyle: {\r\n color: '#fff'\r\n }\r\n }\r\n },\r\n label: {\r\n show: true,\r\n distance: 0,\r\n padding: 5,\r\n position: 'inside',\r\n color: '#fff',\r\n overflow: 'truncate'\r\n },\r\n upperLabel: {\r\n show: false,\r\n position: [0, '50%'],\r\n height: 20,\r\n overflow: 'truncate',\r\n verticalAlign: 'middle'\r\n },\r\n itemStyle: {\r\n color: null,\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n borderWidth: 0,\r\n gapWidth: 0,\r\n borderColor: '#fff',\r\n borderColorSaturation: null\r\n },\r\n emphasis: {\r\n upperLabel: {\r\n show: true,\r\n position: [0, '50%'],\r\n ellipsis: true,\r\n verticalAlign: 'middle'\r\n }\r\n },\r\n visualDimension: 0,\r\n visualMin: null,\r\n visualMax: null,\r\n color: [],\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n colorMappingBy: 'index',\r\n visibleMin: 10,\r\n childrenVisibleMin: null,\r\n levels: []\r\n };\r\n return TreemapSeriesModel;\r\n}(SeriesModel));\r\nfunction completeTreeValue(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\nfunction setDefault(levels, ecModel) {\r\n var globalColorList = normalizeToArray(ecModel.get('color'));\r\n var globalDecalList = normalizeToArray(ecModel.get('decals'));\r\n if (!globalColorList) {\r\n return;\r\n }\r\n levels = levels || [];\r\n var hasColorDefine;\r\n var hasDecalDefine;\r\n each(levels, function (levelDefine) {\r\n var model = new Model(levelDefine);\r\n var modelColor = model.get('color');\r\n var modelDecal = model.get('decal');\r\n if (model.get(['itemStyle', 'color'])\r\n || (modelColor && modelColor !== 'none')) {\r\n hasColorDefine = true;\r\n }\r\n if (model.get(['itemStyle', 'decal'])\r\n || (modelDecal && modelDecal !== 'none')) {\r\n hasDecalDefine = true;\r\n }\r\n });\r\n var level0 = levels[0] || (levels[0] = {});\r\n if (!hasColorDefine) {\r\n level0.color = globalColorList.slice();\r\n }\r\n if (!hasDecalDefine && globalDecalList) {\r\n level0.decal = globalDecalList.slice();\r\n }\r\n return levels;\r\n}\r\nSeriesModel.registerClass(TreemapSeriesModel);\n\nvar TEXT_PADDING = 8;\r\nvar ITEM_GAP = 8;\r\nvar ARRAY_LENGTH = 5;\r\nvar Breadcrumb = (function () {\r\n function Breadcrumb(containerGroup) {\r\n this.group = new Group();\r\n containerGroup.add(this.group);\r\n }\r\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\r\n var model = seriesModel.getModel('breadcrumb');\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n var normalStyleModel = model.getModel('itemStyle');\r\n var textStyleModel = normalStyleModel.getModel('textStyle');\r\n var layoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\r\n positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n };\r\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\r\n for (var node = targetNode; node; node = node.parentNode) {\r\n var text = convertOptionIdName(node.getModel().get('name'), '');\r\n var textRect = textStyleModel.getTextRect(text);\r\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n };\r\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\r\n var lastX = 0;\r\n var emptyItemWidth = layoutParam.emptyItemWidth;\r\n var height = seriesModel.get(['breadcrumb', 'height']);\r\n var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box);\r\n var totalWidth = layoutParam.totalWidth;\r\n var renderList = layoutParam.renderList;\r\n for (var i = renderList.length - 1; i >= 0; i--) {\r\n var item = renderList[i];\r\n var itemNode = item.node;\r\n var itemWidth = item.width;\r\n var text = item.text;\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n var el = new Polygon({\r\n shape: {\r\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\r\n },\r\n style: defaults(normalStyleModel.getItemStyle(), {\r\n lineJoin: 'bevel'\r\n }),\r\n textContent: new ZRText({\r\n style: {\r\n text: text,\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z: 10,\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n el.disableLabelAnimation = true;\r\n this.group.add(el);\r\n packEventData(el, seriesModel, itemNode);\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n };\r\n Breadcrumb.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n return Breadcrumb;\r\n}());\r\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\r\n var points = [\r\n [head ? x : x - ARRAY_LENGTH, y],\r\n [x + itemWidth, y],\r\n [x + itemWidth, y + itemHeight],\r\n [head ? x : x - ARRAY_LENGTH, y + itemHeight]\r\n ];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n}\r\nfunction packEventData(el, seriesModel, itemNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.componentIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb',\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n}\n\nvar AnimationWrap = (function () {\r\n function AnimationWrap() {\r\n this._storage = [];\r\n this._elExistsMap = {};\r\n }\r\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\r\n if (this._elExistsMap[el.id]) {\r\n return false;\r\n }\r\n this._elExistsMap[el.id] = true;\r\n this._storage.push({\r\n el: el,\r\n target: target,\r\n duration: duration,\r\n delay: delay,\r\n easing: easing\r\n });\r\n return true;\r\n };\r\n AnimationWrap.prototype.finished = function (callback) {\r\n this._finishedCallback = callback;\r\n return this;\r\n };\r\n AnimationWrap.prototype.start = function () {\r\n var _this = this;\r\n var count = this._storage.length;\r\n var checkTerminate = function () {\r\n count--;\r\n if (count <= 0) {\r\n _this._storage.length = 0;\r\n _this._elExistsMap = {};\r\n _this._finishedCallback && _this._finishedCallback();\r\n }\r\n };\r\n for (var i = 0, len = this._storage.length; i < len; i++) {\r\n var item = this._storage[i];\r\n item.el.animateTo(item.target, {\r\n duration: item.duration,\r\n delay: item.delay,\r\n easing: item.easing,\r\n setToFinal: true,\r\n done: checkTerminate,\r\n aborted: checkTerminate\r\n });\r\n }\r\n return this;\r\n };\r\n return AnimationWrap;\r\n}());\r\nfunction createWrap() {\r\n return new AnimationWrap();\r\n}\n\nvar Group$1 = Group;\r\nvar Rect$1 = Rect;\r\nvar DRAG_THRESHOLD = 3;\r\nvar PATH_LABEL_NOAMAL = 'label';\r\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel';\r\nvar Z_BASE = 10;\r\nvar Z_BG = 1;\r\nvar Z_CONTENT = 2;\r\nvar getStateItemStyle = makeStyleMapper([\r\n ['fill', 'color'],\r\n ['stroke', 'strokeColor'],\r\n ['lineWidth', 'strokeWidth'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor']\r\n]);\r\nvar getItemStyleNormal = function (model) {\r\n var itemStyle = getStateItemStyle(model);\r\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\r\n return itemStyle;\r\n};\r\nvar inner$9 = makeInner();\r\nvar TreemapView = (function (_super) {\r\n __extends(TreemapView, _super);\r\n function TreemapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapView.type;\r\n _this._state = 'ready';\r\n _this._storage = createStorage();\r\n return _this;\r\n }\r\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var models = ecModel.findComponents({\r\n mainType: 'series', subType: 'treemap', query: payload\r\n });\r\n if (indexOf(models, seriesModel) < 0) {\r\n return;\r\n }\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var payloadType = payload && payload.type;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var isInit = !this._oldTree;\r\n var thisStorage = this._storage;\r\n var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)\r\n ? {\r\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\r\n direction: payload.direction\r\n }\r\n : null;\r\n var containerGroup = this._giveContainerGroup(layoutInfo);\r\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\r\n (!isInit && (!payloadType\r\n || payloadType === 'treemapZoomToNode'\r\n || payloadType === 'treemapRootToNode'))\r\n ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)\r\n : renderResult.renderFinally();\r\n this._resetController(api);\r\n this._renderBreadcrumb(seriesModel, api, targetInfo);\r\n };\r\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\r\n var containerGroup = this._containerGroup;\r\n if (!containerGroup) {\r\n containerGroup = this._containerGroup = new Group$1();\r\n this._initEvents(containerGroup);\r\n this.group.add(containerGroup);\r\n }\r\n containerGroup.x = layoutInfo.x;\r\n containerGroup.y = layoutInfo.y;\r\n return containerGroup;\r\n };\r\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\r\n var thisTree = seriesModel.getData().tree;\r\n var oldTree = this._oldTree;\r\n var lastsForAnimation = createStorage();\r\n var thisStorage = createStorage();\r\n var oldStorage = this._storage;\r\n var willInvisibleEls = [];\r\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\r\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\r\n }\r\n dualTravel(thisTree.root ? [thisTree.root] : [], (oldTree && oldTree.root) ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\r\n var willDeleteEls = clearStorage(oldStorage);\r\n this._oldTree = thisTree;\r\n this._storage = thisStorage;\r\n return {\r\n lastsForAnimation: lastsForAnimation,\r\n willDeleteEls: willDeleteEls,\r\n renderFinally: renderFinally\r\n };\r\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\r\n if (sameTree) {\r\n oldViewChildren = thisViewChildren;\r\n each(thisViewChildren, function (child, index) {\r\n !child.isRemoved() && processNode(index, index);\r\n });\r\n }\r\n else {\r\n (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n }\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIndex, oldIndex) {\r\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\r\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\r\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\r\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\r\n }\r\n }\r\n function clearStorage(storage) {\r\n var willDeleteEls = createStorage();\r\n storage && each(storage, function (store, storageName) {\r\n var delEls = willDeleteEls[storageName];\r\n each(store, function (el) {\r\n el && (delEls.push(el), inner$9(el).willDelete = true);\r\n });\r\n });\r\n return willDeleteEls;\r\n }\r\n function renderFinally() {\r\n each(willDeleteEls, function (els) {\r\n each(els, function (el) {\r\n el.parent && el.parent.remove(el);\r\n });\r\n });\r\n each(willInvisibleEls, function (el) {\r\n el.invisible = true;\r\n el.dirty();\r\n });\r\n }\r\n };\r\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\r\n if (!seriesModel.get('animation')) {\r\n return;\r\n }\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n var easingOption = seriesModel.get('animationEasing');\r\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\r\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\r\n var animationWrap = createWrap();\r\n each(renderResult.willDeleteEls, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n if (el.invisible) {\r\n return;\r\n }\r\n var parent = el.parent;\r\n var target;\r\n var innerStore = inner$9(parent);\r\n if (reRoot && reRoot.direction === 'drillDown') {\r\n target = parent === reRoot.rootNodeGroup\r\n ? {\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: innerStore.nodeWidth,\r\n height: innerStore.nodeHeight\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }\r\n : { style: { opacity: 0 } };\r\n }\r\n else {\r\n var targetX = 0;\r\n var targetY = 0;\r\n if (!innerStore.willDelete) {\r\n targetX = innerStore.nodeWidth / 2;\r\n targetY = innerStore.nodeHeight / 2;\r\n }\r\n target = storageName === 'nodeGroup'\r\n ? { x: targetX, y: targetY, style: { opacity: 0 } }\r\n : {\r\n shape: { x: targetX, y: targetY, width: 0, height: 0 },\r\n style: { opacity: 0 }\r\n };\r\n }\r\n target && animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n });\r\n each(this._storage, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\r\n var target = {};\r\n if (!last) {\r\n return;\r\n }\r\n if (el instanceof Group) {\r\n if (last.oldX != null) {\r\n target.x = el.x;\r\n target.y = el.y;\r\n el.x = last.oldX;\r\n el.y = last.oldY;\r\n }\r\n }\r\n else {\r\n if (last.oldShape) {\r\n target.shape = extend({}, el.shape);\r\n el.setShape(last.oldShape);\r\n }\r\n if (last.fadein) {\r\n el.setStyle('opacity', 0);\r\n target.style = { opacity: 1 };\r\n }\r\n else if (el.style.opacity !== 1) {\r\n target.style = { opacity: 1 };\r\n }\r\n }\r\n animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n }, this);\r\n this._state = 'animating';\r\n animationWrap\r\n .finished(bind(function () {\r\n this._state = 'ready';\r\n renderResult.renderFinally();\r\n }, this))\r\n .start();\r\n };\r\n TreemapView.prototype._resetController = function (api) {\r\n var controller = this._controller;\r\n if (!controller) {\r\n controller = this._controller = new RoamController(api.getZr());\r\n controller.enable(this.seriesModel.get('roam'));\r\n controller.on('pan', bind(this._onPan, this));\r\n controller.on('zoom', bind(this._onZoom, this));\r\n }\r\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\r\n controller.setPointerChecker(function (e, x, y) {\r\n return rect.contain(x, y);\r\n });\r\n };\r\n TreemapView.prototype._clearController = function () {\r\n var controller = this._controller;\r\n if (controller) {\r\n controller.dispose();\r\n controller = null;\r\n }\r\n };\r\n TreemapView.prototype._onPan = function (e) {\r\n if (this._state !== 'animating'\r\n && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n this.api.dispatchAction({\r\n type: 'treemapMove',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rootLayout.x + e.dx, y: rootLayout.y + e.dy,\r\n width: rootLayout.width, height: rootLayout.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._onZoom = function (e) {\r\n var mouseX = e.originX;\r\n var mouseY = e.originY;\r\n if (this._state !== 'animating') {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\r\n var layoutInfo = this.seriesModel.layoutInfo;\r\n mouseX -= layoutInfo.x;\r\n mouseY -= layoutInfo.y;\r\n var m = create$1();\r\n translate(m, m, [-mouseX, -mouseY]);\r\n scale$1(m, m, [e.scale, e.scale]);\r\n translate(m, m, [mouseX, mouseY]);\r\n rect.applyTransform(m);\r\n this.api.dispatchAction({\r\n type: 'treemapRender',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rect.x, y: rect.y,\r\n width: rect.width, height: rect.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._initEvents = function (containerGroup) {\r\n var _this = this;\r\n containerGroup.on('click', function (e) {\r\n if (_this._state !== 'ready') {\r\n return;\r\n }\r\n var nodeClick = _this.seriesModel.get('nodeClick', true);\r\n if (!nodeClick) {\r\n return;\r\n }\r\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\r\n if (!targetInfo) {\r\n return;\r\n }\r\n var node = targetInfo.node;\r\n if (node.getLayout().isLeafRoot) {\r\n _this._rootToNode(targetInfo);\r\n }\r\n else {\r\n if (nodeClick === 'zoomToNode') {\r\n _this._zoomToNode(targetInfo);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\r\n var link = itemModel.get('link', true);\r\n var linkTarget = itemModel.get('target', true) || 'blank';\r\n link && windowOpen(link, linkTarget);\r\n }\r\n }\r\n }, this);\r\n };\r\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\r\n var _this = this;\r\n if (!targetInfo) {\r\n targetInfo = seriesModel.get('leafDepth', true) != null\r\n ? { node: seriesModel.getViewRoot() }\r\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\r\n if (!targetInfo) {\r\n targetInfo = { node: seriesModel.getData().tree.root };\r\n }\r\n }\r\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group)))\r\n .render(seriesModel, api, targetInfo.node, function (node) {\r\n if (_this._state !== 'animating') {\r\n aboveViewRoot(seriesModel.getViewRoot(), node)\r\n ? _this._rootToNode({ node: node })\r\n : _this._zoomToNode({ node: node });\r\n }\r\n });\r\n };\r\n TreemapView.prototype.remove = function () {\r\n this._clearController();\r\n this._containerGroup && this._containerGroup.removeAll();\r\n this._storage = createStorage();\r\n this._state = 'ready';\r\n this._breadcrumb && this._breadcrumb.remove();\r\n };\r\n TreemapView.prototype.dispose = function () {\r\n this._clearController();\r\n };\r\n TreemapView.prototype._zoomToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapZoomToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype._rootToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapRootToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype.findTarget = function (x, y) {\r\n var targetInfo;\r\n var viewRoot = this.seriesModel.getViewRoot();\r\n viewRoot.eachNode({ attr: 'viewChildren', order: 'preorder' }, function (node) {\r\n var bgEl = this._storage.background[node.getRawIndex()];\r\n if (bgEl) {\r\n var point = bgEl.transformCoordToLocal(x, y);\r\n var shape = bgEl.shape;\r\n if (shape.x <= point[0]\r\n && point[0] <= shape.x + shape.width\r\n && shape.y <= point[1]\r\n && point[1] <= shape.y + shape.height) {\r\n targetInfo = {\r\n node: node,\r\n offsetX: point[0],\r\n offsetY: point[1]\r\n };\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }, this);\r\n return targetInfo;\r\n };\r\n TreemapView.type = 'treemap';\r\n return TreemapView;\r\n}(ChartView));\r\nfunction createStorage() {\r\n return {\r\n nodeGroup: [],\r\n background: [],\r\n content: []\r\n };\r\n}\r\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\r\n if (!thisNode) {\r\n return;\r\n }\r\n var thisLayout = thisNode.getLayout();\r\n var data = seriesModel.getData();\r\n var nodeModel = thisNode.getModel();\r\n data.setItemGraphicEl(thisNode.dataIndex, null);\r\n if (!thisLayout || !thisLayout.isInView) {\r\n return;\r\n }\r\n var thisWidth = thisLayout.width;\r\n var thisHeight = thisLayout.height;\r\n var borderWidth = thisLayout.borderWidth;\r\n var thisInvisible = thisLayout.invisible;\r\n var thisRawIndex = thisNode.getRawIndex();\r\n var oldRawIndex = oldNode && oldNode.getRawIndex();\r\n var thisViewChildren = thisNode.viewChildren;\r\n var upperHeight = thisLayout.upperHeight;\r\n var isParent = thisViewChildren && thisViewChildren.length;\r\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\r\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\r\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\r\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\r\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\r\n var group = giveGraphic('nodeGroup', Group$1);\r\n if (!group) {\r\n return;\r\n }\r\n parentGroup.add(group);\r\n group.x = thisLayout.x || 0;\r\n group.y = thisLayout.y || 0;\r\n group.markRedraw();\r\n inner$9(group).nodeWidth = thisWidth;\r\n inner$9(group).nodeHeight = thisHeight;\r\n if (thisLayout.isAboveViewRoot) {\r\n return group;\r\n }\r\n var bg = giveGraphic('background', Rect$1, depth, Z_BG);\r\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\r\n var focus = nodeModel.get(['emphasis', 'focus']);\r\n var blurScope = nodeModel.get(['emphasis', 'blurScope']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? thisNode.getAncestorsIndices()\r\n : focus === 'descendant' ? thisNode.getDescendantIndices() : null;\r\n if (isParent) {\r\n if (isHighDownDispatcher(group)) {\r\n setAsHighDownDispatcher(group, false);\r\n }\r\n if (bg) {\r\n setAsHighDownDispatcher(bg, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, bg);\r\n enableHoverFocus(bg, focusDataIndices || focus, blurScope);\r\n }\r\n }\r\n else {\r\n var content = giveGraphic('content', Rect$1, depth, Z_CONTENT);\r\n content && renderContent(group, content);\r\n if (bg && isHighDownDispatcher(bg)) {\r\n setAsHighDownDispatcher(bg, false);\r\n }\r\n setAsHighDownDispatcher(group, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, group);\r\n enableHoverFocus(group, focusDataIndices || focus, blurScope);\r\n }\r\n return group;\r\n function renderBackground(group, bg, useUpperLabel) {\r\n var ecData = getECData(bg);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius });\r\n if (thisInvisible) {\r\n processInvisible(bg);\r\n }\r\n else {\r\n bg.invisible = false;\r\n var style = thisNode.getVisual('style');\r\n var visualBorderColor = style.stroke;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualBorderColor;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\r\n if (useUpperLabel) {\r\n var upperLabelWidth = thisWidth - 2 * borderWidth;\r\n prepareText(bg, visualBorderColor, upperLabelWidth, upperHeight, style.opacity, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight });\r\n }\r\n else {\r\n bg.removeTextContent();\r\n }\r\n bg.setStyle(normalStyle);\r\n bg.ensureState('emphasis').style = emphasisStyle;\r\n bg.ensureState('blur').style = blurStyle;\r\n bg.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(bg);\r\n }\r\n group.add(bg);\r\n }\r\n function renderContent(group, content) {\r\n var ecData = getECData(content);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\r\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\r\n content.culling = true;\r\n content.setShape({\r\n x: borderWidth,\r\n y: borderWidth,\r\n width: contentWidth,\r\n height: contentHeight,\r\n r: borderRadius\r\n });\r\n if (thisInvisible) {\r\n processInvisible(content);\r\n }\r\n else {\r\n content.invisible = false;\r\n var nodeStyle = thisNode.getVisual('style');\r\n var visualColor = nodeStyle.fill;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualColor;\r\n normalStyle.decal = nodeStyle.decal;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n prepareText(content, visualColor, contentWidth, nodeStyle.opacity);\r\n content.setStyle(normalStyle);\r\n content.ensureState('emphasis').style = emphasisStyle;\r\n content.ensureState('blur').style = blurStyle;\r\n content.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(content);\r\n }\r\n group.add(content);\r\n }\r\n function processInvisible(element) {\r\n !element.invisible && willInvisibleEls.push(element);\r\n }\r\n function prepareText(rectEl, visualColor, visualOpacity, width, height, upperLabelRect) {\r\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\r\n var text = retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, normalLabelModel.get('formatter')), convertOptionIdName(nodeModel.get('name'), null));\r\n if (!upperLabelRect && thisLayout.isLeafRoot) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n var isShow = normalLabelModel.getShallow('show');\r\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\r\n defaultText: isShow ? text : null,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: thisNode.dataIndex\r\n });\r\n var textEl = rectEl.getTextContent();\r\n var textStyle = textEl.style;\r\n var textPadding = normalizeCssArray(textStyle.padding || 0);\r\n if (upperLabelRect) {\r\n rectEl.setTextConfig({\r\n layoutRect: upperLabelRect\r\n });\r\n textEl.disableLabelLayout = true;\r\n }\r\n textEl.beforeUpdate = function () {\r\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\r\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\r\n if (textStyle.width !== width || textStyle.height !== height) {\r\n textEl.setStyle({\r\n width: width,\r\n height: height\r\n });\r\n }\r\n };\r\n textStyle.truncateMinChar = 2;\r\n textStyle.lineOverflow = 'truncate';\r\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\r\n var textEmphasisState = textEl.getState('emphasis');\r\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\r\n }\r\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\r\n var text = style ? style.text : null;\r\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n style.text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n }\r\n function giveGraphic(storageName, Ctor, depth, z) {\r\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\r\n var lasts = lastsForAnimation[storageName];\r\n if (element) {\r\n oldStorage[storageName][oldRawIndex] = null;\r\n prepareAnimationWhenHasOld(lasts, element);\r\n }\r\n else if (!thisInvisible) {\r\n element = new Ctor();\r\n if (element instanceof Displayable) {\r\n element.z = calculateZ(depth, z);\r\n }\r\n prepareAnimationWhenNoOld(lasts, element);\r\n }\r\n return (thisStorage[storageName][thisRawIndex] = element);\r\n }\r\n function prepareAnimationWhenHasOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n if (element instanceof Group$1) {\r\n lastCfg.oldX = element.x;\r\n lastCfg.oldY = element.y;\r\n }\r\n else {\r\n lastCfg.oldShape = extend({}, element.shape);\r\n }\r\n }\r\n function prepareAnimationWhenNoOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n var parentNode = thisNode.parentNode;\r\n var isGroup = element instanceof Group;\r\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\r\n var parentOldX = 0;\r\n var parentOldY = 0;\r\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\r\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\r\n parentOldX = parentOldBg.oldShape.width;\r\n parentOldY = parentOldBg.oldShape.height;\r\n }\r\n if (isGroup) {\r\n lastCfg.oldX = 0;\r\n lastCfg.oldY = parentOldY;\r\n }\r\n else {\r\n lastCfg.oldShape = { x: parentOldX, y: parentOldY, width: 0, height: 0 };\r\n }\r\n }\r\n lastCfg.fadein = !isGroup;\r\n }\r\n}\r\nfunction calculateZ(depth, zInLevel) {\r\n var zb = depth * Z_BASE + zInLevel;\r\n return (zb - 1) / zb;\r\n}\r\nChartView.registerClass(TreemapView);\n\nvar noop$1 = function () { };\r\nvar actionTypes = [\r\n 'treemapZoomToNode',\r\n 'treemapRender',\r\n 'treemapMove'\r\n];\r\nfor (var i$1 = 0; i$1 < actionTypes.length; i$1++) {\r\n registerAction({\r\n type: actionTypes[i$1],\r\n update: 'updateView'\r\n }, noop$1);\r\n}\r\nregisterAction({ type: 'treemapRootToNode', update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'treemap', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n});\n\nvar each$4 = each;\r\nvar isObject$4 = isObject;\r\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\r\nvar VisualMapping = (function () {\r\n function VisualMapping(option) {\r\n var mappingMethod = option.mappingMethod;\r\n var visualType = option.type;\r\n var thisOption = this.option = clone(option);\r\n this.type = visualType;\r\n this.mappingMethod = mappingMethod;\r\n this._normalizeData = normalizers[mappingMethod];\r\n var visualHandler = VisualMapping.visualHandlers[visualType];\r\n this.applyVisual = visualHandler.applyVisual;\r\n this.getColorMapper = visualHandler.getColorMapper;\r\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\r\n if (mappingMethod === 'piecewise') {\r\n normalizeVisualRange(thisOption);\r\n preprocessForPiecewise(thisOption);\r\n }\r\n else if (mappingMethod === 'category') {\r\n thisOption.categories\r\n ? preprocessForSpecifiedCategory(thisOption)\r\n : normalizeVisualRange(thisOption, true);\r\n }\r\n else {\r\n assert(mappingMethod !== 'linear' || thisOption.dataExtent);\r\n normalizeVisualRange(thisOption);\r\n }\r\n }\r\n VisualMapping.prototype.mapValueToVisual = function (value) {\r\n var normalized = this._normalizeData(value);\r\n return this._normalizedToVisual(normalized, value);\r\n };\r\n VisualMapping.prototype.getNormalizer = function () {\r\n return bind(this._normalizeData, this);\r\n };\r\n VisualMapping.listVisualTypes = function () {\r\n return keys(VisualMapping.visualHandlers);\r\n };\r\n VisualMapping.isValidType = function (visualType) {\r\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\r\n };\r\n VisualMapping.eachVisual = function (visual, callback, context) {\r\n if (isObject(visual)) {\r\n each(visual, callback, context);\r\n }\r\n else {\r\n callback.call(context, visual);\r\n }\r\n };\r\n VisualMapping.mapVisual = function (visual, callback, context) {\r\n var isPrimary;\r\n var newVisual = isArray(visual)\r\n ? []\r\n : isObject(visual)\r\n ? {}\r\n : (isPrimary = true, null);\r\n VisualMapping.eachVisual(visual, function (v, key) {\r\n var newVal = callback.call(context, v, key);\r\n isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal);\r\n });\r\n return newVisual;\r\n };\r\n VisualMapping.retrieveVisuals = function (obj) {\r\n var ret = {};\r\n var hasVisual;\r\n obj && each$4(VisualMapping.visualHandlers, function (h, visualType) {\r\n if (obj.hasOwnProperty(visualType)) {\r\n ret[visualType] = obj[visualType];\r\n hasVisual = true;\r\n }\r\n });\r\n return hasVisual ? ret : null;\r\n };\r\n VisualMapping.prepareVisualTypes = function (visualTypes) {\r\n if (isArray(visualTypes)) {\r\n visualTypes = visualTypes.slice();\r\n }\r\n else if (isObject$4(visualTypes)) {\r\n var types_1 = [];\r\n each$4(visualTypes, function (item, type) {\r\n types_1.push(type);\r\n });\r\n visualTypes = types_1;\r\n }\r\n else {\r\n return [];\r\n }\r\n visualTypes.sort(function (type1, type2) {\r\n return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)\r\n ? 1 : -1;\r\n });\r\n return visualTypes;\r\n };\r\n VisualMapping.dependsOn = function (visualType1, visualType2) {\r\n return visualType2 === 'color'\r\n ? !!(visualType1 && visualType1.indexOf(visualType2) === 0)\r\n : visualType1 === visualType2;\r\n };\r\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\r\n var possibleI;\r\n var abs = Infinity;\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var pieceValue = pieceList[i].value;\r\n if (pieceValue != null) {\r\n if (pieceValue === value\r\n || (typeof pieceValue === 'string' && pieceValue === value + '')) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(pieceValue, i);\r\n }\r\n }\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var piece = pieceList[i];\r\n var interval = piece.interval;\r\n var close_1 = piece.close;\r\n if (interval) {\r\n if (interval[0] === -Infinity) {\r\n if (littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n }\r\n else if (interval[1] === Infinity) {\r\n if (littleThan(close_1[0], interval[0], value)) {\r\n return i;\r\n }\r\n }\r\n else if (littleThan(close_1[0], interval[0], value)\r\n && littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(interval[0], i);\r\n findClosestWhenOutside && updatePossible(interval[1], i);\r\n }\r\n }\r\n if (findClosestWhenOutside) {\r\n return value === Infinity\r\n ? pieceList.length - 1\r\n : value === -Infinity\r\n ? 0\r\n : possibleI;\r\n }\r\n function updatePossible(val, index) {\r\n var newAbs = Math.abs(val - value);\r\n if (newAbs < abs) {\r\n abs = newAbs;\r\n possibleI = index;\r\n }\r\n }\r\n };\r\n VisualMapping.visualHandlers = {\r\n color: {\r\n applyVisual: makeApplyVisual('color'),\r\n getColorMapper: function () {\r\n var thisOption = this.option;\r\n return bind(thisOption.mappingMethod === 'category'\r\n ? function (value, isNormalized) {\r\n !isNormalized && (value = this._normalizeData(value));\r\n return doMapCategory.call(this, value);\r\n }\r\n : function (value, isNormalized, out) {\r\n var returnRGBArray = !!out;\r\n !isNormalized && (value = this._normalizeData(value));\r\n out = fastLerp(value, thisOption.parsedVisual, out);\r\n return returnRGBArray ? out : stringify(out, 'rgba');\r\n }, this);\r\n },\r\n _normalizedToVisual: {\r\n linear: function (normalized) {\r\n return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n colorHue: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, value);\r\n }),\r\n colorSaturation: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, value);\r\n }),\r\n colorLightness: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, null, value);\r\n }),\r\n colorAlpha: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyAlpha(color$1, value);\r\n }),\r\n decal: {\r\n applyVisual: makeApplyVisual('decal'),\r\n _normalizedToVisual: {\r\n linear: null,\r\n category: doMapCategory,\r\n piecewise: null,\r\n fixed: null\r\n }\r\n },\r\n opacity: {\r\n applyVisual: makeApplyVisual('opacity'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n },\r\n liftZ: {\r\n applyVisual: makeApplyVisual('liftZ'),\r\n _normalizedToVisual: {\r\n linear: doMapFixed,\r\n category: doMapFixed,\r\n piecewise: doMapFixed,\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbol: {\r\n applyVisual: function (value, getter, setter) {\r\n var symbolCfg = this.mapValueToVisual(value);\r\n setter('symbol', symbolCfg);\r\n },\r\n _normalizedToVisual: {\r\n linear: doMapToArray,\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = doMapToArray.call(this, normalized);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbolSize: {\r\n applyVisual: makeApplyVisual('symbolSize'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n }\r\n };\r\n return VisualMapping;\r\n}());\r\nfunction preprocessForPiecewise(thisOption) {\r\n var pieceList = thisOption.pieceList;\r\n thisOption.hasSpecialVisual = false;\r\n each(pieceList, function (piece, index) {\r\n piece.originIndex = index;\r\n if (piece.visual != null) {\r\n thisOption.hasSpecialVisual = true;\r\n }\r\n });\r\n}\r\nfunction preprocessForSpecifiedCategory(thisOption) {\r\n var categories = thisOption.categories;\r\n var categoryMap = thisOption.categoryMap = {};\r\n var visual = thisOption.visual;\r\n each$4(categories, function (cate, index) {\r\n categoryMap[cate] = index;\r\n });\r\n if (!isArray(visual)) {\r\n var visualArr_1 = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v, cate) {\r\n var index = categoryMap[cate];\r\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\r\n });\r\n }\r\n else {\r\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\r\n }\r\n visual = setVisualToOption(thisOption, visualArr_1);\r\n }\r\n for (var i = categories.length - 1; i >= 0; i--) {\r\n if (visual[i] == null) {\r\n delete categoryMap[categories[i]];\r\n categories.pop();\r\n }\r\n }\r\n}\r\nfunction normalizeVisualRange(thisOption, isCategory) {\r\n var visual = thisOption.visual;\r\n var visualArr = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v) {\r\n visualArr.push(v);\r\n });\r\n }\r\n else if (visual != null) {\r\n visualArr.push(visual);\r\n }\r\n var doNotNeedPair = { color: 1, symbol: 1 };\r\n if (!isCategory\r\n && visualArr.length === 1\r\n && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\r\n visualArr[1] = visualArr[0];\r\n }\r\n setVisualToOption(thisOption, visualArr);\r\n}\r\nfunction makePartialColorVisualHandler(applyValue) {\r\n return {\r\n applyVisual: function (value, getter, setter) {\r\n var colorChannel = this.mapValueToVisual(value);\r\n setter('color', applyValue(getter('color'), colorChannel));\r\n },\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n };\r\n}\r\nfunction doMapToArray(normalized) {\r\n var visual = this.option.visual;\r\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};\r\n}\r\nfunction makeApplyVisual(visualType) {\r\n return function (value, getter, setter) {\r\n setter(visualType, this.mapValueToVisual(value));\r\n };\r\n}\r\nfunction doMapCategory(normalized) {\r\n var visual = this.option.visual;\r\n return visual[(this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)\r\n ? normalized % visual.length\r\n : normalized];\r\n}\r\nfunction doMapFixed() {\r\n return this.option.visual[0];\r\n}\r\nfunction createNormalizedToNumericVisual(sourceExtent) {\r\n return {\r\n linear: function (normalized) {\r\n return linearMap(normalized, sourceExtent, this.option.visual, true);\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n };\r\n}\r\nfunction getSpecifiedVisual(value) {\r\n var thisOption = this.option;\r\n var pieceList = thisOption.pieceList;\r\n if (thisOption.hasSpecialVisual) {\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\r\n var piece = pieceList[pieceIndex];\r\n if (piece && piece.visual) {\r\n return piece.visual[this.type];\r\n }\r\n }\r\n}\r\nfunction setVisualToOption(thisOption, visualArr) {\r\n thisOption.visual = visualArr;\r\n if (thisOption.type === 'color') {\r\n thisOption.parsedVisual = map(visualArr, function (item) {\r\n return parse(item);\r\n });\r\n }\r\n return visualArr;\r\n}\r\nvar normalizers = {\r\n linear: function (value) {\r\n return linearMap(value, this.option.dataExtent, [0, 1], true);\r\n },\r\n piecewise: function (value) {\r\n var pieceList = this.option.pieceList;\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\r\n if (pieceIndex != null) {\r\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\r\n }\r\n },\r\n category: function (value) {\r\n var index = this.option.categories\r\n ? this.option.categoryMap[value]\r\n : value;\r\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\r\n },\r\n fixed: noop\r\n};\r\nfunction littleThan(close, a, b) {\r\n return close ? a <= b : a < b;\r\n}\n\nvar ITEM_STYLE_NORMAL = 'itemStyle';\r\nvar inner$a = makeInner();\r\nvar treemapVisual = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel) {\r\n var tree = seriesModel.getData().tree;\r\n var root = tree.root;\r\n if (root.isRemoved()) {\r\n return;\r\n }\r\n travelTree(root, {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\r\n }\r\n};\r\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\r\n var nodeModel = node.getModel();\r\n var nodeLayout = node.getLayout();\r\n var data = node.hostTree.data;\r\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\r\n return;\r\n }\r\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\r\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n var borderColor = nodeItemStyleModel.get('borderColor');\r\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\r\n var thisNodeColor;\r\n if (borderColorSaturation != null) {\r\n thisNodeColor = calculateColor(visuals);\r\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\r\n }\r\n existsStyle.stroke = borderColor;\r\n var viewChildren = node.viewChildren;\r\n if (!viewChildren || !viewChildren.length) {\r\n thisNodeColor = calculateColor(visuals);\r\n existsStyle.fill = thisNodeColor;\r\n }\r\n else {\r\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\r\n each(viewChildren, function (child, index) {\r\n if (child.depth >= viewRootAncestors.length\r\n || child === viewRootAncestors[child.depth]) {\r\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\r\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\r\n }\r\n });\r\n }\r\n}\r\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\r\n var visuals = extend({}, designatedVisual);\r\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\r\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\r\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\r\n var val = nodeItemStyleModel.get(visualName);\r\n designatedVisualItemStyle[visualName] = null;\r\n val != null && (visuals[visualName] = val);\r\n });\r\n return visuals;\r\n}\r\nfunction calculateColor(visuals) {\r\n var color = getValueVisualDefine(visuals, 'color');\r\n if (color) {\r\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\r\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\r\n if (colorSaturation) {\r\n color = modifyHSL(color, null, null, colorSaturation);\r\n }\r\n if (colorAlpha) {\r\n color = modifyAlpha(color, colorAlpha);\r\n }\r\n return color;\r\n }\r\n}\r\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\r\n return thisNodeColor != null\r\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation)\r\n : null;\r\n}\r\nfunction getValueVisualDefine(visuals, name) {\r\n var value = visuals[name];\r\n if (value != null && value !== 'none') {\r\n return value;\r\n }\r\n}\r\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\r\n if (!viewChildren || !viewChildren.length) {\r\n return;\r\n }\r\n var rangeVisual = getRangeVisual(nodeModel, 'color')\r\n || (visuals.color != null\r\n && visuals.color !== 'none'\r\n && (getRangeVisual(nodeModel, 'colorAlpha')\r\n || getRangeVisual(nodeModel, 'colorSaturation')));\r\n if (!rangeVisual) {\r\n return;\r\n }\r\n var visualMin = nodeModel.get('visualMin');\r\n var visualMax = nodeModel.get('visualMax');\r\n var dataExtent = nodeLayout.dataExtent.slice();\r\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\r\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\r\n var colorMappingBy = nodeModel.get('colorMappingBy');\r\n var opt = {\r\n type: rangeVisual.name,\r\n dataExtent: dataExtent,\r\n visual: rangeVisual.range\r\n };\r\n if (opt.type === 'color'\r\n && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\r\n opt.mappingMethod = 'category';\r\n opt.loop = true;\r\n }\r\n else {\r\n opt.mappingMethod = 'linear';\r\n }\r\n var mapping = new VisualMapping(opt);\r\n inner$a(mapping).drColorMappingBy = colorMappingBy;\r\n return mapping;\r\n}\r\nfunction getRangeVisual(nodeModel, name) {\r\n var range = nodeModel.get(name);\r\n return (isArray(range) && range.length) ? {\r\n name: name,\r\n range: range\r\n } : null;\r\n}\r\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\r\n var childVisuals = extend({}, visuals);\r\n if (mapping) {\r\n var mappingType = mapping.type;\r\n var colorMappingBy = mappingType === 'color' && inner$a(mapping).drColorMappingBy;\r\n var value = colorMappingBy === 'index'\r\n ? index\r\n : colorMappingBy === 'id'\r\n ? seriesModel.mapIdToIndex(child.getId())\r\n : child.getValue(nodeModel.get('visualDimension'));\r\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\r\n }\r\n return childVisuals;\r\n}\n\nvar mathMax$7 = Math.max;\r\nvar mathMin$7 = Math.min;\r\nvar retrieveValue = retrieve;\r\nvar each$5 = each;\r\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\r\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\r\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\r\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\r\nvar treemapLayout = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel, ecModel, api, payload) {\r\n var ecWidth = api.getWidth();\r\n var ecHeight = api.getHeight();\r\n var seriesOption = seriesModel.option;\r\n var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n var size = seriesOption.size || [];\r\n var containerWidth = parsePercent$2(retrieveValue(layoutInfo.width, size[0]), ecWidth);\r\n var containerHeight = parsePercent$2(retrieveValue(layoutInfo.height, size[1]), ecHeight);\r\n var payloadType = payload && payload.type;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')\r\n ? payload.rootRect : null;\r\n var viewRoot = seriesModel.getViewRoot();\r\n var viewAbovePath = getPathToRoot(viewRoot);\r\n if (payloadType !== 'treemapMove') {\r\n var rootSize = payloadType === 'treemapZoomToNode'\r\n ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight)\r\n : rootRect\r\n ? [rootRect.width, rootRect.height]\r\n : [containerWidth, containerHeight];\r\n var sort_1 = seriesOption.sort;\r\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\r\n sort_1 = 'desc';\r\n }\r\n var options = {\r\n squareRatio: seriesOption.squareRatio,\r\n sort: sort_1,\r\n leafDepth: seriesOption.leafDepth\r\n };\r\n viewRoot.hostTree.clearLayouts();\r\n var viewRootLayout_1 = {\r\n x: 0,\r\n y: 0,\r\n width: rootSize[0],\r\n height: rootSize[1],\r\n area: rootSize[0] * rootSize[1]\r\n };\r\n viewRoot.setLayout(viewRootLayout_1);\r\n squarify(viewRoot, options, false, 0);\r\n viewRootLayout_1 = viewRoot.getLayout();\r\n each$5(viewAbovePath, function (node, index) {\r\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\r\n node.setLayout(extend({\r\n dataExtent: [childValue, childValue],\r\n borderWidth: 0,\r\n upperHeight: 0\r\n }, viewRootLayout_1));\r\n });\r\n }\r\n var treeRoot = seriesModel.getData().tree.root;\r\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\r\n seriesModel.setLayoutInfo(layoutInfo);\r\n prunning(treeRoot, new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\r\n }\r\n};\r\nfunction squarify(node, options, hideChildren, depth) {\r\n var width;\r\n var height;\r\n if (node.isRemoved()) {\r\n return;\r\n }\r\n var thisLayout = node.getLayout();\r\n width = thisLayout.width;\r\n height = thisLayout.height;\r\n var nodeModel = node.getModel();\r\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\r\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\r\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\r\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\r\n var layoutOffset = borderWidth - halfGapWidth;\r\n var layoutOffsetUpper = upperHeight - halfGapWidth;\r\n node.setLayout({\r\n borderWidth: borderWidth,\r\n upperHeight: upperHeight,\r\n upperLabelHeight: upperLabelHeight\r\n }, true);\r\n width = mathMax$7(width - 2 * layoutOffset, 0);\r\n height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0);\r\n var totalArea = width * height;\r\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\r\n if (!viewChildren.length) {\r\n return;\r\n }\r\n var rect = { x: layoutOffset, y: layoutOffsetUpper, width: width, height: height };\r\n var rowFixedLength = mathMin$7(width, height);\r\n var best = Infinity;\r\n var row = [];\r\n row.area = 0;\r\n for (var i = 0, len = viewChildren.length; i < len;) {\r\n var child = viewChildren[i];\r\n row.push(child);\r\n row.area += child.getLayout().area;\r\n var score = worst(row, rowFixedLength, options.squareRatio);\r\n if (score <= best) {\r\n i++;\r\n best = score;\r\n }\r\n else {\r\n row.area -= row.pop().getLayout().area;\r\n position(row, rowFixedLength, rect, halfGapWidth, false);\r\n rowFixedLength = mathMin$7(rect.width, rect.height);\r\n row.length = row.area = 0;\r\n best = Infinity;\r\n }\r\n }\r\n if (row.length) {\r\n position(row, rowFixedLength, rect, halfGapWidth, true);\r\n }\r\n if (!hideChildren) {\r\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\r\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\r\n hideChildren = true;\r\n }\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n squarify(viewChildren[i], options, hideChildren, depth + 1);\r\n }\r\n}\r\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\r\n var viewChildren = node.children || [];\r\n var orderBy = options.sort;\r\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\r\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\r\n if (hideChildren && !overLeafDepth) {\r\n return (node.viewChildren = []);\r\n }\r\n viewChildren = filter(viewChildren, function (child) {\r\n return !child.isRemoved();\r\n });\r\n sort$1(viewChildren, orderBy);\r\n var info = statistic(nodeModel, viewChildren, orderBy);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n var area = viewChildren[i].getValue() / info.sum * totalArea;\r\n viewChildren[i].setLayout({\r\n area: area\r\n });\r\n }\r\n if (overLeafDepth) {\r\n viewChildren.length && node.setLayout({\r\n isLeafRoot: true\r\n }, true);\r\n viewChildren.length = 0;\r\n }\r\n node.viewChildren = viewChildren;\r\n node.setLayout({\r\n dataExtent: info.dataExtent\r\n }, true);\r\n return viewChildren;\r\n}\r\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\r\n if (!orderBy) {\r\n return sum;\r\n }\r\n var visibleMin = nodeModel.get('visibleMin');\r\n var len = orderedChildren.length;\r\n var deletePoint = len;\r\n for (var i = len - 1; i >= 0; i--) {\r\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\r\n if (value / sum * totalArea < visibleMin) {\r\n deletePoint = i;\r\n sum -= value;\r\n }\r\n }\r\n orderBy === 'asc'\r\n ? orderedChildren.splice(0, len - deletePoint)\r\n : orderedChildren.splice(deletePoint, len - deletePoint);\r\n return sum;\r\n}\r\nfunction sort$1(viewChildren, orderBy) {\r\n if (orderBy) {\r\n viewChildren.sort(function (a, b) {\r\n var diff = orderBy === 'asc'\r\n ? a.getValue() - b.getValue()\r\n : b.getValue() - a.getValue();\r\n return diff === 0\r\n ? (orderBy === 'asc'\r\n ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex)\r\n : diff;\r\n });\r\n }\r\n return viewChildren;\r\n}\r\nfunction statistic(nodeModel, children, orderBy) {\r\n var sum = 0;\r\n for (var i = 0, len = children.length; i < len; i++) {\r\n sum += children[i].getValue();\r\n }\r\n var dimension = nodeModel.get('visualDimension');\r\n var dataExtent;\r\n if (!children || !children.length) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n else if (dimension === 'value' && orderBy) {\r\n dataExtent = [\r\n children[children.length - 1].getValue(),\r\n children[0].getValue()\r\n ];\r\n orderBy === 'asc' && dataExtent.reverse();\r\n }\r\n else {\r\n dataExtent = [Infinity, -Infinity];\r\n each$5(children, function (child) {\r\n var value = child.getValue(dimension);\r\n value < dataExtent[0] && (dataExtent[0] = value);\r\n value > dataExtent[1] && (dataExtent[1] = value);\r\n });\r\n }\r\n return { sum: sum, dataExtent: dataExtent };\r\n}\r\nfunction worst(row, rowFixedLength, ratio) {\r\n var areaMax = 0;\r\n var areaMin = Infinity;\r\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\r\n area = row[i].getLayout().area;\r\n if (area) {\r\n area < areaMin && (areaMin = area);\r\n area > areaMax && (areaMax = area);\r\n }\r\n }\r\n var squareArea = row.area * row.area;\r\n var f = rowFixedLength * rowFixedLength * ratio;\r\n return squareArea\r\n ? mathMax$7((f * areaMax) / squareArea, squareArea / (f * areaMin))\r\n : Infinity;\r\n}\r\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\r\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\r\n var idx1WhenH = 1 - idx0WhenH;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var last = rect[xy[idx0WhenH]];\r\n var rowOtherLength = rowFixedLength\r\n ? row.area / rowFixedLength : 0;\r\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\r\n rowOtherLength = rect[wh[idx1WhenH]];\r\n }\r\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\r\n var node = row[i];\r\n var nodeLayout = {};\r\n var step = rowOtherLength\r\n ? node.getLayout().area / rowOtherLength : 0;\r\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0);\r\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\r\n var modWH = (i === rowLen - 1 || remain < step) ? remain : step;\r\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0);\r\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2);\r\n nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2);\r\n last += modWH;\r\n node.setLayout(nodeLayout, true);\r\n }\r\n rect[xy[idx1WhenH]] += rowOtherLength;\r\n rect[wh[idx1WhenH]] -= rowOtherLength;\r\n}\r\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\r\n var currNode = (targetInfo || {}).node;\r\n var defaultSize = [containerWidth, containerHeight];\r\n if (!currNode || currNode === viewRoot) {\r\n return defaultSize;\r\n }\r\n var parent;\r\n var viewArea = containerWidth * containerHeight;\r\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\r\n while (parent = currNode.parentNode) {\r\n var sum = 0;\r\n var siblings = parent.children;\r\n for (var i = 0, len = siblings.length; i < len; i++) {\r\n sum += siblings[i].getValue();\r\n }\r\n var currNodeValue = currNode.getValue();\r\n if (currNodeValue === 0) {\r\n return defaultSize;\r\n }\r\n area *= sum / currNodeValue;\r\n var parentModel = parent.getModel();\r\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\r\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\r\n area += 4 * borderWidth * borderWidth\r\n + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\r\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\r\n currNode = parent;\r\n }\r\n area < viewArea && (area = viewArea);\r\n var scale = Math.pow(area / viewArea, 0.5);\r\n return [containerWidth * scale, containerHeight * scale];\r\n}\r\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\r\n if (rootRect) {\r\n return { x: rootRect.x, y: rootRect.y };\r\n }\r\n var defaultPosition = { x: 0, y: 0 };\r\n if (!targetInfo) {\r\n return defaultPosition;\r\n }\r\n var targetNode = targetInfo.node;\r\n var layout = targetNode.getLayout();\r\n if (!layout) {\r\n return defaultPosition;\r\n }\r\n var targetCenter = [layout.width / 2, layout.height / 2];\r\n var node = targetNode;\r\n while (node) {\r\n var nodeLayout = node.getLayout();\r\n targetCenter[0] += nodeLayout.x;\r\n targetCenter[1] += nodeLayout.y;\r\n node = node.parentNode;\r\n }\r\n return {\r\n x: layoutInfo.width / 2 - targetCenter[0],\r\n y: layoutInfo.height / 2 - targetCenter[1]\r\n };\r\n}\r\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\r\n var nodeLayout = node.getLayout();\r\n var nodeInViewAbovePath = viewAbovePath[depth];\r\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\r\n if ((nodeInViewAbovePath && !isAboveViewRoot)\r\n || (depth === viewAbovePath.length && node !== viewRoot)) {\r\n return;\r\n }\r\n node.setLayout({\r\n isInView: true,\r\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\r\n isAboveViewRoot: isAboveViewRoot\r\n }, true);\r\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\r\n each$5(node.viewChildren || [], function (child) {\r\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\r\n });\r\n}\r\nfunction getUpperLabelHeight(model) {\r\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\r\n}\n\nregisterVisual(treemapVisual);\r\nregisterLayout(treemapLayout);\n\nfunction generateNodeKey(id) {\r\n return '_EC_' + id;\r\n}\r\nvar Graph = (function () {\r\n function Graph(directed) {\r\n this.type = 'graph';\r\n this.nodes = [];\r\n this.edges = [];\r\n this._nodesMap = {};\r\n this._edgesMap = {};\r\n this._directed = directed || false;\r\n }\r\n Graph.prototype.isDirected = function () {\r\n return this._directed;\r\n };\r\n Graph.prototype.addNode = function (id, dataIndex) {\r\n id = id == null ? ('' + dataIndex) : ('' + id);\r\n var nodesMap = this._nodesMap;\r\n if (nodesMap[generateNodeKey(id)]) {\r\n if (__DEV__) {\r\n console.error('Graph nodes have duplicate name or id');\r\n }\r\n return;\r\n }\r\n var node = new GraphNode(id, dataIndex);\r\n node.hostGraph = this;\r\n this.nodes.push(node);\r\n nodesMap[generateNodeKey(id)] = node;\r\n return node;\r\n };\r\n Graph.prototype.getNodeByIndex = function (dataIndex) {\r\n var rawIdx = this.data.getRawIndex(dataIndex);\r\n return this.nodes[rawIdx];\r\n };\r\n Graph.prototype.getNodeById = function (id) {\r\n return this._nodesMap[generateNodeKey(id)];\r\n };\r\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\r\n var nodesMap = this._nodesMap;\r\n var edgesMap = this._edgesMap;\r\n if (typeof n1 === 'number') {\r\n n1 = this.nodes[n1];\r\n }\r\n if (typeof n2 === 'number') {\r\n n2 = this.nodes[n2];\r\n }\r\n if (!(n1 instanceof GraphNode)) {\r\n n1 = nodesMap[generateNodeKey(n1)];\r\n }\r\n if (!(n2 instanceof GraphNode)) {\r\n n2 = nodesMap[generateNodeKey(n2)];\r\n }\r\n if (!n1 || !n2) {\r\n return;\r\n }\r\n var key = n1.id + '-' + n2.id;\r\n var edge = new GraphEdge(n1, n2, dataIndex);\r\n edge.hostGraph = this;\r\n if (this._directed) {\r\n n1.outEdges.push(edge);\r\n n2.inEdges.push(edge);\r\n }\r\n n1.edges.push(edge);\r\n if (n1 !== n2) {\r\n n2.edges.push(edge);\r\n }\r\n this.edges.push(edge);\r\n edgesMap[key] = edge;\r\n return edge;\r\n };\r\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\r\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\r\n return this.edges[rawIdx];\r\n };\r\n Graph.prototype.getEdge = function (n1, n2) {\r\n if (n1 instanceof GraphNode) {\r\n n1 = n1.id;\r\n }\r\n if (n2 instanceof GraphNode) {\r\n n2 = n2.id;\r\n }\r\n var edgesMap = this._edgesMap;\r\n if (this._directed) {\r\n return edgesMap[n1 + '-' + n2];\r\n }\r\n else {\r\n return edgesMap[n1 + '-' + n2]\r\n || edgesMap[n2 + '-' + n1];\r\n }\r\n };\r\n Graph.prototype.eachNode = function (cb, context) {\r\n var nodes = this.nodes;\r\n var len = nodes.length;\r\n for (var i = 0; i < len; i++) {\r\n if (nodes[i].dataIndex >= 0) {\r\n cb.call(context, nodes[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.eachEdge = function (cb, context) {\r\n var edges = this.edges;\r\n var len = edges.length;\r\n for (var i = 0; i < len; i++) {\r\n if (edges[i].dataIndex >= 0\r\n && edges[i].node1.dataIndex >= 0\r\n && edges[i].node2.dataIndex >= 0) {\r\n cb.call(context, edges[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\r\n if (!(startNode instanceof GraphNode)) {\r\n startNode = this._nodesMap[generateNodeKey(startNode)];\r\n }\r\n if (!startNode) {\r\n return;\r\n }\r\n var edgeType = direction === 'out'\r\n ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');\r\n for (var i = 0; i < this.nodes.length; i++) {\r\n this.nodes[i].__visited = false;\r\n }\r\n if (cb.call(context, startNode, null)) {\r\n return;\r\n }\r\n var queue = [startNode];\r\n while (queue.length) {\r\n var currentNode = queue.shift();\r\n var edges = currentNode[edgeType];\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n var otherNode = e.node1 === currentNode\r\n ? e.node2 : e.node1;\r\n if (!otherNode.__visited) {\r\n if (cb.call(context, otherNode, currentNode)) {\r\n return;\r\n }\r\n queue.push(otherNode);\r\n otherNode.__visited = true;\r\n }\r\n }\r\n }\r\n };\r\n Graph.prototype.update = function () {\r\n var data = this.data;\r\n var edgeData = this.edgeData;\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n edgeData.filterSelf(function (idx) {\r\n var edge = edges[edgeData.getRawIndex(idx)];\r\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\r\n });\r\n for (var i = 0, len = edges.length; i < len; i++) {\r\n edges[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = edgeData.count(); i < len; i++) {\r\n edges[edgeData.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Graph.prototype.clone = function () {\r\n var graph = new Graph(this._directed);\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\r\n }\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\r\n }\r\n return graph;\r\n };\r\n return Graph;\r\n}());\r\nvar GraphNode = (function () {\r\n function GraphNode(id, dataIndex) {\r\n this.inEdges = [];\r\n this.outEdges = [];\r\n this.edges = [];\r\n this.dataIndex = -1;\r\n this.id = id == null ? '' : id;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphNode.prototype.degree = function () {\r\n return this.edges.length;\r\n };\r\n GraphNode.prototype.inDegree = function () {\r\n return this.inEdges.length;\r\n };\r\n GraphNode.prototype.outDegree = function () {\r\n return this.outEdges.length;\r\n };\r\n GraphNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphNode.prototype.getAdjacentDataIndices = function () {\r\n var dataIndices = {\r\n edge: [],\r\n node: []\r\n };\r\n for (var i = 0; i < this.edges.length; i++) {\r\n var adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n dataIndices.edge.push(adjacentEdge.dataIndex);\r\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\r\n }\r\n return dataIndices;\r\n };\r\n return GraphNode;\r\n}());\r\nvar GraphEdge = (function () {\r\n function GraphEdge(n1, n2, dataIndex) {\r\n this.dataIndex = -1;\r\n this.node1 = n1;\r\n this.node2 = n2;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphEdge.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphEdge.prototype.getAdjacentDataIndices = function () {\r\n return {\r\n edge: [this.dataIndex],\r\n node: [this.node1.dataIndex, this.node2.dataIndex]\r\n };\r\n };\r\n return GraphEdge;\r\n}());\r\nfunction createGraphDataProxyMixin(hostName, dataName) {\r\n return {\r\n getValue: function (dimension) {\r\n var data = this[hostName][dataName];\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n },\r\n setVisual: function (key, value) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\r\n },\r\n getVisual: function (key) {\r\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\r\n },\r\n setLayout: function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\r\n },\r\n getLayout: function () {\r\n return this[hostName][dataName].getItemLayout(this.dataIndex);\r\n },\r\n getGraphicEl: function () {\r\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\r\n },\r\n getRawIndex: function () {\r\n return this[hostName][dataName].getRawIndex(this.dataIndex);\r\n }\r\n };\r\n}\r\nmixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\r\nmixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\n\nfunction createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\r\n var graph = new Graph(directed);\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(retrieve(nodes[i].id, nodes[i].name, i), i);\r\n }\r\n var linkNameList = [];\r\n var validEdges = [];\r\n var linkCount = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n var link = edges[i];\r\n var source = link.source;\r\n var target = link.target;\r\n if (graph.addEdge(source, target, linkCount)) {\r\n validEdges.push(link);\r\n linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\r\n linkCount++;\r\n }\r\n }\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n var nodeData;\r\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\r\n nodeData = createListFromArray(nodes, seriesModel);\r\n }\r\n else {\r\n var coordSysCtor = CoordinateSystemManager.get(coordSys);\r\n var coordDimensions = coordSysCtor\r\n ? (coordSysCtor.dimensions || []) : [];\r\n if (indexOf(coordDimensions, 'value') < 0) {\r\n coordDimensions.concat(['value']);\r\n }\r\n var dimensionNames = createDimensions(nodes, {\r\n coordDimensions: coordDimensions\r\n });\r\n nodeData = new List(dimensionNames, seriesModel);\r\n nodeData.initData(nodes);\r\n }\r\n var edgeData = new List(['value'], seriesModel);\r\n edgeData.initData(validEdges, linkNameList);\r\n beforeLink && beforeLink(nodeData, edgeData);\r\n linkList({\r\n mainData: nodeData,\r\n struct: graph,\r\n structAttr: 'graph',\r\n datas: { node: nodeData, edge: edgeData },\r\n datasAttr: { node: 'data', edge: 'edgeData' }\r\n });\r\n graph.update();\r\n return graph;\r\n}\n\nvar KEY_DELIMITER = '-->';\r\nvar getAutoCurvenessParams = function (seriesModel) {\r\n return seriesModel.get('autoCurveness') || null;\r\n};\r\nvar createCurveness = function (seriesModel, appendLength) {\r\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\r\n var length = 20;\r\n var curvenessList = [];\r\n if (typeof autoCurvenessParmas === 'number') {\r\n length = autoCurvenessParmas;\r\n }\r\n else if (isArray(autoCurvenessParmas)) {\r\n seriesModel.__curvenessList = autoCurvenessParmas;\r\n return;\r\n }\r\n if (appendLength > length) {\r\n length = appendLength;\r\n }\r\n var len = length % 2 ? length + 2 : length + 3;\r\n curvenessList = [];\r\n for (var i = 0; i < len; i++) {\r\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\r\n }\r\n seriesModel.__curvenessList = curvenessList;\r\n};\r\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\r\n var source = [n1.id, n1.dataIndex].join('.');\r\n var target = [n2.id, n2.dataIndex].join('.');\r\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\r\n};\r\nvar getOppositeKey = function (key) {\r\n var keys = key.split(KEY_DELIMITER);\r\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\r\n};\r\nvar getEdgeFromMap = function (edge, seriesModel) {\r\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n return seriesModel.__edgeMap[key];\r\n};\r\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\r\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\r\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\r\n return len + lenV;\r\n};\r\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\r\n var edgeMap = seriesModel.__edgeMap;\r\n return edgeMap[key] ? edgeMap[key].length : 0;\r\n};\r\nfunction initCurvenessList(seriesModel) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n seriesModel.__curvenessList = [];\r\n seriesModel.__edgeMap = {};\r\n createCurveness(seriesModel);\r\n}\r\nfunction createEdgeMapForCurveness(n1, n2, seriesModel, index) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n var key = getKeyOfEdges(n1, n2, seriesModel);\r\n var edgeMap = seriesModel.__edgeMap;\r\n var oppositeEdges = edgeMap[getOppositeKey(key)];\r\n if (edgeMap[key] && !oppositeEdges) {\r\n edgeMap[key].isForward = true;\r\n }\r\n else if (oppositeEdges && edgeMap[key]) {\r\n oppositeEdges.isForward = true;\r\n edgeMap[key].isForward = false;\r\n }\r\n edgeMap[key] = edgeMap[key] || [];\r\n edgeMap[key].push(index);\r\n}\r\nfunction getCurvenessForEdge(edge, seriesModel, index, needReverse) {\r\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\r\n var isArrayParam = isArray(autoCurvenessParams);\r\n if (!autoCurvenessParams) {\r\n return null;\r\n }\r\n var edgeArray = getEdgeFromMap(edge, seriesModel);\r\n if (!edgeArray) {\r\n return null;\r\n }\r\n var edgeIndex = -1;\r\n for (var i = 0; i < edgeArray.length; i++) {\r\n if (edgeArray[i] === index) {\r\n edgeIndex = i;\r\n break;\r\n }\r\n }\r\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\r\n createCurveness(seriesModel, totalLen);\r\n edge.lineStyle = edge.lineStyle || {};\r\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n var curvenessList = seriesModel.__curvenessList;\r\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\r\n if (!edgeArray.isForward) {\r\n var oppositeKey = getOppositeKey(curKey);\r\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\r\n var resValue = curvenessList[edgeIndex + len + parityCorrection];\r\n if (needReverse) {\r\n if (isArrayParam) {\r\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n else {\r\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return curvenessList[edgeIndex + len + parityCorrection];\r\n }\r\n }\r\n else {\r\n return curvenessList[parityCorrection + edgeIndex];\r\n }\r\n}\n\nvar GraphSeriesModel = (function (_super) {\r\n __extends(GraphSeriesModel, _super);\r\n function GraphSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n GraphSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n var self = this;\r\n function getCategoriesData() {\r\n return self._categoriesData;\r\n }\r\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\r\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\r\n defaultEmphasis(option, 'edgeLabel', ['show']);\r\n };\r\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var edges = option.edges || option.links || [];\r\n var nodes = option.data || option.nodes || [];\r\n var self = this;\r\n if (nodes && edges) {\r\n initCurvenessList(this);\r\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\r\n each(graph.edges, function (edge) {\r\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\r\n }, this);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model) {\r\n var categoriesModels = self._categoriesModels;\r\n var categoryIdx = model.getShallow('category');\r\n var categoryModel = categoriesModels[categoryIdx];\r\n if (categoryModel) {\r\n categoryModel.parentModel = model.parentModel;\r\n model.parentModel = categoryModel;\r\n }\r\n return model;\r\n });\r\n var oldGetModel = Model.prototype.getModel;\r\n function newGetModel(path, parentModel) {\r\n var model = oldGetModel.call(this, path, parentModel);\r\n model.resolveParentPath = resolveParentPath;\r\n return model;\r\n }\r\n edgeData.wrapMethod('getItemModel', function (model) {\r\n model.resolveParentPath = resolveParentPath;\r\n model.getModel = newGetModel;\r\n return model;\r\n });\r\n function resolveParentPath(pathArr) {\r\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\r\n var newPathArr = pathArr.slice();\r\n if (pathArr[0] === 'label') {\r\n newPathArr[0] = 'edgeLabel';\r\n }\r\n else if (pathArr[1] === 'label') {\r\n newPathArr[1] = 'edgeLabel';\r\n }\r\n return newPathArr;\r\n }\r\n return pathArr;\r\n }\r\n }\r\n };\r\n GraphSeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n GraphSeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n GraphSeriesModel.prototype.getCategoriesData = function () {\r\n return this._categoriesData;\r\n };\r\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n if (dataType === 'edge') {\r\n var nodeData = this.getData();\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\r\n var sourceName = nodeData.getName(edge.node1.dataIndex);\r\n var targetName = nodeData.getName(edge.node2.dataIndex);\r\n var nameArr = [];\r\n sourceName != null && nameArr.push(sourceName);\r\n targetName != null && nameArr.push(targetName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > '),\r\n value: params.value,\r\n noValue: params.value == null\r\n });\r\n }\r\n var nodeMarkup = defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n return nodeMarkup;\r\n };\r\n GraphSeriesModel.prototype._updateCategoriesData = function () {\r\n var categories = map(this.option.categories || [], function (category) {\r\n return category.value != null ? category : extend({\r\n value: 0\r\n }, category);\r\n });\r\n var categoriesData = new List(['value'], this);\r\n categoriesData.initData(categories);\r\n this._categoriesData = categoriesData;\r\n this._categoriesModels = categoriesData.mapArray(function (idx) {\r\n return categoriesData.getItemModel(idx);\r\n });\r\n };\r\n GraphSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GraphSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\r\n return _super.prototype.isAnimationEnabled.call(this)\r\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\r\n };\r\n GraphSeriesModel.type = 'series.graph';\r\n GraphSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n legendHoverLink: true,\r\n layout: null,\r\n focusNodeAdjacency: false,\r\n circular: {\r\n rotateLabel: false\r\n },\r\n force: {\r\n initLayout: null,\r\n repulsion: [0, 50],\r\n gravity: 0.1,\r\n friction: 0.6,\r\n edgeLength: 30,\r\n layoutAnimation: true\r\n },\r\n left: 'center',\r\n top: 'center',\r\n symbol: 'circle',\r\n symbolSize: 10,\r\n edgeSymbol: ['none', 'none'],\r\n edgeSymbolSize: 10,\r\n edgeLabel: {\r\n position: 'middle',\r\n distance: 5\r\n },\r\n draggable: false,\r\n roam: false,\r\n center: null,\r\n zoom: 1,\r\n nodeScaleRatio: 0.6,\r\n label: {\r\n show: false,\r\n formatter: '{b}'\r\n },\r\n itemStyle: {},\r\n lineStyle: {\r\n color: '#aaa',\r\n width: 1,\r\n opacity: 0.5\r\n },\r\n emphasis: {\r\n scale: true,\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return GraphSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(GraphSeriesModel);\n\nvar straightLineProto = Line.prototype;\r\nvar bezierCurveProto = BezierCurve.prototype;\r\nvar StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n}());\r\nvar CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n}(StraightLineShape));\r\nfunction isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n}\r\nvar ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n}(Path));\n\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\nfunction makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n}\r\nfunction createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n}\r\nfunction createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n}\r\nfunction setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n}\r\nvar Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n}(Group));\n\nvar LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n}());\r\nfunction isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n}\r\nfunction makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n}\r\nfunction isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n}\r\nfunction lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n}\n\nfunction getNodeGlobalScale(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n}\r\nfunction getSymbolSize(node) {\r\n var symbolSize = node.getVisual('symbolSize');\r\n if (symbolSize instanceof Array) {\r\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\r\n }\r\n return +symbolSize;\r\n}\n\nvar v1 = [];\r\nvar v2 = [];\r\nvar v3 = [];\r\nvar quadraticAt$1 = quadraticAt;\r\nvar v2DistSquare = distSquare;\r\nvar mathAbs$2 = Math.abs;\r\nfunction intersectCurveCircle(curvePoints, center, radius) {\r\n var p0 = curvePoints[0];\r\n var p1 = curvePoints[1];\r\n var p2 = curvePoints[2];\r\n var d = Infinity;\r\n var t;\r\n var radiusSquare = radius * radius;\r\n var interval = 0.1;\r\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\r\n v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t);\r\n v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t);\r\n var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare);\r\n if (diff < d) {\r\n d = diff;\r\n t = _t;\r\n }\r\n }\r\n for (var i = 0; i < 32; i++) {\r\n var next = t + interval;\r\n v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t);\r\n v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t);\r\n v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next);\r\n v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next);\r\n var diff = v2DistSquare(v2, center) - radiusSquare;\r\n if (mathAbs$2(diff) < 1e-2) {\r\n break;\r\n }\r\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\r\n interval /= 2;\r\n if (diff < 0) {\r\n if (nextDiff >= 0) {\r\n t = t + interval;\r\n }\r\n else {\r\n t = t - interval;\r\n }\r\n }\r\n else {\r\n if (nextDiff >= 0) {\r\n t = t - interval;\r\n }\r\n else {\r\n t = t + interval;\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\nfunction adjustEdge(graph, scale) {\r\n var tmp0 = [];\r\n var quadraticSubdivide$1 = quadraticSubdivide;\r\n var pts = [[], [], []];\r\n var pts2 = [[], []];\r\n var v = [];\r\n scale /= 2;\r\n graph.eachEdge(function (edge, idx) {\r\n var linePoints = edge.getLayout();\r\n var fromSymbol = edge.getVisual('fromSymbol');\r\n var toSymbol = edge.getVisual('toSymbol');\r\n if (!linePoints.__original) {\r\n linePoints.__original = [\r\n clone$1(linePoints[0]),\r\n clone$1(linePoints[1])\r\n ];\r\n if (linePoints[2]) {\r\n linePoints.__original.push(clone$1(linePoints[2]));\r\n }\r\n }\r\n var originalPoints = linePoints.__original;\r\n if (linePoints[2] != null) {\r\n copy(pts[0], originalPoints[0]);\r\n copy(pts[1], originalPoints[2]);\r\n copy(pts[2], originalPoints[1]);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[0][0] = tmp0[3];\r\n pts[1][0] = tmp0[4];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[0][1] = tmp0[3];\r\n pts[1][1] = tmp0[4];\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[1][0] = tmp0[1];\r\n pts[2][0] = tmp0[2];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[1][1] = tmp0[1];\r\n pts[2][1] = tmp0[2];\r\n }\r\n copy(linePoints[0], pts[0]);\r\n copy(linePoints[1], pts[2]);\r\n copy(linePoints[2], pts[1]);\r\n }\r\n else {\r\n copy(pts2[0], originalPoints[0]);\r\n copy(pts2[1], originalPoints[1]);\r\n sub(v, pts2[1], pts2[0]);\r\n normalize(v, v);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\r\n }\r\n copy(linePoints[0], pts2[0]);\r\n copy(linePoints[1], pts2[1]);\r\n }\r\n });\r\n}\n\nfunction isViewCoordSys(coordSys) {\r\n return coordSys.type === 'view';\r\n}\r\nvar GraphView = (function (_super) {\r\n __extends(GraphView, _super);\r\n function GraphView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphView.type;\r\n return _this;\r\n }\r\n GraphView.prototype.init = function (ecModel, api) {\r\n var symbolDraw = new SymbolDraw();\r\n var lineDraw = new LineDraw();\r\n var group = this.group;\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: group\r\n };\r\n group.add(symbolDraw.group);\r\n group.add(lineDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineDraw = lineDraw;\r\n this._firstRender = true;\r\n };\r\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n this._model = seriesModel;\r\n var symbolDraw = this._symbolDraw;\r\n var lineDraw = this._lineDraw;\r\n var group = this.group;\r\n if (isViewCoordSys(coordSys)) {\r\n var groupNewProp = {\r\n x: coordSys.x, y: coordSys.y,\r\n scaleX: coordSys.scaleX, scaleY: coordSys.scaleY\r\n };\r\n if (this._firstRender) {\r\n group.attr(groupNewProp);\r\n }\r\n else {\r\n updateProps(group, groupNewProp, seriesModel);\r\n }\r\n }\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n var data = seriesModel.getData();\r\n symbolDraw.updateData(data);\r\n var edgeData = seriesModel.getEdgeData();\r\n lineDraw.updateData(edgeData);\r\n this._updateNodeAndLinkScale();\r\n this._updateController(seriesModel, ecModel, api);\r\n clearTimeout(this._layoutTimeout);\r\n var forceLayout = seriesModel.forceLayout;\r\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\r\n if (forceLayout) {\r\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n }\r\n data.graph.eachNode(function (node) {\r\n var idx = node.dataIndex;\r\n var el = node.getGraphicEl();\r\n var itemModel = node.getModel();\r\n el.off('drag').off('dragend');\r\n var draggable = itemModel.get('draggable');\r\n if (draggable) {\r\n el.on('drag', function () {\r\n if (forceLayout) {\r\n forceLayout.warmUp();\r\n !_this._layouting\r\n && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n forceLayout.setFixed(idx);\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n }\r\n }).on('dragend', function () {\r\n if (forceLayout) {\r\n forceLayout.setUnfixed(idx);\r\n }\r\n });\r\n }\r\n el.setDraggable(draggable && !!forceLayout);\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = node.getAdjacentDataIndices();\r\n }\r\n });\r\n data.graph.eachEdge(function (edge) {\r\n var el = edge.getGraphicEl();\r\n var focus = edge.getModel().get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = {\r\n edge: [edge.dataIndex],\r\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\r\n };\r\n }\r\n });\r\n var circularRotateLabel = seriesModel.get('layout') === 'circular'\r\n && seriesModel.get(['circular', 'rotateLabel']);\r\n var cx = data.getLayout('cx');\r\n var cy = data.getLayout('cy');\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelRotate = itemModel.get(['label', 'rotate']) || 0;\r\n var symbolPath = el.getSymbolPath();\r\n if (circularRotateLabel) {\r\n var pos = data.getItemLayout(idx);\r\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n var isLeft = pos[0] < cx;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n symbolPath.setTextConfig({\r\n rotation: -rad,\r\n position: textPosition,\r\n origin: 'center'\r\n });\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\r\n position: textPosition\r\n });\r\n }\r\n else {\r\n symbolPath.setTextConfig({\r\n rotation: labelRotate *= Math.PI / 180\r\n });\r\n }\r\n });\r\n this._firstRender = false;\r\n };\r\n GraphView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\r\n var self = this;\r\n (function step() {\r\n forceLayout.step(function (stopped) {\r\n self.updateLayout(self._model);\r\n (self._layouting = !stopped) && (layoutAnimation\r\n ? (self._layoutTimeout = setTimeout(step, 16))\r\n : step());\r\n });\r\n })();\r\n };\r\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\r\n controller.disable();\r\n return;\r\n }\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale();\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n _this._lineDraw.updateLayout();\r\n api.updateLabelLayout();\r\n });\r\n };\r\n GraphView.prototype._updateNodeAndLinkScale = function () {\r\n var seriesModel = this._model;\r\n var data = seriesModel.getData();\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n GraphView.prototype.updateLayout = function (seriesModel) {\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n this._symbolDraw.updateLayout();\r\n this._lineDraw.updateLayout();\r\n };\r\n GraphView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove();\r\n this._lineDraw && this._lineDraw.remove();\r\n };\r\n GraphView.type = 'graph';\r\n return GraphView;\r\n}(ChartView));\r\nChartView.registerClass(GraphView);\n\nregisterAction({\r\n type: 'focusNodeAdjacency',\r\n event: 'focusNodeAdjacency',\r\n update: 'series:focusNodeAdjacency'\r\n}, function () { });\r\nregisterAction({\r\n type: 'unfocusNodeAdjacency',\r\n event: 'unfocusNodeAdjacency',\r\n update: 'series:unfocusNodeAdjacency'\r\n}, function () { });\n\nvar actionInfo = {\r\n type: 'graphRoam',\r\n event: 'graphRoam',\r\n update: 'none'\r\n};\r\nregisterAction(actionInfo, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n});\n\nfunction categoryFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var categoriesData = graphSeries.getCategoriesData();\r\n var graph = graphSeries.getGraph();\r\n var data = graph.data;\r\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n data.filterSelf(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var category = model.getShallow('category');\r\n if (category != null) {\r\n if (typeof category === 'number') {\r\n category = categoryNames[category];\r\n }\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n });\r\n}\n\nfunction categoryVisual(ecModel) {\r\n var paletteScope = {};\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var categoriesData = seriesModel.getCategoriesData();\r\n var data = seriesModel.getData();\r\n var categoryNameIdxMap = {};\r\n categoriesData.each(function (idx) {\r\n var name = categoriesData.getName(idx);\r\n categoryNameIdxMap['ec-' + name] = idx;\r\n var itemModel = categoriesData.getItemModel(idx);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\r\n }\r\n categoriesData.setItemVisual(idx, 'style', style);\r\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < symbolVisualList.length; i++) {\r\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\r\n if (symbolVisual != null) {\r\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\r\n }\r\n }\r\n });\r\n if (categoriesData.count()) {\r\n data.each(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var categoryIdx = model.getShallow('category');\r\n if (categoryIdx != null) {\r\n if (typeof categoryIdx === 'string') {\r\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\r\n }\r\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\r\n var style = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(style, categoryStyle);\r\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < visualList.length; i++) {\r\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\n\nfunction normalize$2(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\nfunction graphEdgeVisual(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var edgeData = seriesModel.getEdgeData();\r\n var symbolType = normalize$2(seriesModel.get('edgeSymbol'));\r\n var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize'));\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n edgeData.each(function (idx) {\r\n var itemModel = edgeData.getItemModel(idx);\r\n var edge = graph.getEdgeByIndex(idx);\r\n var symbolType = normalize$2(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true));\r\n var style = itemModel.getModel('lineStyle').getLineStyle();\r\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n switch (existsStyle.stroke) {\r\n case 'source': {\r\n var nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n case 'target': {\r\n var nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n}\n\nfunction simpleLayout(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var graph = seriesModel.getGraph();\r\n graph.eachNode(function (node) {\r\n var model = node.getModel();\r\n node.setLayout([+model.get('x'), +model.get('y')]);\r\n });\r\n simpleLayoutEdge(graph, seriesModel);\r\n}\r\nfunction simpleLayoutEdge(graph, seriesModel) {\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var points = [p1, p2];\r\n if (+curveness) {\r\n points.push([\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness\r\n ]);\r\n }\r\n edge.setLayout(points);\r\n });\r\n}\n\nfunction graphSimpleLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var layout = seriesModel.get('layout');\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n var data_1 = seriesModel.getData();\r\n var dimensions_1 = [];\r\n each(coordSys.dimensions, function (coordDim) {\r\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\r\n });\r\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\r\n var value = [];\r\n var hasValue = false;\r\n for (var i = 0; i < dimensions_1.length; i++) {\r\n var val = data_1.get(dimensions_1[i], dataIndex);\r\n if (!isNaN(val)) {\r\n hasValue = true;\r\n }\r\n value.push(val);\r\n }\r\n if (hasValue) {\r\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\r\n }\r\n else {\r\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\r\n }\r\n }\r\n simpleLayoutEdge(data_1.graph, seriesModel);\r\n }\r\n else if (!layout || layout === 'none') {\r\n simpleLayout(seriesModel);\r\n }\r\n });\r\n}\n\nvar PI$7 = Math.PI;\r\nvar _symbolRadiansHalf = [];\r\nfunction circularLayout(seriesModel, basedOn) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var rect = coordSys.getBoundingRect();\r\n var nodeData = seriesModel.getData();\r\n var graph = nodeData.graph;\r\n var cx = rect.width / 2 + rect.x;\r\n var cy = rect.height / 2 + rect.y;\r\n var r = Math.min(rect.width, rect.height) / 2;\r\n var count = nodeData.count();\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n if (!count) {\r\n return;\r\n }\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var cp1;\r\n var x12 = (p1[0] + p2[0]) / 2;\r\n var y12 = (p1[1] + p2[1]) / 2;\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [\r\n cx * curveness + x12 * (1 - curveness),\r\n cy * curveness + y12 * (1 - curveness)\r\n ];\r\n }\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n}\r\nvar _layoutNodesBasedOn = {\r\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var angle = 0;\r\n var sum = nodeData.getSum('value');\r\n var unitAngle = Math.PI * 2 / (sum || count);\r\n graph.eachNode(function (node) {\r\n var value = node.getValue('value');\r\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n },\r\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n graph.eachNode(function (node) {\r\n var symbolSize = getSymbolSize(node);\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n symbolSize *= nodeScale;\r\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$7 / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n var halfRemainRadian = (2 * PI$7 - sumRadian) / count / 2;\r\n var angle = 0;\r\n graph.eachNode(function (node) {\r\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n }\r\n};\n\nfunction graphCircularLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n if (seriesModel.get('layout') === 'circular') {\r\n circularLayout(seriesModel, 'symbolSize');\r\n }\r\n });\r\n}\n\nvar scaleAndAdd$1 = scaleAndAdd;\r\nfunction forceLayout(inNodes, inEdges, opts) {\r\n var nodes = inNodes;\r\n var edges = inEdges;\r\n var rect = opts.rect;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var center = [rect.x + width / 2, rect.y + height / 2];\r\n var gravity = opts.gravity == null ? 0.1 : opts.gravity;\r\n for (var i = 0; i < nodes.length; i++) {\r\n var n = nodes[i];\r\n if (!n.p) {\r\n n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\r\n }\r\n n.pp = clone$1(n.p);\r\n n.edges = null;\r\n }\r\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\r\n var friction = initialFriction;\r\n var beforeStepCallback;\r\n var afterStepCallback;\r\n return {\r\n warmUp: function () {\r\n friction = initialFriction * 0.8;\r\n },\r\n setFixed: function (idx) {\r\n nodes[idx].fixed = true;\r\n },\r\n setUnfixed: function (idx) {\r\n nodes[idx].fixed = false;\r\n },\r\n beforeStep: function (cb) {\r\n beforeStepCallback = cb;\r\n },\r\n afterStep: function (cb) {\r\n afterStepCallback = cb;\r\n },\r\n step: function (cb) {\r\n beforeStepCallback && beforeStepCallback(nodes, edges);\r\n var v12 = [];\r\n var nLen = nodes.length;\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n if (e.ignoreForceLayout) {\r\n continue;\r\n }\r\n var n1 = e.n1;\r\n var n2 = e.n2;\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12) - e.d;\r\n var w = n2.w / (n1.w + n2.w);\r\n if (isNaN(w)) {\r\n w = 0;\r\n }\r\n normalize(v12, v12);\r\n !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction);\r\n !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction);\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v12, center, n.p);\r\n scaleAndAdd$1(n.p, n.p, v12, gravity * friction);\r\n }\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n1 = nodes[i];\r\n for (var j = i + 1; j < nLen; j++) {\r\n var n2 = nodes[j];\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12);\r\n if (d === 0) {\r\n set(v12, Math.random() - 0.5, Math.random() - 0.5);\r\n d = 1;\r\n }\r\n var repFact = (n1.rep + n2.rep) / d / d;\r\n !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact);\r\n !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact);\r\n }\r\n }\r\n var v = [];\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v, n.p, n.pp);\r\n scaleAndAdd$1(n.p, n.p, v, friction);\r\n copy(n.pp, n.p);\r\n }\r\n }\r\n friction = friction * 0.992;\r\n var finished = friction < 0.01;\r\n afterStepCallback && afterStepCallback(nodes, edges, finished);\r\n cb && cb(finished);\r\n }\r\n };\r\n}\n\nfunction graphForceLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var coordSys = graphSeries.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n if (graphSeries.get('layout') === 'force') {\r\n var preservedPoints_1 = graphSeries.preservedPoints || {};\r\n var graph_1 = graphSeries.getGraph();\r\n var nodeData_1 = graph_1.data;\r\n var edgeData = graph_1.edgeData;\r\n var forceModel = graphSeries.getModel('force');\r\n var initLayout = forceModel.get('initLayout');\r\n if (graphSeries.preservedPoints) {\r\n nodeData_1.each(function (idx) {\r\n var id = nodeData_1.getId(idx);\r\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\r\n });\r\n }\r\n else if (!initLayout || initLayout === 'none') {\r\n simpleLayout(graphSeries);\r\n }\r\n else if (initLayout === 'circular') {\r\n circularLayout(graphSeries, 'value');\r\n }\r\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\r\n var edgeDataExtent_1 = edgeData.getDataExtent('value');\r\n var repulsion = forceModel.get('repulsion');\r\n var edgeLength = forceModel.get('edgeLength');\r\n var repulsionArr_1 = isArray(repulsion)\r\n ? repulsion : [repulsion, repulsion];\r\n var edgeLengthArr_1 = isArray(edgeLength)\r\n ? edgeLength : [edgeLength, edgeLength];\r\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\r\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\r\n var point = nodeData_1.getItemLayout(idx);\r\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\r\n if (isNaN(rep)) {\r\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\r\n }\r\n return {\r\n w: rep,\r\n rep: rep,\r\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\r\n p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point\r\n };\r\n });\r\n var edges = edgeData.mapArray('value', function (value, idx) {\r\n var edge = graph_1.getEdgeByIndex(idx);\r\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\r\n if (isNaN(d)) {\r\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\r\n }\r\n var edgeModel = edge.getModel();\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\r\n return {\r\n n1: nodes_1[edge.node1.dataIndex],\r\n n2: nodes_1[edge.node2.dataIndex],\r\n d: d,\r\n curveness: curveness,\r\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\r\n };\r\n });\r\n var rect = coordSys.getBoundingRect();\r\n var forceInstance = forceLayout(nodes_1, edges, {\r\n rect: rect,\r\n gravity: forceModel.get('gravity'),\r\n friction: forceModel.get('friction')\r\n });\r\n forceInstance.beforeStep(function (nodes, edges) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (nodes[i].fixed) {\r\n copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\r\n }\r\n }\r\n });\r\n forceInstance.afterStep(function (nodes, edges, stopped) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (!nodes[i].fixed) {\r\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\r\n }\r\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\r\n }\r\n for (var i = 0, l = edges.length; i < l; i++) {\r\n var e = edges[i];\r\n var edge = graph_1.getEdgeByIndex(i);\r\n var p1 = e.n1.p;\r\n var p2 = e.n2.p;\r\n var points = edge.getLayout();\r\n points = points ? points.slice() : [];\r\n points[0] = points[0] || [];\r\n points[1] = points[1] || [];\r\n copy(points[0], p1);\r\n copy(points[1], p2);\r\n if (+e.curveness) {\r\n points[2] = [\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness\r\n ];\r\n }\r\n edge.setLayout(points);\r\n }\r\n });\r\n graphSeries.forceLayout = forceInstance;\r\n graphSeries.preservedPoints = preservedPoints_1;\r\n forceInstance.step();\r\n }\r\n else {\r\n graphSeries.forceLayout = null;\r\n }\r\n });\r\n}\n\nfunction getViewRect$2(seriesModel, api, aspect) {\r\n var option = extend(seriesModel.getBoxLayoutParams(), {\r\n aspect: aspect\r\n });\r\n return getLayoutRect(option, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction createViewCoordSys(ecModel, api) {\r\n var viewList = [];\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var coordSysType = seriesModel.get('coordinateSystem');\r\n if (!coordSysType || coordSysType === 'view') {\r\n var data_1 = seriesModel.getData();\r\n var positions = data_1.mapArray(function (idx) {\r\n var itemModel = data_1.getItemModel(idx);\r\n return [+itemModel.get('x'), +itemModel.get('y')];\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(positions, min, max);\r\n if (max[0] - min[0] === 0) {\r\n max[0] += 1;\r\n min[0] -= 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n max[1] += 1;\r\n min[1] -= 1;\r\n }\r\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\r\n var viewRect = getViewRect$2(seriesModel, api, aspect);\r\n if (isNaN(aspect)) {\r\n min = [viewRect.x, viewRect.y];\r\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\r\n }\r\n var bbWidth = max[0] - min[0];\r\n var bbHeight = max[1] - min[1];\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\r\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n viewList.push(viewCoordSys);\r\n }\r\n });\r\n return viewList;\r\n}\n\nregisterProcessor(categoryFilter);\r\nregisterVisual(categoryVisual);\r\nregisterVisual(graphEdgeVisual);\r\nregisterLayout(graphSimpleLayout);\r\nregisterLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);\r\nregisterLayout(graphForceLayout);\r\nregisterCoordinateSystem('graphView', {\r\n dimensions: View.dimensions,\r\n create: createViewCoordSys\r\n});\n\nvar GaugeSeriesModel = (function (_super) {\r\n __extends(GaugeSeriesModel, _super);\r\n function GaugeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeSeriesModel.type;\r\n _this.visualStyleAccessPath = 'itemStyle';\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, ['value']);\r\n };\r\n GaugeSeriesModel.type = 'series.gauge';\r\n GaugeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n legendHoverLink: true,\r\n radius: '75%',\r\n startAngle: 225,\r\n endAngle: -45,\r\n clockwise: true,\r\n min: 0,\r\n max: 100,\r\n splitNumber: 10,\r\n axisLine: {\r\n show: true,\r\n roundCap: false,\r\n lineStyle: {\r\n color: [[1, '#E6EBF8']],\r\n width: 10\r\n }\r\n },\r\n progress: {\r\n show: false,\r\n overlap: true,\r\n width: 10,\r\n roundCap: false,\r\n clip: true\r\n },\r\n splitLine: {\r\n show: true,\r\n length: 10,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 3,\r\n type: 'solid'\r\n }\r\n },\r\n axisTick: {\r\n show: true,\r\n splitNumber: 5,\r\n length: 6,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n distance: 15,\r\n color: '#464646',\r\n fontSize: 12\r\n },\r\n pointer: {\r\n icon: null,\r\n offsetCenter: [0, 0],\r\n show: true,\r\n length: '60%',\r\n width: 6,\r\n keepAspect: false\r\n },\r\n anchor: {\r\n show: false,\r\n showAbove: false,\r\n size: 6,\r\n icon: 'circle',\r\n offsetCenter: [0, 0],\r\n keepAspect: false,\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 0,\r\n borderColor: '#5470c6'\r\n }\r\n },\r\n title: {\r\n show: true,\r\n offsetCenter: [0, '20%'],\r\n color: '#464646',\r\n fontSize: 16,\r\n valueAnimation: false\r\n },\r\n detail: {\r\n show: true,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 0,\r\n borderColor: '#ccc',\r\n width: 100,\r\n height: null,\r\n padding: [5, 10],\r\n offsetCenter: [0, '40%'],\r\n color: '#464646',\r\n fontSize: 30,\r\n fontWeight: 'bold',\r\n lineHeight: 30,\r\n valueAnimation: false\r\n }\r\n };\r\n return GaugeSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(GaugeSeriesModel);\n\nvar PointerShape = (function () {\r\n function PointerShape() {\r\n this.angle = 0;\r\n this.width = 10;\r\n this.r = 10;\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n return PointerShape;\r\n}());\r\nvar PointerPath = (function (_super) {\r\n __extends(PointerPath, _super);\r\n function PointerPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'pointer';\r\n return _this;\r\n }\r\n PointerPath.prototype.getDefaultShape = function () {\r\n return new PointerShape();\r\n };\r\n PointerPath.prototype.buildPath = function (ctx, shape) {\r\n var mathCos = Math.cos;\r\n var mathSin = Math.sin;\r\n var r = shape.r;\r\n var width = shape.width;\r\n var angle = shape.angle;\r\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\r\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\r\n angle = shape.angle - Math.PI / 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\r\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\r\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\r\n ctx.lineTo(x, y);\r\n };\r\n return PointerPath;\r\n}(Path));\n\nfunction parsePosition(seriesModel, api) {\r\n var center = seriesModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], api.getWidth());\r\n var cy = parsePercent$2(center[1], api.getHeight());\r\n var r = parsePercent$2(seriesModel.get('radius'), size / 2);\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r: r\r\n };\r\n}\r\nfunction formatLabel(value, labelFormatter) {\r\n var label = value == null ? '' : (value + '');\r\n if (labelFormatter) {\r\n if (typeof labelFormatter === 'string') {\r\n label = labelFormatter.replace('{value}', label);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n label = labelFormatter(value);\r\n }\r\n }\r\n return label;\r\n}\r\nvar PI2$9 = Math.PI * 2;\r\nvar GaugeView = (function (_super) {\r\n __extends(GaugeView, _super);\r\n function GaugeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeView.type;\r\n return _this;\r\n }\r\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\r\n var posInfo = parsePosition(seriesModel, api);\r\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\r\n this._data = seriesModel.getData();\r\n };\r\n GaugeView.prototype.dispose = function () { };\r\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\r\n var group = this.group;\r\n var clockwise = seriesModel.get('clockwise');\r\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\r\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\r\n var axisLineModel = seriesModel.getModel('axisLine');\r\n var roundCap = axisLineModel.get('roundCap');\r\n var MainPath = roundCap ? SausagePath : Sector;\r\n var showAxis = axisLineModel.get('show');\r\n var lineStyleModel = axisLineModel.getModel('lineStyle');\r\n var axisLineWidth = lineStyleModel.get('width');\r\n var angleRangeSpan = !((endAngle - startAngle) % PI2$9) && endAngle !== startAngle\r\n ? PI2$9 : (endAngle - startAngle) % PI2$9;\r\n var prevEndAngle = startAngle;\r\n for (var i = 0; showAxis && i < colorList.length; i++) {\r\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\r\n endAngle = startAngle + angleRangeSpan * percent;\r\n var sector = new MainPath({\r\n shape: {\r\n startAngle: prevEndAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: posInfo.r - axisLineWidth,\r\n r: posInfo.r\r\n },\r\n silent: true\r\n });\r\n sector.setStyle({\r\n fill: colorList[i][1]\r\n });\r\n sector.setStyle(lineStyleModel.getLineStyle(['color', 'width']));\r\n group.add(sector);\r\n prevEndAngle = endAngle;\r\n }\r\n var getColor = function (percent) {\r\n if (percent <= 0) {\r\n return colorList[0][1];\r\n }\r\n var i;\r\n for (i = 0; i < colorList.length; i++) {\r\n if (colorList[i][0] >= percent\r\n && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\r\n return colorList[i][1];\r\n }\r\n }\r\n return colorList[i - 1][1];\r\n };\r\n if (!clockwise) {\r\n var tmp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp;\r\n }\r\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\r\n this._renderAnchor(seriesModel, posInfo);\r\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n };\r\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var cx = posInfo.cx;\r\n var cy = posInfo.cy;\r\n var r = posInfo.r;\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var splitLineModel = seriesModel.getModel('splitLine');\r\n var tickModel = seriesModel.getModel('axisTick');\r\n var labelModel = seriesModel.getModel('axisLabel');\r\n var splitNumber = seriesModel.get('splitNumber');\r\n var subSplitNumber = tickModel.get('splitNumber');\r\n var splitLineLen = parsePercent$2(splitLineModel.get('length'), r);\r\n var tickLen = parsePercent$2(tickModel.get('length'), r);\r\n var angle = startAngle;\r\n var step = (endAngle - startAngle) / splitNumber;\r\n var subStep = step / subSplitNumber;\r\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\r\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\r\n var splitLineDistance = splitLineModel.get('distance');\r\n var unitX;\r\n var unitY;\r\n for (var i = 0; i <= splitNumber; i++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n if (splitLineModel.get('show')) {\r\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\r\n var splitLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - splitLineLen - distance) + cx,\r\n y2: unitY * (r - splitLineLen - distance) + cy\r\n },\r\n style: splitLineStyle,\r\n silent: true\r\n });\r\n if (splitLineStyle.stroke === 'auto') {\r\n splitLine.setStyle({\r\n stroke: getColor(i / splitNumber)\r\n });\r\n }\r\n group.add(splitLine);\r\n }\r\n if (labelModel.get('show')) {\r\n var distance = labelModel.get('distance') + splitLineDistance;\r\n var label = formatLabel(round$1(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\r\n var autoColor = getColor(i / splitNumber);\r\n group.add(new ZRText({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: unitX * (r - splitLineLen - distance) + cx,\r\n y: unitY * (r - splitLineLen - distance) + cy,\r\n verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'),\r\n align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true\r\n }));\r\n }\r\n if (tickModel.get('show') && i !== splitNumber) {\r\n var distance = tickModel.get('distance');\r\n distance = distance ? distance + axisLineWidth : axisLineWidth;\r\n for (var j = 0; j <= subSplitNumber; j++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n var tickLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - tickLen - distance) + cx,\r\n y2: unitY * (r - tickLen - distance) + cy\r\n },\r\n silent: true,\r\n style: tickLineStyle\r\n });\r\n if (tickLineStyle.stroke === 'auto') {\r\n tickLine.setStyle({\r\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\r\n });\r\n }\r\n group.add(tickLine);\r\n angle += subStep;\r\n }\r\n angle -= subStep;\r\n }\r\n else {\r\n angle += step;\r\n }\r\n }\r\n };\r\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n var oldProgressData = this._progressEls;\r\n var progressList = [];\r\n var showPointer = seriesModel.get(['pointer', 'show']);\r\n var progressModel = seriesModel.getModel('progress');\r\n var showProgress = progressModel.get('show');\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var valueExtent = [minVal, maxVal];\r\n var angleExtent = [startAngle, endAngle];\r\n function createPointer(idx, angle) {\r\n var itemModel = data.getItemModel(idx);\r\n var pointerModel = itemModel.getModel('pointer');\r\n var pointerWidth = parsePercent$2(pointerModel.get('width'), posInfo.r);\r\n var pointerLength = parsePercent$2(pointerModel.get('length'), posInfo.r);\r\n var pointerStr = seriesModel.get(['pointer', 'icon']);\r\n var pointerOffset = pointerModel.get('offsetCenter');\r\n var pointerKeepAspect = pointerModel.get('keepAspect');\r\n var pointer;\r\n if (pointerStr) {\r\n pointer = createSymbol(pointerStr, parsePercent$2(pointerOffset[0], posInfo.r) - pointerWidth / 2, parsePercent$2(pointerOffset[1], posInfo.r) - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\r\n }\r\n else {\r\n pointer = new PointerPath({\r\n shape: {\r\n angle: -Math.PI / 2,\r\n width: parsePercent$2(pointerModel.get('width'), posInfo.r),\r\n r: parsePercent$2(pointerModel.get('length'), posInfo.r)\r\n }\r\n });\r\n }\r\n pointer.rotation = -(angle + Math.PI / 2);\r\n pointer.x = posInfo.cx;\r\n pointer.y = posInfo.cy;\r\n return pointer;\r\n }\r\n function createProgress(idx, endAngle) {\r\n var roundCap = progressModel.get('roundCap');\r\n var ProgressPath = roundCap ? SausagePath : Sector;\r\n var isOverlap = progressModel.get('overlap');\r\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\r\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\r\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\r\n var progress = new ProgressPath({\r\n shape: {\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: r0,\r\n r: r\r\n }\r\n });\r\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\r\n return progress;\r\n }\r\n if (showProgress || showPointer) {\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n if (showPointer) {\r\n var pointer = createPointer(idx, startAngle);\r\n initProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(idx, pointer);\r\n }\r\n if (showProgress) {\r\n var progress = createProgress(idx, startAngle);\r\n var isClip = progressModel.get('clip');\r\n initProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[idx] = progress;\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n if (showPointer) {\r\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\r\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\r\n var pointer = createPointer(newIdx, previousRotate);\r\n pointer.rotation = previousRotate;\r\n updateProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(newIdx, pointer);\r\n }\r\n if (showProgress) {\r\n var previousProgress = oldProgressData[oldIdx];\r\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\r\n var progress = createProgress(newIdx, previousEndAngle);\r\n var isClip = progressModel.get('clip');\r\n updateProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[newIdx] = progress;\r\n }\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n if (showPointer) {\r\n var pointer = data.getItemGraphicEl(idx);\r\n pointer.useStyle(data.getItemVisual(idx, 'style'));\r\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\r\n if (pointer.style.fill === 'auto') {\r\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\r\n }\r\n pointer.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(pointer, itemModel);\r\n enableHoverEmphasis(pointer, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n if (showProgress) {\r\n var progress = progressList[idx];\r\n progress.useStyle(data.getItemVisual(idx, 'style'));\r\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\r\n progress.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(progress, itemModel);\r\n enableHoverEmphasis(progress, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n });\r\n this._progressEls = progressList;\r\n }\r\n };\r\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\r\n var anchorModel = seriesModel.getModel('anchor');\r\n var showAnchor = anchorModel.get('show');\r\n if (showAnchor) {\r\n var anchorSize = anchorModel.get('size');\r\n var anchorType = anchorModel.get('icon');\r\n var offsetCenter = anchorModel.get('offsetCenter');\r\n var anchorKeepAspect = anchorModel.get('keepAspect');\r\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$2(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$2(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\r\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\r\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\r\n this.group.add(anchor);\r\n }\r\n };\r\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\r\n var _this = this;\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var contentGroup = new Group();\r\n var newTitleEls = [];\r\n var newDetailEls = [];\r\n var hasAnimation = seriesModel.isAnimationEnabled();\r\n data.diff(this._data)\r\n .add(function (idx) {\r\n newTitleEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n newDetailEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n })\r\n .update(function (idx, oldIdx) {\r\n newTitleEls[idx] = _this._titleEls[oldIdx];\r\n newDetailEls[idx] = _this._detailEls[oldIdx];\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var value = data.get(valueDim, idx);\r\n var itemGroup = new Group();\r\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\r\n var itemTitleModel = itemModel.getModel('title');\r\n if (itemTitleModel.get('show')) {\r\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\r\n var titleX = posInfo.cx + parsePercent$2(titleOffsetCenter[0], posInfo.r);\r\n var titleY = posInfo.cy + parsePercent$2(titleOffsetCenter[1], posInfo.r);\r\n var labelEl = newTitleEls[idx];\r\n labelEl.attr({\r\n style: createTextStyle(itemTitleModel, {\r\n x: titleX,\r\n y: titleY,\r\n text: data.getName(idx),\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: autoColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemTitleModel }, seriesModel.getRawValue(idx), function () { return data.getName(idx); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n var itemDetailModel = itemModel.getModel('detail');\r\n if (itemDetailModel.get('show')) {\r\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\r\n var detailX = posInfo.cx + parsePercent$2(detailOffsetCenter[0], posInfo.r);\r\n var detailY = posInfo.cy + parsePercent$2(detailOffsetCenter[1], posInfo.r);\r\n var width = parsePercent$2(itemDetailModel.get('width'), posInfo.r);\r\n var height = parsePercent$2(itemDetailModel.get('height'), posInfo.r);\r\n var detailColor = (seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor);\r\n var labelEl = newDetailEls[idx];\r\n var formatter_1 = itemDetailModel.get('formatter');\r\n labelEl.attr({\r\n style: createTextStyle(itemDetailModel, {\r\n x: detailX,\r\n y: detailY,\r\n text: formatLabel(value, formatter_1),\r\n width: isNaN(width) ? null : width,\r\n height: isNaN(height) ? null : height,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: detailColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemDetailModel }, seriesModel.getRawValue(idx), function (value) { return formatLabel(value, formatter_1); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n contentGroup.add(itemGroup);\r\n });\r\n this.group.add(contentGroup);\r\n this._titleEls = newTitleEls;\r\n this._detailEls = newDetailEls;\r\n };\r\n GaugeView.type = 'gauge';\r\n return GaugeView;\r\n}(ChartView));\r\nChartView.registerClass(GaugeView);\n\nvar FunnelSeriesModel = (function (_super) {\r\n __extends(FunnelSeriesModel, _super);\r\n function FunnelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n FunnelSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueDim = data.mapDimension('value');\r\n var sum = data.getSum(valueDim);\r\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n FunnelSeriesModel.type = 'series.funnel';\r\n FunnelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n minSize: '0%',\r\n maxSize: '100%',\r\n sort: 'descending',\r\n orient: 'vertical',\r\n gap: 0,\r\n funnelAlign: 'center',\r\n label: {\r\n show: true,\r\n position: 'outer'\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 20,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n itemStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return FunnelSeriesModel;\r\n}(SeriesModel));\r\nComponentModel.registerClass(FunnelSeriesModel);\n\nvar opacityAccessPath = ['itemStyle', 'opacity'];\r\nvar FunnelPiece = (function (_super) {\r\n __extends(FunnelPiece, _super);\r\n function FunnelPiece(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var polygon = _this;\r\n var labelLine = new Polyline();\r\n var text = new ZRText();\r\n polygon.setTextContent(text);\r\n _this.setTextGuideLine(labelLine);\r\n _this.updateData(data, idx, true);\r\n return _this;\r\n }\r\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\r\n var polygon = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var opacity = itemModel.get(opacityAccessPath);\r\n opacity = opacity == null ? 1 : opacity;\r\n polygon.useStyle(data.getItemVisual(idx, 'style'));\r\n polygon.style.lineJoin = 'round';\r\n if (firstCreate) {\r\n polygon.setShape({\r\n points: layout.points\r\n });\r\n polygon.style.opacity = 0;\r\n initProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n updateProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n },\r\n shape: {\r\n points: layout.points\r\n }\r\n }, seriesModel, idx);\r\n }\r\n setStatesStylesFromModel(polygon, itemModel);\r\n this._updateLabel(data, idx);\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n FunnelPiece.prototype._updateLabel = function (data, idx) {\r\n var polygon = this;\r\n var labelLine = this.getTextGuideLine();\r\n var labelText = polygon.getTextContent();\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var labelLayout = layout.label;\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style.fill;\r\n setLabelStyle(labelText, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: data.getName(idx)\r\n }, { normal: {\r\n align: labelLayout.textAlign,\r\n verticalAlign: labelLayout.verticalAlign\r\n } });\r\n polygon.setTextConfig({\r\n local: true,\r\n inside: !!labelLayout.inside,\r\n insideStroke: visualColor,\r\n outsideFill: visualColor\r\n });\r\n var linePoints = labelLayout.linePoints;\r\n labelLine.setShape({\r\n points: linePoints\r\n });\r\n polygon.textGuideLineConfig = {\r\n anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null\r\n };\r\n updateProps(labelText, {\r\n style: {\r\n x: labelLayout.x,\r\n y: labelLayout.y\r\n }\r\n }, seriesModel, idx);\r\n labelText.attr({\r\n rotation: labelLayout.rotation,\r\n originX: labelLayout.x,\r\n originY: labelLayout.y,\r\n z2: 10\r\n });\r\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor\r\n });\r\n };\r\n return FunnelPiece;\r\n}(Polygon));\r\nvar FunnelView = (function (_super) {\r\n __extends(FunnelView, _super);\r\n function FunnelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelView.type;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var funnelPiece = new FunnelPiece(data, idx);\r\n data.setItemGraphicEl(idx, funnelPiece);\r\n group.add(funnelPiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piece = oldData.getItemGraphicEl(oldIdx);\r\n piece.updateData(data, newIdx);\r\n group.add(piece);\r\n data.setItemGraphicEl(newIdx, piece);\r\n })\r\n .remove(function (idx) {\r\n var piece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piece, seriesModel, idx);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n FunnelView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n FunnelView.prototype.dispose = function () { };\r\n FunnelView.type = 'funnel';\r\n return FunnelView;\r\n}(ChartView));\r\nChartView.registerClass(FunnelView);\n\nfunction getViewRect$3(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction getSortedIndices(data, sort) {\r\n var valueDim = data.mapDimension('value');\r\n var valueArr = data.mapArray(valueDim, function (val) {\r\n return val;\r\n });\r\n var indices = [];\r\n var isAscending = sort === 'ascending';\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n indices[i] = i;\r\n }\r\n if (typeof sort === 'function') {\r\n indices.sort(sort);\r\n }\r\n else if (sort !== 'none') {\r\n indices.sort(function (a, b) {\r\n return isAscending\r\n ? valueArr[a] - valueArr[b]\r\n : valueArr[b] - valueArr[a];\r\n });\r\n }\r\n return indices;\r\n}\r\nfunction labelLayout(data) {\r\n var seriesModel = data.hostModel;\r\n var orient = seriesModel.get('orient');\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var layout = data.getItemLayout(idx);\r\n var points = layout.points;\r\n var isLabelInside = labelPosition === 'inner'\r\n || labelPosition === 'inside' || labelPosition === 'center'\r\n || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\r\n var textAlign;\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n if (isLabelInside) {\r\n if (labelPosition === 'insideLeft') {\r\n textX = (points[0][0] + points[3][0]) / 2 + 5;\r\n textY = (points[0][1] + points[3][1]) / 2;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'insideRight') {\r\n textX = (points[1][0] + points[2][0]) / 2 - 5;\r\n textY = (points[1][1] + points[2][1]) / 2;\r\n textAlign = 'right';\r\n }\r\n else {\r\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\r\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\r\n textAlign = 'center';\r\n }\r\n linePoints = [\r\n [textX, textY], [textX, textY]\r\n ];\r\n }\r\n else {\r\n var x1 = void 0;\r\n var y1 = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var labelLineLen = labelLineModel.get('length');\r\n if (__DEV__) {\r\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'left';\r\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\r\n }\r\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'bottom';\r\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\r\n }\r\n }\r\n if (labelPosition === 'left') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n else if (labelPosition === 'right') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'top') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'bottom') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'rightTop') {\r\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\r\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'top';\r\n }\r\n }\r\n else if (labelPosition === 'rightBottom') {\r\n x1 = points[2][0];\r\n y1 = points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'bottom';\r\n }\r\n }\r\n else if (labelPosition === 'leftTop') {\r\n x1 = points[0][0];\r\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (labelPosition === 'leftBottom') {\r\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\r\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n }\r\n if (orient === 'horizontal') {\r\n x2 = x1;\r\n textX = x2;\r\n }\r\n else {\r\n y2 = y1;\r\n textY = y2;\r\n }\r\n linePoints = [[x1, y1], [x2, y2]];\r\n }\r\n layout.label = {\r\n linePoints: linePoints,\r\n x: textX,\r\n y: textY,\r\n verticalAlign: 'middle',\r\n textAlign: textAlign,\r\n inside: isLabelInside\r\n };\r\n });\r\n}\r\nfunction funnelLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var sort = seriesModel.get('sort');\r\n var viewRect = getViewRect$3(seriesModel, api);\r\n var orient = seriesModel.get('orient');\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var indices = getSortedIndices(data, sort);\r\n var x = viewRect.x;\r\n var y = viewRect.y;\r\n var sizeExtent = orient === 'horizontal' ? [\r\n parsePercent$2(seriesModel.get('minSize'), viewHeight),\r\n parsePercent$2(seriesModel.get('maxSize'), viewHeight)\r\n ] : [\r\n parsePercent$2(seriesModel.get('minSize'), viewWidth),\r\n parsePercent$2(seriesModel.get('maxSize'), viewWidth)\r\n ];\r\n var dataExtent = data.getDataExtent(valueDim);\r\n var min = seriesModel.get('min');\r\n var max = seriesModel.get('max');\r\n if (min == null) {\r\n min = Math.min(dataExtent[0], 0);\r\n }\r\n if (max == null) {\r\n max = dataExtent[1];\r\n }\r\n var funnelAlign = seriesModel.get('funnelAlign');\r\n var gap = seriesModel.get('gap');\r\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\r\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\r\n var getLinePoints = function (idx, offset) {\r\n if (orient === 'horizontal') {\r\n var val_1 = data.get(valueDim, idx) || 0;\r\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\r\n var y0 = void 0;\r\n switch (funnelAlign) {\r\n case 'top':\r\n y0 = y;\r\n break;\r\n case 'center':\r\n y0 = y + (viewHeight - itemHeight) / 2;\r\n break;\r\n case 'bottom':\r\n y0 = y + (viewHeight - itemHeight);\r\n break;\r\n }\r\n return [\r\n [offset, y0],\r\n [offset, y0 + itemHeight]\r\n ];\r\n }\r\n var val = data.get(valueDim, idx) || 0;\r\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\r\n var x0;\r\n switch (funnelAlign) {\r\n case 'left':\r\n x0 = x;\r\n break;\r\n case 'center':\r\n x0 = x + (viewWidth - itemWidth) / 2;\r\n break;\r\n case 'right':\r\n x0 = x + viewWidth - itemWidth;\r\n break;\r\n }\r\n return [\r\n [x0, offset],\r\n [x0 + itemWidth, offset]\r\n ];\r\n };\r\n if (sort === 'ascending') {\r\n itemSize = -itemSize;\r\n gap = -gap;\r\n if (orient === 'horizontal') {\r\n x += viewWidth;\r\n }\r\n else {\r\n y += viewHeight;\r\n }\r\n indices = indices.reverse();\r\n }\r\n for (var i = 0; i < indices.length; i++) {\r\n var idx = indices[i];\r\n var nextIdx = indices[i + 1];\r\n var itemModel = data.getItemModel(idx);\r\n if (orient === 'horizontal') {\r\n var width = itemModel.get(['itemStyle', 'width']);\r\n if (width == null) {\r\n width = itemSize;\r\n }\r\n else {\r\n width = parsePercent$2(width, viewWidth);\r\n if (sort === 'ascending') {\r\n width = -width;\r\n }\r\n }\r\n var start = getLinePoints(idx, x);\r\n var end = getLinePoints(nextIdx, x + width);\r\n x += width + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n else {\r\n var height = itemModel.get(['itemStyle', 'height']);\r\n if (height == null) {\r\n height = itemSize;\r\n }\r\n else {\r\n height = parsePercent$2(height, viewHeight);\r\n if (sort === 'ascending') {\r\n height = -height;\r\n }\r\n }\r\n var start = getLinePoints(idx, y);\r\n var end = getLinePoints(nextIdx, y + height);\r\n y += height + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n }\r\n labelLayout(data);\r\n });\r\n}\n\nregisterLayout(funnelLayout);\r\nregisterProcessor(dataFilter('funnel'));\n\nfunction parallelPreprocessor(option) {\r\n createParallelIfNeeded(option);\r\n mergeAxisOptionFromParallel(option);\r\n}\r\nfunction createParallelIfNeeded(option) {\r\n if (option.parallel) {\r\n return;\r\n }\r\n var hasParallelSeries = false;\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'parallel') {\r\n hasParallelSeries = true;\r\n }\r\n });\r\n if (hasParallelSeries) {\r\n option.parallel = [{}];\r\n }\r\n}\r\nfunction mergeAxisOptionFromParallel(option) {\r\n var axes = normalizeToArray(option.parallelAxis);\r\n each(axes, function (axisOption) {\r\n if (!isObject(axisOption)) {\r\n return;\r\n }\r\n var parallelIndex = axisOption.parallelIndex || 0;\r\n var parallelOption = normalizeToArray(option.parallel)[parallelIndex];\r\n if (parallelOption && parallelOption.parallelAxisDefault) {\r\n merge(axisOption, parallelOption.parallelAxisDefault, false);\r\n }\r\n });\r\n}\n\nvar ParallelAxis = (function (_super) {\r\n __extends(ParallelAxis, _super);\r\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.axisIndex = axisIndex;\r\n return _this;\r\n }\r\n ParallelAxis.prototype.isHorizontal = function () {\r\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\r\n };\r\n return ParallelAxis;\r\n}(Axis));\n\nfunction sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n}\r\nfunction getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n}\r\nfunction restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n}\n\nvar each$6 = each;\r\nvar mathMin$8 = Math.min;\r\nvar mathMax$8 = Math.max;\r\nvar mathFloor$2 = Math.floor;\r\nvar mathCeil$1 = Math.ceil;\r\nvar round$2 = round$1;\r\nvar PI$8 = Math.PI;\r\nvar Parallel = (function () {\r\n function Parallel(parallelModel, ecModel, api) {\r\n this.type = 'parallel';\r\n this._axesMap = createHashMap();\r\n this._axesLayout = {};\r\n this.dimensions = parallelModel.dimensions;\r\n this._model = parallelModel;\r\n this._init(parallelModel, ecModel, api);\r\n }\r\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\r\n var dimensions = parallelModel.dimensions;\r\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\r\n each$6(dimensions, function (dim, idx) {\r\n var axisIndex = parallelAxisIndex[idx];\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = axisModel.coordinateSystem = this;\r\n }, this);\r\n };\r\n Parallel.prototype.update = function (ecModel, api) {\r\n this._updateAxesFromSeries(this._model, ecModel);\r\n };\r\n Parallel.prototype.containPoint = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var axisBase = layoutInfo.axisBase;\r\n var layoutBase = layoutInfo.layoutBase;\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var pAxis = point[1 - pixelDimIndex];\r\n var pLayout = point[pixelDimIndex];\r\n return pAxis >= axisBase\r\n && pAxis <= axisBase + layoutInfo.axisLength\r\n && pLayout >= layoutBase\r\n && pLayout <= layoutBase + layoutInfo.layoutLength;\r\n };\r\n Parallel.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!parallelModel.contains(seriesModel, ecModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n each$6(this.dimensions, function (dim) {\r\n var axis = this._axesMap.get(dim);\r\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\r\n niceScaleExtent(axis.scale, axis.model);\r\n }, this);\r\n }, this);\r\n };\r\n Parallel.prototype.resize = function (parallelModel, api) {\r\n this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._layoutAxes();\r\n };\r\n Parallel.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Parallel.prototype._makeLayoutInfo = function () {\r\n var parallelModel = this._model;\r\n var rect = this._rect;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var layout = parallelModel.get('layout');\r\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\r\n var layoutLength = rect[wh[pixelDimIndex]];\r\n var layoutExtent = [0, layoutLength];\r\n var axisCount = this.dimensions.length;\r\n var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent);\r\n var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\r\n var axisExpandable = parallelModel.get('axisExpandable')\r\n && axisCount > 3\r\n && axisCount > axisExpandCount\r\n && axisExpandCount > 1\r\n && axisExpandWidth > 0\r\n && layoutLength > 0;\r\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\r\n var winSize;\r\n if (!axisExpandWindow) {\r\n winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\r\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2);\r\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n else {\r\n winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\r\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\r\n var winInnerIndices = [\r\n mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,\r\n mathCeil$1(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1\r\n ];\r\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\r\n return {\r\n layout: layout,\r\n pixelDimIndex: pixelDimIndex,\r\n layoutBase: rect[xy[pixelDimIndex]],\r\n layoutLength: layoutLength,\r\n axisBase: rect[xy[1 - pixelDimIndex]],\r\n axisLength: rect[wh[1 - pixelDimIndex]],\r\n axisExpandable: axisExpandable,\r\n axisExpandWidth: axisExpandWidth,\r\n axisCollapseWidth: axisCollapseWidth,\r\n axisExpandWindow: axisExpandWindow,\r\n axisCount: axisCount,\r\n winInnerIndices: winInnerIndices,\r\n axisExpandWindow0Pos: axisExpandWindow0Pos\r\n };\r\n };\r\n Parallel.prototype._layoutAxes = function () {\r\n var rect = this._rect;\r\n var axes = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var layoutInfo = this._makeLayoutInfo();\r\n var layout = layoutInfo.layout;\r\n axes.each(function (axis) {\r\n var axisExtent = [0, layoutInfo.axisLength];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\r\n });\r\n each$6(dimensions, function (dim, idx) {\r\n var posInfo = (layoutInfo.axisExpandable\r\n ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\r\n var positionTable = {\r\n horizontal: {\r\n x: posInfo.position,\r\n y: layoutInfo.axisLength\r\n },\r\n vertical: {\r\n x: 0,\r\n y: posInfo.position\r\n }\r\n };\r\n var rotationTable = {\r\n horizontal: PI$8 / 2,\r\n vertical: 0\r\n };\r\n var position = [\r\n positionTable[layout].x + rect.x,\r\n positionTable[layout].y + rect.y\r\n ];\r\n var rotation = rotationTable[layout];\r\n var transform = create$1();\r\n rotate(transform, transform, rotation);\r\n translate(transform, transform, position);\r\n this._axesLayout[dim] = {\r\n position: position,\r\n rotation: rotation,\r\n transform: transform,\r\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\r\n axisLabelShow: posInfo.axisLabelShow,\r\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\r\n tickDirection: 1,\r\n labelDirection: 1\r\n };\r\n }, this);\r\n };\r\n Parallel.prototype.getAxis = function (dim) {\r\n return this._axesMap.get(dim);\r\n };\r\n Parallel.prototype.dataToPoint = function (value, dim) {\r\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\r\n };\r\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\r\n start == null && (start = 0);\r\n end == null && (end = data.count());\r\n var axesMap = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var dataDimensions = [];\r\n var axisModels = [];\r\n each(dimensions, function (axisDim) {\r\n dataDimensions.push(data.mapDimension(axisDim));\r\n axisModels.push(axesMap.get(axisDim).model);\r\n });\r\n var hasActiveSet = this.hasAxisBrushed();\r\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\r\n var activeState = void 0;\r\n if (!hasActiveSet) {\r\n activeState = 'normal';\r\n }\r\n else {\r\n activeState = 'active';\r\n var values = data.getValues(dataDimensions, dataIndex);\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n var state = axisModels[j].getActiveState(values[j]);\r\n if (state === 'inactive') {\r\n activeState = 'inactive';\r\n break;\r\n }\r\n }\r\n }\r\n callback(activeState, dataIndex);\r\n }\r\n };\r\n Parallel.prototype.hasAxisBrushed = function () {\r\n var dimensions = this.dimensions;\r\n var axesMap = this._axesMap;\r\n var hasActiveSet = false;\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\r\n hasActiveSet = true;\r\n }\r\n }\r\n return hasActiveSet;\r\n };\r\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\r\n var axisLayout = this._axesLayout[dim];\r\n return applyTransform$1([coord, 0], axisLayout.transform);\r\n };\r\n Parallel.prototype.getAxisLayout = function (dim) {\r\n return clone(this._axesLayout[dim]);\r\n };\r\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\r\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\r\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\r\n if (!this.containPoint(point)) {\r\n return { behavior: 'none', axisExpandWindow: axisExpandWindow };\r\n }\r\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\r\n var delta;\r\n var behavior = 'slide';\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var triggerArea = this._model.get('axisExpandSlideTriggerArea');\r\n var useJump = triggerArea[0] != null;\r\n if (axisCollapseWidth) {\r\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * triggerArea[2];\r\n }\r\n else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * (1 - triggerArea[2]);\r\n }\r\n else {\r\n (delta = pointCoord - winSize * triggerArea[1]) >= 0\r\n && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0\r\n && (delta = 0);\r\n }\r\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\r\n delta\r\n ? sliderMove(delta, axisExpandWindow, extent, 'all')\r\n : (behavior = 'none');\r\n }\r\n else {\r\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\r\n var pos = extent[1] * pointCoord / winSize2;\r\n axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)];\r\n axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2);\r\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\r\n }\r\n return {\r\n axisExpandWindow: axisExpandWindow,\r\n behavior: behavior\r\n };\r\n };\r\n return Parallel;\r\n}());\r\nfunction restrict$1(len, extent) {\r\n return mathMin$8(mathMax$8(len, extent[0]), extent[1]);\r\n}\r\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\r\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\r\n return {\r\n position: step * axisIndex,\r\n axisNameAvailableWidth: step,\r\n axisLabelShow: true\r\n };\r\n}\r\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\r\n var layoutLength = layoutInfo.layoutLength;\r\n var axisExpandWidth = layoutInfo.axisExpandWidth;\r\n var axisCount = layoutInfo.axisCount;\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var winInnerIndices = layoutInfo.winInnerIndices;\r\n var position;\r\n var axisNameAvailableWidth = axisCollapseWidth;\r\n var axisLabelShow = false;\r\n var nameTruncateMaxWidth;\r\n if (axisIndex < winInnerIndices[0]) {\r\n position = axisIndex * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n else if (axisIndex <= winInnerIndices[1]) {\r\n position = layoutInfo.axisExpandWindow0Pos\r\n + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\r\n axisNameAvailableWidth = axisExpandWidth;\r\n axisLabelShow = true;\r\n }\r\n else {\r\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n return {\r\n position: position,\r\n axisNameAvailableWidth: axisNameAvailableWidth,\r\n axisLabelShow: axisLabelShow,\r\n nameTruncateMaxWidth: nameTruncateMaxWidth\r\n };\r\n}\n\nfunction create$2(ecModel, api) {\r\n var coordSysList = [];\r\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\r\n var coordSys = new Parallel(parallelModel, ecModel, api);\r\n coordSys.name = 'parallel_' + idx;\r\n coordSys.resize(parallelModel, api);\r\n parallelModel.coordinateSystem = coordSys;\r\n coordSys.model = parallelModel;\r\n coordSysList.push(coordSys);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'parallel') {\r\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\r\n }\r\n });\r\n return coordSysList;\r\n}\r\nCoordinateSystemManager.register('parallel', { create: create$2 });\n\nvar ParallelAxisModel = (function (_super) {\r\n __extends(ParallelAxisModel, _super);\r\n function ParallelAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisModel.type;\r\n _this.activeIntervals = [];\r\n return _this;\r\n }\r\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\r\n return makeStyleMapper([\r\n ['fill', 'color'],\r\n ['lineWidth', 'borderWidth'],\r\n ['stroke', 'borderColor'],\r\n ['width', 'width'],\r\n ['opacity', 'opacity']\r\n ])(this.getModel('areaSelectStyle'));\r\n };\r\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\r\n var activeIntervals = this.activeIntervals = clone(intervals);\r\n if (activeIntervals) {\r\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\r\n asc(activeIntervals[i]);\r\n }\r\n }\r\n };\r\n ParallelAxisModel.prototype.getActiveState = function (value) {\r\n var activeIntervals = this.activeIntervals;\r\n if (!activeIntervals.length) {\r\n return 'normal';\r\n }\r\n if (value == null || isNaN(+value)) {\r\n return 'inactive';\r\n }\r\n if (activeIntervals.length === 1) {\r\n var interval = activeIntervals[0];\r\n if (interval[0] <= value && value <= interval[1]) {\r\n return 'active';\r\n }\r\n }\r\n else {\r\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\r\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\r\n return 'active';\r\n }\r\n }\r\n }\r\n return 'inactive';\r\n };\r\n return ParallelAxisModel;\r\n}(ComponentModel));\r\nvar defaultOption$1 = {\r\n type: 'value',\r\n areaSelectStyle: {\r\n width: 20,\r\n borderWidth: 1,\r\n borderColor: 'rgba(160,197,232)',\r\n color: 'rgba(160,197,232)',\r\n opacity: 0.3\r\n },\r\n realtime: true,\r\n z: 10\r\n};\r\nComponentModel.registerClass(ParallelAxisModel);\r\nmixin(ParallelAxisModel, AxisModelCommonMixin);\r\naxisModelCreator('parallel', ParallelAxisModel, defaultOption$1);\n\nvar ParallelModel = (function (_super) {\r\n __extends(ParallelModel, _super);\r\n function ParallelModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelModel.type;\r\n return _this;\r\n }\r\n ParallelModel.prototype.init = function () {\r\n _super.prototype.init.apply(this, arguments);\r\n this.mergeOption({});\r\n };\r\n ParallelModel.prototype.mergeOption = function (newOption) {\r\n var thisOption = this.option;\r\n newOption && merge(thisOption, newOption, true);\r\n this._initDimensions();\r\n };\r\n ParallelModel.prototype.contains = function (model, ecModel) {\r\n var parallelIndex = model.get('parallelIndex');\r\n return parallelIndex != null\r\n && ecModel.getComponent('parallel', parallelIndex) === this;\r\n };\r\n ParallelModel.prototype.setAxisExpand = function (opt) {\r\n each([\r\n 'axisExpandable',\r\n 'axisExpandCenter',\r\n 'axisExpandCount',\r\n 'axisExpandWidth',\r\n 'axisExpandWindow'\r\n ], function (name) {\r\n if (opt.hasOwnProperty(name)) {\r\n this.option[name] = opt[name];\r\n }\r\n }, this);\r\n };\r\n ParallelModel.prototype._initDimensions = function () {\r\n var dimensions = this.dimensions = [];\r\n var parallelAxisIndex = this.parallelAxisIndex = [];\r\n var axisModels = filter(this.ecModel.queryComponents({ mainType: 'parallelAxis' }), function (axisModel) {\r\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\r\n }, this);\r\n each(axisModels, function (axisModel) {\r\n dimensions.push('dim' + axisModel.get('dim'));\r\n parallelAxisIndex.push(axisModel.componentIndex);\r\n });\r\n };\r\n ParallelModel.type = 'parallel';\r\n ParallelModel.dependencies = ['parallelAxis'];\r\n ParallelModel.layoutMode = 'box';\r\n ParallelModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n layout: 'horizontal',\r\n axisExpandable: false,\r\n axisExpandCenter: null,\r\n axisExpandCount: 0,\r\n axisExpandWidth: 50,\r\n axisExpandRate: 17,\r\n axisExpandDebounce: 50,\r\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\r\n axisExpandTriggerOn: 'click',\r\n parallelAxisDefault: null\r\n };\r\n return ParallelModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(ParallelModel);\n\nvar actionInfo$1 = {\r\n type: 'axisAreaSelect',\r\n event: 'axisAreaSelected'\r\n};\r\nregisterAction(actionInfo$1, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallelAxis', query: payload }, function (parallelAxisModel) {\r\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\r\n });\r\n});\r\nregisterAction('parallelAxisExpand', function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallel', query: payload }, function (parallelModel) {\r\n parallelModel.setAxisExpand(payload);\r\n });\r\n});\n\nvar BRUSH_PANEL_GLOBAL = true;\r\nvar mathMin$9 = Math.min;\r\nvar mathMax$9 = Math.max;\r\nvar mathPow$2 = Math.pow;\r\nvar COVER_Z = 10000;\r\nvar UNSELECT_THRESHOLD = 6;\r\nvar MIN_RESIZE_LINE_WIDTH = 6;\r\nvar MUTEX_RESOURCE_KEY = 'globalPan';\r\nvar DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n};\r\nvar CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n};\r\nvar DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n};\r\nvar baseUID = 0;\r\nvar BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n}(Eventful));\r\nfunction createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n}\r\nfunction endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n}\r\nfunction updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n}\r\nfunction updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n}\r\nfunction updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n}\r\nfunction getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n}\r\nfunction getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n}\r\nfunction getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n}\r\nfunction clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n}\r\nfunction trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n}\r\nfunction shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n}\r\nfunction getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n}\r\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n}\r\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n}\r\nfunction updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n}\r\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n}\r\nfunction makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n}\r\nfunction formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$9(x, x2), mathMin$9(y, y2)];\r\n var max = [mathMax$9(x, x2), mathMax$9(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n}\r\nfunction getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n}\r\nfunction getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n}\r\nfunction getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n}\r\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n}\r\nfunction driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n}\r\nfunction toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n}\r\nfunction clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n}\r\nfunction pointsToRect(points) {\r\n var xmin = mathMin$9(points[0][0], points[1][0]);\r\n var ymin = mathMin$9(points[0][1], points[1][1]);\r\n var xmax = mathMax$9(points[0][0], points[1][0]);\r\n var ymax = mathMax$9(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n}\r\nfunction resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n}\r\nfunction preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n}\r\nfunction mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n}\r\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n}\r\nfunction determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n}\r\nvar pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n};\r\nfunction handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n}\r\nfunction isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n}\r\nvar coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n};\r\nfunction getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n}\n\nfunction makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n}\r\nfunction makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n}\r\nfunction makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n}\r\nfunction normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n}\n\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\r\nvar ParallelAxisView = (function (_super) {\r\n __extends(ParallelAxisView, _super);\r\n function ParallelAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisView.type;\r\n return _this;\r\n }\r\n ParallelAxisView.prototype.init = function (ecModel, api) {\r\n _super.prototype.init.apply(this, arguments);\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this));\r\n };\r\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\r\n return;\r\n }\r\n this.axisModel = axisModel;\r\n this.api = api;\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\r\n var coordSys = coordSysModel.coordinateSystem;\r\n var areaSelectStyle = axisModel.getAreaSelectStyle();\r\n var areaWidth = areaSelectStyle.width;\r\n var dim = axisModel.axis.dim;\r\n var axisLayout = coordSys.getAxisLayout(dim);\r\n var builderOpt = extend({ strokeContainThreshold: areaWidth }, axisLayout);\r\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\r\n each(elementList, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n };\r\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\r\n var extent = axisModel.axis.getExtent();\r\n var extentLen = extent[1] - extent[0];\r\n var extra = Math.min(30, Math.abs(extentLen) * 0.1);\r\n var rect = BoundingRect.create({\r\n x: extent[0],\r\n y: -areaWidth / 2,\r\n width: extentLen,\r\n height: areaWidth\r\n });\r\n rect.x -= extra;\r\n rect.width += 2 * extra;\r\n this._brushController\r\n .mount({\r\n enableGlobalPan: true,\r\n rotation: builderOpt.rotation,\r\n x: builderOpt.position[0],\r\n y: builderOpt.position[1]\r\n })\r\n .setPanels([{\r\n panelId: 'pl',\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)\r\n }])\r\n .enableBrush({\r\n brushType: 'lineX',\r\n brushStyle: areaSelectStyle,\r\n removeOnClick: true\r\n })\r\n .updateCovers(getCoverInfoList(axisModel));\r\n };\r\n ParallelAxisView.prototype._onBrush = function (eventParam) {\r\n var coverInfoList = eventParam.areas;\r\n var axisModel = this.axisModel;\r\n var axis = axisModel.axis;\r\n var intervals = map(coverInfoList, function (coverInfo) {\r\n return [\r\n axis.coordToData(coverInfo.range[0], true),\r\n axis.coordToData(coverInfo.range[1], true)\r\n ];\r\n });\r\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\r\n this.api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n parallelAxisId: axisModel.id,\r\n intervals: intervals\r\n });\r\n }\r\n };\r\n ParallelAxisView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n ParallelAxisView.type = 'parallelAxis';\r\n return ParallelAxisView;\r\n}(ComponentView));\r\nComponentView.registerClass(ParallelAxisView);\r\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\r\n return payload\r\n && payload.type === 'axisAreaSelect'\r\n && ecModel.findComponents({ mainType: 'parallelAxis', query: payload })[0] === axisModel;\r\n}\r\nfunction getCoverInfoList(axisModel) {\r\n var axis = axisModel.axis;\r\n return map(axisModel.activeIntervals, function (interval) {\r\n return {\r\n brushType: 'lineX',\r\n panelId: 'pl',\r\n range: [\r\n axis.dataToCoord(interval[0], true),\r\n axis.dataToCoord(interval[1], true)\r\n ]\r\n };\r\n });\r\n}\r\nfunction getCoordSysModel(axisModel, ecModel) {\r\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\r\n}\n\nvar CLICK_THRESHOLD = 5;\r\nvar ParallelView = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n return _this;\r\n }\r\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\r\n this._model = parallelModel;\r\n this._api = api;\r\n if (!this._handlers) {\r\n this._handlers = {};\r\n each(handlers, function (handler, eventName) {\r\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\r\n }, this);\r\n }\r\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\r\n };\r\n ParallelView.prototype.dispose = function (ecModel, api) {\r\n each(this._handlers, function (handler, eventName) {\r\n api.getZr().off(eventName, handler);\r\n });\r\n this._handlers = null;\r\n };\r\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\r\n this._dispatchExpand(opt);\r\n };\r\n ParallelView.prototype._dispatchExpand = function (opt) {\r\n opt && this._api.dispatchAction(extend({ type: 'parallelAxisExpand' }, opt));\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n}(ComponentView));\r\nComponentView.registerClass(ParallelView);\r\nvar handlers = {\r\n mousedown: function (e) {\r\n if (checkTrigger(this, 'click')) {\r\n this._mouseDownPoint = [e.offsetX, e.offsetY];\r\n }\r\n },\r\n mouseup: function (e) {\r\n var mouseDownPoint = this._mouseDownPoint;\r\n if (checkTrigger(this, 'click') && mouseDownPoint) {\r\n var point = [e.offsetX, e.offsetY];\r\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2)\r\n + Math.pow(mouseDownPoint[1] - point[1], 2);\r\n if (dist > CLICK_THRESHOLD) {\r\n return;\r\n }\r\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n result.behavior !== 'none' && this._dispatchExpand({\r\n axisExpandWindow: result.axisExpandWindow\r\n });\r\n }\r\n this._mouseDownPoint = null;\r\n },\r\n mousemove: function (e) {\r\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\r\n return;\r\n }\r\n var model = this._model;\r\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n var behavior = result.behavior;\r\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\r\n this._throttledDispatchExpand(behavior === 'none'\r\n ? null\r\n : {\r\n axisExpandWindow: result.axisExpandWindow,\r\n animation: behavior === 'jump' ? null : {\r\n duration: 0\r\n }\r\n });\r\n }\r\n};\r\nfunction checkTrigger(view, triggerOn) {\r\n var model = view._model;\r\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\r\n}\r\nregisterPreprocessor(parallelPreprocessor);\n\nvar ParallelSeriesModel = (function (_super) {\r\n __extends(ParallelSeriesModel, _super);\r\n function ParallelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\r\n });\r\n };\r\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\r\n var coordSys = this.coordinateSystem;\r\n var data = this.getData();\r\n var indices = [];\r\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\r\n if (activeState === theActiveState) {\r\n indices.push(data.getRawIndex(dataIndex));\r\n }\r\n });\r\n return indices;\r\n };\r\n ParallelSeriesModel.type = 'series.parallel';\r\n ParallelSeriesModel.dependencies = ['parallel'];\r\n ParallelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'parallel',\r\n parallelIndex: 0,\r\n label: {\r\n show: false\r\n },\r\n inactiveOpacity: 0.05,\r\n activeOpacity: 1,\r\n lineStyle: {\r\n width: 1,\r\n opacity: 0.45,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n label: {\r\n show: false\r\n }\r\n },\r\n progressive: 500,\r\n smooth: false,\r\n animationEasing: 'linear'\r\n };\r\n return ParallelSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ParallelSeriesModel);\r\nfunction makeDefaultEncode(seriesModel) {\r\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n if (!parallelModel) {\r\n return;\r\n }\r\n var encodeDefine = {};\r\n each(parallelModel.dimensions, function (axisDim) {\r\n var dataDimIndex = convertDimNameToNumber(axisDim);\r\n encodeDefine[axisDim] = dataDimIndex;\r\n });\r\n return encodeDefine;\r\n}\r\nfunction convertDimNameToNumber(dimName) {\r\n return +dimName.replace('dim', '');\r\n}\n\nvar DEFAULT_SMOOTH = 0.3;\r\nvar ParallelView$1 = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n _this._dataGroup = new Group();\r\n _this._initialized = false;\r\n return _this;\r\n }\r\n ParallelView.prototype.init = function () {\r\n this.group.add(this._dataGroup);\r\n };\r\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var dataGroup = this._dataGroup;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n data.diff(oldData)\r\n .add(add)\r\n .update(update)\r\n .remove(remove)\r\n .execute();\r\n function add(newDataIndex) {\r\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function update(newDataIndex, oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\r\n data.setItemGraphicEl(newDataIndex, line);\r\n updateProps(line, { shape: { points: points } }, seriesModel, newDataIndex);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function remove(oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n dataGroup.remove(line);\r\n }\r\n if (!this._initialized) {\r\n this._initialized = true;\r\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\r\n setTimeout(function () {\r\n dataGroup.removeClipPath();\r\n });\r\n });\r\n dataGroup.setClipPath(clipPath);\r\n }\r\n this._data = data;\r\n };\r\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._initialized = true;\r\n this._data = null;\r\n this._dataGroup.removeAll();\r\n };\r\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\r\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\r\n line.incremental = true;\r\n updateElCommon(line, data, dataIndex, seriesScope);\r\n }\r\n };\r\n ParallelView.prototype.remove = function () {\r\n this._dataGroup && this._dataGroup.removeAll();\r\n this._data = null;\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n}(ChartView));\r\nfunction createGridClipShape(coordSys, seriesModel, cb) {\r\n var parallelModel = coordSys.model;\r\n var rect = coordSys.getRect();\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n });\r\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\r\n rectEl.setShape(dim, 0);\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\r\n var points = [];\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimName = dimensions[i];\r\n var value = data.get(data.mapDimension(dimName), dataIndex);\r\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\r\n points.push(coordSys.dataToPoint(value, dimName));\r\n }\r\n }\r\n return points;\r\n}\r\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\r\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\r\n var line = new Polyline({\r\n shape: { points: points },\r\n z2: 10\r\n });\r\n dataGroup.add(line);\r\n data.setItemGraphicEl(dataIndex, line);\r\n return line;\r\n}\r\nfunction makeSeriesScope$2(seriesModel) {\r\n var smooth = seriesModel.get('smooth', true);\r\n smooth === true && (smooth = DEFAULT_SMOOTH);\r\n smooth = numericToNumber(smooth);\r\n eqNaN(smooth) && (smooth = 0);\r\n return { smooth: smooth };\r\n}\r\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.fill = null;\r\n el.setShape('smooth', seriesScope.smooth);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n}\r\nfunction isEmptyValue(val, axisType) {\r\n return axisType === 'category'\r\n ? val == null\r\n : (val == null || isNaN(val));\r\n}\r\nChartView.registerClass(ParallelView$1);\n\nvar opacityAccessPath$1 = ['lineStyle', 'opacity'];\r\nvar parallelVisual = {\r\n seriesType: 'parallel',\r\n reset: function (seriesModel, ecModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var opacityMap = {\r\n normal: seriesModel.get(['lineStyle', 'opacity']),\r\n active: seriesModel.get('activeOpacity'),\r\n inactive: seriesModel.get('inactiveOpacity')\r\n };\r\n return {\r\n progress: function (params, data) {\r\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\r\n var opacity = opacityMap[activeState];\r\n if (activeState === 'normal' && data.hasItemOption) {\r\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true);\r\n itemOpacity != null && (opacity = itemOpacity);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n existsStyle.opacity = opacity;\r\n }, params.start, params.end);\r\n }\r\n };\r\n }\r\n};\n\nregisterVisual(PRIORITY.VISUAL.BRUSH, parallelVisual);\n\nvar SankeySeriesModel = (function (_super) {\r\n __extends(SankeySeriesModel, _super);\r\n function SankeySeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeySeriesModel.type;\r\n return _this;\r\n }\r\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var links = option.edges || option.links;\r\n var nodes = option.data || option.nodes;\r\n var levels = option.levels;\r\n this.levelModels = [];\r\n var levelModels = this.levelModels;\r\n for (var i = 0; i < levels.length; i++) {\r\n if (levels[i].depth != null && levels[i].depth >= 0) {\r\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('levels[i].depth is mandatory and should be natural number');\r\n }\r\n }\r\n }\r\n if (nodes && links) {\r\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var layout = seriesModel.getData().getItemLayout(idx);\r\n if (layout) {\r\n var nodeDepth = layout.depth;\r\n var levelModel = seriesModel.levelModels[nodeDepth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n edgeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\r\n var layout = edge.node1.getLayout();\r\n if (layout) {\r\n var depth = layout.depth;\r\n var levelModel = seriesModel.levelModels[depth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\r\n var dataItem = this.option.data[dataIndex];\r\n dataItem.localX = localPosition[0];\r\n dataItem.localY = localPosition[1];\r\n };\r\n SankeySeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n SankeySeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n function noValue(val) {\r\n return isNaN(val) || val == null;\r\n }\r\n if (dataType === 'edge') {\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var rawDataOpt = params.data;\r\n var edgeValue = params.value;\r\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\r\n return createTooltipMarkup('nameValue', {\r\n name: edgeName,\r\n value: edgeValue,\r\n noValue: noValue(edgeValue)\r\n });\r\n }\r\n else {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var value = node.getLayout().value;\r\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\r\n return createTooltipMarkup('nameValue', {\r\n name: name_1,\r\n value: value,\r\n noValue: noValue(value)\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n if (option.focusNodeAdjacency === true) {\r\n option.focusNodeAdjacency = 'allEdges';\r\n }\r\n };\r\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n if (params.value == null && dataType === 'node') {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var nodeValue = node.getLayout().value;\r\n params.value = nodeValue;\r\n }\r\n return params;\r\n };\r\n SankeySeriesModel.type = 'series.sankey';\r\n SankeySeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '5%',\r\n top: '5%',\r\n right: '20%',\r\n bottom: '5%',\r\n orient: 'horizontal',\r\n nodeWidth: 20,\r\n nodeGap: 8,\r\n draggable: true,\r\n focusNodeAdjacency: false,\r\n layoutIterations: 32,\r\n label: {\r\n show: true,\r\n position: 'right',\r\n fontSize: 12\r\n },\r\n levels: [],\r\n nodeAlign: 'justify',\r\n lineStyle: {\r\n color: '#314656',\r\n opacity: 0.2,\r\n curveness: 0.5\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 1000\r\n };\r\n return SankeySeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(SankeySeriesModel);\n\nvar SankeyPathShape = (function () {\r\n function SankeyPathShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.cpx2 = 0;\r\n this.cpy2 = 0;\r\n this.extent = 0;\r\n }\r\n return SankeyPathShape;\r\n}());\r\nvar SankeyPath = (function (_super) {\r\n __extends(SankeyPath, _super);\r\n function SankeyPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n SankeyPath.prototype.getDefaultShape = function () {\r\n return new SankeyPathShape();\r\n };\r\n SankeyPath.prototype.buildPath = function (ctx, shape) {\r\n var extent = shape.extent;\r\n ctx.moveTo(shape.x1, shape.y1);\r\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\r\n if (shape.orient === 'vertical') {\r\n ctx.lineTo(shape.x2 + extent, shape.y2);\r\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\r\n }\r\n else {\r\n ctx.lineTo(shape.x2, shape.y2 + extent);\r\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\r\n }\r\n ctx.closePath();\r\n };\r\n SankeyPath.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n SankeyPath.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n return SankeyPath;\r\n}(Path));\r\nvar SankeyView = (function (_super) {\r\n __extends(SankeyView, _super);\r\n function SankeyView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeyView.type;\r\n _this._focusAdjacencyDisabled = false;\r\n return _this;\r\n }\r\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\r\n var sankeyView = this;\r\n var graph = seriesModel.getGraph();\r\n var group = this.group;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var nodeData = seriesModel.getData();\r\n var edgeData = seriesModel.getData('edge');\r\n var orient = seriesModel.get('orient');\r\n this._model = seriesModel;\r\n group.removeAll();\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n graph.eachEdge(function (edge) {\r\n var curve = new SankeyPath();\r\n var ecData = getECData(curve);\r\n ecData.dataIndex = edge.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataType = 'edge';\r\n var edgeModel = edge.getModel();\r\n var lineStyleModel = edgeModel.getModel('lineStyle');\r\n var curvature = lineStyleModel.get('curveness');\r\n var n1Layout = edge.node1.getLayout();\r\n var node1Model = edge.node1.getModel();\r\n var dragX1 = node1Model.get('localX');\r\n var dragY1 = node1Model.get('localY');\r\n var n2Layout = edge.node2.getLayout();\r\n var node2Model = edge.node2.getModel();\r\n var dragX2 = node2Model.get('localX');\r\n var dragY2 = node2Model.get('localY');\r\n var edgeLayout = edge.getLayout();\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n curve.shape.extent = Math.max(1, edgeLayout.dy);\r\n curve.shape.orient = orient;\r\n if (orient === 'vertical') {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\r\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\r\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\r\n cpx1 = x1;\r\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\r\n cpx2 = x2;\r\n cpy2 = y1 * curvature + y2 * (1 - curvature);\r\n }\r\n else {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\r\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\r\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\r\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\r\n cpy1 = y1;\r\n cpx2 = x1 * curvature + x2 * (1 - curvature);\r\n cpy2 = y2;\r\n }\r\n curve.setShape({\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n });\r\n curve.useStyle(lineStyleModel.getItemStyle());\r\n switch (curve.style.fill) {\r\n case 'source':\r\n curve.style.fill = edge.node1.getVisual('color');\r\n curve.style.decal = edge.node1.getVisual('style').decal;\r\n break;\r\n case 'target':\r\n curve.style.fill = edge.node2.getVisual('color');\r\n curve.style.decal = edge.node2.getVisual('style').decal;\r\n break;\r\n case 'gradient':\r\n var sourceColor = edge.node1.getVisual('color');\r\n var targetColor = edge.node2.getVisual('color');\r\n if (typeof sourceColor === 'string' && typeof targetColor === 'string') {\r\n curve.style.fill = new LinearGradient(0, 0, 1, 0, [{\r\n color: sourceColor,\r\n offset: 0\r\n }, {\r\n color: targetColor,\r\n offset: 1\r\n }]);\r\n }\r\n }\r\n var emphasisModel = edgeModel.getModel('emphasis');\r\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { return model.getItemStyle(); });\r\n group.add(curve);\r\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n getECData(curve).dataType = 'edge';\r\n });\r\n graph.eachNode(function (node) {\r\n var layout = node.getLayout();\r\n var itemModel = node.getModel();\r\n var dragX = itemModel.get('localX');\r\n var dragY = itemModel.get('localY');\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var rect = new Rect({\r\n shape: {\r\n x: dragX != null ? dragX * width : layout.x,\r\n y: dragY != null ? dragY * height : layout.y,\r\n width: layout.dx,\r\n height: layout.dy\r\n },\r\n style: itemModel.getModel('itemStyle').getItemStyle()\r\n });\r\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: node.dataIndex,\r\n defaultText: node.id\r\n });\r\n rect.disableLabelAnimation = true;\r\n rect.setStyle('fill', node.getVisual('color'));\r\n rect.setStyle('decal', node.getVisual('style').decal);\r\n setStatesStylesFromModel(rect, itemModel);\r\n group.add(rect);\r\n nodeData.setItemGraphicEl(node.dataIndex, rect);\r\n getECData(rect).dataType = 'node';\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n });\r\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\r\n var itemModel = nodeData.getItemModel(dataIndex);\r\n if (itemModel.get('draggable')) {\r\n el.drift = function (dx, dy) {\r\n sankeyView._focusAdjacencyDisabled = true;\r\n this.shape.x += dx;\r\n this.shape.y += dy;\r\n this.dirty();\r\n api.dispatchAction({\r\n type: 'dragNode',\r\n seriesId: seriesModel.id,\r\n dataIndex: nodeData.getRawIndex(dataIndex),\r\n localX: this.shape.x / width,\r\n localY: this.shape.y / height\r\n });\r\n };\r\n el.ondragend = function () {\r\n sankeyView._focusAdjacencyDisabled = false;\r\n };\r\n el.draggable = true;\r\n el.cursor = 'move';\r\n }\r\n });\r\n if (!this._data && seriesModel.isAnimationEnabled()) {\r\n group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () {\r\n group.removeClipPath();\r\n }));\r\n }\r\n this._data = seriesModel.getData();\r\n };\r\n SankeyView.prototype.dispose = function () {\r\n };\r\n SankeyView.type = 'sankey';\r\n return SankeyView;\r\n}(ChartView));\r\nfunction createGridClipShape$1(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nChartView.registerClass(SankeyView);\n\nregisterAction({\r\n type: 'dragNode',\r\n event: 'dragnode',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'sankey',\r\n query: payload\r\n }, function (seriesModel) {\r\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\r\n });\r\n});\n\nfunction sankeyLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var nodeWidth = seriesModel.get('nodeWidth');\r\n var nodeGap = seriesModel.get('nodeGap');\r\n var layoutInfo = getViewRect$4(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n var edges = graph.edges;\r\n computeNodeValues(nodes);\r\n var filteredNodes = filter(nodes, function (node) {\r\n return node.getLayout().value === 0;\r\n });\r\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\r\n var orient = seriesModel.get('orient');\r\n var nodeAlign = seriesModel.get('nodeAlign');\r\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\r\n });\r\n}\r\nfunction getViewRect$4(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\r\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\r\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\r\n computeEdgeDepths(nodes, orient);\r\n}\r\nfunction computeNodeValues(nodes) {\r\n each(nodes, function (node) {\r\n var value1 = sum(node.outEdges, getEdgeValue);\r\n var value2 = sum(node.inEdges, getEdgeValue);\r\n var nodeRawValue = node.getValue() || 0;\r\n var value = Math.max(value1, value2, nodeRawValue);\r\n node.setLayout({ value: value }, true);\r\n });\r\n}\r\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\r\n var remainEdges = [];\r\n var indegreeArr = [];\r\n var zeroIndegrees = [];\r\n var nextTargetNode = [];\r\n var x = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n remainEdges[i] = 1;\r\n }\r\n for (var i = 0; i < nodes.length; i++) {\r\n indegreeArr[i] = nodes[i].inEdges.length;\r\n if (indegreeArr[i] === 0) {\r\n zeroIndegrees.push(nodes[i]);\r\n }\r\n }\r\n var maxNodeDepth = -1;\r\n while (zeroIndegrees.length) {\r\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\r\n var node = zeroIndegrees[idx];\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n var isItemDepth = item.depth != null && item.depth >= 0;\r\n if (isItemDepth && item.depth > maxNodeDepth) {\r\n maxNodeDepth = item.depth;\r\n }\r\n node.setLayout({ depth: isItemDepth ? item.depth : x }, true);\r\n orient === 'vertical'\r\n ? node.setLayout({ dy: nodeWidth }, true)\r\n : node.setLayout({ dx: nodeWidth }, true);\r\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\r\n var edge = node.outEdges[edgeIdx];\r\n var indexEdge = edges.indexOf(edge);\r\n remainEdges[indexEdge] = 0;\r\n var targetNode = edge.node2;\r\n var nodeIndex = nodes.indexOf(targetNode);\r\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\r\n nextTargetNode.push(targetNode);\r\n }\r\n }\r\n }\r\n ++x;\r\n zeroIndegrees = nextTargetNode;\r\n nextTargetNode = [];\r\n }\r\n for (var i = 0; i < remainEdges.length; i++) {\r\n if (remainEdges[i] === 1) {\r\n throw new Error('Sankey is a DAG, the original data has cycle!');\r\n }\r\n }\r\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\r\n if (nodeAlign && nodeAlign !== 'left') {\r\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\r\n }\r\n var kx = orient === 'vertical'\r\n ? (height - nodeWidth) / maxDepth\r\n : (width - nodeWidth) / maxDepth;\r\n scaleNodeBreadths(nodes, kx, orient);\r\n}\r\nfunction isNodeDepth(node) {\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n return item.depth != null && item.depth >= 0;\r\n}\r\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\r\n if (nodeAlign === 'right') {\r\n var nextSourceNode = [];\r\n var remainNodes = nodes;\r\n var nodeHeight = 0;\r\n while (remainNodes.length) {\r\n for (var i = 0; i < remainNodes.length; i++) {\r\n var node = remainNodes[i];\r\n node.setLayout({ skNodeHeight: nodeHeight }, true);\r\n for (var j = 0; j < node.inEdges.length; j++) {\r\n var edge = node.inEdges[j];\r\n if (nextSourceNode.indexOf(edge.node1) < 0) {\r\n nextSourceNode.push(edge.node1);\r\n }\r\n }\r\n }\r\n remainNodes = nextSourceNode;\r\n nextSourceNode = [];\r\n ++nodeHeight;\r\n }\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node)) {\r\n node.setLayout({ depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) }, true);\r\n }\r\n });\r\n }\r\n else if (nodeAlign === 'justify') {\r\n moveSinksRight(nodes, maxDepth);\r\n }\r\n}\r\nfunction moveSinksRight(nodes, maxDepth) {\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node) && !node.outEdges.length) {\r\n node.setLayout({ depth: maxDepth }, true);\r\n }\r\n });\r\n}\r\nfunction scaleNodeBreadths(nodes, kx, orient) {\r\n each(nodes, function (node) {\r\n var nodeDepth = node.getLayout().depth * kx;\r\n orient === 'vertical'\r\n ? node.setLayout({ y: nodeDepth }, true)\r\n : node.setLayout({ x: nodeDepth }, true);\r\n });\r\n}\r\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\r\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\r\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n for (var alpha = 1; iterations > 0; iterations--) {\r\n alpha *= 0.99;\r\n relaxRightToLeft(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n relaxLeftToRight(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n }\r\n}\r\nfunction prepareNodesByBreadth(nodes, orient) {\r\n var nodesByBreadth = [];\r\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\r\n var groupResult = groupData(nodes, function (node) {\r\n return node.getLayout()[keyAttr];\r\n });\r\n groupResult.keys.sort(function (a, b) {\r\n return a - b;\r\n });\r\n each(groupResult.keys, function (key) {\r\n nodesByBreadth.push(groupResult.buckets.get(key));\r\n });\r\n return nodesByBreadth;\r\n}\r\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\r\n var minKy = Infinity;\r\n each(nodesByBreadth, function (nodes) {\r\n var n = nodes.length;\r\n var sum = 0;\r\n each(nodes, function (node) {\r\n sum += node.getLayout().value;\r\n });\r\n var ky = orient === 'vertical'\r\n ? (width - (n - 1) * nodeGap) / sum\r\n : (height - (n - 1) * nodeGap) / sum;\r\n if (ky < minKy) {\r\n minKy = ky;\r\n }\r\n });\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node, i) {\r\n var nodeDy = node.getLayout().value * minKy;\r\n if (orient === 'vertical') {\r\n node.setLayout({ x: i }, true);\r\n node.setLayout({ dx: nodeDy }, true);\r\n }\r\n else {\r\n node.setLayout({ y: i }, true);\r\n node.setLayout({ dy: nodeDy }, true);\r\n }\r\n });\r\n });\r\n each(edges, function (edge) {\r\n var edgeDy = +edge.getValue() * minKy;\r\n edge.setLayout({ dy: edgeDy }, true);\r\n });\r\n}\r\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodesByBreadth, function (nodes) {\r\n nodes.sort(function (a, b) {\r\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\r\n });\r\n var nodeX;\r\n var node;\r\n var dy;\r\n var y0 = 0;\r\n var n = nodes.length;\r\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\r\n for (var i = 0; i < n; i++) {\r\n node = nodes[i];\r\n dy = y0 - node.getLayout()[keyAttr];\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] + dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\r\n }\r\n var viewWidth = orient === 'vertical' ? width : height;\r\n dy = y0 - nodeGap - viewWidth;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n y0 = nodeX;\r\n for (var i = n - 2; i >= 0; --i) {\r\n node = nodes[i];\r\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr];\r\n }\r\n }\r\n });\r\n}\r\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth.slice().reverse(), function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.outEdges.length) {\r\n var y = sum(node.outEdges, weightedTarget, orient)\r\n / sum(node.outEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.outEdges.length;\r\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\nfunction weightedTarget(edge, orient) {\r\n return center$1(edge.node2, orient) * edge.getValue();\r\n}\r\nfunction centerTarget(edge, orient) {\r\n return center$1(edge.node2, orient);\r\n}\r\nfunction weightedSource(edge, orient) {\r\n return center$1(edge.node1, orient) * edge.getValue();\r\n}\r\nfunction centerSource(edge, orient) {\r\n return center$1(edge.node1, orient);\r\n}\r\nfunction center$1(node, orient) {\r\n return orient === 'vertical'\r\n ? node.getLayout().x + node.getLayout().dx / 2\r\n : node.getLayout().y + node.getLayout().dy / 2;\r\n}\r\nfunction getEdgeValue(edge) {\r\n return edge.getValue();\r\n}\r\nfunction sum(array, cb, orient) {\r\n var sum = 0;\r\n var len = array.length;\r\n var i = -1;\r\n while (++i < len) {\r\n var value = +cb(array[i], orient);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n return sum;\r\n}\r\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.inEdges.length) {\r\n var y = sum(node.inEdges, weightedSource, orient)\r\n / sum(node.inEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.inEdges.length;\r\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\nfunction computeEdgeDepths(nodes, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodes, function (node) {\r\n node.outEdges.sort(function (a, b) {\r\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\r\n });\r\n node.inEdges.sort(function (a, b) {\r\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\r\n });\r\n });\r\n each(nodes, function (node) {\r\n var sy = 0;\r\n var ty = 0;\r\n each(node.outEdges, function (edge) {\r\n edge.setLayout({ sy: sy }, true);\r\n sy += edge.getLayout().dy;\r\n });\r\n each(node.inEdges, function (edge) {\r\n edge.setLayout({ ty: ty }, true);\r\n ty += edge.getLayout().dy;\r\n });\r\n });\r\n}\n\nfunction sankeyVisual(ecModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n if (nodes.length) {\r\n var minValue_1 = Infinity;\r\n var maxValue_1 = -Infinity;\r\n each(nodes, function (node) {\r\n var nodeValue = node.getLayout().value;\r\n if (nodeValue < minValue_1) {\r\n minValue_1 = nodeValue;\r\n }\r\n if (nodeValue > maxValue_1) {\r\n maxValue_1 = nodeValue;\r\n }\r\n });\r\n each(nodes, function (node) {\r\n var mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue_1, maxValue_1],\r\n visual: seriesModel.get('color')\r\n });\r\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n var customColor = node.getModel().get(['itemStyle', 'color']);\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', { fill: customColor });\r\n }\r\n else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', { fill: mapValueToColor });\r\n }\r\n });\r\n }\r\n });\r\n}\n\nregisterLayout(sankeyLayout);\r\nregisterVisual(sankeyVisual);\n\nvar WhiskerBoxCommonMixin = (function () {\r\n function WhiskerBoxCommonMixin() {\r\n }\r\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\r\n var ordinalMeta;\r\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\r\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\r\n var xAxisType = xAxisModel.get('type');\r\n var yAxisType = yAxisModel.get('type');\r\n var addOrdinal;\r\n if (xAxisType === 'category') {\r\n option.layout = 'horizontal';\r\n ordinalMeta = xAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else if (yAxisType === 'category') {\r\n option.layout = 'vertical';\r\n ordinalMeta = yAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else {\r\n option.layout = option.layout || 'horizontal';\r\n }\r\n var coordDims = ['x', 'y'];\r\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\r\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\r\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\r\n var axisModels = [xAxisModel, yAxisModel];\r\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\r\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\r\n var data = option.data;\r\n if (data && addOrdinal) {\r\n var newOptionData_1 = [];\r\n each(data, function (item, index) {\r\n var newItem;\r\n if (isArray(item)) {\r\n newItem = item.slice();\r\n item.unshift(index);\r\n }\r\n else if (isArray(item.value)) {\r\n newItem = item.value.slice();\r\n item.value.unshift(index);\r\n }\r\n else {\r\n newItem = item;\r\n }\r\n newOptionData_1.push(newItem);\r\n });\r\n option.data = newOptionData_1;\r\n }\r\n var defaultValueDimensions = this.defaultValueDimensions;\r\n var coordDimensions = [{\r\n name: baseAxisDim,\r\n type: getDimensionTypeByAxis(baseAxisType),\r\n ordinalMeta: ordinalMeta,\r\n otherDims: {\r\n tooltip: false,\r\n itemName: 0\r\n },\r\n dimsDef: ['base']\r\n }, {\r\n name: otherAxisDim,\r\n type: getDimensionTypeByAxis(otherAxisType),\r\n dimsDef: defaultValueDimensions.slice()\r\n }];\r\n return createListSimply(this, {\r\n coordDimensions: coordDimensions,\r\n dimensionsCount: defaultValueDimensions.length + 1,\r\n encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\r\n });\r\n };\r\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\r\n var dim = this._baseAxisDim;\r\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\r\n };\r\n return WhiskerBoxCommonMixin;\r\n}());\n\nvar BoxplotSeriesModel = (function (_super) {\r\n __extends(BoxplotSeriesModel, _super);\r\n function BoxplotSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'min', defaultTooltip: true },\r\n { name: 'Q1', defaultTooltip: true },\r\n { name: 'median', defaultTooltip: true },\r\n { name: 'Q3', defaultTooltip: true },\r\n { name: 'max', defaultTooltip: true }\r\n ];\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n BoxplotSeriesModel.type = 'series.boxplot';\r\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n BoxplotSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n boxWidth: [7, 50],\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2,\r\n shadowBlur: 5,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n },\r\n animationDuration: 800\r\n };\r\n return BoxplotSeriesModel;\r\n}(SeriesModel));\r\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\r\nSeriesModel.registerClass(BoxplotSeriesModel);\n\nvar BoxplotView = (function (_super) {\r\n __extends(BoxplotView, _super);\r\n function BoxplotView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotView.type;\r\n return _this;\r\n }\r\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var group = this.group;\r\n var oldData = this._data;\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (!symbolEl) {\r\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\r\n }\r\n else {\r\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n BoxplotView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var data = this._data;\r\n this._data = null;\r\n data && data.eachItemGraphicEl(function (el) {\r\n el && group.remove(el);\r\n });\r\n };\r\n BoxplotView.type = 'boxplot';\r\n return BoxplotView;\r\n}(ChartView));\r\nvar BoxPathShape = (function () {\r\n function BoxPathShape() {\r\n }\r\n return BoxPathShape;\r\n}());\r\nvar BoxPath = (function (_super) {\r\n __extends(BoxPath, _super);\r\n function BoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'boxplotBoxPath';\r\n return _this;\r\n }\r\n BoxPath.prototype.getDefaultShape = function () {\r\n return new BoxPathShape();\r\n };\r\n BoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n var i = 0;\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n for (; i < 4; i++) {\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n ctx.closePath();\r\n for (; i < ends.length; i++) {\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n };\r\n return BoxPath;\r\n}(Path));\r\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\r\n var ends = itemLayout.ends;\r\n var el = new BoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, constDim, itemLayout)\r\n : ends\r\n }\r\n });\r\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\r\n return el;\r\n}\r\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\r\n var seriesModel = data.hostModel;\r\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\r\n updateMethod(el, { shape: { points: itemLayout.ends } }, seriesModel, dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.z2 = 100;\r\n var itemModel = data.getItemModel(dataIndex);\r\n setStatesStylesFromModel(el, itemModel);\r\n enableHoverEmphasis(el, itemModel.get(['emphasis', 'focus']), itemModel.get(['emphasis', 'blurScope']));\r\n}\r\nfunction transInit(points, dim, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[dim] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\nChartView.registerClass(BoxplotView);\n\nfunction boxplotVisual(ecModel, api) {\r\n ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n });\r\n}\n\nvar each$7 = each;\r\nfunction boxplotLayout(ecModel) {\r\n var groupResult = groupSeriesByAxis(ecModel);\r\n each$7(groupResult, function (groupItem) {\r\n var seriesModels = groupItem.seriesModels;\r\n if (!seriesModels.length) {\r\n return;\r\n }\r\n calculateBase(groupItem);\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\r\n });\r\n });\r\n}\r\nfunction groupSeriesByAxis(ecModel) {\r\n var result = [];\r\n var axisList = [];\r\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var idx = indexOf(axisList, baseAxis);\r\n if (idx < 0) {\r\n idx = axisList.length;\r\n axisList[idx] = baseAxis;\r\n result[idx] = {\r\n axis: baseAxis,\r\n seriesModels: []\r\n };\r\n }\r\n result[idx].seriesModels.push(seriesModel);\r\n });\r\n return result;\r\n}\r\nfunction calculateBase(groupItem) {\r\n var extent;\r\n var baseAxis = groupItem.axis;\r\n var seriesModels = groupItem.seriesModels;\r\n var seriesCount = seriesModels.length;\r\n var boxWidthList = groupItem.boxWidthList = [];\r\n var boxOffsetList = groupItem.boxOffsetList = [];\r\n var boundList = [];\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else {\r\n var maxDataCount_1 = 0;\r\n each$7(seriesModels, function (seriesModel) {\r\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\r\n });\r\n extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / maxDataCount_1;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var boxWidthBound = seriesModel.get('boxWidth');\r\n if (!isArray(boxWidthBound)) {\r\n boxWidthBound = [boxWidthBound, boxWidthBound];\r\n }\r\n boundList.push([\r\n parsePercent$2(boxWidthBound[0], bandWidth) || 0,\r\n parsePercent$2(boxWidthBound[1], bandWidth) || 0\r\n ]);\r\n });\r\n var availableWidth = bandWidth * 0.8 - 2;\r\n var boxGap = availableWidth / seriesCount * 0.3;\r\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\r\n var base = boxWidth / 2 - availableWidth / 2;\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n boxOffsetList.push(base);\r\n base += boxGap + boxWidth;\r\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\r\n });\r\n}\r\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var halfWidth = boxWidth / 2;\r\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\r\n var vDimIdx = 1 - cDimIdx;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n if (cDim == null || vDims.length < 5) {\r\n return;\r\n }\r\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\r\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\r\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\r\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\r\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\r\n var ends = [];\r\n addBodyEnd(ends, end2, false);\r\n addBodyEnd(ends, end4, true);\r\n ends.push(end1, end2, end5, end4);\r\n layEndLine(ends, end1);\r\n layEndLine(ends, end5);\r\n layEndLine(ends, median);\r\n data.setItemLayout(dataIndex, {\r\n initBaseline: median[vDimIdx],\r\n ends: ends\r\n });\r\n }\r\n function getPoint(axisDimVal, dim, dataIndex) {\r\n var val = data.get(dim, dataIndex);\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n var point;\r\n if (isNaN(axisDimVal) || isNaN(val)) {\r\n point = [NaN, NaN];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(p);\r\n point[cDimIdx] += offset;\r\n }\r\n return point;\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] += halfWidth;\r\n point2[cDimIdx] -= halfWidth;\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function layEndLine(ends, endCenter) {\r\n var from = endCenter.slice();\r\n var to = endCenter.slice();\r\n from[cDimIdx] -= halfWidth;\r\n to[cDimIdx] += halfWidth;\r\n ends.push(from, to);\r\n }\r\n}\n\nfunction prepareBoxplotData(rawData, opt) {\r\n opt = opt || {};\r\n var boxData = [];\r\n var outliers = [];\r\n var boundIQR = opt.boundIQR;\r\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\r\n for (var i = 0; i < rawData.length; i++) {\r\n var ascList = asc(rawData[i].slice());\r\n var Q1 = quantile(ascList, 0.25);\r\n var Q2 = quantile(ascList, 0.5);\r\n var Q3 = quantile(ascList, 0.75);\r\n var min = ascList[0];\r\n var max = ascList[ascList.length - 1];\r\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\r\n var low = useExtreme\r\n ? min\r\n : Math.max(min, Q1 - bound);\r\n var high = useExtreme\r\n ? max\r\n : Math.min(max, Q3 + bound);\r\n var itemNameFormatter = opt.itemNameFormatter;\r\n var itemName = isFunction(itemNameFormatter)\r\n ? itemNameFormatter({ value: i })\r\n : isString(itemNameFormatter)\r\n ? itemNameFormatter.replace('{value}', i + '')\r\n : i + '';\r\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\r\n for (var j = 0; j < ascList.length; j++) {\r\n var dataItem = ascList[j];\r\n if (dataItem < low || dataItem > high) {\r\n var outlier = [itemName, dataItem];\r\n outliers.push(outlier);\r\n }\r\n }\r\n }\r\n return {\r\n boxData: boxData,\r\n outliers: outliers\r\n };\r\n}\n\nvar boxplotTransform = {\r\n type: 'echarts:boxplot',\r\n transform: function transform(params) {\r\n var upstream = params.upstream;\r\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\r\n }\r\n throwError(errMsg);\r\n }\r\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\r\n return [{\r\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\r\n data: result.boxData\r\n }, {\r\n data: result.outliers\r\n }];\r\n }\r\n};\n\nregisterVisual(boxplotVisual);\r\nregisterLayout(boxplotLayout);\r\nregisterTransform(boxplotTransform);\n\nvar CandlestickSeriesModel = (function (_super) {\r\n __extends(CandlestickSeriesModel, _super);\r\n function CandlestickSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'open', defaultTooltip: true },\r\n { name: 'close', defaultTooltip: true },\r\n { name: 'lowest', defaultTooltip: true },\r\n { name: 'highest', defaultTooltip: true }\r\n ];\r\n return _this;\r\n }\r\n CandlestickSeriesModel.prototype.getShadowDim = function () {\r\n return 'open';\r\n };\r\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n return itemLayout && selectors.rect(itemLayout.brushRect);\r\n };\r\n CandlestickSeriesModel.type = 'series.candlestick';\r\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n CandlestickSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n clip: true,\r\n itemStyle: {\r\n color: '#c23531',\r\n color0: '#314656',\r\n borderWidth: 1,\r\n borderColor: '#c23531',\r\n borderColor0: '#314656'\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2\r\n }\r\n },\r\n barMaxWidth: null,\r\n barMinWidth: null,\r\n barWidth: null,\r\n large: true,\r\n largeThreshold: 600,\r\n progressive: 3e3,\r\n progressiveThreshold: 1e4,\r\n progressiveChunkMode: 'mod',\r\n animationEasing: 'linear',\r\n animationDuration: 300\r\n };\r\n return CandlestickSeriesModel;\r\n}(SeriesModel));\r\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\r\nSeriesModel.registerClass(CandlestickSeriesModel);\n\nvar SKIP_PROPS = ['color', 'borderColor'];\r\nvar CandlestickView = (function (_super) {\r\n __extends(CandlestickView, _super);\r\n function CandlestickView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickView.type;\r\n return _this;\r\n }\r\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeClipPath();\r\n this._updateDrawMode(seriesModel);\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel)\r\n : this._renderNormal(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n this._isLargeDraw\r\n ? this._incrementalRenderLarge(params, seriesModel)\r\n : this._incrementalRenderNormal(params, seriesModel);\r\n };\r\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n CandlestickView.prototype._renderNormal = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var needsClip = seriesModel.get('clip', true);\r\n var coord = seriesModel.coordinateSystem;\r\n var clipArea = coord.getArea && coord.getArea();\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n return;\r\n }\r\n var el = createNormalBox$1(itemLayout, newIdx, true);\r\n initProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx);\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(el);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n if (!el) {\r\n el = createNormalBox$1(itemLayout);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: {\r\n points: itemLayout.ends\r\n }\r\n }, seriesModel, newIdx);\r\n }\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n CandlestickView.prototype._renderLarge = function (seriesModel) {\r\n this._clear();\r\n createLarge$1(seriesModel, this.group);\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\r\n var data = seriesModel.getData();\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n var el = createNormalBox$1(itemLayout);\r\n setBoxCommon(el, data, dataIndex, isSimpleBox);\r\n el.incremental = true;\r\n this.group.add(el);\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n createLarge$1(seriesModel, this.group, true);\r\n };\r\n CandlestickView.prototype.remove = function (ecModel) {\r\n this._clear();\r\n };\r\n CandlestickView.prototype._clear = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CandlestickView.type = 'candlestick';\r\n return CandlestickView;\r\n}(ChartView));\r\nChartView.registerClass(CandlestickView);\r\nvar NormalBoxPathShape = (function () {\r\n function NormalBoxPathShape() {\r\n }\r\n return NormalBoxPathShape;\r\n}());\r\nvar NormalBoxPath = (function (_super) {\r\n __extends(NormalBoxPath, _super);\r\n function NormalBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'normalCandlestickBox';\r\n return _this;\r\n }\r\n NormalBoxPath.prototype.getDefaultShape = function () {\r\n return new NormalBoxPathShape();\r\n };\r\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n if (this.__simpleBox) {\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[6][0], ends[6][1]);\r\n }\r\n else {\r\n ctx.moveTo(ends[0][0], ends[0][1]);\r\n ctx.lineTo(ends[1][0], ends[1][1]);\r\n ctx.lineTo(ends[2][0], ends[2][1]);\r\n ctx.lineTo(ends[3][0], ends[3][1]);\r\n ctx.closePath();\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[5][0], ends[5][1]);\r\n ctx.moveTo(ends[6][0], ends[6][1]);\r\n ctx.lineTo(ends[7][0], ends[7][1]);\r\n }\r\n };\r\n return NormalBoxPath;\r\n}(Path));\r\nfunction createNormalBox$1(itemLayout, dataIndex, isInit) {\r\n var ends = itemLayout.ends;\r\n return new NormalBoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit$1(ends, itemLayout)\r\n : ends\r\n },\r\n z2: 100\r\n });\r\n}\r\nfunction isNormalBoxClipped(clipArea, itemLayout) {\r\n var clipped = true;\r\n for (var i = 0; i < itemLayout.ends.length; i++) {\r\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\r\n clipped = false;\r\n break;\r\n }\r\n }\r\n return clipped;\r\n}\r\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.__simpleBox = isSimpleBox;\r\n setStatesStylesFromModel(el, itemModel);\r\n}\r\nfunction transInit$1(points, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[1] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\nvar LargeBoxPathShape = (function () {\r\n function LargeBoxPathShape() {\r\n }\r\n return LargeBoxPathShape;\r\n}());\r\nvar LargeBoxPath = (function (_super) {\r\n __extends(LargeBoxPath, _super);\r\n function LargeBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeCandlestickBox';\r\n return _this;\r\n }\r\n LargeBoxPath.prototype.getDefaultShape = function () {\r\n return new LargeBoxPathShape();\r\n };\r\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n for (var i = 0; i < points.length;) {\r\n if (this.__sign === points[i++]) {\r\n var x = points[i++];\r\n ctx.moveTo(x, points[i++]);\r\n ctx.lineTo(x, points[i++]);\r\n }\r\n else {\r\n i += 3;\r\n }\r\n }\r\n };\r\n return LargeBoxPath;\r\n}(Path));\r\nfunction createLarge$1(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var largePoints = data.getLayout('largePoints');\r\n var elP = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: 1\r\n });\r\n group.add(elP);\r\n var elN = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: -1\r\n });\r\n group.add(elN);\r\n setLargeStyle$1(1, elP, seriesModel);\r\n setLargeStyle$1(-1, elN, seriesModel);\r\n if (incremental) {\r\n elP.incremental = true;\r\n elN.incremental = true;\r\n }\r\n}\r\nfunction setLargeStyle$1(sign, el, seriesModel, data) {\r\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0'])\r\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\r\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n}\n\nfunction candlestickPreprocessor(option) {\r\n if (!option || !isArray(option.series)) {\r\n return;\r\n }\r\n each(option.series, function (seriesItem) {\r\n if (isObject(seriesItem) && seriesItem.type === 'k') {\r\n seriesItem.type = 'candlestick';\r\n }\r\n });\r\n}\n\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\r\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\r\nvar positiveColorQuery = ['itemStyle', 'color'];\r\nvar negativeColorQuery = ['itemStyle', 'color0'];\r\nvar candlestickVisual = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n function getColor(sign, model) {\r\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\r\n }\r\n function getBorderColor(sign, model) {\r\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\r\n }\r\n var data = seriesModel.getData();\r\n data.setVisual('legendSymbol', 'roundRect');\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var isLargeRender = seriesModel.pipelineContext.large;\r\n return !isLargeRender && {\r\n progress: function (params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var sign = data.getItemLayout(dataIndex).sign;\r\n var style = itemModel.getItemStyle();\r\n style.fill = getColor(sign, itemModel);\r\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n extend(existsStyle, style);\r\n }\r\n }\r\n };\r\n }\r\n};\n\nvar LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\nvar candlestickLayout = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var candleWidth = calculateCandleWidth(seriesModel, data);\r\n var cDimIdx = 0;\r\n var vDimIdx = 1;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n var openDim = vDims[0];\r\n var closeDim = vDims[1];\r\n var lowestDim = vDims[2];\r\n var highestDim = vDims[3];\r\n data.setLayout({\r\n candleWidth: candleWidth,\r\n isSimpleBox: candleWidth <= 1.3\r\n });\r\n if (cDim == null || vDims.length < 4) {\r\n return;\r\n }\r\n return {\r\n progress: seriesModel.pipelineContext.large\r\n ? largeProgress : normalProgress\r\n };\r\n function normalProgress(params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n var ocLow = Math.min(openVal, closeVal);\r\n var ocHigh = Math.max(openVal, closeVal);\r\n var ocLowPoint = getPoint(ocLow, axisDimVal);\r\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\r\n var lowestPoint = getPoint(lowestVal, axisDimVal);\r\n var highestPoint = getPoint(highestVal, axisDimVal);\r\n var ends = [];\r\n addBodyEnd(ends, ocHighPoint, 0);\r\n addBodyEnd(ends, ocLowPoint, 1);\r\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\r\n data.setItemLayout(dataIndex, {\r\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\r\n initBaseline: openVal > closeVal\r\n ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\r\n ends: ends,\r\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\r\n });\r\n }\r\n function getPoint(val, axisDimVal) {\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n return (isNaN(axisDimVal) || isNaN(val))\r\n ? [NaN, NaN]\r\n : coordSys.dataToPoint(p);\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false);\r\n point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true);\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\r\n var pmin = getPoint(lowestVal, axisDimVal);\r\n var pmax = getPoint(highestVal, axisDimVal);\r\n pmin[cDimIdx] -= candleWidth / 2;\r\n pmax[cDimIdx] -= candleWidth / 2;\r\n return {\r\n x: pmin[0],\r\n y: pmin[1],\r\n width: candleWidth ,\r\n height: pmax[1] - pmin[1] \r\n };\r\n }\r\n function subPixelOptimizePoint(point) {\r\n point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1);\r\n return point;\r\n }\r\n }\r\n function largeProgress(params, data) {\r\n var points = new LargeArr$1(params.count * 4);\r\n var offset = 0;\r\n var point;\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\r\n points[offset++] = NaN;\r\n offset += 3;\r\n continue;\r\n }\r\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\r\n tmpIn[cDimIdx] = axisDimVal;\r\n tmpIn[vDimIdx] = lowestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[0] : NaN;\r\n points[offset++] = point ? point[1] : NaN;\r\n tmpIn[vDimIdx] = highestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[1] : NaN;\r\n }\r\n data.setLayout('largePoints', points);\r\n }\r\n }\r\n};\r\nfunction getSign(data, dataIndex, openVal, closeVal, closeDim) {\r\n var sign;\r\n if (openVal > closeVal) {\r\n sign = -1;\r\n }\r\n else if (openVal < closeVal) {\r\n sign = 1;\r\n }\r\n else {\r\n sign = dataIndex > 0\r\n ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1)\r\n : 1;\r\n }\r\n return sign;\r\n}\r\nfunction calculateCandleWidth(seriesModel, data) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var extent;\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / data.count());\r\n var barMaxWidth = parsePercent$2(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\r\n var barMinWidth = parsePercent$2(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\r\n var barWidth = seriesModel.get('barWidth');\r\n return barWidth != null\r\n ? parsePercent$2(barWidth, bandWidth)\r\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\r\n}\n\nregisterPreprocessor(candlestickPreprocessor);\r\nregisterVisual(candlestickVisual);\r\nregisterLayout(candlestickLayout);\n\nvar EffectScatterSeriesModel = (function (_super) {\r\n __extends(EffectScatterSeriesModel, _super);\r\n function EffectScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n EffectScatterSeriesModel.type = 'series.effectScatter';\r\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\r\n EffectScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n effectType: 'ripple',\r\n progressive: 0,\r\n showEffectOn: 'render',\r\n rippleEffect: {\r\n period: 4,\r\n scale: 2.5,\r\n brushType: 'fill'\r\n },\r\n symbolSize: 10\r\n };\r\n return EffectScatterSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(EffectScatterSeriesModel);\n\nvar EFFECT_RIPPLE_NUMBER = 3;\r\nfunction normalizeSymbolSize$1(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n}\r\nfunction updateRipplePath(rippleGroup, effectCfg) {\r\n var color = effectCfg.rippleEffectColor || effectCfg.color;\r\n rippleGroup.eachChild(function (ripplePath) {\r\n ripplePath.attr({\r\n z: effectCfg.z,\r\n zlevel: effectCfg.zlevel,\r\n style: {\r\n stroke: effectCfg.brushType === 'stroke' ? color : null,\r\n fill: effectCfg.brushType === 'fill' ? color : null\r\n }\r\n });\r\n });\r\n}\r\nvar EffectSymbol = (function (_super) {\r\n __extends(EffectSymbol, _super);\r\n function EffectSymbol(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var symbol = new Symbol(data, idx);\r\n var rippleGroup = new Group();\r\n _this.add(symbol);\r\n _this.add(rippleGroup);\r\n _this.updateData(data, idx);\r\n return _this;\r\n }\r\n EffectSymbol.prototype.stopEffectAnimation = function () {\r\n this.childAt(1).removeAll();\r\n };\r\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\r\n var symbolType = effectCfg.symbolType;\r\n var color = effectCfg.color;\r\n var rippleGroup = this.childAt(1);\r\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\r\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n ripplePath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 99,\r\n silent: true,\r\n scaleX: 0.5,\r\n scaleY: 0.5\r\n });\r\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset;\r\n ripplePath.animate('', true)\r\n .when(effectCfg.period, {\r\n scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2]\r\n })\r\n .delay(delay)\r\n .start();\r\n ripplePath.animateStyle(true)\r\n .when(effectCfg.period, {\r\n opacity: 0\r\n })\r\n .delay(delay)\r\n .start();\r\n rippleGroup.add(ripplePath);\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\r\n var oldEffectCfg = this._effectCfg;\r\n var rippleGroup = this.childAt(1);\r\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\r\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\r\n var propName = DIFFICULT_PROPS[i];\r\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\r\n this.stopEffectAnimation();\r\n this.startEffectAnimation(effectCfg);\r\n return;\r\n }\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n EffectSymbol.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n EffectSymbol.prototype.updateData = function (data, idx) {\r\n var _this = this;\r\n var seriesModel = data.hostModel;\r\n this.childAt(0).updateData(data, idx);\r\n var rippleGroup = this.childAt(1);\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = data.getItemVisual(idx, 'symbol');\r\n var symbolSize = normalizeSymbolSize$1(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var color = symbolStyle && symbolStyle.fill;\r\n rippleGroup.setScale(symbolSize);\r\n rippleGroup.traverse(function (ripplePath) {\r\n ripplePath.setStyle('fill', color);\r\n });\r\n var symbolOffset = itemModel.getShallow('symbolOffset');\r\n if (symbolOffset) {\r\n rippleGroup.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n rippleGroup.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var effectCfg = {};\r\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\r\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\r\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\r\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\r\n effectCfg.effectOffset = idx / data.count();\r\n effectCfg.z = seriesModel.getShallow('z') || 0;\r\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\r\n effectCfg.symbolType = symbolType;\r\n effectCfg.color = color;\r\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\r\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\r\n if (effectCfg.showEffectOn === 'render') {\r\n this._effectCfg\r\n ? this.updateEffectAnimation(effectCfg)\r\n : this.startEffectAnimation(effectCfg);\r\n this._effectCfg = effectCfg;\r\n }\r\n else {\r\n this._effectCfg = null;\r\n this.stopEffectAnimation();\r\n this.onHoverStateChange = function (toState) {\r\n if (toState === 'emphasis') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.startEffectAnimation(effectCfg);\r\n }\r\n }\r\n else if (toState === 'normal') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.stopEffectAnimation();\r\n }\r\n }\r\n };\r\n }\r\n this._effectCfg = effectCfg;\r\n enableHoverEmphasis(this);\r\n };\r\n EffectSymbol.prototype.fadeOut = function (cb) {\r\n this.off('mouseover').off('mouseout');\r\n cb && cb();\r\n };\r\n return EffectSymbol;\r\n}(Group));\r\ninherits(EffectSymbol, Group);\n\nvar EffectScatterView = (function (_super) {\r\n __extends(EffectScatterView, _super);\r\n function EffectScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterView.type;\r\n return _this;\r\n }\r\n EffectScatterView.prototype.init = function () {\r\n this._symbolDraw = new SymbolDraw(EffectSymbol);\r\n };\r\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var effectSymbolDraw = this._symbolDraw;\r\n effectSymbolDraw.updateData(data);\r\n this.group.add(effectSymbolDraw.group);\r\n };\r\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._symbolDraw.updateLayout();\r\n };\r\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.getRoamTransform) {\r\n this.group.transform = clone$2(coordSys.getRoamTransform());\r\n this.group.decomposeTransform();\r\n }\r\n };\r\n EffectScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n };\r\n EffectScatterView.type = 'effectScatter';\r\n return EffectScatterView;\r\n}(ChartView));\r\nChartView.registerClass(EffectScatterView);\n\nregisterLayout(pointsLayout('effectScatter'));\n\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\r\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\r\nfunction compatEc2(seriesOpt) {\r\n var data = seriesOpt.data;\r\n if (data && data[0] && data[0][0] && data[0][0].coord) {\r\n if (__DEV__) {\r\n console.warn('Lines data configuration has been changed to'\r\n + ' { coords:[[1,2],[2,3]] }');\r\n }\r\n seriesOpt.data = map(data, function (itemOpt) {\r\n var coords = [\r\n itemOpt[0].coord, itemOpt[1].coord\r\n ];\r\n var target = {\r\n coords: coords\r\n };\r\n if (itemOpt[0].name) {\r\n target.fromName = itemOpt[0].name;\r\n }\r\n if (itemOpt[1].name) {\r\n target.toName = itemOpt[1].name;\r\n }\r\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\r\n });\r\n }\r\n}\r\nvar LinesSeriesModel = (function (_super) {\r\n __extends(LinesSeriesModel, _super);\r\n function LinesSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n LinesSeriesModel.prototype.init = function (option) {\r\n option.data = option.data || [];\r\n compatEc2(option);\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n _super.prototype.init.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.mergeOption = function (option) {\r\n compatEc2(option);\r\n if (option.data) {\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n }\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.appendData = function (params) {\r\n var result = this._processFlatCoordsArray(params.data);\r\n if (result.flatCoords) {\r\n if (!this._flatCoords) {\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n }\r\n else {\r\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\r\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\r\n }\r\n params.data = new Float32Array(result.count);\r\n }\r\n this.getRawData().appendData(params.data);\r\n };\r\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\r\n var itemModel = this.getData().getItemModel(idx);\r\n var coords = (itemModel.option instanceof Array)\r\n ? itemModel.option : itemModel.getShallow('coords');\r\n if (__DEV__) {\r\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\r\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\r\n }\r\n }\r\n return coords;\r\n };\r\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\r\n if (this._flatCoordsOffset) {\r\n return this._flatCoordsOffset[idx * 2 + 1];\r\n }\r\n else {\r\n return this._getCoordsFromItemModel(idx).length;\r\n }\r\n };\r\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\r\n if (this._flatCoordsOffset) {\r\n var offset = this._flatCoordsOffset[idx * 2];\r\n var len = this._flatCoordsOffset[idx * 2 + 1];\r\n for (var i = 0; i < len; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = this._flatCoords[offset + i * 2];\r\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\r\n }\r\n return len;\r\n }\r\n else {\r\n var coords = this._getCoordsFromItemModel(idx);\r\n for (var i = 0; i < coords.length; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = coords[i][0];\r\n out[i][1] = coords[i][1];\r\n }\r\n return coords.length;\r\n }\r\n };\r\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\r\n var startOffset = 0;\r\n if (this._flatCoords) {\r\n startOffset = this._flatCoords.length;\r\n }\r\n if (typeof data[0] === 'number') {\r\n var len = data.length;\r\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\r\n var coordsStorage = new Float64Arr(len);\r\n var coordsCursor = 0;\r\n var offsetCursor = 0;\r\n var dataCount = 0;\r\n for (var i = 0; i < len;) {\r\n dataCount++;\r\n var count = data[i++];\r\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\r\n coordsOffsetAndLenStorage[offsetCursor++] = count;\r\n for (var k = 0; k < count; k++) {\r\n var x = data[i++];\r\n var y = data[i++];\r\n coordsStorage[coordsCursor++] = x;\r\n coordsStorage[coordsCursor++] = y;\r\n if (i > len) {\r\n if (__DEV__) {\r\n throw new Error('Invalid data format.');\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\r\n flatCoords: coordsStorage,\r\n count: dataCount\r\n };\r\n }\r\n return {\r\n flatCoordsOffset: null,\r\n flatCoords: null,\r\n count: data.length\r\n };\r\n };\r\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n if (__DEV__) {\r\n var CoordSys = CoordinateSystemManager.get(option.coordinateSystem);\r\n if (!CoordSys) {\r\n throw new Error('Unkown coordinate system ' + option.coordinateSystem);\r\n }\r\n }\r\n var lineData = new List(['value'], this);\r\n lineData.hasItemOption = false;\r\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\r\n if (dataItem instanceof Array) {\r\n return NaN;\r\n }\r\n else {\r\n lineData.hasItemOption = true;\r\n var value = dataItem.value;\r\n if (value != null) {\r\n return value instanceof Array ? value[dimIndex] : value;\r\n }\r\n }\r\n });\r\n return lineData;\r\n };\r\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var itemModel = data.getItemModel(dataIndex);\r\n var name = itemModel.get('name');\r\n if (name) {\r\n return name;\r\n }\r\n var fromName = itemModel.get('fromName');\r\n var toName = itemModel.get('toName');\r\n var nameArr = [];\r\n fromName != null && nameArr.push(fromName);\r\n toName != null && nameArr.push(toName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > ')\r\n });\r\n };\r\n LinesSeriesModel.prototype.preventIncremental = function () {\r\n return !!this.get(['effect', 'show']);\r\n };\r\n LinesSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 1e4 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n LinesSeriesModel.type = 'series.lines';\r\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\r\n LinesSeriesModel.defaultOption = {\r\n coordinateSystem: 'geo',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n xAxisIndex: 0,\r\n yAxisIndex: 0,\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 10],\r\n geoIndex: 0,\r\n effect: {\r\n show: false,\r\n period: 4,\r\n constantSpeed: 0,\r\n symbol: 'circle',\r\n symbolSize: 3,\r\n loop: true,\r\n trailLength: 0.2\r\n },\r\n large: false,\r\n largeThreshold: 2000,\r\n polyline: false,\r\n clip: true,\r\n label: {\r\n show: false,\r\n position: 'end'\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n };\r\n return LinesSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(LinesSeriesModel);\n\nvar EffectLine = (function (_super) {\r\n __extends(EffectLine, _super);\r\n function EffectLine(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this.add(_this.createLine(lineData, idx, seriesScope));\r\n _this._updateEffectSymbol(lineData, idx);\r\n return _this;\r\n }\r\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Line$1(lineData, idx, seriesScope);\r\n };\r\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\r\n var itemModel = lineData.getItemModel(idx);\r\n var effectModel = itemModel.getModel('effect');\r\n var size = effectModel.get('symbolSize');\r\n var symbolType = effectModel.get('symbol');\r\n if (!isArray(size)) {\r\n size = [size, size];\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var color = effectModel.get('color') || (lineStyle && lineStyle.stroke);\r\n var symbol = this.childAt(1);\r\n if (this._symbolType !== symbolType) {\r\n this.remove(symbol);\r\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n this.add(symbol);\r\n }\r\n if (!symbol) {\r\n return;\r\n }\r\n symbol.setStyle('shadowColor', color);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n symbol.setColor(color);\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\r\n var symbol = this.childAt(1);\r\n if (!symbol) {\r\n return;\r\n }\r\n var self = this;\r\n var points = lineData.getItemLayout(idx);\r\n var period = effectModel.get('period') * 1000;\r\n var loop = effectModel.get('loop');\r\n var constantSpeed = effectModel.get('constantSpeed');\r\n var delayExpr = retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n });\r\n symbol.ignore = true;\r\n this._updateAnimationPoints(symbol, points);\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n if (period !== this._period || loop !== this._loop) {\r\n symbol.stopAnimation();\r\n if (period > 0) {\r\n var delayNum = void 0;\r\n if (typeof delayExpr === 'function') {\r\n delayNum = delayExpr(idx);\r\n }\r\n else {\r\n delayNum = delayExpr;\r\n }\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n symbol.__t = 0;\r\n var animator = symbol.animate('', loop)\r\n .when(period, {\r\n __t: 1\r\n })\r\n .delay(delayNum)\r\n .during(function () {\r\n self._updateSymbolPosition(symbol);\r\n });\r\n if (!loop) {\r\n animator.done(function () {\r\n self.remove(symbol);\r\n });\r\n }\r\n animator.start();\r\n }\r\n }\r\n this._period = period;\r\n this._loop = loop;\r\n };\r\n EffectLine.prototype._getLineLength = function (symbol) {\r\n return (dist(symbol.__p1, symbol.__cp1)\r\n + dist(symbol.__cp1, symbol.__p2));\r\n };\r\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [\r\n (points[0][0] + points[1][0]) / 2,\r\n (points[0][1] + points[1][1]) / 2\r\n ];\r\n };\r\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\r\n this.childAt(0).updateData(lineData, idx, seriesScope);\r\n this._updateEffectSymbol(lineData, idx);\r\n };\r\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\r\n var p1 = symbol.__p1;\r\n var p2 = symbol.__p2;\r\n var cp1 = symbol.__cp1;\r\n var t = symbol.__t;\r\n var pos = [symbol.x, symbol.y];\r\n var lastPos = pos.slice();\r\n var quadraticAt$1 = quadraticAt;\r\n var quadraticDerivativeAt$1 = quadraticDerivativeAt;\r\n pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t);\r\n var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t);\r\n var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t);\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = dist(lastPos, pos) * 1.05;\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n }\r\n else if (symbol.__lastT === 1) {\r\n symbol.scaleY = 2 * dist(p1, pos);\r\n }\r\n else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n };\r\n EffectLine.prototype.updateLayout = function (lineData, idx) {\r\n this.childAt(0).updateLayout(lineData, idx);\r\n var effectModel = lineData.getItemModel(idx).getModel('effect');\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n return EffectLine;\r\n}(Group));\n\nvar Polyline$1 = (function (_super) {\r\n __extends(Polyline$1, _super);\r\n function Polyline$1(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createPolyline(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) {\r\n var points = lineData.getItemLayout(idx);\r\n var line = new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n });\r\n this.add(line);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childAt(0);\r\n var target = {\r\n shape: {\r\n points: lineData.getItemLayout(idx)\r\n }\r\n };\r\n updateProps(line, target, seriesModel, idx);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var line = this.childAt(0);\r\n var itemModel = lineData.getItemModel(idx);\r\n var hoverLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n hoverLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n }\r\n line.useStyle(lineData.getItemVisual(idx, 'style'));\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n var lineEmphasisState = line.ensureState('emphasis');\r\n lineEmphasisState.style = hoverLineStyle;\r\n enableHoverEmphasis(this);\r\n };\r\n Polyline$1.prototype.updateLayout = function (lineData, idx) {\r\n var polyline = this.childAt(0);\r\n polyline.setShape('points', lineData.getItemLayout(idx));\r\n };\r\n return Polyline$1;\r\n}(Group));\n\nvar EffectPolyline = (function (_super) {\r\n __extends(EffectPolyline, _super);\r\n function EffectPolyline() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._lastFrame = 0;\r\n _this._lastFramePercent = 0;\r\n return _this;\r\n }\r\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Polyline$1(lineData, idx, seriesScope);\r\n };\r\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\r\n this._points = points;\r\n var accLenArr = [0];\r\n var len = 0;\r\n for (var i = 1; i < points.length; i++) {\r\n var p1 = points[i - 1];\r\n var p2 = points[i];\r\n len += dist(p1, p2);\r\n accLenArr.push(len);\r\n }\r\n if (len === 0) {\r\n this._length = 0;\r\n return;\r\n }\r\n for (var i = 0; i < accLenArr.length; i++) {\r\n accLenArr[i] /= len;\r\n }\r\n this._offsets = accLenArr;\r\n this._length = len;\r\n };\r\n EffectPolyline.prototype._getLineLength = function () {\r\n return this._length;\r\n };\r\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\r\n var t = symbol.__t;\r\n var points = this._points;\r\n var offsets = this._offsets;\r\n var len = points.length;\r\n if (!offsets) {\r\n return;\r\n }\r\n var lastFrame = this._lastFrame;\r\n var frame;\r\n if (t < this._lastFramePercent) {\r\n var start = Math.min(lastFrame + 1, len - 1);\r\n for (frame = start; frame >= 0; frame--) {\r\n if (offsets[frame] <= t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame, len - 2);\r\n }\r\n else {\r\n for (frame = lastFrame; frame < len; frame++) {\r\n if (offsets[frame] > t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame - 1, len - 2);\r\n }\r\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\r\n var p0 = points[frame];\r\n var p1 = points[frame + 1];\r\n symbol.x = p0[0] * (1 - p) + p * p1[0];\r\n symbol.y = p0[1] * (1 - p) + p * p1[1];\r\n var tx = p1[0] - p0[0];\r\n var ty = p1[1] - p0[1];\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n this._lastFrame = frame;\r\n this._lastFramePercent = t;\r\n symbol.ignore = false;\r\n };\r\n return EffectPolyline;\r\n}(EffectLine));\n\nvar LargeLinesPathShape = (function () {\r\n function LargeLinesPathShape() {\r\n this.polyline = false;\r\n this.curveness = 0;\r\n this.segs = [];\r\n }\r\n return LargeLinesPathShape;\r\n}());\r\nvar LargeLinesPath = (function (_super) {\r\n __extends(LargeLinesPath, _super);\r\n function LargeLinesPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeLinesPath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n LargeLinesPath.prototype.getDefaultShape = function () {\r\n return new LargeLinesPathShape();\r\n };\r\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n if (shape.polyline) {\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n ctx.moveTo(segs[i++], segs[i++]);\r\n for (var k = 1; k < count; k++) {\r\n ctx.lineTo(segs[i++], segs[i++]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n ctx.moveTo(x0, y0);\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n ctx.quadraticCurveTo(x2, y2, x1, y1);\r\n }\r\n else {\r\n ctx.lineTo(x1, y1);\r\n }\r\n }\r\n }\r\n };\r\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n var lineWidth = this.style.lineWidth;\r\n if (shape.polyline) {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n for (var k = 1; k < count; k++) {\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n else {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n else {\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeLinesPath;\r\n}(Path));\r\nvar LargeLineDraw = (function () {\r\n function LargeLineDraw() {\r\n this.group = new Group();\r\n }\r\n LargeLineDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeLineDraw.prototype.updateData = function (data) {\r\n this.group.removeAll();\r\n var lineEl = new LargeLinesPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data);\r\n this.group.add(lineEl);\r\n this._incremental = null;\r\n };\r\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 5e5) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\r\n var lineEl = new LargeLinesPath();\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data, !!this._incremental);\r\n if (!this._incremental) {\r\n lineEl.rectHover = true;\r\n lineEl.cursor = 'default';\r\n lineEl.__startIndex = taskParams.start;\r\n this.group.add(lineEl);\r\n }\r\n else {\r\n this._incremental.addDisplayable(lineEl, true);\r\n }\r\n };\r\n LargeLineDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\r\n var hostModel = data.hostModel;\r\n lineEl.setShape({\r\n polyline: hostModel.get('polyline'),\r\n curveness: hostModel.get(['lineStyle', 'curveness'])\r\n });\r\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\r\n lineEl.style.strokeNoScale = true;\r\n var style = data.getVisual('style');\r\n if (style && style.stroke) {\r\n lineEl.setStyle('stroke', style.stroke);\r\n }\r\n lineEl.setStyle('fill', null);\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(lineEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n lineEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex > 0) {\r\n ecData_1.dataIndex = dataIndex + lineEl.__startIndex;\r\n }\r\n });\r\n }\r\n };\r\n LargeLineDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeLineDraw;\r\n}());\n\nvar linesLayout = {\r\n seriesType: 'lines',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var isPolyline = seriesModel.get('polyline');\r\n var isLarge = seriesModel.pipelineContext.large;\r\n return {\r\n progress: function (params, lineData) {\r\n var lineCoords = [];\r\n if (isLarge) {\r\n var points = void 0;\r\n var segCount = params.end - params.start;\r\n if (isPolyline) {\r\n var totalCoordsCount = 0;\r\n for (var i = params.start; i < params.end; i++) {\r\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\r\n }\r\n points = new Float32Array(segCount + totalCoordsCount * 2);\r\n }\r\n else {\r\n points = new Float32Array(segCount * 4);\r\n }\r\n var offset = 0;\r\n var pt = [];\r\n for (var i = params.start; i < params.end; i++) {\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n if (isPolyline) {\r\n points[offset++] = len;\r\n }\r\n for (var k = 0; k < len; k++) {\r\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\r\n points[offset++] = pt[0];\r\n points[offset++] = pt[1];\r\n }\r\n }\r\n lineData.setLayout('linesPoints', points);\r\n }\r\n else {\r\n for (var i = params.start; i < params.end; i++) {\r\n var itemModel = lineData.getItemModel(i);\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n var pts = [];\r\n if (isPolyline) {\r\n for (var j = 0; j < len; j++) {\r\n pts.push(coordSys.dataToPoint(lineCoords[j]));\r\n }\r\n }\r\n else {\r\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\r\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\r\n var curveness = itemModel.get(['lineStyle', 'curveness']);\r\n if (+curveness) {\r\n pts[2] = [\r\n (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness,\r\n (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness\r\n ];\r\n }\r\n }\r\n lineData.setItemLayout(i, pts);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n};\n\nvar LinesView = (function (_super) {\r\n __extends(LinesView, _super);\r\n function LinesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesView.type;\r\n return _this;\r\n }\r\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n var zlevel = seriesModel.get('zlevel');\r\n var trailLength = seriesModel.get(['effect', 'trailLength']);\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg) {\r\n zr.painter.getLayer(zlevel).clear(true);\r\n }\r\n if (this._lastZlevel != null && !isSvg) {\r\n zr.configLayer(this._lastZlevel, {\r\n motionBlur: false\r\n });\r\n }\r\n if (this._showEffect(seriesModel) && trailLength) {\r\n if (__DEV__) {\r\n var notInIndividual_1 = false;\r\n ecModel.eachSeries(function (otherSeriesModel) {\r\n if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {\r\n notInIndividual_1 = true;\r\n }\r\n });\r\n notInIndividual_1 && console.warn('Lines with trail effect should have an individual zlevel');\r\n }\r\n if (!isSvg) {\r\n zr.configLayer(zlevel, {\r\n motionBlur: true,\r\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\r\n });\r\n }\r\n }\r\n lineDraw.updateData(data);\r\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n this._lastZlevel = zlevel;\r\n this._finished = true;\r\n };\r\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n lineDraw.incrementalPrepareUpdate(data);\r\n this._clearLayer(api);\r\n this._finished = false;\r\n };\r\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = linesLayout.reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._lineDraw.updateLayout();\r\n this._clearLayer(api);\r\n }\r\n };\r\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\r\n var lineDraw = this._lineDraw;\r\n var hasEffect = this._showEffect(seriesModel);\r\n var isPolyline = !!seriesModel.get('polyline');\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (__DEV__) {\r\n if (hasEffect && isLargeDraw) {\r\n console.warn('Large lines not support effect');\r\n }\r\n }\r\n if (!lineDraw\r\n || hasEffect !== this._hasEffet\r\n || isPolyline !== this._isPolyline\r\n || isLargeDraw !== this._isLargeDraw) {\r\n if (lineDraw) {\r\n lineDraw.remove();\r\n }\r\n lineDraw = this._lineDraw = isLargeDraw\r\n ? new LargeLineDraw()\r\n : new LineDraw(isPolyline\r\n ? (hasEffect ? EffectPolyline : Polyline$1)\r\n : (hasEffect ? EffectLine : Line$1));\r\n this._hasEffet = hasEffect;\r\n this._isPolyline = isPolyline;\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(lineDraw.group);\r\n return lineDraw;\r\n };\r\n LinesView.prototype._showEffect = function (seriesModel) {\r\n return !!seriesModel.get(['effect', 'show']);\r\n };\r\n LinesView.prototype._clearLayer = function (api) {\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg && this._lastZlevel != null) {\r\n zr.painter.getLayer(this._lastZlevel).clear(true);\r\n }\r\n };\r\n LinesView.prototype.remove = function (ecModel, api) {\r\n this._lineDraw && this._lineDraw.remove();\r\n this._lineDraw = null;\r\n this._clearLayer(api);\r\n };\r\n LinesView.type = 'lines';\r\n return LinesView;\r\n}(ChartView));\r\nChartView.registerClass(LinesView);\n\nfunction normalize$3(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\nvar linesVisual = {\r\n seriesType: 'lines',\r\n reset: function (seriesModel) {\r\n var symbolType = normalize$3(seriesModel.get('symbol'));\r\n var symbolSize = normalize$3(seriesModel.get('symbolSize'));\r\n var data = seriesModel.getData();\r\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n data.setVisual('toSymbol', symbolType && symbolType[1]);\r\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = normalize$3(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true));\r\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\r\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\r\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\r\n }\r\n return {\r\n dataEach: data.hasItemOption ? dataEach : null\r\n };\r\n }\r\n};\n\nregisterLayout(linesLayout);\r\nregisterVisual(linesVisual);\n\nvar HeatmapSeriesModel = (function (_super) {\r\n __extends(HeatmapSeriesModel, _super);\r\n function HeatmapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapSeriesModel.type;\r\n return _this;\r\n }\r\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n generateCoord: 'value'\r\n });\r\n };\r\n HeatmapSeriesModel.prototype.preventIncremental = function () {\r\n var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem'));\r\n if (coordSysCreator && coordSysCreator.dimensions) {\r\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\r\n }\r\n };\r\n HeatmapSeriesModel.type = 'series.heatmap';\r\n HeatmapSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n geoIndex: 0,\r\n blurSize: 30,\r\n pointSize: 20,\r\n maxOpacity: 1,\r\n minOpacity: 0,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return HeatmapSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(HeatmapSeriesModel);\n\nvar GRADIENT_LEVELS = 256;\r\nvar HeatmapLayer = (function () {\r\n function HeatmapLayer() {\r\n this.blurSize = 30;\r\n this.pointSize = 20;\r\n this.maxOpacity = 1;\r\n this.minOpacity = 0;\r\n this._gradientPixels = {\r\n inRange: null,\r\n outOfRange: null\r\n };\r\n var canvas = createCanvas();\r\n this.canvas = canvas;\r\n }\r\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\r\n var brush = this._getBrush();\r\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\r\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\r\n var r = this.pointSize + this.blurSize;\r\n var canvas = this.canvas;\r\n var ctx = canvas.getContext('2d');\r\n var len = data.length;\r\n canvas.width = width;\r\n canvas.height = height;\r\n for (var i = 0; i < len; ++i) {\r\n var p = data[i];\r\n var x = p[0];\r\n var y = p[1];\r\n var value = p[2];\r\n var alpha = normalize(value);\r\n ctx.globalAlpha = alpha;\r\n ctx.drawImage(brush, x - r, y - r);\r\n }\r\n if (!canvas.width || !canvas.height) {\r\n return canvas;\r\n }\r\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n var pixels = imageData.data;\r\n var offset = 0;\r\n var pixelLen = pixels.length;\r\n var minOpacity = this.minOpacity;\r\n var maxOpacity = this.maxOpacity;\r\n var diffOpacity = maxOpacity - minOpacity;\r\n while (offset < pixelLen) {\r\n var alpha = pixels[offset + 3] / 256;\r\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\r\n if (alpha > 0) {\r\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\r\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\r\n pixels[offset++] = gradient[gradientOffset];\r\n pixels[offset++] = gradient[gradientOffset + 1];\r\n pixels[offset++] = gradient[gradientOffset + 2];\r\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\r\n }\r\n else {\r\n offset += 4;\r\n }\r\n }\r\n ctx.putImageData(imageData, 0, 0);\r\n return canvas;\r\n };\r\n HeatmapLayer.prototype._getBrush = function () {\r\n var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas());\r\n var r = this.pointSize + this.blurSize;\r\n var d = r * 2;\r\n brushCanvas.width = d;\r\n brushCanvas.height = d;\r\n var ctx = brushCanvas.getContext('2d');\r\n ctx.clearRect(0, 0, d, d);\r\n ctx.shadowOffsetX = d;\r\n ctx.shadowBlur = this.blurSize;\r\n ctx.shadowColor = '#000';\r\n ctx.beginPath();\r\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n return brushCanvas;\r\n };\r\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\r\n var gradientPixels = this._gradientPixels;\r\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\r\n var color = [0, 0, 0, 0];\r\n var off = 0;\r\n for (var i = 0; i < 256; i++) {\r\n colorFunc[state](i / 255, true, color);\r\n pixelsSingleState[off++] = color[0];\r\n pixelsSingleState[off++] = color[1];\r\n pixelsSingleState[off++] = color[2];\r\n pixelsSingleState[off++] = color[3];\r\n }\r\n return pixelsSingleState;\r\n };\r\n return HeatmapLayer;\r\n}());\n\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n pieceList = map(pieceList, function (piece) {\r\n return {\r\n interval: [\r\n (piece.interval[0] - dataExtent[0]) / dataSpan,\r\n (piece.interval[1] - dataExtent[0]) / dataSpan\r\n ]\r\n };\r\n });\r\n var len = pieceList.length;\r\n var lastIndex = 0;\r\n return function (val) {\r\n var i;\r\n for (i = lastIndex; i < len; i++) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n if (i === len) {\r\n for (i = lastIndex - 1; i >= 0; i--) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return i >= 0 && i < len && selected[i];\r\n };\r\n}\r\nfunction getIsInContinuousRange(dataExtent, range) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n range = [\r\n (range[0] - dataExtent[0]) / dataSpan,\r\n (range[1] - dataExtent[0]) / dataSpan\r\n ];\r\n return function (val) {\r\n return val >= range[0] && val <= range[1];\r\n };\r\n}\r\nfunction isGeoCoordSys(coordSys) {\r\n var dimensions = coordSys.dimensions;\r\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\r\n}\r\nvar HeatmapView = (function (_super) {\r\n __extends(HeatmapView, _super);\r\n function HeatmapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapView.type;\r\n return _this;\r\n }\r\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\r\n var visualMapOfThisSeries;\r\n ecModel.eachComponent('visualMap', function (visualMap) {\r\n visualMap.eachTargetSeries(function (targetSeries) {\r\n if (targetSeries === seriesModel) {\r\n visualMapOfThisSeries = visualMap;\r\n }\r\n });\r\n });\r\n if (__DEV__) {\r\n if (!visualMapOfThisSeries) {\r\n throw new Error('Heatmap must use with visualMap');\r\n }\r\n }\r\n this.group.removeAll();\r\n this._incrementalDisplayable = null;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\r\n }\r\n else if (isGeoCoordSys(coordSys)) {\r\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\r\n }\r\n };\r\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var width;\r\n var height;\r\n var xAxisExtent;\r\n var yAxisExtent;\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n if (__DEV__) {\r\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\r\n throw new Error('Heatmap on cartesian must have two category axes');\r\n }\r\n if (!(xAxis.onBand && yAxis.onBand)) {\r\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\r\n }\r\n }\r\n width = xAxis.getBandWidth();\r\n height = yAxis.getBandWidth();\r\n xAxisExtent = xAxis.scale.getExtent();\r\n yAxisExtent = yAxis.scale.getExtent();\r\n }\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\r\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var labelStatesModels = getLabelStatesModels(seriesModel);\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n var dataDims = isCoordinateSystemType(coordSys, 'cartesian2d')\r\n ? [\r\n data.mapDimension('x'),\r\n data.mapDimension('y'),\r\n data.mapDimension('value')\r\n ]\r\n : [\r\n data.mapDimension('time'),\r\n data.mapDimension('value')\r\n ];\r\n for (var idx = start; idx < end; idx++) {\r\n var rect = void 0;\r\n var style = data.getItemVisual(idx, 'style');\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var dataDimX = data.get(dataDims[0], idx);\r\n var dataDimY = data.get(dataDims[1], idx);\r\n if (isNaN(data.get(dataDims[2], idx))\r\n || dataDimX < xAxisExtent[0]\r\n || dataDimX > xAxisExtent[1]\r\n || dataDimY < yAxisExtent[0]\r\n || dataDimY > yAxisExtent[1]) {\r\n continue;\r\n }\r\n var point = coordSys.dataToPoint([\r\n dataDimX,\r\n dataDimY\r\n ]);\r\n rect = new Rect({\r\n shape: {\r\n x: Math.floor(Math.round(point[0]) - width / 2),\r\n y: Math.floor(Math.round(point[1]) - height / 2),\r\n width: Math.ceil(width),\r\n height: Math.ceil(height)\r\n },\r\n style: style\r\n });\r\n }\r\n else {\r\n if (isNaN(data.get(dataDims[1], idx))) {\r\n continue;\r\n }\r\n rect = new Rect({\r\n z2: 1,\r\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\r\n style: style\r\n });\r\n }\r\n var itemModel = data.getItemModel(idx);\r\n if (data.hasItemOption) {\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var defaultText = '-';\r\n if (rawValue && rawValue[2] != null) {\r\n defaultText = rawValue[2] + '';\r\n }\r\n setLabelStyle(rect, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: defaultText\r\n });\r\n rect.ensureState('emphasis').style = emphasisStyle;\r\n rect.ensureState('blur').style = blurStyle;\r\n rect.ensureState('select').style = selectStyle;\r\n enableHoverEmphasis(rect, focus, blurScope);\r\n rect.incremental = incremental;\r\n if (incremental) {\r\n rect.states.emphasis.hoverLayer = true;\r\n }\r\n group.add(rect);\r\n data.setItemGraphicEl(idx, rect);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\r\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\r\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\r\n var data = seriesModel.getData();\r\n var hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());\r\n hmLayer.blurSize = seriesModel.get('blurSize');\r\n hmLayer.pointSize = seriesModel.get('pointSize');\r\n hmLayer.minOpacity = seriesModel.get('minOpacity');\r\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\r\n var rect = geo.getViewRect().clone();\r\n var roamTransform = geo.getRoamTransform();\r\n rect.applyTransform(roamTransform);\r\n var x = Math.max(rect.x, 0);\r\n var y = Math.max(rect.y, 0);\r\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\r\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var dims = [\r\n data.mapDimension('lng'),\r\n data.mapDimension('lat'),\r\n data.mapDimension('value')\r\n ];\r\n var points = data.mapArray(dims, function (lng, lat, value) {\r\n var pt = geo.dataToPoint([lng, lat]);\r\n pt[0] -= x;\r\n pt[1] -= y;\r\n pt.push(value);\r\n return pt;\r\n });\r\n var dataExtent = visualMapModel.getExtent();\r\n var isInRange = visualMapModel.type === 'visualMap.continuous'\r\n ? getIsInContinuousRange(dataExtent, visualMapModel.option.range)\r\n : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\r\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\r\n inRange: inRangeVisuals.color.getColorMapper(),\r\n outOfRange: outOfRangeVisuals.color.getColorMapper()\r\n }, isInRange);\r\n var img = new ZRImage({\r\n style: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y,\r\n image: hmLayer.canvas\r\n },\r\n silent: true\r\n });\r\n this.group.add(img);\r\n };\r\n HeatmapView.type = 'heatmap';\r\n return HeatmapView;\r\n}(ChartView));\r\nChartView.registerClass(HeatmapView);\n\nvar PictorialBarSeriesModel = (function (_super) {\r\n __extends(PictorialBarSeriesModel, _super);\r\n function PictorialBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.defaultSymbol = 'roundRect';\r\n return _this;\r\n }\r\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\r\n option.stack = null;\r\n return _super.prototype.getInitialData.apply(this, arguments);\r\n };\r\n PictorialBarSeriesModel.type = 'series.pictorialBar';\r\n PictorialBarSeriesModel.dependencies = ['grid'];\r\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n symbol: 'circle',\r\n symbolSize: null,\r\n symbolRotate: null,\r\n symbolPosition: null,\r\n symbolOffset: null,\r\n symbolMargin: null,\r\n symbolRepeat: false,\r\n symbolRepeatDirection: 'end',\r\n symbolClip: false,\r\n symbolBoundingData: null,\r\n symbolPatternSize: 400,\r\n barGap: '-100%',\r\n progressive: 0,\r\n emphasis: {\r\n scale: false\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n });\r\n return PictorialBarSeriesModel;\r\n}(BaseBarSeriesModel));\r\nSeriesModel.registerClass(PictorialBarSeriesModel);\n\nvar BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth'];\r\nvar LAYOUT_ATTRS = [\r\n { xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right'] },\r\n { xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom'] }\r\n];\r\nvar pathForLineWidth = new Circle();\r\nvar PictorialBarView = (function (_super) {\r\n __extends(PictorialBarView, _super);\r\n function PictorialBarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarView.type;\r\n return _this;\r\n }\r\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var coordSysRect = cartesian.master.getRect();\r\n var opt = {\r\n ecSize: { width: api.getWidth(), height: api.getHeight() },\r\n seriesModel: seriesModel,\r\n coordSys: cartesian,\r\n coordSysExtent: [\r\n [coordSysRect.x, coordSysRect.x + coordSysRect.width],\r\n [coordSysRect.y, coordSysRect.y + coordSysRect.height]\r\n ],\r\n isHorizontal: isHorizontal,\r\n valueDim: LAYOUT_ATTRS[+isHorizontal],\r\n categoryDim: LAYOUT_ATTRS[1 - (+isHorizontal)]\r\n };\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var itemModel = getItemModel(data, dataIndex);\r\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\r\n var bar = createBar(data, opt, symbolMeta);\r\n data.setItemGraphicEl(dataIndex, bar);\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var bar = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(bar);\r\n return;\r\n }\r\n var itemModel = getItemModel(data, newIndex);\r\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\r\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\r\n group.remove(bar);\r\n data.setItemGraphicEl(newIndex, null);\r\n bar = null;\r\n }\r\n if (bar) {\r\n updateBar(bar, opt, symbolMeta);\r\n }\r\n else {\r\n bar = createBar(data, opt, symbolMeta, true);\r\n }\r\n data.setItemGraphicEl(newIndex, bar);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .remove(function (dataIndex) {\r\n var bar = oldData.getItemGraphicEl(dataIndex);\r\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\r\n })\r\n .execute();\r\n this._data = data;\r\n return this.group;\r\n };\r\n PictorialBarView.prototype.remove = function (ecModel, api) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (ecModel.get('animation')) {\r\n if (data) {\r\n data.eachItemGraphicEl(function (bar) {\r\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\r\n });\r\n }\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n PictorialBarView.type = 'pictorialBar';\r\n return PictorialBarView;\r\n}(ChartView));\r\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var symbolRepeat = itemModel.get('symbolRepeat');\r\n var symbolClip = itemModel.get('symbolClip');\r\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\r\n var symbolRotate = itemModel.get('symbolRotate');\r\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\r\n var isAnimationEnabled = itemModel.isAnimationEnabled();\r\n var symbolMeta = {\r\n dataIndex: dataIndex,\r\n layout: layout,\r\n itemModel: itemModel,\r\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\r\n style: data.getItemVisual(dataIndex, 'style'),\r\n symbolClip: symbolClip,\r\n symbolRepeat: symbolRepeat,\r\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\r\n symbolPatternSize: symbolPatternSize,\r\n rotation: rotation,\r\n animationModel: isAnimationEnabled ? itemModel : null,\r\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\r\n z2: itemModel.getShallow('z', true) || 0\r\n };\r\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\r\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\r\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\r\n var symbolSize = symbolMeta.symbolSize;\r\n var symbolOffset = itemModel.get('symbolOffset');\r\n if (isArray(symbolOffset)) {\r\n symbolOffset = [\r\n parsePercent$2(symbolOffset[0], symbolSize[0]),\r\n parsePercent$2(symbolOffset[1], symbolSize[1])\r\n ];\r\n }\r\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\r\n return symbolMeta;\r\n}\r\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var symbolBoundingData = itemModel.get('symbolBoundingData');\r\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\r\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\r\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\r\n var boundingLength;\r\n if (isArray(symbolBoundingData)) {\r\n var symbolBoundingExtent = [\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\r\n ];\r\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\r\n boundingLength = symbolBoundingExtent[pxSignIdx];\r\n }\r\n else if (symbolBoundingData != null) {\r\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\r\n }\r\n else if (symbolRepeat) {\r\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\r\n }\r\n else {\r\n boundingLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.boundingLength = boundingLength;\r\n if (symbolRepeat) {\r\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\r\n}\r\nfunction convertToCoordOnAxis(axis, value) {\r\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\r\n}\r\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var categoryDim = opt.categoryDim;\r\n var categorySize = Math.abs(layout[categoryDim.wh]);\r\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\r\n var parsedSymbolSize;\r\n if (isArray(symbolSize)) {\r\n parsedSymbolSize = symbolSize.slice();\r\n }\r\n else {\r\n if (symbolSize == null) {\r\n parsedSymbolSize = ['100%', '100%'];\r\n }\r\n else {\r\n parsedSymbolSize = [symbolSize, symbolSize];\r\n }\r\n }\r\n parsedSymbolSize[categoryDim.index] = parsePercent$2(parsedSymbolSize[categoryDim.index], categorySize);\r\n parsedSymbolSize[valueDim.index] = parsePercent$2(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\r\n outputSymbolMeta.symbolSize = parsedSymbolSize;\r\n var symbolScale = outputSymbolMeta.symbolScale = [\r\n parsedSymbolSize[0] / symbolPatternSize,\r\n parsedSymbolSize[1] / symbolPatternSize\r\n ];\r\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\r\n}\r\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\r\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0;\r\n if (valueLineWidth) {\r\n pathForLineWidth.attr({\r\n scaleX: symbolScale[0],\r\n scaleY: symbolScale[1],\r\n rotation: rotation\r\n });\r\n pathForLineWidth.updateTransform();\r\n valueLineWidth /= pathForLineWidth.getLineScale();\r\n valueLineWidth *= symbolScale[opt.valueDim.index];\r\n }\r\n outputSymbolMeta.valueLineWidth = valueLineWidth;\r\n}\r\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\r\n var categoryDim = opt.categoryDim;\r\n var valueDim = opt.valueDim;\r\n var pxSign = outputSymbolMeta.pxSign;\r\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\r\n var pathLen = unitLength;\r\n if (symbolRepeat) {\r\n var absBoundingLength = Math.abs(boundingLength);\r\n var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + '';\r\n var hasEndGap = false;\r\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\r\n hasEndGap = true;\r\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\r\n }\r\n var symbolMarginNumeric = parsePercent$2(symbolMargin, symbolSize[valueDim.index]);\r\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\r\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n var repeatSpecified = isNumeric(symbolRepeat);\r\n var repeatTimes = repeatSpecified\r\n ? symbolRepeat\r\n : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\r\n var mDiff = absBoundingLength - repeatTimes * unitLength;\r\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\r\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\r\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\r\n repeatTimes = repeatCutLength\r\n ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin)\r\n : 0;\r\n }\r\n pathLen = repeatTimes * uLenWithMargin - endFix;\r\n outputSymbolMeta.repeatTimes = repeatTimes;\r\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\r\n }\r\n var sizeFix = pxSign * (pathLen / 2);\r\n var pathPosition = outputSymbolMeta.pathPosition = [];\r\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\r\n pathPosition[valueDim.index] = symbolPosition === 'start'\r\n ? sizeFix\r\n : symbolPosition === 'end'\r\n ? boundingLength - sizeFix\r\n : boundingLength / 2;\r\n if (symbolOffset) {\r\n pathPosition[0] += symbolOffset[0];\r\n pathPosition[1] += symbolOffset[1];\r\n }\r\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\r\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\r\n bundlePosition[valueDim.index] = layout[valueDim.xy];\r\n var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout);\r\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\r\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\r\n var clipShape = outputSymbolMeta.clipShape = {};\r\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\r\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\r\n clipShape[valueDim.xy] = 0;\r\n clipShape[valueDim.wh] = layout[valueDim.wh];\r\n}\r\nfunction createPath(symbolMeta) {\r\n var symbolPatternSize = symbolMeta.symbolPatternSize;\r\n var path = createSymbol(symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\r\n path.attr({\r\n culling: true\r\n });\r\n path.type !== 'image' && path.setStyle({\r\n strokeNoScale: true\r\n });\r\n return path;\r\n}\r\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var symbolSize = symbolMeta.symbolSize;\r\n var valueLineWidth = symbolMeta.valueLineWidth;\r\n var pathPosition = symbolMeta.pathPosition;\r\n var valueDim = opt.valueDim;\r\n var repeatTimes = symbolMeta.repeatTimes || 0;\r\n var index = 0;\r\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\r\n eachPath(bar, function (path) {\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n if (index < repeatTimes) {\r\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(path, null, { scaleX: 0, scaleY: 0 }, symbolMeta, isUpdate, function () {\r\n bundle.remove(path);\r\n });\r\n }\r\n index++;\r\n });\r\n for (; index < repeatTimes; index++) {\r\n var path = createPath(symbolMeta);\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n bundle.add(path);\r\n var target = makeTarget(index);\r\n updateAttr(path, {\r\n x: target.x,\r\n y: target.y,\r\n scaleX: 0,\r\n scaleY: 0\r\n }, {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n rotation: target.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n function makeTarget(index) {\r\n var position = pathPosition.slice();\r\n var pxSign = symbolMeta.pxSign;\r\n var i = index;\r\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\r\n i = repeatTimes - 1 - index;\r\n }\r\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n };\r\n }\r\n}\r\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var mainPath = bar.__pictorialMainPath;\r\n if (!mainPath) {\r\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\r\n bundle.add(mainPath);\r\n updateAttr(mainPath, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: 0,\r\n scaleY: 0,\r\n rotation: symbolMeta.rotation\r\n }, {\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1]\r\n }, symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(mainPath, null, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n}\r\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\r\n var rectShape = extend({}, symbolMeta.barRectShape);\r\n var barRect = bar.__pictorialBarRect;\r\n if (!barRect) {\r\n barRect = bar.__pictorialBarRect = new Rect({\r\n z2: 2,\r\n shape: rectShape,\r\n silent: true,\r\n style: {\r\n stroke: 'transparent',\r\n fill: 'transparent',\r\n lineWidth: 0\r\n }\r\n });\r\n bar.add(barRect);\r\n }\r\n else {\r\n updateAttr(barRect, null, { shape: rectShape }, symbolMeta, isUpdate);\r\n }\r\n}\r\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\r\n if (symbolMeta.symbolClip) {\r\n var clipPath = bar.__pictorialClipPath;\r\n var clipShape = extend({}, symbolMeta.clipShape);\r\n var valueDim = opt.valueDim;\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n if (clipPath) {\r\n updateProps(clipPath, { shape: clipShape }, animationModel, dataIndex);\r\n }\r\n else {\r\n clipShape[valueDim.wh] = 0;\r\n clipPath = new Rect({ shape: clipShape });\r\n bar.__pictorialBundle.setClipPath(clipPath);\r\n bar.__pictorialClipPath = clipPath;\r\n var target = {};\r\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\r\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { shape: target }, animationModel, dataIndex);\r\n }\r\n }\r\n}\r\nfunction getItemModel(data, dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\r\n itemModel.isAnimationEnabled = isAnimationEnabled;\r\n return itemModel;\r\n}\r\nfunction getAnimationDelayParams(path) {\r\n return {\r\n index: path.__pictorialAnimationIndex,\r\n count: path.__pictorialRepeatTimes\r\n };\r\n}\r\nfunction isAnimationEnabled() {\r\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\r\n}\r\nfunction createBar(data, opt, symbolMeta, isUpdate) {\r\n var bar = new Group();\r\n var bundle = new Group();\r\n bar.add(bundle);\r\n bar.__pictorialBundle = bundle;\r\n bundle.x = symbolMeta.bundlePosition[0];\r\n bundle.y = symbolMeta.bundlePosition[1];\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\r\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\r\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n return bar;\r\n}\r\nfunction updateBar(bar, opt, symbolMeta) {\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n var bundle = bar.__pictorialBundle;\r\n updateProps(bundle, {\r\n x: symbolMeta.bundlePosition[0],\r\n y: symbolMeta.bundlePosition[1]\r\n }, animationModel, dataIndex);\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, true);\r\n createOrUpdateClip(bar, opt, symbolMeta, true);\r\n}\r\nfunction removeBar(data, dataIndex, animationModel, bar) {\r\n var labelRect = bar.__pictorialBarRect;\r\n labelRect && (labelRect.removeTextContent());\r\n var pathes = [];\r\n eachPath(bar, function (path) {\r\n pathes.push(path);\r\n });\r\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath);\r\n bar.__pictorialClipPath && (animationModel = null);\r\n each(pathes, function (path) {\r\n removeElement(path, { scaleX: 0, scaleY: 0 }, animationModel, dataIndex, function () {\r\n bar.parent && bar.parent.remove(bar);\r\n });\r\n });\r\n data.setItemGraphicEl(dataIndex, null);\r\n}\r\nfunction getShapeStr(data, symbolMeta) {\r\n return [\r\n data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none',\r\n !!symbolMeta.symbolRepeat,\r\n !!symbolMeta.symbolClip\r\n ].join(':');\r\n}\r\nfunction eachPath(bar, cb, context) {\r\n each(bar.__pictorialBundle.children(), function (el) {\r\n el !== bar.__pictorialBarRect && cb.call(context, el);\r\n });\r\n}\r\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\r\n immediateAttrs && el.attr(immediateAttrs);\r\n if (symbolMeta.symbolClip && !isUpdate) {\r\n animationAttrs && el.attr(animationAttrs);\r\n }\r\n else {\r\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\r\n }\r\n}\r\nfunction updateCommon$1(bar, opt, symbolMeta) {\r\n var dataIndex = symbolMeta.dataIndex;\r\n var itemModel = symbolMeta.itemModel;\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n var focus = emphasisModel.get('focus');\r\n var blurScope = emphasisModel.get('blurScope');\r\n var hoverScale = emphasisModel.get('scale');\r\n eachPath(bar, function (path) {\r\n if (path instanceof ZRImage) {\r\n var pathStyle = path.style;\r\n path.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolMeta.style));\r\n }\r\n else {\r\n path.useStyle(symbolMeta.style);\r\n }\r\n var emphasisState = path.ensureState('emphasis');\r\n emphasisState.style = emphasisStyle;\r\n if (hoverScale) {\r\n emphasisState.scaleX = path.scaleX * 1.1;\r\n emphasisState.scaleY = path.scaleY * 1.1;\r\n }\r\n path.ensureState('blur').style = blurStyle;\r\n path.ensureState('select').style = selectStyle;\r\n cursorStyle && (path.cursor = cursorStyle);\r\n path.z2 = symbolMeta.z2;\r\n });\r\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\r\n var barRect = bar.__pictorialBarRect;\r\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\r\n labelFetcher: opt.seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\r\n inheritColor: symbolMeta.style.fill,\r\n defaultOpacity: symbolMeta.style.opacity,\r\n defaultOutsidePosition: barPositionOutside\r\n });\r\n enableHoverEmphasis(bar, focus, blurScope);\r\n}\r\nfunction toIntTimes(times) {\r\n var roundedTimes = Math.round(times);\r\n return Math.abs(times - roundedTimes) < 1e-4\r\n ? roundedTimes\r\n : Math.ceil(times);\r\n}\r\nChartView.registerClass(PictorialBarView);\n\nregisterLayout(curry(layout, 'pictorialBar'));\n\nvar SingleAxis = (function (_super) {\r\n __extends(SingleAxis, _super);\r\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n SingleAxis.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n SingleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.coordinateSystem.pointToData(point)[0];\r\n };\r\n return SingleAxis;\r\n}(Axis));\n\nvar Single = (function () {\r\n function Single(axisModel, ecModel, api) {\r\n this.type = 'single';\r\n this.dimension = 'single';\r\n this.dimensions = ['single'];\r\n this.axisPointerEnabled = true;\r\n this.model = axisModel;\r\n this._init(axisModel, ecModel, api);\r\n }\r\n Single.prototype._init = function (axisModel, ecModel, api) {\r\n var dim = this.dimension;\r\n var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axis.orient = axisModel.get('orient');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = this;\r\n this._axis = axis;\r\n };\r\n Single.prototype.update = function (ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === this) {\r\n var data_1 = seriesModel.getData();\r\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\r\n this._axis.scale.unionExtentFromData(data_1, dim);\r\n }, this);\r\n niceScaleExtent(this._axis.scale, this._axis.model);\r\n }\r\n }, this);\r\n };\r\n Single.prototype.resize = function (axisModel, api) {\r\n this._rect = getLayoutRect({\r\n left: axisModel.get('left'),\r\n top: axisModel.get('top'),\r\n right: axisModel.get('right'),\r\n bottom: axisModel.get('bottom'),\r\n width: axisModel.get('width'),\r\n height: axisModel.get('height')\r\n }, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._adjustAxis();\r\n };\r\n Single.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Single.prototype._adjustAxis = function () {\r\n var rect = this._rect;\r\n var axis = this._axis;\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\r\n var idx = axis.reverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\r\n };\r\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var extentSum = axisExtent[0] + axisExtent[1];\r\n var isHorizontal = axis.isHorizontal();\r\n axis.toGlobalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n };\r\n Single.prototype.getAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getBaseAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getAxes = function () {\r\n return [this._axis];\r\n };\r\n Single.prototype.getTooltipAxes = function () {\r\n return {\r\n baseAxes: [this.getAxis()],\r\n otherAxes: []\r\n };\r\n };\r\n Single.prototype.containPoint = function (point) {\r\n var rect = this.getRect();\r\n var axis = this.getAxis();\r\n var orient = axis.orient;\r\n if (orient === 'horizontal') {\r\n return axis.contain(axis.toLocalCoord(point[0]))\r\n && (point[1] >= rect.y && point[1] <= (rect.y + rect.height));\r\n }\r\n else {\r\n return axis.contain(axis.toLocalCoord(point[1]))\r\n && (point[0] >= rect.y && point[0] <= (rect.y + rect.height));\r\n }\r\n };\r\n Single.prototype.pointToData = function (point) {\r\n var axis = this.getAxis();\r\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\r\n };\r\n Single.prototype.dataToPoint = function (val) {\r\n var axis = this.getAxis();\r\n var rect = this.getRect();\r\n var pt = [];\r\n var idx = axis.orient === 'horizontal' ? 0 : 1;\r\n if (val instanceof Array) {\r\n val = val[0];\r\n }\r\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\r\n pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2);\r\n return pt;\r\n };\r\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Single;\r\n}());\r\nfunction getCoordSys$2(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var singleModel = finder.singleAxisModel;\r\n return singleModel && singleModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n}\n\nfunction create$3(ecModel, api) {\r\n var singles = [];\r\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\r\n var single = new Single(axisModel, ecModel, api);\r\n single.name = 'single_' + idx;\r\n single.resize(axisModel, api);\r\n axisModel.coordinateSystem = single;\r\n singles.push(single);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\r\n }\r\n });\r\n return singles;\r\n}\r\nCoordinateSystemManager.register('single', {\r\n create: create$3,\r\n dimensions: Single.prototype.dimensions\r\n});\n\nfunction layout$2(axisModel, opt) {\r\n opt = opt || {};\r\n var single = axisModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var axisPosition = axis.position;\r\n var orient = axis.orient;\r\n var rect = single.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var positionMap = {\r\n horizontal: { top: rectBound[2], bottom: rectBound[3] },\r\n vertical: { left: rectBound[0], right: rectBound[1] }\r\n };\r\n layout.position = [\r\n orient === 'vertical'\r\n ? positionMap.vertical[axisPosition]\r\n : rectBound[0],\r\n orient === 'horizontal'\r\n ? positionMap.horizontal[axisPosition]\r\n : rectBound[3]\r\n ];\r\n var r = { horizontal: 0, vertical: 1 };\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n var directionMap = { top: -1, bottom: 1, right: 1, left: -1 };\r\n layout.labelDirection = layout.tickDirection =\r\n layout.nameDirection = directionMap[axisPosition];\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n layout.z2 = 1;\r\n return layout;\r\n}\n\nvar axisBuilderAttrs$2 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs$1 = ['splitArea', 'splitLine'];\r\nvar SingleAxisView = (function (_super) {\r\n __extends(SingleAxisView, _super);\r\n function SingleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisView.type;\r\n _this.axisPointerClass = 'SingleAxisPointer';\r\n return _this;\r\n }\r\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n var layout = layout$2(axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, layout);\r\n each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder);\r\n group.add(this._axisGroup);\r\n group.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs$1, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders$1[name](this, this.group, this._axisGroup, axisModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n SingleAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n SingleAxisView.type = 'singleAxis';\r\n return SingleAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders$1 = {\r\n splitLine: function (axisView, group, axisGroup, axisModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var gridRect = axisModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var splitLines = [];\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n for (var i = 0; i < ticksCoords.length; ++i) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n silent: true\r\n }));\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle(['color']);\r\n for (var i = 0; i < splitLines.length; ++i) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n splitArea: function (axisView, group, axisGroup, axisModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\r\n }\r\n};\r\nComponentView.registerClass(SingleAxisView);\n\nvar SingleAxisModel = (function (_super) {\r\n __extends(SingleAxisModel, _super);\r\n function SingleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisModel.type;\r\n return _this;\r\n }\r\n SingleAxisModel.prototype.getCoordSysModel = function () {\r\n return this;\r\n };\r\n SingleAxisModel.type = 'singleAxis';\r\n SingleAxisModel.layoutMode = 'box';\r\n SingleAxisModel.defaultOption = {\r\n left: '5%',\r\n top: '5%',\r\n right: '5%',\r\n bottom: '5%',\r\n type: 'value',\r\n position: 'bottom',\r\n orient: 'horizontal',\r\n axisLine: {\r\n show: true,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n tooltip: {\r\n show: true\r\n },\r\n axisTick: {\r\n show: true,\r\n length: 6,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n interval: 'auto'\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n type: 'dashed',\r\n opacity: 0.2\r\n }\r\n }\r\n };\r\n return SingleAxisModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(SingleAxisModel);\r\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\r\naxisModelCreator('single', SingleAxisModel, SingleAxisModel.defaultOption);\n\nfunction findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n}\n\nvar inner$b = makeInner();\r\nfunction axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n}\r\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n}\r\nfunction buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n}\r\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n}\r\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n}\r\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n}\r\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n}\r\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$b(zr)[highDownKey] || {};\r\n var newHighlights = inner$b(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n}\r\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n}\r\nfunction makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n}\r\nfunction illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n}\n\nvar inner$c = makeInner();\r\nvar each$8 = each;\r\nfunction register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$c(zr).records || (inner$c(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$c(zr).records[key] || (inner$c(zr).records[key] = {});\r\n record.handler = handler;\r\n}\r\nfunction initGlobalListeners(zr, api) {\r\n if (inner$c(zr).initialized) {\r\n return;\r\n }\r\n inner$c(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$8(inner$c(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n}\r\nfunction dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n}\r\nfunction onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n}\r\nfunction doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n}\r\nfunction makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n}\r\nfunction unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$c(zr).records || {})[key];\r\n if (record) {\r\n inner$c(zr).records[key] = null;\r\n }\r\n}\n\nvar AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n}(ComponentView));\r\nComponentView.registerClass(AxisPointerView);\n\nvar inner$d = makeInner();\r\nvar clone$3 = clone;\r\nvar bind$1 = bind;\r\nvar BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$d(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$d(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$d(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$d(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$d(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n}());\r\nfunction updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$d(el).lastProp, props)) {\r\n inner$d(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n}\r\nfunction propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n}\r\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n}\r\nfunction getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n}\r\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n}\n\nfunction buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n}\r\nfunction buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n}\r\nfunction confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n}\r\nfunction getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n}\r\nfunction getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n}\r\nfunction buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n}\r\nfunction makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n}\r\nfunction makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n}\r\nfunction makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: true\r\n };\r\n}\n\nvar CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n}(BaseAxisPointer));\r\nfunction getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n}\r\nvar pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n};\r\nfunction getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n}\r\nAxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\nvar AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n}(ComponentModel));\n\nComponentModel.registerClass(AxisPointerModel);\r\nregisterPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n});\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n});\r\nregisterAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n}, axisTrigger);\n\nvar XY = ['x', 'y'];\r\nvar WH = ['width', 'height'];\r\nvar SingleAxisPointer = (function (_super) {\r\n __extends(SingleAxisPointer, _super);\r\n function SingleAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\r\n var pixelValue = coordSys.dataToPoint(value)[0];\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$2(axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$2(axisModel, { labelInside: false });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var position = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var dimIndex = getPointDimIndex(axis);\r\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: {\r\n verticalAlign: 'middle'\r\n }\r\n };\r\n };\r\n return SingleAxisPointer;\r\n}(BaseAxisPointer));\r\nvar pointerShapeBuilder$1 = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = axis.getBandWidth();\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\r\n };\r\n }\r\n};\r\nfunction getPointDimIndex(axis) {\r\n return axis.isHorizontal() ? 0 : 1;\r\n}\r\nfunction getGlobalExtent(coordSys, dimIndex) {\r\n var rect = coordSys.getRect();\r\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\r\n}\r\nAxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n\nextendComponentView({\r\n type: 'single'\r\n});\n\nvar DATA_NAME_INDEX = 2;\r\nvar ThemeRiverSeriesModel = (function (_super) {\r\n __extends(ThemeRiverSeriesModel, _super);\r\n function ThemeRiverSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n ThemeRiverSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\r\n var rawDataLength = data.length;\r\n var timeValueKeys = {};\r\n var groupResult = groupData(data, function (item) {\r\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\r\n timeValueKeys[item[0] + ''] = -1;\r\n }\r\n return item[2];\r\n });\r\n var layerData = [];\r\n groupResult.buckets.each(function (items, key) {\r\n layerData.push({\r\n name: key, dataList: items\r\n });\r\n });\r\n var layerNum = layerData.length;\r\n for (var k = 0; k < layerNum; ++k) {\r\n var name_1 = layerData[k].name;\r\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\r\n var timeValue = layerData[k].dataList[j][0] + '';\r\n timeValueKeys[timeValue] = k;\r\n }\r\n for (var timeValue in timeValueKeys) {\r\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\r\n timeValueKeys[timeValue] = k;\r\n data[rawDataLength] = [timeValue, 0, name_1];\r\n rawDataLength++;\r\n }\r\n }\r\n }\r\n return data;\r\n };\r\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n var axisType = singleAxisModel.get('type');\r\n var filterData = filter(option.data, function (dataItem) {\r\n return dataItem[2] !== undefined;\r\n });\r\n var data = this.fixData(filterData || []);\r\n var nameList = [];\r\n var nameMap = this.nameMap = createHashMap();\r\n var count = 0;\r\n for (var i = 0; i < data.length; ++i) {\r\n nameList.push(data[i][DATA_NAME_INDEX]);\r\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\r\n nameMap.set(data[i][DATA_NAME_INDEX], count);\r\n count++;\r\n }\r\n }\r\n var dimensionsInfo = createDimensions(data, {\r\n coordDimensions: ['single'],\r\n dimensionsDefine: [\r\n {\r\n name: 'time',\r\n type: getDimensionTypeByAxis(axisType)\r\n },\r\n {\r\n name: 'value',\r\n type: 'float'\r\n },\r\n {\r\n name: 'name',\r\n type: 'ordinal'\r\n }\r\n ],\r\n encodeDefine: {\r\n single: 0,\r\n value: 1,\r\n itemName: 2\r\n }\r\n });\r\n var list = new List(dimensionsInfo, this);\r\n list.initData(data);\r\n return list;\r\n };\r\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\r\n var data = this.getData();\r\n var lenCount = data.count();\r\n var indexArr = [];\r\n for (var i = 0; i < lenCount; ++i) {\r\n indexArr[i] = i;\r\n }\r\n var timeDim = data.mapDimension('single');\r\n var groupResult = groupData(indexArr, function (index) {\r\n return data.get('name', index);\r\n });\r\n var layerSeries = [];\r\n groupResult.buckets.each(function (items, key) {\r\n items.sort(function (index1, index2) {\r\n return data.get(timeDim, index1) - data.get(timeDim, index2);\r\n });\r\n layerSeries.push({\r\n name: key,\r\n indices: items\r\n });\r\n });\r\n return layerSeries;\r\n };\r\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\r\n if (!isArray(dim)) {\r\n dim = dim ? [dim] : [];\r\n }\r\n var data = this.getData();\r\n var layerSeries = this.getLayerSeries();\r\n var indices = [];\r\n var layerNum = layerSeries.length;\r\n var nestestValue;\r\n for (var i = 0; i < layerNum; ++i) {\r\n var minDist = Number.MAX_VALUE;\r\n var nearestIdx = -1;\r\n var pointNum = layerSeries[i].indices.length;\r\n for (var j = 0; j < pointNum; ++j) {\r\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\r\n var dist = Math.abs(theValue - value);\r\n if (dist <= minDist) {\r\n nestestValue = theValue;\r\n minDist = dist;\r\n nearestIdx = layerSeries[i].indices[j];\r\n }\r\n }\r\n indices.push(nearestIdx);\r\n }\r\n return { dataIndices: indices, nestestValue: nestestValue };\r\n };\r\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var name = data.getName(dataIndex);\r\n var value = data.get(data.mapDimension('value'), dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n ThemeRiverSeriesModel.type = 'series.themeRiver';\r\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\r\n ThemeRiverSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'singleAxis',\r\n boundaryGap: ['10%', '10%'],\r\n singleAxisIndex: 0,\r\n animationEasing: 'linear',\r\n label: {\r\n margin: 4,\r\n show: true,\r\n position: 'left',\r\n fontSize: 11\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return ThemeRiverSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ThemeRiverSeriesModel);\n\nvar ThemeRiverView = (function (_super) {\r\n __extends(ThemeRiverView, _super);\r\n function ThemeRiverView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverView.type;\r\n _this._layers = [];\r\n return _this;\r\n }\r\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var self = this;\r\n var group = this.group;\r\n var layersSeries = seriesModel.getLayerSeries();\r\n var layoutInfo = data.getLayout('layoutInfo');\r\n var rect = layoutInfo.rect;\r\n var boundaryGap = layoutInfo.boundaryGap;\r\n group.x = 0;\r\n group.y = rect.y + boundaryGap[0];\r\n function keyGetter(item) {\r\n return item.name;\r\n }\r\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\r\n var newLayersGroups = [];\r\n dataDiffer\r\n .add(bind(process, this, 'add'))\r\n .update(bind(process, this, 'update'))\r\n .remove(bind(process, this, 'remove'))\r\n .execute();\r\n function process(status, idx, oldIdx) {\r\n var oldLayersGroups = self._layers;\r\n if (status === 'remove') {\r\n group.remove(oldLayersGroups[idx]);\r\n return;\r\n }\r\n var points0 = [];\r\n var points1 = [];\r\n var style;\r\n var indices = layersSeries[idx].indices;\r\n var j = 0;\r\n for (; j < indices.length; j++) {\r\n var layout = data.getItemLayout(indices[j]);\r\n var x = layout.x;\r\n var y0 = layout.y0;\r\n var y = layout.y;\r\n points0.push(x, y0);\r\n points1.push(x, y0 + y);\r\n style = data.getItemVisual(indices[j], 'style');\r\n }\r\n var polygon;\r\n var textLayout = data.getItemLayout(indices[0]);\r\n var labelModel = seriesModel.getModel('label');\r\n var margin = labelModel.get('margin');\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n if (status === 'add') {\r\n var layerGroup = newLayersGroups[idx] = new Group();\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1,\r\n smooth: 0.4,\r\n stackedOnSmooth: 0.4,\r\n smoothConstraint: false\r\n },\r\n z2: 0\r\n });\r\n layerGroup.add(polygon);\r\n group.add(layerGroup);\r\n if (seriesModel.isAnimationEnabled()) {\r\n polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () {\r\n polygon.removeClipPath();\r\n }));\r\n }\r\n }\r\n else {\r\n var layerGroup = oldLayersGroups[oldIdx];\r\n polygon = layerGroup.childAt(0);\r\n group.add(layerGroup);\r\n newLayersGroups[idx] = layerGroup;\r\n updateProps(polygon, {\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1\r\n }\r\n }, seriesModel);\r\n }\r\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\r\n labelDataIndex: indices[j - 1],\r\n defaultText: data.getName(indices[j - 1]),\r\n inheritColor: style.fill\r\n }, {\r\n normal: {\r\n verticalAlign: 'middle'\r\n }\r\n });\r\n polygon.setTextConfig({\r\n position: null,\r\n local: true\r\n });\r\n var labelEl = polygon.getTextContent();\r\n if (labelEl) {\r\n labelEl.x = textLayout.x - margin;\r\n labelEl.y = textLayout.y0 + textLayout.y / 2;\r\n }\r\n polygon.useStyle(style);\r\n data.setItemGraphicEl(idx, polygon);\r\n setStatesStylesFromModel(polygon, seriesModel);\r\n enableHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n this._layersSeries = layersSeries;\r\n this._layers = newLayersGroups;\r\n };\r\n ThemeRiverView.type = 'themeRiver';\r\n return ThemeRiverView;\r\n}(ChartView));\r\nfunction createGridClipShape$2(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n x: rect.x - 50,\r\n width: rect.width + 100,\r\n height: rect.height + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nChartView.registerClass(ThemeRiverView);\n\nfunction themeRiverLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var single = seriesModel.coordinateSystem;\r\n var layoutInfo = {};\r\n var rect = single.getRect();\r\n layoutInfo.rect = rect;\r\n var boundaryGap = seriesModel.get('boundaryGap');\r\n var axis = single.getAxis();\r\n layoutInfo.boundaryGap = boundaryGap;\r\n if (axis.orient === 'horizontal') {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.height);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.height);\r\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, height);\r\n }\r\n else {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.width);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.width);\r\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, width);\r\n }\r\n data.setLayout('layoutInfo', layoutInfo);\r\n });\r\n}\r\nfunction doThemeRiverLayout(data, seriesModel, height) {\r\n if (!data.count()) {\r\n return;\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n var layerSeries = seriesModel.getLayerSeries();\r\n var timeDim = data.mapDimension('single');\r\n var valueDim = data.mapDimension('value');\r\n var layerPoints = map(layerSeries, function (singleLayer) {\r\n return map(singleLayer.indices, function (idx) {\r\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\r\n pt[1] = data.get(valueDim, idx);\r\n return pt;\r\n });\r\n });\r\n var base = computeBaseline(layerPoints);\r\n var baseLine = base.y0;\r\n var ky = height / base.max;\r\n var n = layerSeries.length;\r\n var m = layerSeries[0].indices.length;\r\n var baseY0;\r\n for (var j = 0; j < m; ++j) {\r\n baseY0 = baseLine[j] * ky;\r\n data.setItemLayout(layerSeries[0].indices[j], {\r\n layerIndex: 0,\r\n x: layerPoints[0][j][0],\r\n y0: baseY0,\r\n y: layerPoints[0][j][1] * ky\r\n });\r\n for (var i = 1; i < n; ++i) {\r\n baseY0 += layerPoints[i - 1][j][1] * ky;\r\n data.setItemLayout(layerSeries[i].indices[j], {\r\n layerIndex: i,\r\n x: layerPoints[i][j][0],\r\n y0: baseY0,\r\n y: layerPoints[i][j][1] * ky\r\n });\r\n }\r\n }\r\n}\r\nfunction computeBaseline(data) {\r\n var layerNum = data.length;\r\n var pointNum = data[0].length;\r\n var sums = [];\r\n var y0 = [];\r\n var max = 0;\r\n for (var i = 0; i < pointNum; ++i) {\r\n var temp = 0;\r\n for (var j = 0; j < layerNum; ++j) {\r\n temp += data[j][i][1];\r\n }\r\n if (temp > max) {\r\n max = temp;\r\n }\r\n sums.push(temp);\r\n }\r\n for (var k = 0; k < pointNum; ++k) {\r\n y0[k] = (max - sums[k]) / 2;\r\n }\r\n max = 0;\r\n for (var l = 0; l < pointNum; ++l) {\r\n var sum = sums[l] + y0[l];\r\n if (sum > max) {\r\n max = sum;\r\n }\r\n }\r\n return {\r\n y0: y0,\r\n max: max\r\n };\r\n}\n\nregisterLayout(themeRiverLayout);\r\nregisterProcessor(dataFilter('themeRiver'));\n\nvar SunburstSeriesModel = (function (_super) {\r\n __extends(SunburstSeriesModel, _super);\r\n function SunburstSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstSeriesModel.type;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = { name: option.name, children: option.data };\r\n completeTreeValue$1(root);\r\n var levelModels = map(option.levels || [], function (levelDefine) {\r\n return new Model(levelDefine, this, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n levelModel && (model.parentModel = levelModel);\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n SunburstSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n SunburstSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n SunburstSeriesModel.type = 'series.sunburst';\r\n SunburstSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n stillShowZeroSum: true,\r\n nodeClick: 'rootToNode',\r\n renderLabelForZeroData: false,\r\n label: {\r\n rotate: 'radial',\r\n show: true,\r\n opacity: 1,\r\n align: 'center',\r\n position: 'inside',\r\n distance: 5,\r\n silent: true\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderColor: 'white',\r\n borderType: 'solid',\r\n shadowBlur: 0,\r\n shadowColor: 'rgba(0, 0, 0, 0.2)',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n emphasis: {\r\n focus: 'descendant'\r\n },\r\n blur: {\r\n itemStyle: {\r\n opacity: 0.2\r\n },\r\n label: {\r\n opacity: 0.1\r\n }\r\n },\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n data: [],\r\n levels: [],\r\n sort: 'desc'\r\n };\r\n return SunburstSeriesModel;\r\n}(SeriesModel));\r\nfunction completeTreeValue$1(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue$1(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\nSeriesModel.registerClass(SunburstSeriesModel);\n\nvar DEFAULT_SECTOR_Z = 2;\r\nvar DEFAULT_TEXT_Z = 4;\r\nvar SunburstPiece = (function (_super) {\r\n __extends(SunburstPiece, _super);\r\n function SunburstPiece(node, seriesModel, ecModel, api) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = DEFAULT_SECTOR_Z;\r\n _this.textConfig = {\r\n inside: true\r\n };\r\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\r\n var text = new ZRText({\r\n z2: DEFAULT_TEXT_Z,\r\n silent: node.getModel().get(['label', 'silent'])\r\n });\r\n _this.setTextContent(text);\r\n _this.updateData(true, node, seriesModel, ecModel, api);\r\n return _this;\r\n }\r\n SunburstPiece.prototype.updateData = function (firstCreate, node, seriesModel, ecModel, api) {\r\n this.node = node;\r\n node.piece = this;\r\n seriesModel = seriesModel || this._seriesModel;\r\n ecModel = ecModel || this._ecModel;\r\n var sector = this;\r\n getECData(sector).dataIndex = node.dataIndex;\r\n var itemModel = node.getModel();\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = node.getLayout();\r\n var sectorShape = extend({}, layout);\r\n sectorShape.label = null;\r\n var normalStyle = node.getVisual('style');\r\n normalStyle.lineJoin = 'bevel';\r\n var decal = node.getVisual('decal');\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape);\r\n extend(sectorShape, cornerRadius);\r\n each(SPECIAL_STATES, function (stateName) {\r\n var state = sector.ensureState(stateName);\r\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\r\n state.style = itemStyleModel.getItemStyle();\r\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\r\n if (cornerRadius) {\r\n state.shape = cornerRadius;\r\n }\r\n });\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n sector.shape.r = layout.r0;\r\n updateProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, node.dataIndex);\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel);\r\n }\r\n sector.useStyle(normalStyle);\r\n this._updateLabel(seriesModel);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._seriesModel = seriesModel || this._seriesModel;\r\n this._ecModel = ecModel || this._ecModel;\r\n var focus = emphasisModel.get('focus');\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n enableHoverEmphasis(this, focusDataIndices || focus, emphasisModel.get('blurScope'));\r\n };\r\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\r\n var _this = this;\r\n var itemModel = this.node.getModel();\r\n var normalLabelModel = itemModel.getModel('label');\r\n var layout = this.node.getLayout();\r\n var angle = layout.endAngle - layout.startAngle;\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var dx = Math.cos(midAngle);\r\n var dy = Math.sin(midAngle);\r\n var sector = this;\r\n var label = sector.getTextContent();\r\n var dataIndex = this.node.dataIndex;\r\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\r\n var isNormalShown = normalLabelModel.get('show')\r\n && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\r\n label.ignore = !isNormalShown;\r\n each(DISPLAY_STATES, function (stateName) {\r\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label')\r\n : itemModel.getModel([stateName, 'label']);\r\n var isNormal = stateName === 'normal';\r\n var state = isNormal ? label : label.ensureState(stateName);\r\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\r\n if (isNormal) {\r\n text = text || _this.node.name;\r\n }\r\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\r\n if (text) {\r\n state.style.text = text;\r\n }\r\n var isShown = labelStateModel.get('show');\r\n if (isShown != null && !isNormal) {\r\n state.ignore = !isShown;\r\n }\r\n var labelPosition = getLabelAttr(labelStateModel, 'position');\r\n var sectorState = isNormal ? sector : sector.states[stateName];\r\n var labelColor = sectorState.style.fill;\r\n sectorState.textConfig = {\r\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\r\n inside: labelPosition !== 'outside'\r\n };\r\n var r;\r\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\r\n var textAlign = getLabelAttr(labelStateModel, 'align');\r\n if (labelPosition === 'outside') {\r\n r = layout.r + labelPadding;\r\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\r\n }\r\n else {\r\n if (!textAlign || textAlign === 'center') {\r\n r = (layout.r + layout.r0) / 2;\r\n textAlign = 'center';\r\n }\r\n else if (textAlign === 'left') {\r\n r = layout.r0 + labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (textAlign === 'right') {\r\n r = layout.r - labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'left';\r\n }\r\n }\r\n }\r\n state.style.align = textAlign;\r\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\r\n state.x = r * dx + layout.cx;\r\n state.y = r * dy + layout.cy;\r\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\r\n var rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = -midAngle;\r\n if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = Math.PI / 2 - midAngle;\r\n if (rotate > Math.PI / 2) {\r\n rotate -= Math.PI;\r\n }\r\n else if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (typeof rotateType === 'number') {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n state.rotation = rotate;\r\n });\r\n function getLabelAttr(model, name) {\r\n var stateAttr = model.get(name);\r\n if (stateAttr == null) {\r\n return normalLabelModel.get(name);\r\n }\r\n return stateAttr;\r\n }\r\n label.dirtyStyle();\r\n };\r\n return SunburstPiece;\r\n}(Sector));\n\nvar ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\r\nregisterAction({ type: ROOT_TO_NODE_ACTION, update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n});\r\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\r\nregisterAction({ type: HIGHLIGHT_ACTION, update: 'none' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleHighlight);\r\n function handleHighlight(model) {\r\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\r\n if (targetInfo) {\r\n payload.dataIndex = targetInfo.node.dataIndex;\r\n }\r\n }\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlight', 'sunburstHighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'highlight'\r\n }));\r\n});\r\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\r\nregisterAction({ type: UNHIGHLIGHT_ACTION, update: 'updateView' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'sunburstUnhighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'downplay'\r\n }));\r\n});\n\nvar SunburstView = (function (_super) {\r\n __extends(SunburstView, _super);\r\n function SunburstView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstView.type;\r\n return _this;\r\n }\r\n SunburstView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var self = this;\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var data = seriesModel.getData();\r\n var virtualRoot = data.tree.root;\r\n var newRoot = seriesModel.getViewRoot();\r\n var group = this.group;\r\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\r\n var newChildren = [];\r\n newRoot.eachNode(function (node) {\r\n newChildren.push(node);\r\n });\r\n var oldChildren = this._oldChildren || [];\r\n dualTravel(newChildren, oldChildren);\r\n renderRollUp(virtualRoot, newRoot);\r\n this._initEvents();\r\n this._oldChildren = newChildren;\r\n function dualTravel(newChildren, oldChildren) {\r\n if (newChildren.length === 0 && oldChildren.length === 0) {\r\n return;\r\n }\r\n new DataDiffer(oldChildren, newChildren, getKey, getKey)\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIdx, oldIdx) {\r\n var newNode = newIdx == null ? null : newChildren[newIdx];\r\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\r\n doRenderNode(newNode, oldNode);\r\n }\r\n }\r\n function doRenderNode(newNode, oldNode) {\r\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\r\n newNode = null;\r\n }\r\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\r\n if (oldNode && oldNode.piece) {\r\n if (newNode) {\r\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\r\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\r\n }\r\n else {\r\n removeNode(oldNode);\r\n }\r\n }\r\n else if (newNode) {\r\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\r\n group.add(piece);\r\n data.setItemGraphicEl(newNode.dataIndex, piece);\r\n }\r\n }\r\n }\r\n function removeNode(node) {\r\n if (!node) {\r\n return;\r\n }\r\n if (node.piece) {\r\n group.remove(node.piece);\r\n node.piece = null;\r\n }\r\n }\r\n function renderRollUp(virtualRoot, viewRoot) {\r\n if (viewRoot.depth > 0) {\r\n if (self.virtualPiece) {\r\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\r\n }\r\n else {\r\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\r\n group.add(self.virtualPiece);\r\n }\r\n viewRoot.piece.off('click');\r\n self.virtualPiece.on('click', function (e) {\r\n self._rootToNode(viewRoot.parentNode);\r\n });\r\n }\r\n else if (self.virtualPiece) {\r\n group.remove(self.virtualPiece);\r\n self.virtualPiece = null;\r\n }\r\n }\r\n };\r\n SunburstView.prototype._initEvents = function () {\r\n var _this = this;\r\n this.group.off('click');\r\n this.group.on('click', function (e) {\r\n var targetFound = false;\r\n var viewRoot = _this.seriesModel.getViewRoot();\r\n viewRoot.eachNode(function (node) {\r\n if (!targetFound\r\n && node.piece && node.piece === e.target) {\r\n var nodeClick = node.getModel().get('nodeClick');\r\n if (nodeClick === 'rootToNode') {\r\n _this._rootToNode(node);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.getModel();\r\n var link = itemModel.get('link');\r\n if (link) {\r\n var linkTarget = itemModel.get('target', true)\r\n || '_blank';\r\n windowOpen(link, linkTarget);\r\n }\r\n }\r\n targetFound = true;\r\n }\r\n });\r\n });\r\n };\r\n SunburstView.prototype._rootToNode = function (node) {\r\n if (node !== this.seriesModel.getViewRoot()) {\r\n this.api.dispatchAction({\r\n type: ROOT_TO_NODE_ACTION,\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: node\r\n });\r\n }\r\n };\r\n SunburstView.prototype.containPoint = function (point, seriesModel) {\r\n var treeRoot = seriesModel.getData();\r\n var itemLayout = treeRoot.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n SunburstView.type = 'sunburst';\r\n return SunburstView;\r\n}(ChartView));\r\nChartView.registerClass(SunburstView);\n\nvar RADIAN$2 = Math.PI / 180;\r\nfunction sunburstLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width);\r\n var cy = parsePercent$2(center[1], height);\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$2;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$2;\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var treeRoot = seriesModel.getViewRoot();\r\n var rootDepth = treeRoot.depth;\r\n var sort = seriesModel.get('sort');\r\n if (sort != null) {\r\n initChildren$1(treeRoot, sort);\r\n }\r\n var validDataCount = 0;\r\n each(treeRoot.children, function (child) {\r\n !isNaN(child.getValue()) && validDataCount++;\r\n });\r\n var sum = treeRoot.getValue();\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var renderRollupNode = treeRoot.depth > 0;\r\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\r\n var rPerLevel = (r - r0) / (levels || 1);\r\n var clockwise = seriesModel.get('clockwise');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var dir = clockwise ? 1 : -1;\r\n var renderNode = function (node, startAngle) {\r\n if (!node) {\r\n return;\r\n }\r\n var endAngle = startAngle;\r\n if (node !== virtualRoot) {\r\n var value = node.getValue();\r\n var angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n }\r\n endAngle = startAngle + dir * angle;\r\n var depth = node.depth - rootDepth\r\n - (renderRollupNode ? -1 : 1);\r\n var rStart = r0 + rPerLevel * depth;\r\n var rEnd = r0 + rPerLevel * (depth + 1);\r\n var itemModel = node.getModel();\r\n if (itemModel.get('r0') != null) {\r\n rStart = parsePercent$2(itemModel.get('r0'), size / 2);\r\n }\r\n if (itemModel.get('r') != null) {\r\n rEnd = parsePercent$2(itemModel.get('r'), size / 2);\r\n }\r\n node.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n if (node.children && node.children.length) {\r\n var siblingAngle_1 = 0;\r\n each(node.children, function (node) {\r\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\r\n });\r\n }\r\n return endAngle - startAngle;\r\n };\r\n if (renderRollupNode) {\r\n var rStart = r0;\r\n var rEnd = r0 + rPerLevel;\r\n var angle = Math.PI * 2;\r\n virtualRoot.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: startAngle + angle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n renderNode(treeRoot, startAngle);\r\n });\r\n}\r\nfunction initChildren$1(node, sortOrder) {\r\n var children = node.children || [];\r\n node.children = sort$2(children, sortOrder);\r\n if (children.length) {\r\n each(node.children, function (child) {\r\n initChildren$1(child, sortOrder);\r\n });\r\n }\r\n}\r\nfunction sort$2(children, sortOrder) {\r\n if (typeof sortOrder === 'function') {\r\n var sortTargets = map(children, function (child, idx) {\r\n var value = child.getValue();\r\n return {\r\n params: {\r\n depth: child.depth,\r\n height: child.height,\r\n dataIndex: child.dataIndex,\r\n getValue: function () { return value; }\r\n },\r\n index: idx\r\n };\r\n });\r\n sortTargets.sort(function (a, b) {\r\n return sortOrder(a.params, b.params);\r\n });\r\n return map(sortTargets, function (target) {\r\n return children[target.index];\r\n });\r\n }\r\n else {\r\n var isAsc_1 = sortOrder === 'asc';\r\n return children.sort(function (a, b) {\r\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\r\n return diff === 0\r\n ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1)\r\n : diff;\r\n });\r\n }\r\n}\n\nfunction sunburstVisual(ecModel) {\r\n var paletteScope = {};\r\n function pickColor(node, seriesModel, treeHeight) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var color = seriesModel.getColorFromPalette((current.name || current.dataIndex + ''), paletteScope);\r\n if (node.depth > 1 && typeof color === 'string') {\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n return color;\r\n }\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\n\nregisterLayout(curry(sunburstLayout, 'sunburst'));\r\nregisterProcessor(curry(dataFilter, 'sunburst'));\r\nregisterVisual(sunburstVisual);\n\nfunction dataToCoordSize(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['x', 'y'], function (dim, dimIdx) {\r\n var axis = this.getAxis(dim);\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }, this);\r\n}\r\nfunction cartesianPrepareCustom(coordSys) {\r\n var rect = coordSys.master.getRect();\r\n return {\r\n coordSys: {\r\n type: 'cartesian2d',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$1(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map([0, 1], function (dimIdx) {\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var p1 = [];\r\n var p2 = [];\r\n p1[dimIdx] = val - halfSize;\r\n p2[dimIdx] = val + halfSize;\r\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\r\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\r\n }, this);\r\n}\r\nfunction geoPrepareCustom(coordSys) {\r\n var rect = coordSys.getBoundingRect();\r\n return {\r\n coordSys: {\r\n type: 'geo',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n zoom: coordSys.getZoom()\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize$1, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$2(dataSize, dataItem) {\r\n var axis = this.getAxis();\r\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\r\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n}\r\nfunction singlePrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n return {\r\n coordSys: {\r\n type: 'singleAxis',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (val) {\r\n return coordSys.dataToPoint(val);\r\n },\r\n size: bind(dataToCoordSize$2, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$3(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['Radius', 'Angle'], function (dim, dimIdx) {\r\n var getterName = 'get' + dim + 'Axis';\r\n var axis = this[getterName]();\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var result = axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n if (dim === 'Angle') {\r\n result = result * Math.PI / 180;\r\n }\r\n return result;\r\n }, this);\r\n}\r\nfunction polarPrepareCustom(coordSys) {\r\n var radiusAxis = coordSys.getRadiusAxis();\r\n var angleAxis = coordSys.getAngleAxis();\r\n var radius = radiusAxis.getExtent();\r\n radius[0] > radius[1] && radius.reverse();\r\n return {\r\n coordSys: {\r\n type: 'polar',\r\n cx: coordSys.cx,\r\n cy: coordSys.cy,\r\n r: radius[1],\r\n r0: radius[0]\r\n },\r\n api: {\r\n coord: function (data) {\r\n var radius = radiusAxis.dataToRadius(data[0]);\r\n var angle = angleAxis.dataToAngle(data[1]);\r\n var coord = coordSys.coordToPoint([radius, angle]);\r\n coord.push(radius, angle * Math.PI / 180);\r\n return coord;\r\n },\r\n size: bind(dataToCoordSize$3, coordSys)\r\n }\r\n };\r\n}\n\nfunction calendarPrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n var rangeInfo = coordSys.getRangeInfo();\r\n return {\r\n coordSys: {\r\n type: 'calendar',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n cellWidth: coordSys.getCellWidth(),\r\n cellHeight: coordSys.getCellHeight(),\r\n rangeInfo: {\r\n start: rangeInfo.start,\r\n end: rangeInfo.end,\r\n weeks: rangeInfo.weeks,\r\n dayCount: rangeInfo.allDay\r\n }\r\n },\r\n api: {\r\n coord: function (data, clamp) {\r\n return coordSys.dataToPoint(data, clamp);\r\n }\r\n }\r\n };\r\n}\n\nvar deprecatedLogs = {};\r\nfunction isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n}\r\nfunction convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n}\r\nfunction convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n}\r\nfunction convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\r\n var out = itemStl;\r\n out.textPosition = out.textPosition || txCfg.position || 'inside';\r\n txCfg.offset != null && (out.textOffset = txCfg.offset);\r\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\r\n txCfg.distance != null && (out.textDistance = txCfg.distance);\r\n var isInside = out.textPosition.indexOf('inside') >= 0;\r\n var hostFill = itemStl.fill || '#000';\r\n convertToEC4RichItem(out, txStl);\r\n var textFillNotSet = out.textFill == null;\r\n if (isInside) {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.insideFill || '#fff';\r\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\r\n !out.textStroke && (out.textStroke = hostFill);\r\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\r\n }\r\n }\r\n else {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.outsideFill || hostFill;\r\n }\r\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\r\n }\r\n out.text = txStl.text;\r\n out.rich = txStl.rich;\r\n each(txStl.rich, function (richItem) {\r\n convertToEC4RichItem(richItem, richItem);\r\n });\r\n return out;\r\n}\r\nfunction convertToEC4RichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\r\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\r\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\r\n hasOwn(richItem, 'font') && (out.font = richItem.font);\r\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\r\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\r\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\r\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\r\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\r\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\r\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\r\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\r\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\r\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\r\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\r\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\r\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\r\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\r\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\r\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\r\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\r\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\r\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\r\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\r\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\r\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\r\n}\r\nfunction warnDeprecated(deprecated, insteadApproach) {\r\n if (__DEV__) {\r\n var key = deprecated + '^_^' + insteadApproach;\r\n if (!deprecatedLogs[key]) {\r\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\r\n deprecatedLogs[key] = true;\r\n }\r\n }\r\n}\n\nvar inner$e = makeInner();\r\nvar TRANSFORM_PROPS = {\r\n x: 1,\r\n y: 1,\r\n scaleX: 1,\r\n scaleY: 1,\r\n originX: 1,\r\n originY: 1,\r\n rotation: 1\r\n};\r\nvar transformPropNamesStr = keys(TRANSFORM_PROPS).join(', ');\r\nvar STYLE_VISUAL_TYPE = {\r\n color: 'fill',\r\n borderColor: 'stroke'\r\n};\r\nvar NON_STYLE_VISUAL_PROPS = {\r\n symbol: 1,\r\n symbolSize: 1,\r\n symbolKeepAspect: 1,\r\n legendSymbol: 1,\r\n visualMeta: 1,\r\n liftZ: 1,\r\n decal: 1\r\n};\r\nvar EMPHASIS = 'emphasis';\r\nvar NORMAL = 'normal';\r\nvar BLUR = 'blur';\r\nvar SELECT = 'select';\r\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\r\nvar PATH_ITEM_STYLE = {\r\n normal: ['itemStyle'],\r\n emphasis: [EMPHASIS, 'itemStyle'],\r\n blur: [BLUR, 'itemStyle'],\r\n select: [SELECT, 'itemStyle']\r\n};\r\nvar PATH_LABEL = {\r\n normal: ['label'],\r\n emphasis: [EMPHASIS, 'label'],\r\n blur: [BLUR, 'label'],\r\n select: [SELECT, 'label']\r\n};\r\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\r\nvar attachedTxInfoTmp = {\r\n normal: {},\r\n emphasis: {},\r\n blur: {},\r\n select: {}\r\n};\r\nvar LEGACY_TRANSFORM_PROPS = {\r\n position: ['x', 'y'],\r\n scale: ['scaleX', 'scaleY'],\r\n origin: ['originX', 'originY']\r\n};\r\nvar tmpTransformable = new Transformable();\r\nvar prepareCustoms = {\r\n cartesian2d: cartesianPrepareCustom,\r\n geo: geoPrepareCustom,\r\n singleAxis: singlePrepareCustom,\r\n polar: polarPrepareCustom,\r\n calendar: calendarPrepareCustom\r\n};\r\nvar CustomSeriesModel = (function (_super) {\r\n __extends(CustomSeriesModel, _super);\r\n function CustomSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesModel.type;\r\n return _this;\r\n }\r\n CustomSeriesModel.prototype.optionUpdated = function () {\r\n this.currentZLevel = this.get('zlevel', true);\r\n this.currentZ = this.get('z', true);\r\n };\r\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this);\r\n };\r\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n el && (params.info = inner$e(el).info);\r\n return params;\r\n };\r\n CustomSeriesModel.type = 'series.custom';\r\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n CustomSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n clip: false\r\n };\r\n return CustomSeriesModel;\r\n}(SeriesModel));\r\nComponentModel.registerClass(CustomSeriesModel);\r\nvar CustomSeriesView = (function (_super) {\r\n __extends(CustomSeriesView, _super);\r\n function CustomSeriesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesView.type;\r\n return _this;\r\n }\r\n CustomSeriesView.prototype.render = function (customSeries, ecModel, api, payload) {\r\n var oldData = this._data;\r\n var data = customSeries.getData();\r\n var group = this.group;\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n var transOpt = customSeries.__transientTransitionOpt;\r\n if (transOpt && (transOpt.from == null || transOpt.to == null)) {\r\n oldData && oldData.each(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n });\r\n data.each(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n });\r\n }\r\n else {\r\n var morphPreparation_1 = new MorphPreparation(customSeries, transOpt);\r\n var diffMode = transOpt ? 'multiple' : 'oneToOne';\r\n (new DataDiffer(oldData ? oldData.getIndices() : [], data.getIndices(), createGetKey(oldData, diffMode, transOpt && transOpt.from), createGetKey(data, diffMode, transOpt && transOpt.to), null, diffMode))\r\n .add(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n })\r\n .remove(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n morphPreparation_1.reset('oneToOne');\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n if (morphPreparation_1.hasFrom()) {\r\n removeElementDirectly(oldEl, group);\r\n oldEl = null;\r\n }\r\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateManyToOne(function (newIdx, oldIndices) {\r\n morphPreparation_1.reset('manyToOne');\r\n for (var i = 0; i < oldIndices.length; i++) {\r\n var oldEl = oldData.getItemGraphicEl(oldIndices[i]);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n }\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateOneToMany(function (newIndices, oldIdx) {\r\n morphPreparation_1.reset('oneToMany');\r\n var newLen = newIndices.length;\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n for (var i = 0; i < newLen; i++) {\r\n createOrUpdateItem(api, null, newIndices[i], renderItem(newIndices[i], payload), customSeries, group, data, morphPreparation_1);\r\n }\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .execute();\r\n }\r\n var clipPath = customSeries.get('clip', true)\r\n ? createClipPath(customSeries.coordinateSystem, false, customSeries)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n this._data = data;\r\n };\r\n CustomSeriesView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CustomSeriesView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\r\n var data = customSeries.getData();\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n function setIncrementalAndHoverLayer(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = params.start; idx < params.end; idx++) {\r\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data, null);\r\n el.traverse(setIncrementalAndHoverLayer);\r\n }\r\n };\r\n CustomSeriesView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\r\n var elementName = query.element;\r\n if (elementName == null || targetEl.name === elementName) {\r\n return true;\r\n }\r\n while ((targetEl = (targetEl.__hostTarget || targetEl.parent)) && targetEl !== this.group) {\r\n if (targetEl.name === elementName) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n CustomSeriesView.type = 'custom';\r\n return CustomSeriesView;\r\n}(ChartView));\r\nChartView.registerClass(CustomSeriesView);\r\nfunction createGetKey(data, diffMode, dimension) {\r\n if (!data) {\r\n return;\r\n }\r\n if (diffMode === 'oneToOne') {\r\n return function (rawIdx, dataIndex) {\r\n return data.getId(dataIndex);\r\n };\r\n }\r\n var diffByDimName = data.getDimension(dimension);\r\n var dimInfo = data.getDimensionInfo(diffByDimName);\r\n if (!dimInfo) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = dimension + \" is not a valid dimension.\";\r\n }\r\n throwError(errMsg);\r\n }\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n return function (rawIdx, dataIndex) {\r\n var key = data.get(diffByDimName, dataIndex);\r\n if (ordinalMeta) {\r\n key = ordinalMeta.categories[key];\r\n }\r\n return (key == null || eqNaN(key))\r\n ? rawIdx + ''\r\n : '_ec_' + key;\r\n };\r\n}\r\nfunction createEl(elOption) {\r\n var graphicType = elOption.type;\r\n var el;\r\n if (graphicType === 'path') {\r\n var shape = elOption.shape;\r\n var pathRect = (shape.width != null && shape.height != null)\r\n ? {\r\n x: shape.x || 0,\r\n y: shape.y || 0,\r\n width: shape.width,\r\n height: shape.height\r\n }\r\n : null;\r\n var pathData = getPathData(shape);\r\n el = makePath(pathData, null, pathRect, shape.layout || 'center');\r\n inner$e(el).customPathData = pathData;\r\n }\r\n else if (graphicType === 'image') {\r\n el = new ZRImage({});\r\n inner$e(el).customImagePath = elOption.style.image;\r\n }\r\n else if (graphicType === 'text') {\r\n el = new ZRText({});\r\n }\r\n else if (graphicType === 'group') {\r\n el = new Group();\r\n }\r\n else if (graphicType === 'compoundPath') {\r\n throw new Error('\"compoundPath\" is not supported yet.');\r\n }\r\n else {\r\n var Clz = getShapeClass(graphicType);\r\n if (!Clz) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\r\n }\r\n throwError(errMsg);\r\n }\r\n el = new Clz();\r\n }\r\n inner$e(el).customGraphicType = graphicType;\r\n el.name = elOption.name;\r\n el.z2EmphasisLift = 1;\r\n el.z2SelectLift = 1;\r\n return el;\r\n}\r\nfunction updateElNormal(api, el, isMorphTo, dataIndex, elOption, styleOpt, attachedTxInfo, seriesModel, isInit, isTextContent) {\r\n var transFromProps = {};\r\n var allPropsFinal = {};\r\n var elDisplayable = el.isGroup ? null : el;\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('shape', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('shape', elOption, allPropsFinal);\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('extra', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('extra', elOption, allPropsFinal);\r\n !isMorphTo && prepareTransformTransitionFrom(el, null, elOption, transFromProps, isInit);\r\n prepareTransformAllPropsFinal(elOption, allPropsFinal);\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\r\n if (txCfgOpt) {\r\n el.setTextConfig(txCfgOpt);\r\n }\r\n if (el.type === 'text' && styleOpt) {\r\n var textOptionStyle = styleOpt;\r\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\r\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\r\n }\r\n if (styleOpt) {\r\n var decalPattern = void 0;\r\n var decalObj = isPath$1(el) ? styleOpt.decal : null;\r\n if (api && decalObj) {\r\n decalObj.dirty = true;\r\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\r\n }\r\n styleOpt.__decalPattern = decalPattern;\r\n }\r\n !isMorphTo && prepareStyleTransitionFrom(el, null, elOption, styleOpt, transFromProps, isInit);\r\n if (elDisplayable) {\r\n hasOwn(elOption, 'invisible') && (elDisplayable.invisible = elOption.invisible);\r\n }\r\n if (!isMorphTo) {\r\n applyPropsFinal(el, allPropsFinal, styleOpt);\r\n applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit);\r\n }\r\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\r\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\r\n if (!isTextContent) {\r\n hasOwn(elOption, 'info') && (inner$e(el).info = elOption.info);\r\n }\r\n styleOpt ? el.dirty() : el.markRedraw();\r\n return isMorphTo ? allPropsFinal : null;\r\n}\r\nfunction applyPropsFinal(el, allPropsFinal, styleOpt) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n if (elDisplayable && styleOpt) {\r\n var decalPattern = styleOpt.__decalPattern;\r\n var originalDecalObj = void 0;\r\n if (decalPattern) {\r\n originalDecalObj = styleOpt.decal;\r\n styleOpt.decal = decalPattern;\r\n }\r\n elDisplayable.useStyle(styleOpt);\r\n if (decalPattern) {\r\n styleOpt.decal = originalDecalObj;\r\n }\r\n var animators = elDisplayable.animators;\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (animator.targetName === 'style') {\r\n animator.changeTarget(elDisplayable.style);\r\n }\r\n }\r\n }\r\n allPropsFinal && el.attr(allPropsFinal);\r\n}\r\nfunction applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit) {\r\n if (transFromProps) {\r\n var userDuring = elOption.during;\r\n inner$e(el).userDuring = userDuring;\r\n var cfgDuringCall = userDuring ? bind(duringCall, { el: el, userDuring: userDuring }) : null;\r\n var cfg = {\r\n dataIndex: dataIndex,\r\n isFrom: true,\r\n during: cfgDuringCall\r\n };\r\n isInit\r\n ? initProps(el, transFromProps, seriesModel, cfg)\r\n : updateProps(el, transFromProps, seriesModel, cfg);\r\n }\r\n}\r\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, el, morphFromEl, elOption, transFromProps, isInit) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var elPropsInAttr = el[mainAttr];\r\n var transFromPropsInAttr;\r\n var enterFrom = attrOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromPropsInAttr[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit\r\n && elPropsInAttr\r\n && !(morphFromEl != null && mainAttr === 'shape')) {\r\n if (attrOpt.transition) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var transitionKeys = normalizeToArray(attrOpt.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer(key, attrOpt[key], elVal);\r\n }\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n else if (indexOf(elOption.transition, mainAttr) >= 0) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var elPropsInAttrKeys = keys(elPropsInAttr);\r\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\r\n var key = elPropsInAttrKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = attrOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToPropsInAttr = leaveToProps[mainAttr] || (leaveToProps[mainAttr] = {});\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToPropsInAttr[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var allPropsInAttr = allProps[mainAttr] = {};\r\n var keysInAttr = keys(attrOpt);\r\n for (var i = 0; i < keysInAttr.length; i++) {\r\n var key = keysInAttr[i];\r\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\r\n }\r\n}\r\nfunction prepareTransformTransitionFrom(el, morphFromEl, elOption, transFromProps, isInit) {\r\n var enterFrom = elOption.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.enterFrom');\r\n }\r\n transFromProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit) {\r\n if (morphFromEl) {\r\n var fromTransformable = calcOldElLocalTransformBasedOnNewElParent(morphFromEl, el);\r\n setTransformPropToTransitionFrom(transFromProps, 'x', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'rotation', fromTransformable);\r\n }\r\n else if (elOption.transition) {\r\n var transitionKeys = normalizeToArray(elOption.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n if (key === 'style' || key === 'shape' || key === 'extra') {\r\n continue;\r\n }\r\n var elVal = el[key];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.transition');\r\n checkNonStyleTansitionRefer(key, elOption[key], elVal);\r\n }\r\n transFromProps[key] = elVal;\r\n }\r\n }\r\n else {\r\n setTransformPropToTransitionFrom(transFromProps, 'x', el);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', el);\r\n }\r\n }\r\n var leaveTo = elOption.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.leaveTo');\r\n }\r\n leaveToProps[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction prepareTransformAllPropsFinal(elOption, allProps) {\r\n setLagecyTransformProp(elOption, allProps, 'position');\r\n setLagecyTransformProp(elOption, allProps, 'scale');\r\n setLagecyTransformProp(elOption, allProps, 'origin');\r\n setTransformProp(elOption, allProps, 'x');\r\n setTransformProp(elOption, allProps, 'y');\r\n setTransformProp(elOption, allProps, 'scaleX');\r\n setTransformProp(elOption, allProps, 'scaleY');\r\n setTransformProp(elOption, allProps, 'originX');\r\n setTransformProp(elOption, allProps, 'originY');\r\n setTransformProp(elOption, allProps, 'rotation');\r\n}\r\nfunction prepareStyleTransitionFrom(el, morphFromEl, elOption, styleOpt, transFromProps, isInit) {\r\n if (!styleOpt) {\r\n return;\r\n }\r\n var fromEl = morphFromEl || el;\r\n var fromElStyle = fromEl.style;\r\n var transFromStyleProps;\r\n var enterFrom = styleOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromStyleProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit && fromElStyle) {\r\n if (styleOpt.transition) {\r\n var transitionKeys = normalizeToArray(styleOpt.transition);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n else if (el.getAnimationStyleProps\r\n && indexOf(elOption.transition, 'style') >= 0) {\r\n var animationProps = el.getAnimationStyleProps();\r\n var animationStyleProps = animationProps ? animationProps.style : null;\r\n if (animationStyleProps) {\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n var styleKeys = keys(styleOpt);\r\n for (var i = 0; i < styleKeys.length; i++) {\r\n var key = styleKeys[i];\r\n if (animationStyleProps[key]) {\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = styleOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToKeys = keys(leaveTo);\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToStyleProps = leaveToProps.style || (leaveToProps.style = {});\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToStyleProps[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction calcOldElLocalTransformBasedOnNewElParent(oldEl, newEl) {\r\n if (!oldEl || oldEl === newEl || oldEl.parent === newEl.parent) {\r\n return oldEl;\r\n }\r\n var tmpM = tmpTransformable.transform\r\n || (tmpTransformable.transform = identity([]));\r\n var oldGlobalTransform = oldEl.getComputedTransform();\r\n oldGlobalTransform\r\n ? copy$1(tmpM, oldGlobalTransform)\r\n : identity(tmpM);\r\n var newParent = newEl.parent;\r\n if (newParent) {\r\n newParent.getComputedTransform();\r\n }\r\n tmpTransformable.originX = oldEl.originX;\r\n tmpTransformable.originY = oldEl.originY;\r\n tmpTransformable.parent = newParent;\r\n tmpTransformable.decomposeTransform();\r\n return tmpTransformable;\r\n}\r\nvar checkNonStyleTansitionRefer;\r\nif (__DEV__) {\r\n checkNonStyleTansitionRefer = function (propName, optVal, elVal) {\r\n if (!isArrayLike(optVal)) {\r\n assert(optVal != null && isFinite(optVal), 'Prop `' + propName + '` must refer to a finite number or ArrayLike for transition.');\r\n }\r\n else {\r\n assert(optVal !== elVal, 'Prop `' + propName + '` must use different Array object each time for transition.');\r\n }\r\n };\r\n}\r\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\r\n return !isArrayLike(optVal)\r\n ? (optVal != null && isFinite(optVal))\r\n : optVal !== elVal;\r\n}\r\nvar checkTransformPropRefer;\r\nif (__DEV__) {\r\n checkTransformPropRefer = function (key, usedIn) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Prop `' + key + '` is not a permitted in `' + usedIn + '`. '\r\n + 'Only `' + keys(TRANSFORM_PROPS).join('`, `') + '` are permitted.');\r\n };\r\n}\r\nfunction getOrCreateLeaveToPropsFromEl(el) {\r\n var innerEl = inner$e(el);\r\n return innerEl.leaveToProps || (innerEl.leaveToProps = {});\r\n}\r\nvar tmpDuringScope = {};\r\nvar customDuringAPI = {\r\n setTransform: function (key, val) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\r\n }\r\n tmpDuringScope.el[key] = val;\r\n return this;\r\n },\r\n getTransform: function (key) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\r\n }\r\n return tmpDuringScope.el[key];\r\n },\r\n setShape: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape\r\n || (tmpDuringScope.el.shape = {});\r\n shape[key] = val;\r\n tmpDuringScope.isShapeDirty = true;\r\n return this;\r\n },\r\n getShape: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape;\r\n if (shape) {\r\n return shape[key];\r\n }\r\n },\r\n setStyle: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n if (__DEV__) {\r\n if (eqNaN(val)) {\r\n warn('style.' + key + ' must not be assigned with NaN.');\r\n }\r\n }\r\n style[key] = val;\r\n tmpDuringScope.isStyleDirty = true;\r\n }\r\n return this;\r\n },\r\n getStyle: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n return style[key];\r\n }\r\n },\r\n setExtra: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra\r\n || (tmpDuringScope.el.extra = {});\r\n extra[key] = val;\r\n return this;\r\n },\r\n getExtra: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra;\r\n if (extra) {\r\n return extra[key];\r\n }\r\n }\r\n};\r\nfunction assertNotReserved(key) {\r\n if (__DEV__) {\r\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\r\n throw new Error('key must not be \"' + key + '\"');\r\n }\r\n }\r\n}\r\nfunction duringCall() {\r\n var scope = this;\r\n var el = scope.el;\r\n if (!el) {\r\n return;\r\n }\r\n var newstUserDuring = inner$e(el).userDuring;\r\n var scopeUserDuring = scope.userDuring;\r\n if (newstUserDuring !== scopeUserDuring) {\r\n scope.el = scope.userDuring = null;\r\n return;\r\n }\r\n tmpDuringScope.el = el;\r\n tmpDuringScope.isShapeDirty = false;\r\n tmpDuringScope.isStyleDirty = false;\r\n scopeUserDuring(customDuringAPI);\r\n if (tmpDuringScope.isShapeDirty && el.dirtyShape) {\r\n el.dirtyShape();\r\n }\r\n if (tmpDuringScope.isStyleDirty && el.dirtyStyle) {\r\n el.dirtyStyle();\r\n }\r\n}\r\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo, isRoot, isTextContent) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\r\n if (elDisplayable) {\r\n var stateObj = elDisplayable.ensureState(state);\r\n if (styleOpt === false) {\r\n var existingEmphasisState = elDisplayable.getState(state);\r\n if (existingEmphasisState) {\r\n existingEmphasisState.style = null;\r\n }\r\n }\r\n else {\r\n stateObj.style = styleOpt || null;\r\n }\r\n if (txCfgOpt) {\r\n stateObj.textConfig = txCfgOpt;\r\n }\r\n setDefaultStateProxy(elDisplayable);\r\n }\r\n}\r\nfunction updateZ$1(el, elOption, seriesModel, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n var elDisplayable = el;\r\n var currentZ = seriesModel.currentZ;\r\n var currentZLevel = seriesModel.currentZLevel;\r\n elDisplayable.z = currentZ;\r\n elDisplayable.zlevel = currentZLevel;\r\n var optZ2 = elOption.z2;\r\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\r\n for (var i = 0; i < STATES.length; i++) {\r\n updateZForEachState(elDisplayable, elOption, STATES[i]);\r\n }\r\n}\r\nfunction updateZForEachState(elDisplayable, elOption, state) {\r\n var isNormal = state === NORMAL;\r\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\r\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\r\n var stateObj;\r\n if (optZ2 != null) {\r\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\r\n stateObj.z2 = optZ2 || 0;\r\n }\r\n}\r\nfunction setLagecyTransformProp(elOption, targetProps, legacyName, fromTransformable) {\r\n var legacyArr = elOption[legacyName];\r\n var xyName = LEGACY_TRANSFORM_PROPS[legacyName];\r\n if (legacyArr) {\r\n if (fromTransformable) {\r\n targetProps[xyName[0]] = fromTransformable[xyName[0]];\r\n targetProps[xyName[1]] = fromTransformable[xyName[1]];\r\n }\r\n else {\r\n targetProps[xyName[0]] = legacyArr[0];\r\n targetProps[xyName[1]] = legacyArr[1];\r\n }\r\n }\r\n}\r\nfunction setTransformProp(elOption, allProps, name, fromTransformable) {\r\n if (elOption[name] != null) {\r\n allProps[name] = fromTransformable ? fromTransformable[name] : elOption[name];\r\n }\r\n}\r\nfunction setTransformPropToTransitionFrom(transitionFrom, name, fromTransformable) {\r\n if (fromTransformable) {\r\n transitionFrom[name] = fromTransformable[name];\r\n }\r\n}\r\nfunction makeRenderItem(customSeries, data, ecModel, api) {\r\n var renderItem = customSeries.get('renderItem');\r\n var coordSys = customSeries.coordinateSystem;\r\n var prepareResult = {};\r\n if (coordSys) {\r\n if (__DEV__) {\r\n assert(renderItem, 'series.render is required.');\r\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\r\n }\r\n prepareResult = coordSys.prepareCustoms\r\n ? coordSys.prepareCustoms(coordSys)\r\n : prepareCustoms[coordSys.type](coordSys);\r\n }\r\n var userAPI = defaults({\r\n getWidth: api.getWidth,\r\n getHeight: api.getHeight,\r\n getZr: api.getZr,\r\n getDevicePixelRatio: api.getDevicePixelRatio,\r\n value: value,\r\n style: style,\r\n ordinalRawValue: ordinalRawValue,\r\n styleEmphasis: styleEmphasis,\r\n visual: visual,\r\n barLayout: barLayout,\r\n currentSeriesIndices: currentSeriesIndices,\r\n font: font\r\n }, prepareResult.api || {});\r\n var userParams = {\r\n context: {},\r\n seriesId: customSeries.id,\r\n seriesName: customSeries.name,\r\n seriesIndex: customSeries.seriesIndex,\r\n coordSys: prepareResult.coordSys,\r\n dataInsideLength: data.count(),\r\n encode: wrapEncodeDef(customSeries.getData())\r\n };\r\n var currDataIndexInside;\r\n var currItemModel;\r\n var currItemStyleModels = {};\r\n var currLabelModels = {};\r\n var seriesItemStyleModels = {};\r\n var seriesLabelModels = {};\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n seriesItemStyleModels[stateName] = customSeries\r\n .getModel(PATH_ITEM_STYLE[stateName]);\r\n seriesLabelModels[stateName] = customSeries\r\n .getModel(PATH_LABEL[stateName]);\r\n }\r\n function getItemModel(dataIndexInside) {\r\n return dataIndexInside === currDataIndexInside\r\n ? (currItemModel || (currItemModel = data.getItemModel(dataIndexInside)))\r\n : data.getItemModel(dataIndexInside);\r\n }\r\n function getItemStyleModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesItemStyleModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\r\n }\r\n function getLabelModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesLabelModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\r\n }\r\n return function (dataIndexInside, payload) {\r\n currDataIndexInside = dataIndexInside;\r\n currItemModel = null;\r\n currItemStyleModels = {};\r\n currLabelModels = {};\r\n return renderItem && renderItem(defaults({\r\n dataIndexInside: dataIndexInside,\r\n dataIndex: data.getRawIndex(dataIndexInside),\r\n actionType: payload ? payload.type : null\r\n }, userParams), userAPI);\r\n };\r\n function value(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n return data.get(data.getDimension(dim || 0), dataIndexInside);\r\n }\r\n function ordinalRawValue(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var dimInfo = data.getDimensionInfo(dim || 0);\r\n if (!dimInfo) {\r\n return;\r\n }\r\n var val = data.get(dimInfo.name, dataIndexInside);\r\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.categories[val]\r\n : val;\r\n }\r\n function style(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.style', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var style = data.getItemVisual(dataIndexInside, 'style');\r\n var visualColor = style && style.fill;\r\n var opacity = style && style.opacity;\r\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\r\n visualColor != null && (itemStyle.fill = visualColor);\r\n opacity != null && (itemStyle.opacity = opacity);\r\n var opt = { inheritColor: isString(visualColor) ? visualColor : '#000' };\r\n var labelModel = getLabelModel(dataIndexInside, NORMAL);\r\n var textStyle = createTextStyle(labelModel, null, opt, false, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, opt, false);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function styleEmphasis(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\r\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\r\n var textStyle = createTextStyle(labelModel, null, null, true, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, null, true);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function applyUserPropsAfter(itemStyle, extra) {\r\n for (var key in extra) {\r\n if (hasOwn(extra, key)) {\r\n itemStyle[key] = extra[key];\r\n }\r\n }\r\n }\r\n function preFetchFromExtra(extra, itemStyle) {\r\n if (extra) {\r\n extra.textFill && (itemStyle.textFill = extra.textFill);\r\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\r\n }\r\n }\r\n function visual(visualType, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\r\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\r\n return style_1\r\n ? style_1[STYLE_VISUAL_TYPE[visualType]]\r\n : null;\r\n }\r\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\r\n return data.getItemVisual(dataIndexInside, visualType);\r\n }\r\n }\r\n function barLayout(opt) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var baseAxis = coordSys.getBaseAxis();\r\n return getLayoutOnAxis(defaults({ axis: baseAxis }, opt));\r\n }\r\n }\r\n function currentSeriesIndices() {\r\n return ecModel.getCurrentSeriesIndices();\r\n }\r\n function font(opt) {\r\n return getFont(opt, ecModel);\r\n }\r\n}\r\nfunction wrapEncodeDef(data) {\r\n var encodeDef = {};\r\n each(data.dimensions, function (dimName, dataDimIndex) {\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isExtraCoord) {\r\n var coordDim = dimInfo.coordDim;\r\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\r\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\r\n }\r\n });\r\n return encodeDef;\r\n}\r\nfunction createOrUpdateItem(api, el, dataIndex, elOption, seriesModel, group, data, morphPreparation) {\r\n if (!elOption) {\r\n removeElementDirectly(el, group);\r\n return;\r\n }\r\n el = doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, true, morphPreparation);\r\n el && data.setItemGraphicEl(dataIndex, el);\r\n enableHoverEmphasis(el, elOption.focus, elOption.blurScope);\r\n return el;\r\n}\r\nfunction doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, isRoot, morphPreparation) {\r\n if (__DEV__) {\r\n assert(elOption, 'should not have an null/undefined element setting');\r\n }\r\n var toBeReplacedIdx = -1;\r\n if (el && (doesElNeedRecreate(el, elOption))) {\r\n toBeReplacedIdx = group.childrenRef().indexOf(el);\r\n el = null;\r\n }\r\n var elIsNewCreated = !el;\r\n if (!el) {\r\n el = createEl(elOption);\r\n }\r\n else {\r\n el.clearStates();\r\n }\r\n var canMorph = inner$e(el).canMorph = elOption.morph && isPath$1(el);\r\n var thisElIsMorphTo = canMorph && morphPreparation && morphPreparation.hasFrom();\r\n var isInit = elIsNewCreated && !thisElIsMorphTo;\r\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt =\r\n attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt =\r\n attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt =\r\n attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\r\n attachedTxInfoTmp.isLegacy = false;\r\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\r\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\r\n var pendingAllPropsFinal = updateElNormal(api, el, thisElIsMorphTo, dataIndex, elOption, elOption.style, attachedTxInfoTmp, seriesModel, isInit, false);\r\n if (thisElIsMorphTo) {\r\n morphPreparation.addTo(el, elOption, dataIndex, pendingAllPropsFinal);\r\n }\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var otherStateOpt = retrieveStateOption(elOption, stateName);\r\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\r\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\r\n }\r\n }\r\n updateZ$1(el, elOption, seriesModel);\r\n if (elOption.type === 'group') {\r\n mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation);\r\n }\r\n if (toBeReplacedIdx >= 0) {\r\n group.replaceAt(el, toBeReplacedIdx);\r\n }\r\n else {\r\n group.add(el);\r\n }\r\n return el;\r\n}\r\nfunction doesElNeedRecreate(el, elOption) {\r\n var elInner = inner$e(el);\r\n var elOptionType = elOption.type;\r\n var elOptionShape = elOption.shape;\r\n var elOptionStyle = elOption.style;\r\n return ((elOptionType != null\r\n && elOptionType !== elInner.customGraphicType)\r\n || (elOptionType === 'path'\r\n && hasOwnPathData(elOptionShape)\r\n && getPathData(elOptionShape) !== elInner.customPathData)\r\n || (elOptionType === 'image'\r\n && hasOwn(elOptionStyle, 'image')\r\n && elOptionStyle.image !== elInner.customImagePath));\r\n}\r\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\r\n var clipPathOpt = elOption.clipPath;\r\n if (clipPathOpt === false) {\r\n if (el && el.getClipPath()) {\r\n el.removeClipPath();\r\n }\r\n }\r\n else if (clipPathOpt) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {\r\n clipPath = null;\r\n }\r\n if (!clipPath) {\r\n clipPath = createEl(clipPathOpt);\r\n if (__DEV__) {\r\n assert(clipPath instanceof Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\r\n }\r\n el.setClipPath(clipPath);\r\n }\r\n updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);\r\n }\r\n}\r\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n processTxInfo(elOption, null, attachedTxInfo);\r\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\r\n var txConOptNormal = attachedTxInfo.normal.conOpt;\r\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\r\n var txConOptBlur = attachedTxInfo.blur.conOpt;\r\n var txConOptSelect = attachedTxInfo.select.conOpt;\r\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\r\n var textContent = el.getTextContent();\r\n if (txConOptNormal === false) {\r\n textContent && el.removeTextContent();\r\n }\r\n else {\r\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { type: 'text' };\r\n if (!textContent) {\r\n textContent = createEl(txConOptNormal);\r\n el.setTextContent(textContent);\r\n }\r\n else {\r\n textContent.clearStates();\r\n }\r\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\r\n updateElNormal(null, textContent, null, dataIndex, txConOptNormal, txConStlOptNormal, null, seriesModel, isInit, true);\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\r\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\r\n }\r\n }\r\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\r\n }\r\n }\r\n}\r\nfunction processTxInfo(elOption, state, attachedTxInfo) {\r\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\r\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\r\n var elType = elOption.type;\r\n var txCfg = stateOpt ? stateOpt.textConfig : null;\r\n var txConOptNormal = elOption.textContent;\r\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\r\n if (styleOpt && (attachedTxInfo.isLegacy\r\n || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\r\n attachedTxInfo.isLegacy = true;\r\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\r\n if (!txCfg && convertResult.textConfig) {\r\n txCfg = convertResult.textConfig;\r\n }\r\n if (!txConOpt && convertResult.textContent) {\r\n txConOpt = convertResult.textContent;\r\n }\r\n }\r\n if (!state && txConOpt) {\r\n var txConOptNormal_1 = txConOpt;\r\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\r\n if (__DEV__) {\r\n txConOptNormal_1.type !== 'text' && assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\r\n }\r\n }\r\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\r\n info.cfg = txCfg;\r\n info.conOpt = txConOpt;\r\n}\r\nfunction retrieveStateOption(elOption, state) {\r\n return !state ? elOption : elOption ? elOption[state] : null;\r\n}\r\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\r\n var style = stateOption && stateOption.style;\r\n if (style == null && state === EMPHASIS && stateOptionNormal) {\r\n style = stateOptionNormal.styleEmphasis;\r\n }\r\n return style;\r\n}\r\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation) {\r\n var newChildren = elOption.children;\r\n var newLen = newChildren ? newChildren.length : 0;\r\n var mergeChildren = elOption.$mergeChildren;\r\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\r\n var notMerge = mergeChildren === false;\r\n if (!newLen && !byName && !notMerge) {\r\n return;\r\n }\r\n if (byName) {\r\n diffGroupChildren({\r\n api: api,\r\n oldChildren: el.children() || [],\r\n newChildren: newChildren || [],\r\n dataIndex: dataIndex,\r\n seriesModel: seriesModel,\r\n group: el,\r\n morphPreparation: morphPreparation\r\n });\r\n return;\r\n }\r\n notMerge && el.removeAll();\r\n var index = 0;\r\n for (; index < newLen; index++) {\r\n newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el, false, morphPreparation);\r\n }\r\n for (var i = el.childCount() - 1; i >= index; i--) {\r\n doRemoveEl(el.childAt(i), seriesModel, el);\r\n }\r\n}\r\nfunction diffGroupChildren(context) {\r\n (new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context))\r\n .add(processAddUpdate)\r\n .update(processAddUpdate)\r\n .remove(processRemove)\r\n .execute();\r\n}\r\nfunction getKey(item, idx) {\r\n var name = item && item.name;\r\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\r\n}\r\nfunction processAddUpdate(newIndex, oldIndex) {\r\n var context = this.context;\r\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\r\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\r\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group, false, context.morphPreparation);\r\n}\r\nfunction processRemove(oldIndex) {\r\n var context = this.context;\r\n var child = context.oldChildren[oldIndex];\r\n doRemoveEl(child, context.seriesModel, context.group);\r\n}\r\nfunction doRemoveEl(el, seriesModel, group) {\r\n if (el) {\r\n var leaveToProps = inner$e(el).leaveToProps;\r\n leaveToProps\r\n ? updateProps(el, leaveToProps, seriesModel, {\r\n cb: function () {\r\n group.remove(el);\r\n }\r\n })\r\n : group.remove(el);\r\n }\r\n}\r\nfunction getPathData(shape) {\r\n return shape && (shape.pathData || shape.d);\r\n}\r\nfunction hasOwnPathData(shape) {\r\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\r\n}\r\nfunction isPath$1(el) {\r\n return el && el instanceof Path;\r\n}\r\nfunction removeElementDirectly(el, group) {\r\n el && group.remove(el);\r\n}\r\nvar MorphPreparation = (function () {\r\n function MorphPreparation(seriesModel, transOpt) {\r\n this._fromList = [];\r\n this._toList = [];\r\n this._toElOptionList = [];\r\n this._allPropsFinalList = [];\r\n this._toDataIndices = [];\r\n this._morphConfigList = [];\r\n this._seriesModel = seriesModel;\r\n this._transOpt = transOpt;\r\n }\r\n MorphPreparation.prototype.hasFrom = function () {\r\n return !!this._fromList.length;\r\n };\r\n MorphPreparation.prototype.findAndAddFrom = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n if (inner$e(el).canMorph) {\r\n this._fromList.push(el);\r\n }\r\n if (el.isGroup) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n this.findAndAddFrom(children[i]);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype.addTo = function (path, elOption, dataIndex, allPropsFinal) {\r\n if (path) {\r\n this._toList.push(path);\r\n this._toElOptionList.push(elOption);\r\n this._toDataIndices.push(dataIndex);\r\n this._allPropsFinalList.push(allPropsFinal);\r\n }\r\n };\r\n MorphPreparation.prototype.applyMorphing = function () {\r\n var type = this._type;\r\n var fromList = this._fromList;\r\n var toList = this._toList;\r\n var toListLen = toList.length;\r\n var fromListLen = fromList.length;\r\n if (!fromListLen || !toListLen) {\r\n return;\r\n }\r\n if (type === 'oneToOne') {\r\n for (var toIdx = 0; toIdx < toListLen; toIdx++) {\r\n this._oneToOneForSingleTo(toIdx, toIdx);\r\n }\r\n }\r\n else if (type === 'manyToOne') {\r\n var fromSingleSegLen = Math.max(1, Math.floor(fromListLen / toListLen));\r\n for (var toIdx = 0, fromIdxStart = 0; toIdx < toListLen; toIdx++, fromIdxStart += fromSingleSegLen) {\r\n var fromCount = toIdx + 1 >= toListLen\r\n ? fromListLen - fromIdxStart\r\n : fromSingleSegLen;\r\n this._manyToOneForSingleTo(toIdx, fromIdxStart >= fromListLen ? null : fromIdxStart, fromCount);\r\n }\r\n }\r\n else if (type === 'oneToMany') {\r\n var toSingleSegLen = Math.max(1, Math.floor(toListLen / fromListLen));\r\n for (var toIdxStart = 0, fromIdx = 0; toIdxStart < toListLen; toIdxStart += toSingleSegLen, fromIdx++) {\r\n var toCount = toIdxStart + toSingleSegLen >= toListLen\r\n ? toListLen - toIdxStart\r\n : toSingleSegLen;\r\n this._oneToManyForSingleFrom(toIdxStart, toCount, fromIdx >= fromListLen ? null : fromIdx);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype._oneToOneForSingleTo = function (toIdx, fromIdx) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var toDataIndex = this._toDataIndices[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n var from = this._fromList[fromIdx];\r\n var elAnimationConfig = this._getOrCreateMorphConfig(toDataIndex);\r\n var morphDuration = elAnimationConfig.duration;\r\n if (from && isCombiningPath(from)) {\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphDuration) {\r\n var combineResult = combine([from], to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n }\r\n else {\r\n var morphFrom = (morphDuration\r\n && from\r\n && (from !== to || isInAnyMorphing(from))) ? from : null;\r\n var transFromProps = {};\r\n prepareShapeOrExtraTransitionFrom('shape', to, morphFrom, toElOption, transFromProps, false);\r\n prepareShapeOrExtraTransitionFrom('extra', to, morphFrom, toElOption, transFromProps, false);\r\n prepareTransformTransitionFrom(to, morphFrom, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(to, morphFrom, toElOption, toElOption.style, transFromProps, false);\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphFrom) {\r\n morphPath(morphFrom, to, elAnimationConfig);\r\n }\r\n applyTransitionFrom(to, toDataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._manyToOneForSingleTo = function (toIdx, fromIdxStart, fromCount) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdx]);\r\n if (elAnimationConfig.duration && fromIdxStart != null) {\r\n var combineFromList = [];\r\n for (var fromIdx = fromIdxStart; fromIdx < fromCount; fromIdx++) {\r\n combineFromList.push(this._fromList[fromIdx]);\r\n }\r\n var combineResult = combine(combineFromList, to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n };\r\n MorphPreparation.prototype._oneToManyForSingleFrom = function (toIdxStart, toCount, fromIdx) {\r\n var from = fromIdx == null ? null : this._fromList[fromIdx];\r\n var toList = this._toList;\r\n var separateToList = [];\r\n for (var toIdx = toIdxStart; toIdx < toCount; toIdx++) {\r\n var to = toList[toIdx];\r\n applyPropsFinal(to, this._allPropsFinalList[toIdx], this._toElOptionList[toIdx].style);\r\n separateToList.push(to);\r\n }\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdxStart]);\r\n if (elAnimationConfig.duration && from) {\r\n var separateResult = separate(from, separateToList, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(separateResult, toIdxStart, toCount);\r\n }\r\n };\r\n MorphPreparation.prototype._processResultIndividuals = function (combineSeparateResult, toIdxStart, toCount) {\r\n var isSeparate = toCount != null;\r\n for (var i = 0; i < combineSeparateResult.count; i++) {\r\n var fromIndividual = combineSeparateResult.fromIndividuals[i];\r\n var toIndividual = combineSeparateResult.toIndividuals[i];\r\n var toIdx = toIdxStart + (isSeparate ? i : 0);\r\n var toElOption = this._toElOptionList[toIdx];\r\n var dataIndex = this._toDataIndices[toIdx];\r\n var transFromProps = {};\r\n prepareTransformTransitionFrom(toIndividual, fromIndividual, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(toIndividual, fromIndividual, toElOption, toElOption.style, transFromProps, false);\r\n applyTransitionFrom(toIndividual, dataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._getOrCreateMorphConfig = function (dataIndex) {\r\n var morphConfigList = this._morphConfigList;\r\n var config = morphConfigList[dataIndex];\r\n if (config) {\r\n return config;\r\n }\r\n var duration;\r\n var easing;\r\n var delay;\r\n var seriesModel = this._seriesModel;\r\n var transOpt = this._transOpt;\r\n if (seriesModel.isAnimationEnabled()) {\r\n var animationPayload = void 0;\r\n if (seriesModel && seriesModel.ecModel) {\r\n var updatePayload = seriesModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n easing = animationPayload.easing || 'cubicOut';\r\n delay = animationPayload.delay || 0;\r\n }\r\n else {\r\n easing = seriesModel.get('animationEasingUpdate');\r\n var delayOption = seriesModel.get('animationDelayUpdate');\r\n delay = isFunction(delayOption) ? delayOption(dataIndex) : delayOption;\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n duration = isFunction(durationOption) ? durationOption(dataIndex) : durationOption;\r\n }\r\n }\r\n config = {\r\n duration: duration || 0,\r\n delay: delay,\r\n easing: easing,\r\n dividingMethod: transOpt ? transOpt.dividingMethod : null\r\n };\r\n morphConfigList[dataIndex] = config;\r\n return config;\r\n };\r\n MorphPreparation.prototype.reset = function (type) {\r\n this._type = type;\r\n this._fromList.length =\r\n this._toList.length =\r\n this._toElOptionList.length =\r\n this._allPropsFinalList.length =\r\n this._toDataIndices.length = 0;\r\n };\r\n return MorphPreparation;\r\n}());\r\nfunction copyPropsWhenDivided(srcPath, tarPath, willClone) {\r\n tarPath.style = willClone\r\n ? clone(srcPath.style)\r\n : srcPath.style;\r\n tarPath.zlevel = srcPath.zlevel;\r\n tarPath.z = srcPath.z;\r\n tarPath.z2 = srcPath.z2;\r\n}\n\nfunction getSeriesStackId$1(seriesModel) {\r\n return seriesModel.get('stack')\r\n || '__ec_stack_' + seriesModel.seriesIndex;\r\n}\r\nfunction getAxisKey$1(polar, axis) {\r\n return axis.dim + polar.model.componentIndex;\r\n}\r\nfunction barLayoutPolar(seriesType, ecModel, api) {\r\n var lastStackCoords = {};\r\n var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\r\n return !ecModel.isSeriesFiltered(seriesModel)\r\n && seriesModel.coordinateSystem\r\n && seriesModel.coordinateSystem.type === 'polar';\r\n }));\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (seriesModel.coordinateSystem.type !== 'polar') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = polar.getOtherAxis(baseAxis);\r\n var cx = seriesModel.coordinateSystem.cx;\r\n var cy = seriesModel.coordinateSystem.cy;\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var clampLayout = baseAxis.dim !== 'radius'\r\n || !seriesModel.get('roundCap', true);\r\n var valueAxisStart = valueAxis.dataToCoord(0);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var r0 = void 0;\r\n var r = void 0;\r\n var startAngle = void 0;\r\n var endAngle = void 0;\r\n if (valueAxis.dim === 'radius') {\r\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\r\n var angle = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(radiusSpan) < barMinHeight) {\r\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n r0 = baseCoord;\r\n r = baseCoord + radiusSpan;\r\n startAngle = angle - columnOffset;\r\n endAngle = startAngle - columnWidth;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\r\n }\r\n else {\r\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\r\n var radius = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(angleSpan) < barMinAngle) {\r\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\r\n }\r\n r0 = radius + columnOffset;\r\n r = r0 + columnWidth;\r\n startAngle = baseCoord;\r\n endAngle = baseCoord + angleSpan;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\r\n }\r\n data.setItemLayout(idx, {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: -startAngle * Math.PI / 180,\r\n endAngle: -endAngle * Math.PI / 180\r\n });\r\n }\r\n });\r\n}\r\nfunction calRadialBar(barSeries) {\r\n var columnsMap = {};\r\n each(barSeries, function (seriesModel, idx) {\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: '20%',\r\n gap: '30%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n if (barWidth && !stacks[stackId].width) {\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n stacks[stackId].width = barWidth;\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGap = parsePercent$2(columnsOnAxis.categoryGap, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column, stack) {\r\n var maxWidth = column.maxWidth;\r\n if (maxWidth && maxWidth < autoWidth) {\r\n maxWidth = Math.min(maxWidth, remainedWidth);\r\n if (column.width) {\r\n maxWidth = Math.min(maxWidth, column.width);\r\n }\r\n remainedWidth -= maxWidth;\r\n column.width = maxWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n}\n\nvar PolarModel = (function (_super) {\r\n __extends(PolarModel, _super);\r\n function PolarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PolarModel.type;\r\n return _this;\r\n }\r\n PolarModel.prototype.findAxisModel = function (axisType) {\r\n var foundAxisModel;\r\n var ecModel = this.ecModel;\r\n ecModel.eachComponent(axisType, function (axisModel) {\r\n if (axisModel.getCoordSysModel() === this) {\r\n foundAxisModel = axisModel;\r\n }\r\n }, this);\r\n return foundAxisModel;\r\n };\r\n PolarModel.type = 'polar';\r\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\r\n PolarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '80%'\r\n };\r\n return PolarModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(PolarModel);\n\nvar PolarAxisModel = (function (_super) {\r\n __extends(PolarAxisModel, _super);\r\n function PolarAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n };\r\n PolarAxisModel.type = 'polarAxis';\r\n return PolarAxisModel;\r\n}(ComponentModel));\r\nmixin(PolarAxisModel, AxisModelCommonMixin);\r\nvar AngleAxisModel = (function (_super) {\r\n __extends(AngleAxisModel, _super);\r\n function AngleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisModel.type;\r\n return _this;\r\n }\r\n AngleAxisModel.type = 'angleAxis';\r\n return AngleAxisModel;\r\n}(PolarAxisModel));\r\nvar RadiusAxisModel = (function (_super) {\r\n __extends(RadiusAxisModel, _super);\r\n function RadiusAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisModel.type;\r\n return _this;\r\n }\r\n RadiusAxisModel.type = 'radiusAxis';\r\n return RadiusAxisModel;\r\n}(PolarAxisModel));\r\nvar angleAxisExtraOption = {\r\n startAngle: 90,\r\n clockwise: true,\r\n splitNumber: 12,\r\n axisLabel: {\r\n rotate: 0\r\n }\r\n};\r\nvar radiusAxisExtraOption = {\r\n splitNumber: 5\r\n};\r\naxisModelCreator('angle', AngleAxisModel, angleAxisExtraOption);\r\naxisModelCreator('radius', RadiusAxisModel, radiusAxisExtraOption);\n\nvar RadiusAxis = (function (_super) {\r\n __extends(RadiusAxis, _super);\r\n function RadiusAxis(scale, radiusExtent) {\r\n return _super.call(this, 'radius', scale, radiusExtent) || this;\r\n }\r\n RadiusAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n return RadiusAxis;\r\n}(Axis));\r\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\r\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\n\nvar inner$f = makeInner();\r\nvar AngleAxis = (function (_super) {\r\n __extends(AngleAxis, _super);\r\n function AngleAxis(scale, angleExtent) {\r\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\r\n }\r\n AngleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n AngleAxis.prototype.calculateCategoryInterval = function () {\r\n var axis = this;\r\n var labelModel = axis.getLabelModel();\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitH = Math.abs(unitSpan);\r\n var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\r\n var maxH = Math.max(rect.height, 7);\r\n var dh = maxH / unitH;\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(dh));\r\n var cache = inner$f(axis.model);\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n }\r\n return interval;\r\n };\r\n return AngleAxis;\r\n}(Axis));\r\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\r\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\n\nvar Polar = (function () {\r\n function Polar(name) {\r\n this.dimensions = ['radius', 'angle'];\r\n this.type = 'polar';\r\n this.cx = 0;\r\n this.cy = 0;\r\n this._radiusAxis = new RadiusAxis();\r\n this._angleAxis = new AngleAxis();\r\n this.axisPointerEnabled = true;\r\n this.name = name || '';\r\n this._radiusAxis.polar = this._angleAxis.polar = this;\r\n }\r\n Polar.prototype.containPoint = function (point) {\r\n var coord = this.pointToCoord(point);\r\n return this._radiusAxis.contain(coord[0])\r\n && this._angleAxis.contain(coord[1]);\r\n };\r\n Polar.prototype.containData = function (data) {\r\n return this._radiusAxis.containData(data[0])\r\n && this._angleAxis.containData(data[1]);\r\n };\r\n Polar.prototype.getAxis = function (dim) {\r\n var key = ('_' + dim + 'Axis');\r\n return this[key];\r\n };\r\n Polar.prototype.getAxes = function () {\r\n return [this._radiusAxis, this._angleAxis];\r\n };\r\n Polar.prototype.getAxesByScale = function (scaleType) {\r\n var axes = [];\r\n var angleAxis = this._angleAxis;\r\n var radiusAxis = this._radiusAxis;\r\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\r\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\r\n return axes;\r\n };\r\n Polar.prototype.getAngleAxis = function () {\r\n return this._angleAxis;\r\n };\r\n Polar.prototype.getRadiusAxis = function () {\r\n return this._radiusAxis;\r\n };\r\n Polar.prototype.getOtherAxis = function (axis) {\r\n var angleAxis = this._angleAxis;\r\n return axis === angleAxis ? this._radiusAxis : angleAxis;\r\n };\r\n Polar.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAngleAxis();\r\n };\r\n Polar.prototype.getTooltipAxes = function (dim) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? this.getAxis(dim) : this.getBaseAxis();\r\n return {\r\n baseAxes: [baseAxis],\r\n otherAxes: [this.getOtherAxis(baseAxis)]\r\n };\r\n };\r\n Polar.prototype.dataToPoint = function (data, clamp) {\r\n return this.coordToPoint([\r\n this._radiusAxis.dataToRadius(data[0], clamp),\r\n this._angleAxis.dataToAngle(data[1], clamp)\r\n ]);\r\n };\r\n Polar.prototype.pointToData = function (point, clamp) {\r\n var coord = this.pointToCoord(point);\r\n return [\r\n this._radiusAxis.radiusToData(coord[0], clamp),\r\n this._angleAxis.angleToData(coord[1], clamp)\r\n ];\r\n };\r\n Polar.prototype.pointToCoord = function (point) {\r\n var dx = point[0] - this.cx;\r\n var dy = point[1] - this.cy;\r\n var angleAxis = this.getAngleAxis();\r\n var extent = angleAxis.getExtent();\r\n var minAngle = Math.min(extent[0], extent[1]);\r\n var maxAngle = Math.max(extent[0], extent[1]);\r\n angleAxis.inverse\r\n ? (minAngle = maxAngle - 360)\r\n : (maxAngle = minAngle + 360);\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx) / Math.PI * 180;\r\n var dir = radian < minAngle ? 1 : -1;\r\n while (radian < minAngle || radian > maxAngle) {\r\n radian += dir * 360;\r\n }\r\n return [radius, radian];\r\n };\r\n Polar.prototype.coordToPoint = function (coord) {\r\n var radius = coord[0];\r\n var radian = coord[1] / 180 * Math.PI;\r\n var x = Math.cos(radian) * radius + this.cx;\r\n var y = -Math.sin(radian) * radius + this.cy;\r\n return [x, y];\r\n };\r\n Polar.prototype.getArea = function () {\r\n var angleAxis = this.getAngleAxis();\r\n var radiusAxis = this.getRadiusAxis();\r\n var radiusExtent = radiusAxis.getExtent().slice();\r\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\r\n var angleExtent = angleAxis.getExtent();\r\n var RADIAN = Math.PI / 180;\r\n return {\r\n cx: this.cx,\r\n cy: this.cy,\r\n r0: radiusExtent[0],\r\n r: radiusExtent[1],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse,\r\n contain: function (x, y) {\r\n var dx = x - this.cx;\r\n var dy = y - this.cy;\r\n var d2 = dx * dx + dy * dy;\r\n var r = this.r;\r\n var r0 = this.r0;\r\n return d2 <= r * r && d2 >= r0 * r0;\r\n }\r\n };\r\n };\r\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Polar;\r\n}());\r\nfunction getCoordSys$3(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var polarModel = finder.polarModel;\r\n return polarModel && polarModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n}\n\nfunction resizePolar(polar, polarModel, api) {\r\n var center = polarModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n polar.cx = parsePercent$2(center[0], width);\r\n polar.cy = parsePercent$2(center[1], height);\r\n var radiusAxis = polar.getRadiusAxis();\r\n var size = Math.min(width, height) / 2;\r\n var radius = polarModel.get('radius');\r\n if (radius == null) {\r\n radius = [0, '100%'];\r\n }\r\n else if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n var parsedRadius = [\r\n parsePercent$2(radius[0], size),\r\n parsePercent$2(radius[1], size)\r\n ];\r\n radiusAxis.inverse\r\n ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0])\r\n : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\r\n}\r\nfunction updatePolarScale(ecModel, api) {\r\n var polar = this;\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxis = polar.getRadiusAxis();\r\n angleAxis.scale.setExtent(Infinity, -Infinity);\r\n radiusAxis.scale.setExtent(Infinity, -Infinity);\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === polar) {\r\n var data_1 = seriesModel.getData();\r\n each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\r\n radiusAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\r\n angleAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n }\r\n });\r\n niceScaleExtent(angleAxis.scale, angleAxis.model);\r\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\r\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\r\n var extent = angleAxis.getExtent();\r\n var diff = 360 / angleAxis.scale.count();\r\n angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);\r\n angleAxis.setExtent(extent[0], extent[1]);\r\n }\r\n}\r\nfunction isAngleAxisModel(axisModel) {\r\n return axisModel.mainType === 'angleAxis';\r\n}\r\nfunction setAxis(axis, axisModel) {\r\n axis.type = axisModel.get('type');\r\n axis.scale = createScaleByModel(axisModel);\r\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\r\n axis.inverse = axisModel.get('inverse');\r\n if (isAngleAxisModel(axisModel)) {\r\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\r\n var startAngle = axisModel.get('startAngle');\r\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\r\n }\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n}\r\nvar polarCreator = {\r\n dimensions: Polar.prototype.dimensions,\r\n create: function (ecModel, api) {\r\n var polarList = [];\r\n ecModel.eachComponent('polar', function (polarModel, idx) {\r\n var polar = new Polar(idx + '');\r\n polar.update = updatePolarScale;\r\n var radiusAxis = polar.getRadiusAxis();\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n setAxis(radiusAxis, radiusAxisModel);\r\n setAxis(angleAxis, angleAxisModel);\r\n resizePolar(polar, polarModel, api);\r\n polarList.push(polar);\r\n polarModel.coordinateSystem = polar;\r\n polar.model = polarModel;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'polar') {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!polarModel) {\r\n throw new Error('Polar \"' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\r\n }\r\n }\r\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\r\n }\r\n });\r\n return polarList;\r\n }\r\n};\r\nCoordinateSystemManager.register('polar', polarCreator);\n\nvar elementList$1 = [\r\n 'axisLine',\r\n 'axisLabel',\r\n 'axisTick',\r\n 'minorTick',\r\n 'splitLine',\r\n 'minorSplitLine',\r\n 'splitArea'\r\n];\r\nfunction getAxisLineShape(polar, rExtent, angle) {\r\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\r\n var start = polar.coordToPoint([rExtent[0], angle]);\r\n var end = polar.coordToPoint([rExtent[1], angle]);\r\n return {\r\n x1: start[0],\r\n y1: start[1],\r\n x2: end[0],\r\n y2: end[1]\r\n };\r\n}\r\nfunction getRadiusIdx(polar) {\r\n var radiusAxis = polar.getRadiusAxis();\r\n return radiusAxis.inverse ? 0 : 1;\r\n}\r\nfunction fixAngleOverlap(list) {\r\n var firstItem = list[0];\r\n var lastItem = list[list.length - 1];\r\n if (firstItem\r\n && lastItem\r\n && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\r\n list.pop();\r\n }\r\n}\r\nvar AngleAxisView = (function (_super) {\r\n __extends(AngleAxisView, _super);\r\n function AngleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!angleAxisModel.get('show')) {\r\n return;\r\n }\r\n var angleAxis = angleAxisModel.axis;\r\n var polar = angleAxis.polar;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var ticksAngles = angleAxis.getTicksCoords();\r\n var minorTickAngles = angleAxis.getMinorTicksCoords();\r\n var labels = map(angleAxis.getViewLabels(), function (labelItem) {\r\n labelItem = clone(labelItem);\r\n labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);\r\n return labelItem;\r\n });\r\n fixAngleOverlap(labels);\r\n fixAngleOverlap(ticksAngles);\r\n each(elementList$1, function (name) {\r\n if (angleAxisModel.get([name, 'show'])\r\n && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\r\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\r\n }\r\n }, this);\r\n };\r\n AngleAxisView.type = 'angleAxis';\r\n return AngleAxisView;\r\n}(AxisView));\r\nvar angelAxisElementsBuilders = {\r\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\r\n var rId = getRadiusIdx(polar);\r\n var r0Id = rId ? 0 : 1;\r\n var shape;\r\n if (radiusExtent[r0Id] === 0) {\r\n shape = new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n else {\r\n shape = new Ring({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n r0: radiusExtent[r0Id]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n shape.style.fill = null;\r\n group.add(shape);\r\n },\r\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = map(ticksAngles, function (tickAngleItem) {\r\n return new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\r\n });\r\n });\r\n group.add(mergePath$1(lines, {\r\n style: defaults(tickModel.getModel('lineStyle').getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n })\r\n }));\r\n },\r\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var minorTickModel = angleAxisModel.getModel('minorTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }))\r\n }));\r\n },\r\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\r\n var rawCategoryData = angleAxisModel.getCategories(true);\r\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\r\n var labelMargin = commonLabelModel.get('margin');\r\n var triggerEvent = angleAxisModel.get('triggerEvent');\r\n each(labels, function (labelItem, idx) {\r\n var labelModel = commonLabelModel;\r\n var tickValue = labelItem.tickValue;\r\n var r = radiusExtent[getRadiusIdx(polar)];\r\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3\r\n ? 'center' : (p[0] > cx ? 'left' : 'right');\r\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3\r\n ? 'middle' : (p[1] > cy ? 'top' : 'bottom');\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\r\n }\r\n }\r\n var textEl = new ZRText({\r\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\r\n style: createTextStyle(labelModel, {\r\n x: p[0],\r\n y: p[1],\r\n fill: labelModel.getTextColor()\r\n || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\r\n text: labelItem.formattedLabel,\r\n align: labelTextAlign,\r\n verticalAlign: labelTextVerticalAlign\r\n })\r\n });\r\n group.add(textEl);\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = labelItem.rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n }, this);\r\n },\r\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var splitLineModel = angleAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksAngles.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: lineStyleModel.getLineStyle(),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n },\r\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!ticksAngles.length) {\r\n return;\r\n }\r\n var splitAreaModel = angleAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var RADIAN = Math.PI / 180;\r\n var prevAngle = -ticksAngles[0].coord * RADIAN;\r\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\r\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\r\n var clockwise = angleAxisModel.get('clockwise');\r\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\r\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: r0,\r\n r: r1,\r\n startAngle: prevAngle,\r\n endAngle: -coord * RADIAN,\r\n clockwise: clockwise\r\n },\r\n silent: true\r\n }));\r\n prevAngle = -coord * RADIAN;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\nComponentView.registerClass(AngleAxisView);\n\nvar axisBuilderAttrs$3 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs$2 = [\r\n 'splitLine', 'splitArea', 'minorSplitLine'\r\n];\r\nvar RadiusAxisView = (function (_super) {\r\n __extends(RadiusAxisView, _super);\r\n function RadiusAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!radiusAxisModel.get('show')) {\r\n return;\r\n }\r\n var oldAxisGroup = this._axisGroup;\r\n var newAxisGroup = this._axisGroup = new Group();\r\n this.group.add(newAxisGroup);\r\n var radiusAxis = radiusAxisModel.axis;\r\n var polar = radiusAxis.polar;\r\n var angleAxis = polar.getAngleAxis();\r\n var ticksCoords = radiusAxis.getTicksCoords();\r\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\r\n var axisAngle = angleAxis.getExtent()[0];\r\n var radiusExtent = radiusAxis.getExtent();\r\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\r\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\r\n each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder);\r\n newAxisGroup.add(axisBuilder.getGroup());\r\n groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\r\n each(selfBuilderAttrs$2, function (name) {\r\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\r\n axisElementBuilders$2[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\r\n }\r\n }, this);\r\n };\r\n RadiusAxisView.type = 'radiusAxis';\r\n return RadiusAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders$2 = {\r\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n var splitLineModel = radiusAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: ticksCoords[i].coord\r\n }\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length],\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n lines.push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: minorTicksCoords[i][k].coord\r\n }\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults({\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n },\r\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var prevRadius = ticksCoords[0].coord;\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: prevRadius,\r\n r: ticksCoords[i].coord,\r\n startAngle: 0,\r\n endAngle: Math.PI * 2\r\n },\r\n silent: true\r\n }));\r\n prevRadius = ticksCoords[i].coord;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\r\n return {\r\n position: [polar.cx, polar.cy],\r\n rotation: axisAngle / 180 * Math.PI,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1,\r\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\r\n z2: 1\r\n };\r\n}\r\nAxisView.registerClass(RadiusAxisView);\n\nvar PolarAxisPointer = (function (_super) {\r\n __extends(PolarAxisPointer, _super);\r\n function PolarAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n if (axis.dim === 'angle') {\r\n this.animationThreshold = Math.PI / 18;\r\n }\r\n var polar = axis.polar;\r\n var otherAxis = polar.getOtherAxis(axis);\r\n var otherExtent = otherAxis.getExtent();\r\n var coordValue = axis.dataToCoord(value);\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, polar, coordValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var labelMargin = axisPointerModel.get(['label', 'margin']);\r\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\r\n };\r\n return PolarAxisPointer;\r\n}(BaseAxisPointer));\r\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\r\n var axis = axisModel.axis;\r\n var coord = axis.dataToCoord(value);\r\n var axisAngle = polar.getAngleAxis().getExtent()[0];\r\n axisAngle = axisAngle / 180 * Math.PI;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var position;\r\n var align;\r\n var verticalAlign;\r\n if (axis.dim === 'radius') {\r\n var transform = create$1();\r\n rotate(transform, transform, axisAngle);\r\n translate(transform, transform, [polar.cx, polar.cy]);\r\n position = applyTransform$1([coord, -labelMargin], transform);\r\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\r\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\r\n align = labelLayout.textAlign;\r\n verticalAlign = labelLayout.textVerticalAlign;\r\n }\r\n else {\r\n var r = radiusExtent[1];\r\n position = polar.coordToPoint([r + labelMargin, coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n align = Math.abs(position[0] - cx) / r < 0.3\r\n ? 'center' : (position[0] > cx ? 'left' : 'right');\r\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3\r\n ? 'middle' : (position[1] > cy ? 'top' : 'bottom');\r\n }\r\n return {\r\n position: position,\r\n align: align,\r\n verticalAlign: verticalAlign\r\n };\r\n}\r\nvar pointerShapeBuilder$2 = {\r\n line: function (axis, polar, coordValue, otherExtent) {\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Line',\r\n shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\r\n }\r\n : {\r\n type: 'Circle',\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: coordValue\r\n }\r\n };\r\n },\r\n shadow: function (axis, polar, coordValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var radian = Math.PI / 180;\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\r\n }\r\n : {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\r\n };\r\n }\r\n};\r\nAxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n\nregisterLayout(curry(barLayoutPolar, 'bar'));\r\nextendComponentView({\r\n type: 'polar'\r\n});\n\nvar GeoView = (function (_super) {\r\n __extends(GeoView, _super);\r\n function GeoView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoView.type;\r\n return _this;\r\n }\r\n GeoView.prototype.init = function (ecModel, api) {\r\n var mapDraw = new MapDraw(api);\r\n this._mapDraw = mapDraw;\r\n this.group.add(mapDraw.group);\r\n this._api = api;\r\n };\r\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\r\n var mapDraw = this._mapDraw;\r\n if (geoModel.get('show')) {\r\n mapDraw.draw(geoModel, ecModel, api, this, payload);\r\n }\r\n else {\r\n this._mapDraw.group.removeAll();\r\n }\r\n mapDraw.group.on('click', this._handleRegionClick, this);\r\n mapDraw.group.silent = geoModel.get('silent');\r\n this._model = geoModel;\r\n this.updateSelectStatus(geoModel, ecModel, api);\r\n };\r\n GeoView.prototype._handleRegionClick = function (e) {\r\n var current = e.target;\r\n var eventData;\r\n while ((eventData = getECData(current).eventData) == null) {\r\n current = current.__hostTarget || current.parent;\r\n }\r\n if (eventData) {\r\n this._api.dispatchAction({\r\n type: 'geoToggleSelect',\r\n geoId: this._model.id,\r\n name: eventData.name\r\n });\r\n }\r\n };\r\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\r\n var _this = this;\r\n this._mapDraw.group.traverse(function (node) {\r\n var eventData = getECData(node).eventData;\r\n if (eventData) {\r\n _this._model.isSelected(eventData.name)\r\n ? api.enterSelect(node) : api.leaveSelect(node);\r\n return true;\r\n }\r\n });\r\n };\r\n GeoView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n };\r\n GeoView.type = 'geo';\r\n return GeoView;\r\n}(ComponentView));\r\nComponentView.registerClass(GeoView);\n\nvar GeoModel = (function (_super) {\r\n __extends(GeoModel, _super);\r\n function GeoModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoModel.type;\r\n return _this;\r\n }\r\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n defaultEmphasis(option, 'label', ['show']);\r\n };\r\n GeoModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n var self = this;\r\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap);\r\n var selectedMap = {};\r\n this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) {\r\n var regionName = regionOpt.name;\r\n if (regionName) {\r\n optionModelMap.set(regionName, new Model(regionOpt, self));\r\n if (regionOpt.selected) {\r\n selectedMap[regionName] = true;\r\n }\r\n }\r\n return optionModelMap;\r\n }, createHashMap());\r\n if (!option.selectedMap) {\r\n option.selectedMap = selectedMap;\r\n }\r\n };\r\n GeoModel.prototype.getRegionModel = function (name) {\r\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\r\n };\r\n GeoModel.prototype.getFormattedLabel = function (name, status) {\r\n var regionModel = this.getRegionModel(name);\r\n var formatter = status === 'normal'\r\n ? regionModel.get(['label', 'formatter'])\r\n : regionModel.get(['emphasis', 'label', 'formatter']);\r\n var params = {\r\n name: name\r\n };\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n return formatter.replace('{a}', name != null ? name : '');\r\n }\r\n };\r\n GeoModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GeoModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GeoModel.prototype.select = function (name) {\r\n var option = this.option;\r\n var selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n if (selectedMode !== 'multiple') {\r\n option.selectedMap = null;\r\n }\r\n var selectedMap = option.selectedMap || (option.selectedMap = {});\r\n selectedMap[name] = true;\r\n };\r\n GeoModel.prototype.unSelect = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n if (selectedMap) {\r\n selectedMap[name] = false;\r\n }\r\n };\r\n GeoModel.prototype.toggleSelected = function (name) {\r\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\r\n };\r\n GeoModel.prototype.isSelected = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n return !!(selectedMap && selectedMap[name]);\r\n };\r\n GeoModel.prototype._initSelectedMapFromData = function () {\r\n };\r\n GeoModel.type = 'geo';\r\n GeoModel.layoutMode = 'box';\r\n GeoModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n show: true,\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: null,\r\n silent: false,\r\n map: '',\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n color: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n regions: []\r\n };\r\n return GeoModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(GeoModel);\n\nfunction makeAction(method, actionInfo) {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n var selected = {};\r\n ecModel.eachComponent({ mainType: 'geo', query: payload }, function (geoModel) {\r\n geoModel[method](payload.name);\r\n var geo = geoModel.coordinateSystem;\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n });\r\n });\r\n return {\r\n selected: selected,\r\n name: payload.name\r\n };\r\n });\r\n}\r\nmakeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n});\r\nmakeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n});\r\nmakeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n});\n\nvar PROXIMATE_ONE_DAY = 86400000;\r\nvar Calendar = (function () {\r\n function Calendar(calendarModel, ecModel, api) {\r\n this.type = 'calendar';\r\n this.dimensions = Calendar.dimensions;\r\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\r\n this._model = calendarModel;\r\n }\r\n Calendar.getDimensionsInfo = function () {\r\n return [{\r\n name: 'time', type: 'time'\r\n }, 'value'];\r\n };\r\n Calendar.prototype.getRangeInfo = function () {\r\n return this._rangeInfo;\r\n };\r\n Calendar.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Calendar.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Calendar.prototype.getCellWidth = function () {\r\n return this._sw;\r\n };\r\n Calendar.prototype.getCellHeight = function () {\r\n return this._sh;\r\n };\r\n Calendar.prototype.getOrient = function () {\r\n return this._orient;\r\n };\r\n Calendar.prototype.getFirstDayOfWeek = function () {\r\n return this._firstDayOfWeek;\r\n };\r\n Calendar.prototype.getDateInfo = function (date) {\r\n date = parseDate(date);\r\n var y = date.getFullYear();\r\n var m = date.getMonth() + 1;\r\n var mStr = m < 10 ? '0' + m : '' + m;\r\n var d = date.getDate();\r\n var dStr = d < 10 ? '0' + d : '' + d;\r\n var day = date.getDay();\r\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\r\n return {\r\n y: y + '',\r\n m: mStr,\r\n d: dStr,\r\n day: day,\r\n time: date.getTime(),\r\n formatedDate: y + '-' + mStr + '-' + dStr,\r\n date: date\r\n };\r\n };\r\n Calendar.prototype.getNextNDay = function (date, n) {\r\n n = n || 0;\r\n if (n === 0) {\r\n return this.getDateInfo(date);\r\n }\r\n date = new Date(this.getDateInfo(date).time);\r\n date.setDate(date.getDate() + n);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.prototype.update = function (ecModel, api) {\r\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\r\n this._orient = this._model.get('orient');\r\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\r\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\r\n var weeks = this._rangeInfo.weeks || 1;\r\n var whNames = ['width', 'height'];\r\n var cellSize = this._model.getCellSize().slice();\r\n var layoutParams = this._model.getBoxLayoutParams();\r\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\r\n each([0, 1], function (idx) {\r\n if (cellSizeSpecified(cellSize, idx)) {\r\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\r\n }\r\n });\r\n var whGlobal = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);\r\n each([0, 1], function (idx) {\r\n if (!cellSizeSpecified(cellSize, idx)) {\r\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\r\n }\r\n });\r\n function cellSizeSpecified(cellSize, idx) {\r\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\r\n }\r\n this._sw = cellSize[0];\r\n this._sh = cellSize[1];\r\n };\r\n Calendar.prototype.dataToPoint = function (data, clamp) {\r\n isArray(data) && (data = data[0]);\r\n clamp == null && (clamp = true);\r\n var dayInfo = this.getDateInfo(data);\r\n var range = this._rangeInfo;\r\n var date = dayInfo.formatedDate;\r\n if (clamp && !(dayInfo.time >= range.start.time\r\n && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\r\n return [NaN, NaN];\r\n }\r\n var week = dayInfo.day;\r\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\r\n if (this._orient === 'vertical') {\r\n return [\r\n this._rect.x + week * this._sw + this._sw / 2,\r\n this._rect.y + nthWeek * this._sh + this._sh / 2\r\n ];\r\n }\r\n return [\r\n this._rect.x + nthWeek * this._sw + this._sw / 2,\r\n this._rect.y + week * this._sh + this._sh / 2\r\n ];\r\n };\r\n Calendar.prototype.pointToData = function (point) {\r\n var date = this.pointToDate(point);\r\n return date && date.time;\r\n };\r\n Calendar.prototype.dataToRect = function (data, clamp) {\r\n var point = this.dataToPoint(data, clamp);\r\n return {\r\n contentShape: {\r\n x: point[0] - (this._sw - this._lineWidth) / 2,\r\n y: point[1] - (this._sh - this._lineWidth) / 2,\r\n width: this._sw - this._lineWidth,\r\n height: this._sh - this._lineWidth\r\n },\r\n center: point,\r\n tl: [\r\n point[0] - this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n tr: [\r\n point[0] + this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n br: [\r\n point[0] + this._sw / 2,\r\n point[1] + this._sh / 2\r\n ],\r\n bl: [\r\n point[0] - this._sw / 2,\r\n point[1] + this._sh / 2\r\n ]\r\n };\r\n };\r\n Calendar.prototype.pointToDate = function (point) {\r\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\r\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\r\n var range = this._rangeInfo.range;\r\n if (this._orient === 'vertical') {\r\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\r\n }\r\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\r\n };\r\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n Calendar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Calendar.prototype._initRangeOption = function () {\r\n var range = this._model.get('range');\r\n var normalizedRange;\r\n if (isArray(range) && range.length === 1) {\r\n range = range[0];\r\n }\r\n if (!isArray(range)) {\r\n var rangeStr = range.toString();\r\n if (/^\\d{4}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n var start = this.getDateInfo(rangeStr);\r\n var firstDay = start.date;\r\n firstDay.setMonth(firstDay.getMonth() + 1);\r\n var end = this.getNextNDay(firstDay, -1);\r\n normalizedRange = [start.formatedDate, end.formatedDate];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr, rangeStr];\r\n }\r\n }\r\n else {\r\n normalizedRange = range;\r\n }\r\n if (!normalizedRange) {\r\n if (__DEV__) {\r\n logError('Invalid date range.');\r\n }\r\n return range;\r\n }\r\n var tmp = this._getRangeInfo(normalizedRange);\r\n if (tmp.start.time > tmp.end.time) {\r\n normalizedRange.reverse();\r\n }\r\n return normalizedRange;\r\n };\r\n Calendar.prototype._getRangeInfo = function (range) {\r\n var parsedRange = [\r\n this.getDateInfo(range[0]),\r\n this.getDateInfo(range[1])\r\n ];\r\n var reversed;\r\n if (parsedRange[0].time > parsedRange[1].time) {\r\n reversed = true;\r\n parsedRange.reverse();\r\n }\r\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY)\r\n - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\r\n var date = new Date(parsedRange[0].time);\r\n var startDateNum = date.getDate();\r\n var endDateNum = parsedRange[1].date.getDate();\r\n date.setDate(startDateNum + allDay - 1);\r\n var dateNum = date.getDate();\r\n if (dateNum !== endDateNum) {\r\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\r\n while ((dateNum = date.getDate()) !== endDateNum\r\n && (date.getTime() - parsedRange[1].time) * sign > 0) {\r\n allDay -= sign;\r\n date.setDate(dateNum - sign);\r\n }\r\n }\r\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\r\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\r\n reversed && parsedRange.reverse();\r\n return {\r\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\r\n start: parsedRange[0],\r\n end: parsedRange[1],\r\n allDay: allDay,\r\n weeks: weeks,\r\n nthWeek: nthWeek,\r\n fweek: parsedRange[0].day,\r\n lweek: parsedRange[1].day\r\n };\r\n };\r\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\r\n var rangeInfo = this._getRangeInfo(range);\r\n if (nthWeek > rangeInfo.weeks\r\n || (nthWeek === 0 && day < rangeInfo.fweek)\r\n || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)) {\r\n return null;\r\n }\r\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\r\n var date = new Date(rangeInfo.start.time);\r\n date.setDate(+rangeInfo.start.d + nthDay);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.create = function (ecModel, api) {\r\n var calendarList = [];\r\n ecModel.eachComponent('calendar', function (calendarModel) {\r\n var calendar = new Calendar(calendarModel, ecModel, api);\r\n calendarList.push(calendar);\r\n calendarModel.coordinateSystem = calendar;\r\n });\r\n ecModel.eachSeries(function (calendarSeries) {\r\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\r\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\r\n }\r\n });\r\n return calendarList;\r\n };\r\n Calendar.dimensions = ['time', 'value'];\r\n return Calendar;\r\n}());\r\nfunction getCoordSys$4(finder) {\r\n var calendarModel = finder.calendarModel;\r\n var seriesModel = finder.seriesModel;\r\n var coordSys = calendarModel\r\n ? calendarModel.coordinateSystem\r\n : seriesModel\r\n ? seriesModel.coordinateSystem\r\n : null;\r\n return coordSys;\r\n}\r\nCoordinateSystemManager.register('calendar', Calendar);\n\nvar CalendarModel = (function (_super) {\r\n __extends(CalendarModel, _super);\r\n function CalendarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarModel.type;\r\n return _this;\r\n }\r\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\r\n };\r\n CalendarModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(this.option, option);\r\n };\r\n CalendarModel.prototype.getCellSize = function () {\r\n return this.option.cellSize;\r\n };\r\n CalendarModel.type = 'calendar';\r\n CalendarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n left: 80,\r\n top: 60,\r\n cellSize: 20,\r\n orient: 'horizontal',\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: '#000',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n },\r\n dayLabel: {\r\n show: true,\r\n firstDay: 0,\r\n position: 'start',\r\n margin: '50%',\r\n nameMap: 'en',\r\n color: '#000'\r\n },\r\n monthLabel: {\r\n show: true,\r\n position: 'start',\r\n margin: 5,\r\n align: 'center',\r\n nameMap: 'en',\r\n formatter: null,\r\n color: '#000'\r\n },\r\n yearLabel: {\r\n show: true,\r\n position: null,\r\n margin: 30,\r\n formatter: null,\r\n color: '#ccc',\r\n fontFamily: 'sans-serif',\r\n fontWeight: 'bolder',\r\n fontSize: 20\r\n }\r\n };\r\n return CalendarModel;\r\n}(ComponentModel));\r\nfunction mergeAndNormalizeLayoutParams(target, raw) {\r\n var cellSize = target.cellSize;\r\n var cellSizeArr;\r\n if (!isArray(cellSize)) {\r\n cellSizeArr = target.cellSize = [cellSize, cellSize];\r\n }\r\n else {\r\n cellSizeArr = cellSize;\r\n }\r\n if (cellSizeArr.length === 1) {\r\n cellSizeArr[1] = cellSizeArr[0];\r\n }\r\n var ignoreSize = map([0, 1], function (hvIdx) {\r\n if (sizeCalculable(raw, hvIdx)) {\r\n cellSizeArr[hvIdx] = 'auto';\r\n }\r\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\r\n });\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: ignoreSize\r\n });\r\n}\r\nComponentModel.registerClass(CalendarModel);\n\nvar MONTH_TEXT = {\r\n EN: [\r\n 'Jan', 'Feb', 'Mar',\r\n 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep',\r\n 'Oct', 'Nov', 'Dec'\r\n ],\r\n CN: [\r\n '一月', '二月', '三月',\r\n '四月', '五月', '六月',\r\n '七月', '八月', '九月',\r\n '十月', '十一月', '十二月'\r\n ]\r\n};\r\nvar WEEK_TEXT = {\r\n EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n CN: ['日', '一', '二', '三', '四', '五', '六']\r\n};\r\nvar CalendarView = (function (_super) {\r\n __extends(CalendarView, _super);\r\n function CalendarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarView.type;\r\n return _this;\r\n }\r\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n var coordSys = calendarModel.coordinateSystem;\r\n var rangeData = coordSys.getRangeInfo();\r\n var orient = coordSys.getOrient();\r\n this._renderDayRect(calendarModel, rangeData, group);\r\n this._renderLines(calendarModel, rangeData, orient, group);\r\n this._renderYearText(calendarModel, rangeData, orient, group);\r\n this._renderMonthText(calendarModel, orient, group);\r\n this._renderWeekText(calendarModel, rangeData, orient, group);\r\n };\r\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\r\n var sw = coordSys.getCellWidth();\r\n var sh = coordSys.getCellHeight();\r\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\r\n var point = coordSys.dataToRect([i], false).tl;\r\n var rect = new Rect({\r\n shape: {\r\n x: point[0],\r\n y: point[1],\r\n width: sw,\r\n height: sh\r\n },\r\n cursor: 'default',\r\n style: itemRectStyleModel\r\n });\r\n group.add(rect);\r\n }\r\n };\r\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\r\n var self = this;\r\n var coordSys = calendarModel.coordinateSystem;\r\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\r\n var show = calendarModel.get(['splitLine', 'show']);\r\n var lineWidth = lineStyleModel.lineWidth;\r\n this._tlpoints = [];\r\n this._blpoints = [];\r\n this._firstDayOfMonth = [];\r\n this._firstDayPoints = [];\r\n var firstDay = rangeData.start;\r\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\r\n addPoints(firstDay.formatedDate);\r\n if (i === 0) {\r\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\r\n }\r\n var date = firstDay.date;\r\n date.setMonth(date.getMonth() + 1);\r\n firstDay = coordSys.getDateInfo(date);\r\n }\r\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\r\n function addPoints(date) {\r\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\r\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\r\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\r\n self._tlpoints.push(points[0]);\r\n self._blpoints.push(points[points.length - 1]);\r\n show && self._drawSplitline(points, lineStyleModel, group);\r\n }\r\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\r\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\r\n };\r\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\r\n var rs = [points[0].slice(), points[points.length - 1].slice()];\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\r\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\r\n return rs;\r\n };\r\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\r\n var poyline = new Polyline({\r\n z2: 20,\r\n shape: {\r\n points: points\r\n },\r\n style: lineStyle\r\n });\r\n group.add(poyline);\r\n };\r\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var parsedDate = coordSys.getDateInfo(date);\r\n var points = [];\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\r\n var point = coordSys.dataToRect([tmpD.time], false);\r\n points[2 * tmpD.day] = point.tl;\r\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\r\n }\r\n return points;\r\n };\r\n CalendarView.prototype._formatterLabel = function (formatter, params) {\r\n if (typeof formatter === 'string' && formatter) {\r\n return formatTplSimple(formatter, params);\r\n }\r\n if (typeof formatter === 'function') {\r\n return formatter(params);\r\n }\r\n return params.nameMap;\r\n };\r\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\r\n var x = point[0];\r\n var y = point[1];\r\n var aligns = ['center', 'bottom'];\r\n if (position === 'bottom') {\r\n y += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else if (position === 'left') {\r\n x -= margin;\r\n }\r\n else if (position === 'right') {\r\n x += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else {\r\n y -= margin;\r\n }\r\n var rotate = 0;\r\n if (position === 'left' || position === 'right') {\r\n rotate = Math.PI / 2;\r\n }\r\n return {\r\n rotation: rotate,\r\n x: x,\r\n y: y,\r\n style: {\r\n align: aligns[0],\r\n verticalAlign: aligns[1]\r\n }\r\n };\r\n };\r\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\r\n var yearLabel = calendarModel.getModel('yearLabel');\r\n if (!yearLabel.get('show')) {\r\n return;\r\n }\r\n var margin = yearLabel.get('margin');\r\n var pos = yearLabel.get('position');\r\n if (!pos) {\r\n pos = orient !== 'horizontal' ? 'top' : 'left';\r\n }\r\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\r\n var xc = (points[0][0] + points[1][0]) / 2;\r\n var yc = (points[0][1] + points[1][1]) / 2;\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n var posPoints = {\r\n top: [xc, points[idx][1]],\r\n bottom: [xc, points[1 - idx][1]],\r\n left: [points[1 - idx][0], yc],\r\n right: [points[idx][0], yc]\r\n };\r\n var name = rangeData.start.y;\r\n if (+rangeData.end.y > +rangeData.start.y) {\r\n name = name + '-' + rangeData.end.y;\r\n }\r\n var formatter = yearLabel.get('formatter');\r\n var params = {\r\n start: rangeData.start.y,\r\n end: rangeData.end.y,\r\n nameMap: name\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var yearText = new ZRText({\r\n z2: 30,\r\n style: createTextStyle(yearLabel, {\r\n text: content\r\n })\r\n });\r\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\r\n group.add(yearText);\r\n };\r\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\r\n var align = 'left';\r\n var vAlign = 'top';\r\n var x = point[0];\r\n var y = point[1];\r\n if (orient === 'horizontal') {\r\n y = y + margin;\r\n if (isCenter) {\r\n align = 'center';\r\n }\r\n if (position === 'start') {\r\n vAlign = 'bottom';\r\n }\r\n }\r\n else {\r\n x = x + margin;\r\n if (isCenter) {\r\n vAlign = 'middle';\r\n }\r\n if (position === 'start') {\r\n align = 'right';\r\n }\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderMonthText = function (calendarModel, orient, group) {\r\n var monthLabel = calendarModel.getModel('monthLabel');\r\n if (!monthLabel.get('show')) {\r\n return;\r\n }\r\n var nameMap = monthLabel.get('nameMap');\r\n var margin = monthLabel.get('margin');\r\n var pos = monthLabel.get('position');\r\n var align = monthLabel.get('align');\r\n var termPoints = [this._tlpoints, this._blpoints];\r\n if (isString(nameMap)) {\r\n nameMap = MONTH_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var idx = pos === 'start' ? 0 : 1;\r\n var axis = orient === 'horizontal' ? 0 : 1;\r\n margin = pos === 'start' ? -margin : margin;\r\n var isCenter = (align === 'center');\r\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\r\n var tmp = termPoints[idx][i].slice();\r\n var firstDay = this._firstDayOfMonth[i];\r\n if (isCenter) {\r\n var firstDayPoints = this._firstDayPoints[i];\r\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\r\n }\r\n var formatter = monthLabel.get('formatter');\r\n var name_1 = nameMap[+firstDay.m - 1];\r\n var params = {\r\n yyyy: firstDay.y,\r\n yy: (firstDay.y + '').slice(2),\r\n MM: firstDay.m,\r\n M: +firstDay.m,\r\n nameMap: name_1\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var monthText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(monthLabel, { text: content }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\r\n });\r\n group.add(monthText);\r\n }\r\n };\r\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\r\n var align = 'center';\r\n var vAlign = 'middle';\r\n var x = point[0];\r\n var y = point[1];\r\n var isStart = position === 'start';\r\n if (orient === 'horizontal') {\r\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\r\n align = isStart ? 'right' : 'left';\r\n }\r\n else {\r\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\r\n vAlign = isStart ? 'bottom' : 'top';\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderWeekText = function (calendarModel, rangeData, orient, group) {\r\n var dayLabel = calendarModel.getModel('dayLabel');\r\n if (!dayLabel.get('show')) {\r\n return;\r\n }\r\n var coordSys = calendarModel.coordinateSystem;\r\n var pos = dayLabel.get('position');\r\n var nameMap = dayLabel.get('nameMap');\r\n var margin = dayLabel.get('margin');\r\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\r\n if (isString(nameMap)) {\r\n nameMap = WEEK_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var start = coordSys.getNextNDay(rangeData.end.time, (7 - rangeData.lweek)).time;\r\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\r\n margin = parsePercent$2(margin, cellSize[orient === 'horizontal' ? 0 : 1]);\r\n if (pos === 'start') {\r\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\r\n margin = -margin;\r\n }\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(start, i);\r\n var point = coordSys.dataToRect([tmpD.time], false).center;\r\n var day = i;\r\n day = Math.abs((i + firstDayOfWeek) % 7);\r\n var weekText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(dayLabel, { text: nameMap[day] }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\r\n });\r\n group.add(weekText);\r\n }\r\n };\r\n CalendarView.type = 'calendar';\r\n return CalendarView;\r\n}(ComponentView));\r\nComponentView.registerClass(CalendarView);\n\nvar inner$g = makeInner();\r\nvar _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n};\r\nregisterPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n});\r\nvar GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(GraphicComponentModel);\r\nvar GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$g(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$g(el);\r\n var parentElInner = inner$g(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$g(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n}(ComponentView));\r\nComponentView.registerClass(GraphicComponentView);\r\nfunction createEl$1(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$g(el).__ecGraphicId = id;\r\n}\r\nfunction removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$g(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n}\r\nfunction getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n}\r\nfunction isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n}\r\nfunction setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n}\r\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n}\r\nfunction setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n}\r\nfunction setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n}\n\nvar ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n}());\r\nvar features = {};\r\nfunction registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n}\r\nfunction getFeature(name) {\r\n return features[name];\r\n}\n\nvar ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(ToolboxModel);\n\nfunction layout$3(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n}\r\nfunction makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n}\n\nvar ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$3(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n}(ComponentView));\r\nComponentView.registerClass(ToolboxView);\r\nfunction isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n}\n\nvar SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n}(ToolboxFeature));\r\nSaveAsImage.prototype.unusable = !env.canvasSupported;\r\nregisterFeature('saveAsImage', SaveAsImage);\n\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\nvar radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n];\r\nvar MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n}(ToolboxFeature));\r\nvar seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n};\r\nregisterAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n});\r\nregisterFeature('magicType', MagicType);\n\nvar BLOCK_SPLITER = new Array(60).join('-');\r\nvar ITEM_SPLITER = '\\t';\r\nfunction groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n}\r\nfunction assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\nfunction assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\nfunction getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n}\r\nfunction trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n}\r\nfunction isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n}\r\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\nfunction parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n}\r\nfunction parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n}\r\nfunction parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n}\r\nvar DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n}(ToolboxFeature));\r\nfunction tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n}\r\nregisterFeature('dataView', DataView);\r\nregisterAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n});\n\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\nvar INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n];\r\nvar BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n}());\r\nfunction formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n}\r\nfunction parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n}\r\nvar targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n};\r\nvar targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n];\r\nvar panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n};\r\nvar coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n};\r\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n}\r\nvar diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n};\r\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n}\r\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n}\r\nfunction getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n}\n\nvar each$9 = each;\r\nvar inner$h = makeInner();\r\nfunction push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$9(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n}\r\nfunction pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$9(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n}\r\nfunction clear$1(ecModel) {\r\n inner$h(ecModel).snapshots = null;\r\n}\r\nfunction count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n}\r\nfunction getStoreSnapshots(ecModel) {\r\n var store = inner$h(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n}\n\nComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n});\n\nvar DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n];\r\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\nfunction isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n}\r\nfunction getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n}\r\nfunction findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n}\r\nfunction collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n}\n\nvar DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n}());\r\nvar DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n}(ComponentModel));\r\nfunction retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n}\n\nvar DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n}(ComponentView));\r\nComponentView.registerClass(DataZoomView);\n\nvar SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(SelectDataZoomModel);\n\nvar SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n}(DataZoomView));\r\nComponentView.registerClass(SelectDataZoomView);\n\nvar each$a = each;\r\nvar asc$1 = asc;\r\nvar AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$a(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$a(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$a(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$a(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$a(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n}());\r\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$a(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n}\n\nregisterProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n});\n\nregisterAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n});\n\nvar each$b = each;\r\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\nvar DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers$1[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$b(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n}(ToolboxFeature));\r\nvar handlers$1 = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n};\r\nfunction makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n}\r\nfunction updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n}\r\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n}\r\nregisterFeature('dataZoom', DataZoomFeature);\r\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$b(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$b(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n});\n\nvar RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n}(ToolboxFeature));\r\nregisterFeature('restore', RestoreOption);\r\nregisterAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n});\n\nvar TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TooltipModel);\n\nfunction shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n}\n\nvar vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\nvar gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\nfunction mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n}\r\nfunction assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n}\r\nfunction assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n}\r\nfunction assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n}\r\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n}\r\nfunction makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\r\nvar TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n}());\n\nvar TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n}());\r\nfunction mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n}\r\nfunction calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n}\r\nfunction makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\n\nvar bind$2 = bind;\r\nvar each$c = each;\r\nvar parsePercent$3 = parsePercent$2;\r\nvar proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n});\r\nvar TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$c(dataByCoordSys, function (itemCoordSys) {\r\n each$c(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$c(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$c(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$c(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n}(ComponentView));\r\nfunction buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n}\r\nfunction makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n}\r\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n}\r\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n}\r\nfunction calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n}\r\nfunction isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n}\r\nComponentView.registerClass(TooltipView);\n\nregisterAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n}, function () { });\r\nregisterAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n}, function () { });\n\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\r\nfunction brushPreprocessor(option, isNew) {\r\n var brushComponents = normalizeToArray(option ? option.brush : []);\r\n if (!brushComponents.length) {\r\n return;\r\n }\r\n var brushComponentSpecifiedBtns = [];\r\n each(brushComponents, function (brushOpt) {\r\n var tbs = brushOpt.hasOwnProperty('toolbox')\r\n ? brushOpt.toolbox : [];\r\n if (tbs instanceof Array) {\r\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\r\n }\r\n });\r\n var toolbox = option && option.toolbox;\r\n if (isArray(toolbox)) {\r\n toolbox = toolbox[0];\r\n }\r\n if (!toolbox) {\r\n toolbox = { feature: {} };\r\n option.toolbox = [toolbox];\r\n }\r\n var toolboxFeature = (toolbox.feature || (toolbox.feature = {}));\r\n var toolboxBrush = (toolboxFeature.brush || (toolboxFeature.brush = {}));\r\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\r\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\r\n removeDuplicate(brushTypes);\r\n if (isNew && !brushTypes.length) {\r\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\r\n }\r\n}\r\nfunction removeDuplicate(arr) {\r\n var map = {};\r\n each(arr, function (val) {\r\n map[val] = 1;\r\n });\r\n arr.length = 0;\r\n each(map, function (flag, val) {\r\n arr.push(val);\r\n });\r\n}\n\nvar each$d = each;\r\nfunction hasKeys(obj) {\r\n if (obj) {\r\n for (var name_1 in obj) {\r\n if (obj.hasOwnProperty(name_1)) {\r\n return true;\r\n }\r\n }\r\n }\r\n}\r\nfunction createVisualMappings(option, stateList, supplementVisualOption) {\r\n var visualMappings = {};\r\n each$d(stateList, function (state) {\r\n var mappings = visualMappings[state] = createMappings();\r\n each$d(option[state], function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var mappingOption = {\r\n type: visualType,\r\n visual: visualData\r\n };\r\n supplementVisualOption && supplementVisualOption(mappingOption, state);\r\n mappings[visualType] = new VisualMapping(mappingOption);\r\n if (visualType === 'opacity') {\r\n mappingOption = clone(mappingOption);\r\n mappingOption.type = 'colorAlpha';\r\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\r\n }\r\n });\r\n });\r\n return visualMappings;\r\n function createMappings() {\r\n var Creater = function () { };\r\n Creater.prototype.__hidden = Creater.prototype;\r\n var obj = new Creater();\r\n return obj;\r\n }\r\n}\r\nfunction replaceVisualOption(thisOption, newOption, keys) {\r\n var has;\r\n each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n has = true;\r\n }\r\n });\r\n has && each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n thisOption[key] = clone(newOption[key]);\r\n }\r\n else {\r\n delete thisOption[key];\r\n }\r\n });\r\n}\r\nfunction applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n var dataIndex;\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n if (dimension == null) {\r\n data.each(eachItem);\r\n }\r\n else {\r\n data.each([dimension], eachItem);\r\n }\r\n function eachItem(valueOrIndex, index) {\r\n dataIndex = dimension == null\r\n ? valueOrIndex\r\n : index;\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n return;\r\n }\r\n var valueState = getValueState.call(scope, valueOrIndex);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\r\n }\r\n }\r\n}\r\nfunction incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n return {\r\n progress: function progress(params, data) {\r\n var dimName;\r\n if (dim != null) {\r\n dimName = data.getDimension(dim);\r\n }\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n continue;\r\n }\r\n var value = dim != null\r\n ? data.get(dimName, dataIndex)\r\n : dataIndex;\r\n var valueState = getValueState(value);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n };\r\n}\n\nfunction makeBrushCommonSelectorForSeries(area) {\r\n var brushType = area.brushType;\r\n var selectors = {\r\n point: function (itemLayout) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect: function (itemLayout) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n}\r\nvar selector = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout\r\n && area.boundingRect.contain(itemLayout[0], itemLayout[1])\r\n && contain$2(area.range, itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n var points = area.range;\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n var x = itemLayout.x;\r\n var y = itemLayout.y;\r\n var width = itemLayout.width;\r\n var height = itemLayout.height;\r\n var p = points[0];\r\n if (contain$2(points, x, y)\r\n || contain$2(points, x + width, y)\r\n || contain$2(points, x, y + height)\r\n || contain$2(points, x + width, y + height)\r\n || BoundingRect.create(itemLayout).contain(p[0], p[1])\r\n || linePolygonIntersect(x, y, x + width, y, points)\r\n || linePolygonIntersect(x, y, x, y + height, points)\r\n || linePolygonIntersect(x + width, y, x + width, y + height, points)\r\n || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\r\n return true;\r\n }\r\n }\r\n }\r\n};\r\nfunction getLineSelectors(xyIndex) {\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var layoutRange = [\r\n itemLayout[xy[xyIndex]],\r\n itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]\r\n ];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range)\r\n || inLineRange(layoutRange[1], range)\r\n || inLineRange(range[0], layoutRange)\r\n || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n}\r\nfunction inLineRange(p, range) {\r\n return range[0] <= p && p <= range[1];\r\n}\n\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\r\nvar DISPATCH_METHOD = '__ecBrushSelect';\r\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\r\nvar PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH;\r\nfunction layoutCovers(ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\r\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\r\n });\r\n}\r\nregisterVisual(PRIORITY_BRUSH, function (ecModel, api, payload) {\r\n var brushSelected = [];\r\n var throttleType;\r\n var throttleDelay;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { brushType: false });\r\n });\r\n layoutCovers(ecModel);\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel, brushIndex) {\r\n var thisBrushSelected = {\r\n brushId: brushModel.id,\r\n brushIndex: brushIndex,\r\n brushName: brushModel.name,\r\n areas: clone(brushModel.areas),\r\n selected: []\r\n };\r\n brushSelected.push(thisBrushSelected);\r\n var brushOption = brushModel.option;\r\n var brushLink = brushOption.brushLink;\r\n var linkedSeriesMap = [];\r\n var selectedDataIndexForLink = [];\r\n var rangeInfoBySeries = [];\r\n var hasBrushExists = false;\r\n if (!brushIndex) {\r\n throttleType = brushOption.throttleType;\r\n throttleDelay = brushOption.throttleDelay;\r\n }\r\n var areas = map(brushModel.areas, function (area) {\r\n var builder = boundingRectBuilders[area.brushType];\r\n var selectableArea = defaults({ boundingRect: builder ? builder(area) : void 0 }, area);\r\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\r\n return selectableArea;\r\n });\r\n var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\r\n mappingOption.mappingMethod = 'fixed';\r\n });\r\n isArray(brushLink) && each(brushLink, function (seriesIndex) {\r\n linkedSeriesMap[seriesIndex] = 1;\r\n });\r\n function linkOthers(seriesIndex) {\r\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\r\n }\r\n function brushed(rangeInfoList) {\r\n return !!rangeInfoList.length;\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\r\n seriesModel.subType === 'parallel'\r\n ? stepAParallel(seriesModel, seriesIndex)\r\n : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\r\n });\r\n function stepAParallel(seriesModel, seriesIndex) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\r\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\r\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\r\n });\r\n }\r\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\r\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\r\n return;\r\n }\r\n each(areas, function (area) {\r\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\r\n rangeInfoList.push(area);\r\n }\r\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\r\n });\r\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\r\n var data_1 = seriesModel.getData();\r\n data_1.each(function (dataIndex) {\r\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\r\n selectedDataIndexForLink[dataIndex] = 1;\r\n }\r\n });\r\n }\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var seriesBrushSelected = {\r\n seriesId: seriesModel.id,\r\n seriesIndex: seriesIndex,\r\n seriesName: seriesModel.name,\r\n dataIndex: []\r\n };\r\n thisBrushSelected.selected.push(seriesBrushSelected);\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\r\n var data = seriesModel.getData();\r\n var getValueState = linkOthers(seriesIndex)\r\n ? function (dataIndex) {\r\n return selectedDataIndexForLink[dataIndex]\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n }\r\n : function (dataIndex) {\r\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex)\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n };\r\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList))\r\n && applyVisual(STATE_LIST, visualMappings, data, getValueState);\r\n });\r\n });\r\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\r\n});\r\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\r\n if (!payload) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n if (zr[DISPATCH_FLAG]) {\r\n return;\r\n }\r\n if (!zr[DISPATCH_METHOD]) {\r\n zr[DISPATCH_METHOD] = doDispatch;\r\n }\r\n var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\r\n fn(api, brushSelected);\r\n}\r\nfunction doDispatch(api, brushSelected) {\r\n if (!api.isDisposed()) {\r\n var zr = api.getZr();\r\n zr[DISPATCH_FLAG] = true;\r\n api.dispatchAction({\r\n type: 'brushSelect',\r\n batch: brushSelected\r\n });\r\n zr[DISPATCH_FLAG] = false;\r\n }\r\n}\r\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\r\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\r\n var area = rangeInfoList[i];\r\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\r\n return true;\r\n }\r\n }\r\n}\r\nfunction brushModelNotControll(brushModel, seriesIndex) {\r\n var seriesIndices = brushModel.option.seriesIndex;\r\n return seriesIndices != null\r\n && seriesIndices !== 'all'\r\n && (isArray(seriesIndices)\r\n ? indexOf(seriesIndices, seriesIndex) < 0\r\n : seriesIndex !== seriesIndices);\r\n}\r\nvar boundingRectBuilders = {\r\n rect: function (area) {\r\n return getBoundingRectFromMinMax(area.range);\r\n },\r\n polygon: function (area) {\r\n var minMax;\r\n var range = area.range;\r\n for (var i = 0, len = range.length; i < len; i++) {\r\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var rg = range[i];\r\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\r\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\r\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\r\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\r\n }\r\n return minMax && getBoundingRectFromMinMax(minMax);\r\n }\r\n};\r\nfunction getBoundingRectFromMinMax(minMax) {\r\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\r\n}\n\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\r\nvar BrushModel = (function (_super) {\r\n __extends(BrushModel, _super);\r\n function BrushModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushModel.type;\r\n _this.areas = [];\r\n _this.brushOption = {};\r\n return _this;\r\n }\r\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\r\n var inBrush = thisOption.inBrush = thisOption.inBrush || {};\r\n thisOption.outOfBrush = thisOption.outOfBrush || { color: DEFAULT_OUT_OF_BRUSH_COLOR };\r\n if (!inBrush.hasOwnProperty('liftZ')) {\r\n inBrush.liftZ = 5;\r\n }\r\n };\r\n BrushModel.prototype.setAreas = function (areas) {\r\n if (__DEV__) {\r\n assert(isArray(areas));\r\n each(areas, function (area) {\r\n assert(area.brushType, 'Illegal areas');\r\n });\r\n }\r\n if (!areas) {\r\n return;\r\n }\r\n this.areas = map(areas, function (area) {\r\n return generateBrushOption(this.option, area);\r\n }, this);\r\n };\r\n BrushModel.prototype.setBrushOption = function (brushOption) {\r\n this.brushOption = generateBrushOption(this.option, brushOption);\r\n this.brushType = this.brushOption.brushType;\r\n };\r\n BrushModel.type = 'brush';\r\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\r\n BrushModel.defaultOption = {\r\n seriesIndex: 'all',\r\n brushType: 'rect',\r\n brushMode: 'single',\r\n transformable: true,\r\n brushStyle: {\r\n borderWidth: 1,\r\n color: 'rgba(210,219,238,0.3)',\r\n borderColor: '#D2DBEE'\r\n },\r\n throttleType: 'fixRate',\r\n throttleDelay: 0,\r\n removeOnClick: true,\r\n z: 10000\r\n };\r\n return BrushModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(BrushModel);\r\nfunction generateBrushOption(option, brushOption) {\r\n return merge({\r\n brushType: option.brushType,\r\n brushMode: option.brushMode,\r\n transformable: option.transformable,\r\n brushStyle: new Model(option.brushStyle).getItemStyle(),\r\n removeOnClick: option.removeOnClick,\r\n z: option.z\r\n }, brushOption, true);\r\n}\n\nvar BrushView = (function (_super) {\r\n __extends(BrushView, _super);\r\n function BrushView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushView.type;\r\n return _this;\r\n }\r\n BrushView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n this.model;\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this))\r\n .mount();\r\n };\r\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\r\n this.model = brushModel;\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\r\n layoutCovers(ecModel);\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\r\n this.updateTransform(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\r\n (!payload || payload.$from !== brushModel.id) && this._brushController\r\n .setPanels(brushModel.brushTargetManager.makePanelOpts(api))\r\n .enableBrush(brushModel.brushOption)\r\n .updateCovers(brushModel.areas.slice());\r\n };\r\n BrushView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n BrushView.prototype._onBrush = function (eventParam) {\r\n var modelId = this.model.id;\r\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\r\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\r\n type: 'brush',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n eventParam.isEnd && this.api.dispatchAction({\r\n type: 'brushEnd',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n };\r\n BrushView.type = 'brush';\r\n return BrushView;\r\n}(ComponentView));\r\nComponentView.registerClass(BrushView);\n\nregisterAction({ type: 'brush', event: 'brush', update: 'updateVisual' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush', query: payload }, function (brushModel) {\r\n brushModel.setAreas(payload.areas);\r\n });\r\n});\r\nregisterAction({ type: 'brushSelect', event: 'brushSelected', update: 'none' }, function () { });\r\nregisterAction({ type: 'brushEnd', event: 'brushEnd', update: 'none' }, function () { });\n\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\r\nvar BrushFeature = (function (_super) {\r\n __extends(BrushFeature, _super);\r\n function BrushFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\r\n var brushType;\r\n var brushMode;\r\n var isBrushed;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n brushType = brushModel.brushType;\r\n brushMode = brushModel.brushOption.brushMode || 'single';\r\n isBrushed = isBrushed || !!brushModel.areas.length;\r\n });\r\n this._brushType = brushType;\r\n this._brushMode = brushMode;\r\n each(featureModel.get('type', true), function (type) {\r\n featureModel.setIconStatus(type, (type === 'keep'\r\n ? brushMode === 'multiple'\r\n : type === 'clear'\r\n ? isBrushed\r\n : type === brushType) ? 'emphasis' : 'normal');\r\n });\r\n };\r\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\r\n this.render(featureModel, ecModel, api);\r\n };\r\n BrushFeature.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon', true);\r\n var icons = {};\r\n each(model.get('type', true), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\r\n var brushType = this._brushType;\r\n var brushMode = this._brushMode;\r\n if (type === 'clear') {\r\n api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n intervals: []\r\n });\r\n api.dispatchAction({\r\n type: 'brush',\r\n command: 'clear',\r\n areas: []\r\n });\r\n }\r\n else {\r\n api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'brush',\r\n brushOption: {\r\n brushType: type === 'keep'\r\n ? brushType\r\n : (brushType === type ? false : type),\r\n brushMode: type === 'keep'\r\n ? (brushMode === 'multiple' ? 'single' : 'multiple')\r\n : brushMode\r\n }\r\n });\r\n }\r\n };\r\n BrushFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: ICON_TYPES.slice(),\r\n icon: {\r\n rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\r\n polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\r\n lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\r\n lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\r\n keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\r\n clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'brush', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return BrushFeature;\r\n}(ToolboxFeature));\r\nregisterFeature('brush', BrushFeature);\n\nregisterPreprocessor(brushPreprocessor);\n\nvar TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TitleModel);\r\nvar TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n}(ComponentView));\r\nComponentView.registerClass(TitleView);\n\nfunction timelinePreprocessor(option) {\r\n var timelineOpt = option && option.timeline;\r\n if (!isArray(timelineOpt)) {\r\n timelineOpt = timelineOpt ? [timelineOpt] : [];\r\n }\r\n each(timelineOpt, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n compatibleEC2(opt);\r\n });\r\n}\r\nfunction compatibleEC2(opt) {\r\n var type = opt.type;\r\n var ec2Types = { 'number': 'value', 'time': 'time' };\r\n if (ec2Types[type]) {\r\n opt.axisType = ec2Types[type];\r\n delete opt.type;\r\n }\r\n transferItem(opt);\r\n if (has(opt, 'controlPosition')) {\r\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\r\n if (!has(controlStyle, 'position')) {\r\n controlStyle.position = opt.controlPosition;\r\n }\r\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\r\n controlStyle.show = false;\r\n delete controlStyle.position;\r\n }\r\n delete opt.controlPosition;\r\n }\r\n each(opt.data || [], function (dataItem) {\r\n if (isObject(dataItem) && !isArray(dataItem)) {\r\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\r\n dataItem.value = dataItem.name;\r\n }\r\n transferItem(dataItem);\r\n }\r\n });\r\n}\r\nfunction transferItem(opt) {\r\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\r\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\r\n var label = opt.label || (opt.label || {});\r\n var labelNormal = label.normal || (label.normal = {});\r\n var excludeLabelAttr = { normal: 1, emphasis: 1 };\r\n each(label, function (value, name) {\r\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\r\n labelNormal[name] = value;\r\n }\r\n });\r\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\r\n label.emphasis = itemStyleEmphasis.label;\r\n delete itemStyleEmphasis.label;\r\n }\r\n}\r\nfunction has(obj, attr) {\r\n return obj.hasOwnProperty(attr);\r\n}\n\nComponentModel.registerSubTypeDefaulter('timeline', function () {\r\n return 'slider';\r\n});\n\nregisterAction({ type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.currentIndex != null) {\r\n timelineModel.setCurrentIndex(payload.currentIndex);\r\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {\r\n timelineModel.setPlayState(false);\r\n }\r\n }\r\n ecModel.resetOption('timeline', { replaceMerge: timelineModel.get('replaceMerge', true) });\r\n return defaults({\r\n currentIndex: timelineModel.option.currentIndex\r\n }, payload);\r\n});\r\nregisterAction({ type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.playState != null) {\r\n timelineModel.setPlayState(payload.playState);\r\n }\r\n});\n\nvar TimelineModel = (function (_super) {\r\n __extends(TimelineModel, _super);\r\n function TimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineModel.type;\r\n _this.layoutMode = 'box';\r\n return _this;\r\n }\r\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n var count = this._data.count();\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n }\r\n else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n this.option.currentIndex = currentIndex;\r\n };\r\n TimelineModel.prototype.getCurrentIndex = function () {\r\n return this.option.currentIndex;\r\n };\r\n TimelineModel.prototype.isIndexMax = function () {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n };\r\n TimelineModel.prototype.setPlayState = function (state) {\r\n this.option.autoPlay = !!state;\r\n };\r\n TimelineModel.prototype.getPlayState = function () {\r\n return !!this.option.autoPlay;\r\n };\r\n TimelineModel.prototype._initData = function () {\r\n var thisOption = this.option;\r\n var dataArr = thisOption.data || [];\r\n var axisType = thisOption.axisType;\r\n var names = this._names = [];\r\n var processedDataArr;\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n var value = convertOptionIdName(getDataItemValue(item), '');\r\n var newItem;\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n newItem.value = index;\r\n }\r\n else {\r\n newItem = index;\r\n }\r\n processedDataArr.push(newItem);\r\n names.push(value);\r\n });\r\n }\r\n else {\r\n processedDataArr = dataArr;\r\n }\r\n var dimType = ({\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n })[axisType] || 'number';\r\n var data = this._data = new List([{\r\n name: 'value', type: dimType\r\n }], this);\r\n data.initData(processedDataArr, names);\r\n };\r\n TimelineModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n TimelineModel.prototype.getCategories = function () {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n };\r\n TimelineModel.type = 'timeline';\r\n TimelineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n axisType: 'time',\r\n realtime: true,\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n controlPosition: 'left',\r\n autoPlay: false,\r\n rewind: false,\r\n loop: true,\r\n playInterval: 2000,\r\n currentIndex: 0,\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n data: []\r\n };\r\n return TimelineModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TimelineModel);\n\nvar SliderTimelineModel = (function (_super) {\r\n __extends(SliderTimelineModel, _super);\r\n function SliderTimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineModel.type;\r\n return _this;\r\n }\r\n SliderTimelineModel.type = 'timeline.slider';\r\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n orient: 'horizontal',\r\n inverse: false,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n symbol: 'circle',\r\n symbolSize: 12,\r\n lineStyle: {\r\n show: true,\r\n width: 2,\r\n color: '#DAE1F5'\r\n },\r\n label: {\r\n position: 'auto',\r\n show: true,\r\n interval: 'auto',\r\n rotate: 0,\r\n color: '#A4B1D7'\r\n },\r\n itemStyle: {\r\n color: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n checkpointStyle: {\r\n symbol: 'circle',\r\n symbolSize: 15,\r\n color: '#316bf3',\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0, 0, 0, 0.3)',\r\n animation: true,\r\n animationDuration: 300,\r\n animationEasing: 'quinticInOut'\r\n },\r\n controlStyle: {\r\n show: true,\r\n showPlayBtn: true,\r\n showPrevBtn: true,\r\n showNextBtn: true,\r\n itemSize: 24,\r\n itemGap: 12,\r\n position: 'left',\r\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\r\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\r\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\r\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\r\n prevBtnSize: 18,\r\n nextBtnSize: 18,\r\n color: '#A4B1D7',\r\n borderColor: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: '#6f778d'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n controlStyle: {\r\n color: '#316BF3',\r\n borderColor: '#316BF3',\r\n borderWidth: 2\r\n }\r\n },\r\n progress: {\r\n lineStyle: {\r\n color: '#316BF3'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n label: {\r\n color: '#6f778d'\r\n }\r\n },\r\n data: []\r\n });\r\n return SliderTimelineModel;\r\n}(TimelineModel));\r\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\r\nComponentModel.registerClass(SliderTimelineModel);\n\nvar TimelineView = (function (_super) {\r\n __extends(TimelineView, _super);\r\n function TimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineView.type;\r\n return _this;\r\n }\r\n TimelineView.type = 'timeline';\r\n return TimelineView;\r\n}(ComponentView));\n\nvar TimelineAxis = (function (_super) {\r\n __extends(TimelineAxis, _super);\r\n function TimelineAxis(dim, scale, coordExtent, axisType) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n return _this;\r\n }\r\n TimelineAxis.prototype.getLabelModel = function () {\r\n return this.model.getModel('label');\r\n };\r\n TimelineAxis.prototype.isHorizontal = function () {\r\n return this.model.get('orient') === 'horizontal';\r\n };\r\n return TimelineAxis;\r\n}(Axis));\n\nvar PI$9 = Math.PI;\r\nvar labelDataIndexStore = makeInner();\r\nvar SliderTimelineView = (function (_super) {\r\n __extends(SliderTimelineView, _super);\r\n function SliderTimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineView.type;\r\n return _this;\r\n }\r\n SliderTimelineView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n };\r\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\r\n this.model = timelineModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n this.group.removeAll();\r\n if (timelineModel.get('show', true)) {\r\n var layoutInfo_1 = this._layout(timelineModel, api);\r\n var mainGroup_1 = this._createGroup('_mainGroup');\r\n var labelGroup = this._createGroup('_labelGroup');\r\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\r\n timelineModel.formatTooltip = function (dataIndex) {\r\n var name = axis_1.scale.getLabel({ value: dataIndex });\r\n return createTooltipMarkup('nameValue', { noName: true, value: name });\r\n };\r\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\r\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\r\n }, this);\r\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\r\n this._position(layoutInfo_1, timelineModel);\r\n }\r\n this._doPlayStop();\r\n this._updateTicksStatus();\r\n };\r\n SliderTimelineView.prototype.remove = function () {\r\n this._clearTimer();\r\n this.group.removeAll();\r\n };\r\n SliderTimelineView.prototype.dispose = function () {\r\n this._clearTimer();\r\n };\r\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\r\n var labelPosOpt = timelineModel.get(['label', 'position']);\r\n var orient = timelineModel.get('orient');\r\n var viewRect = getViewRect$5(timelineModel, api);\r\n var parsedLabelPos;\r\n if (labelPosOpt == null || labelPosOpt === 'auto') {\r\n parsedLabelPos = orient === 'horizontal'\r\n ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')\r\n : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');\r\n }\r\n else if (isString(labelPosOpt)) {\r\n parsedLabelPos = {\r\n horizontal: { top: '-', bottom: '+' },\r\n vertical: { left: '-', right: '+' }\r\n }[orient][labelPosOpt];\r\n }\r\n else {\r\n parsedLabelPos = labelPosOpt;\r\n }\r\n var labelAlignMap = {\r\n horizontal: 'center',\r\n vertical: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'left' : 'right'\r\n };\r\n var labelBaselineMap = {\r\n horizontal: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'top' : 'bottom',\r\n vertical: 'middle'\r\n };\r\n var rotationMap = {\r\n horizontal: 0,\r\n vertical: PI$9 / 2\r\n };\r\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\r\n var controlModel = timelineModel.getModel('controlStyle');\r\n var showControl = controlModel.get('show', true);\r\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\r\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\r\n var sizePlusGap = controlSize + controlGap;\r\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\r\n labelRotation = labelRotation * PI$9 / 180;\r\n var playPosition;\r\n var prevBtnPosition;\r\n var nextBtnPosition;\r\n var controlPosition = controlModel.get('position', true);\r\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\r\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\r\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\r\n var xLeft = 0;\r\n var xRight = mainLength;\r\n if (controlPosition === 'left' || controlPosition === 'bottom') {\r\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n else {\r\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n var axisExtent = [xLeft, xRight];\r\n if (timelineModel.get('inverse')) {\r\n axisExtent.reverse();\r\n }\r\n return {\r\n viewRect: viewRect,\r\n mainLength: mainLength,\r\n orient: orient,\r\n rotation: rotationMap[orient],\r\n labelRotation: labelRotation,\r\n labelPosOpt: parsedLabelPos,\r\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\r\n labelBaseline: timelineModel.get(['label', 'verticalAlign'])\r\n || timelineModel.get(['label', 'baseline'])\r\n || labelBaselineMap[orient],\r\n playPosition: playPosition,\r\n prevBtnPosition: prevBtnPosition,\r\n nextBtnPosition: nextBtnPosition,\r\n axisExtent: axisExtent,\r\n controlSize: controlSize,\r\n controlGap: controlGap\r\n };\r\n };\r\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\r\n var mainGroup = this._mainGroup;\r\n var labelGroup = this._labelGroup;\r\n var viewRect = layoutInfo.viewRect;\r\n if (layoutInfo.orient === 'vertical') {\r\n var m = create$1();\r\n var rotateOriginX = viewRect.x;\r\n var rotateOriginY = viewRect.y + viewRect.height;\r\n translate(m, m, [-rotateOriginX, -rotateOriginY]);\r\n rotate(m, m, -PI$9 / 2);\r\n translate(m, m, [rotateOriginX, rotateOriginY]);\r\n viewRect = viewRect.clone();\r\n viewRect.applyTransform(m);\r\n }\r\n var viewBound = getBound(viewRect);\r\n var mainBound = getBound(mainGroup.getBoundingRect());\r\n var labelBound = getBound(labelGroup.getBoundingRect());\r\n var mainPosition = [mainGroup.x, mainGroup.y];\r\n var labelsPosition = [labelGroup.x, labelGroup.y];\r\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\r\n var labelPosOpt = layoutInfo.labelPosOpt;\r\n if (labelPosOpt == null || isString(labelPosOpt)) {\r\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\r\n }\r\n else {\r\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\r\n }\r\n mainGroup.setPosition(mainPosition);\r\n labelGroup.setPosition(labelsPosition);\r\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\r\n setOrigin(mainGroup);\r\n setOrigin(labelGroup);\r\n function setOrigin(targetGroup) {\r\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\r\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\r\n }\r\n function getBound(rect) {\r\n return [\r\n [rect.x, rect.x + rect.width],\r\n [rect.y, rect.y + rect.height]\r\n ];\r\n }\r\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\r\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\r\n }\r\n };\r\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\r\n var data = timelineModel.getData();\r\n var axisType = timelineModel.get('axisType');\r\n var scale = createScaleByModel$1(timelineModel, axisType);\r\n scale.getTicks = function () {\r\n return data.mapArray(['value'], function (value) {\r\n return { value: value };\r\n });\r\n };\r\n var dataExtent = data.getDataExtent('value');\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n scale.niceTicks();\r\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\r\n axis.model = timelineModel;\r\n return axis;\r\n };\r\n SliderTimelineView.prototype._createGroup = function (key) {\r\n var newGroup = this[key] = new Group();\r\n this.group.add(newGroup);\r\n return newGroup;\r\n };\r\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\r\n var axisExtent = axis.getExtent();\r\n if (!timelineModel.get(['lineStyle', 'show'])) {\r\n return;\r\n }\r\n var line = new Line({\r\n shape: {\r\n x1: axisExtent[0], y1: 0,\r\n x2: axisExtent[1], y2: 0\r\n },\r\n style: extend({ lineCap: 'round' }, timelineModel.getModel('lineStyle').getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(line);\r\n var progressLine = this._progressLine = new Line({\r\n shape: {\r\n x1: axisExtent[0],\r\n x2: this._currentPointer\r\n ? this._currentPointer.x : axisExtent[0],\r\n y1: 0, y2: 0\r\n },\r\n style: defaults({ lineCap: 'round', lineWidth: line.style.lineWidth }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(progressLine);\r\n };\r\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var data = timelineModel.getData();\r\n var ticks = axis.scale.getTicks();\r\n this._tickSymbols = [];\r\n each(ticks, function (tick) {\r\n var tickCoord = axis.dataToCoord(tick.value);\r\n var itemModel = data.getItemModel(tick.value);\r\n var itemStyleModel = itemModel.getModel('itemStyle');\r\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\r\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\r\n var symbolOpt = {\r\n x: tickCoord,\r\n y: 0,\r\n onclick: bind(_this._changeTimeline, _this, tick.value)\r\n };\r\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\r\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\r\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\r\n enableHoverEmphasis(el);\r\n var ecData = getECData(el);\r\n if (itemModel.get('tooltip')) {\r\n ecData.dataIndex = tick.value;\r\n ecData.dataModel = timelineModel;\r\n }\r\n else {\r\n ecData.dataIndex = ecData.dataModel = null;\r\n }\r\n _this._tickSymbols.push(el);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var labelModel = axis.getLabelModel();\r\n if (!labelModel.get('show')) {\r\n return;\r\n }\r\n var data = timelineModel.getData();\r\n var labels = axis.getViewLabels();\r\n this._tickLabels = [];\r\n each(labels, function (labelItem) {\r\n var dataIndex = labelItem.tickValue;\r\n var itemModel = data.getItemModel(dataIndex);\r\n var normalLabelModel = itemModel.getModel('label');\r\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\r\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\r\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: 0,\r\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\r\n onclick: bind(_this._changeTimeline, _this, dataIndex),\r\n silent: false,\r\n style: createTextStyle(normalLabelModel, {\r\n text: labelItem.formattedLabel,\r\n align: layoutInfo.labelAlign,\r\n verticalAlign: layoutInfo.labelBaseline\r\n })\r\n });\r\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\r\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\r\n group.add(textEl);\r\n enableHoverEmphasis(textEl);\r\n labelDataIndexStore(textEl).dataIndex = dataIndex;\r\n _this._tickLabels.push(textEl);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\r\n var controlSize = layoutInfo.controlSize;\r\n var rotation = layoutInfo.rotation;\r\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\r\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\r\n var playState = timelineModel.getPlayState();\r\n var inverse = timelineModel.get('inverse', true);\r\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\r\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\r\n makeBtn(layoutInfo.playPosition, (playState ? 'stop' : 'play'), bind(this._handlePlayClick, this, !playState), true);\r\n function makeBtn(position, iconName, onclick, willRotate) {\r\n if (!position) {\r\n return;\r\n }\r\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\r\n var rect = [0, -iconSize / 2, iconSize, iconSize];\r\n var opt = {\r\n position: position,\r\n origin: [controlSize / 2, 0],\r\n rotation: willRotate ? -rotation : 0,\r\n rectHover: true,\r\n style: itemStyle,\r\n onclick: onclick\r\n };\r\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, opt);\r\n btn.ensureState('emphasis').style = hoverStyle;\r\n group.add(btn);\r\n enableHoverEmphasis(btn);\r\n }\r\n };\r\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\r\n var data = timelineModel.getData();\r\n var currentIndex = timelineModel.getCurrentIndex();\r\n var pointerModel = data.getItemModel(currentIndex)\r\n .getModel('checkpointStyle');\r\n var me = this;\r\n var callback = {\r\n onCreate: function (pointer) {\r\n pointer.draggable = true;\r\n pointer.drift = bind(me._handlePointerDrag, me);\r\n pointer.ondragend = bind(me._handlePointerDragend, me);\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\r\n },\r\n onUpdate: function (pointer) {\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\r\n }\r\n };\r\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\r\n };\r\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\r\n this._clearTimer();\r\n this.api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: nextState,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\r\n this._clearTimer();\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\r\n };\r\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\r\n };\r\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\r\n var toCoord = this._toAxisCoord(mousePos)[0];\r\n var axis = this._axis;\r\n var axisExtent = asc(axis.getExtent().slice());\r\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\r\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\r\n this._currentPointer.x = toCoord;\r\n this._currentPointer.markRedraw();\r\n this._progressLine.shape.x2 = toCoord;\r\n this._progressLine.dirty();\r\n var targetDataIndex = this._findNearestTick(toCoord);\r\n var timelineModel = this.model;\r\n if (trigger || (targetDataIndex !== timelineModel.getCurrentIndex()\r\n && timelineModel.get('realtime'))) {\r\n this._changeTimeline(targetDataIndex);\r\n }\r\n };\r\n SliderTimelineView.prototype._doPlayStop = function () {\r\n var _this = this;\r\n this._clearTimer();\r\n if (this.model.getPlayState()) {\r\n this._timer = setTimeout(function () {\r\n var timelineModel = _this.model;\r\n _this._changeTimeline(timelineModel.getCurrentIndex()\r\n + (timelineModel.get('rewind', true) ? -1 : 1));\r\n }, this.model.get('playInterval'));\r\n }\r\n };\r\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\r\n var trans = this._mainGroup.getLocalTransform();\r\n return applyTransform$1(vertex, trans, true);\r\n };\r\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\r\n var data = this.model.getData();\r\n var dist = Infinity;\r\n var targetDataIndex;\r\n var axis = this._axis;\r\n data.each(['value'], function (value, dataIndex) {\r\n var coord = axis.dataToCoord(value);\r\n var d = Math.abs(coord - axisCoord);\r\n if (d < dist) {\r\n dist = d;\r\n targetDataIndex = dataIndex;\r\n }\r\n });\r\n return targetDataIndex;\r\n };\r\n SliderTimelineView.prototype._clearTimer = function () {\r\n if (this._timer) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n };\r\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\r\n var currentIndex = this.model.getCurrentIndex();\r\n if (nextIndex === '+') {\r\n nextIndex = currentIndex + 1;\r\n }\r\n else if (nextIndex === '-') {\r\n nextIndex = currentIndex - 1;\r\n }\r\n this.api.dispatchAction({\r\n type: 'timelineChange',\r\n currentIndex: nextIndex,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._updateTicksStatus = function () {\r\n var currentIndex = this.model.getCurrentIndex();\r\n var tickSymbols = this._tickSymbols;\r\n var tickLabels = this._tickLabels;\r\n if (tickSymbols) {\r\n for (var i = 0; i < tickSymbols.length; i++) {\r\n tickSymbols && tickSymbols[i]\r\n && tickSymbols[i].toggleState('progress', i < currentIndex);\r\n }\r\n }\r\n if (tickLabels) {\r\n for (var i = 0; i < tickLabels.length; i++) {\r\n tickLabels && tickLabels[i]\r\n && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\r\n }\r\n }\r\n };\r\n SliderTimelineView.type = 'timeline.slider';\r\n return SliderTimelineView;\r\n}(TimelineView));\r\nfunction createScaleByModel$1(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new IntervalScale();\r\n }\r\n }\r\n}\r\nfunction getViewRect$5(model, api) {\r\n return getLayoutRect(model.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, model.get('padding'));\r\n}\r\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\r\n var style = opts.style;\r\n var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\r\n if (style) {\r\n icon.setStyle(style);\r\n }\r\n return icon;\r\n}\r\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\r\n var color = itemStyleModel.get('color');\r\n if (!symbol) {\r\n var symbolType = hostModel.get('symbol');\r\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n symbol.setStyle('strokeNoScale', true);\r\n group.add(symbol);\r\n callback && callback.onCreate(symbol);\r\n }\r\n else {\r\n symbol.setColor(color);\r\n group.add(symbol);\r\n callback && callback.onUpdate(symbol);\r\n }\r\n var itemStyle = itemStyleModel.getItemStyle(['color']);\r\n symbol.setStyle(itemStyle);\r\n opt = merge({\r\n rectHover: true,\r\n z2: 100\r\n }, opt, true);\r\n var symbolSize = hostModel.get('symbolSize');\r\n symbolSize = symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n opt.scaleX = symbolSize[0] / 2;\r\n opt.scaleY = symbolSize[1] / 2;\r\n var symbolOffset = hostModel.get('symbolOffset');\r\n if (symbolOffset) {\r\n opt.x = opt.x || 0;\r\n opt.y = opt.y || 0;\r\n opt.x += parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n opt.y += parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = hostModel.get('symbolRotate');\r\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n symbol.attr(opt);\r\n symbol.updateTransform();\r\n return symbol;\r\n}\r\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\r\n if (pointer.dragging) {\r\n return;\r\n }\r\n var pointerModel = timelineModel.getModel('checkpointStyle');\r\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\r\n if (noAnimation || !pointerModel.get('animation', true)) {\r\n pointer.attr({\r\n x: toCoord,\r\n y: 0\r\n });\r\n progressLine && progressLine.attr({\r\n shape: { x2: toCoord }\r\n });\r\n }\r\n else {\r\n var animationCfg = {\r\n duration: pointerModel.get('animationDuration', true),\r\n easing: pointerModel.get('animationEasing', true)\r\n };\r\n pointer.stopAnimation(null, true);\r\n pointer.animateTo({\r\n x: toCoord,\r\n y: 0\r\n }, animationCfg);\r\n progressLine && progressLine.animateTo({\r\n shape: { x2: toCoord }\r\n }, animationCfg);\r\n }\r\n}\r\nComponentView.registerClass(SliderTimelineView);\n\nregisterPreprocessor(timelinePreprocessor);\n\nfunction fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n}\r\nvar inner$i = makeInner();\r\nvar MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$i(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$i(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$i(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$i(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n}(ComponentModel));\r\nmixin(MarkerModel, DataFormatMixin.prototype);\n\nvar MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkPointModel);\n\nfunction hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n}\r\nfunction hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n}\r\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n}\r\nvar markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n};\r\nfunction dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n}\r\nfunction getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n}\r\nfunction dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n}\r\nfunction dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n}\r\nfunction dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n}\r\nfunction numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n}\n\nvar inner$j = makeInner();\r\nvar MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$j(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$j(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$j(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n}(ComponentView));\n\nfunction updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n}\r\nvar MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n}(MarkerView));\r\nfunction createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n}\r\nComponentView.registerClass(MarkPointView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n});\n\nvar MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkLineModel);\n\nvar inner$k = makeInner();\r\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n};\r\nfunction isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n}\r\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n}\r\nfunction markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n}\r\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n}\r\nvar MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$k(mlModel).from;\r\n var toData_1 = inner$k(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$k(mlModel).from = fromData;\r\n inner$k(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n}(MarkerView));\r\nfunction createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n}\r\nComponentView.registerClass(MarkLineView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n});\n\nvar MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkAreaModel);\n\nvar inner$l = makeInner();\r\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n};\r\nfunction isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n}\r\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n}\r\nfunction markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n}\r\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n}\r\nvar dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\nvar MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$l(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$l(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n}(MarkerView));\r\nfunction createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n}\r\nComponentView.registerClass(MarkAreaView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n});\n\nvar getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n};\r\nvar LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(LegendModel);\n\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n}\r\nregisterAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\nregisterAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\nregisterAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\nregisterAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\nregisterAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\nvar curry$1 = curry;\r\nvar each$e = each;\r\nvar Group$2 = Group;\r\nvar LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$2());\r\n this.group.add(this._selectorGroup = new Group$2());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$e(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$2();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$e(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$2();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n}(ComponentView));\r\nfunction setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n}\r\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n}\r\nfunction isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n}\r\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\nComponentView.registerClass(LegendView);\n\nfunction legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n}\n\nregisterProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\nComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n});\n\nvar ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n}(LegendModel));\r\nfunction mergeAndNormalizeLayoutParams$1(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n}\r\nComponentModel.registerClass(ScrollableLegendModel);\n\nvar Group$3 = Group;\r\nvar WH$1 = ['width', 'height'];\r\nvar XY$1 = ['x', 'y'];\r\nvar ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$3());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$3());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var hw = WH$1[1 - orientIdx];\r\n var yx = XY$1[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n}(LegendView));\r\nComponentView.registerClass(ScrollableLegendView);\n\nregisterAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n});\n\nvar SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(SliderZoomModel);\n\nvar Rect$2 = Rect;\r\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\r\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\r\nvar DEFAULT_FILLER_SIZE = 30;\r\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\r\nvar HORIZONTAL = 'horizontal';\r\nvar VERTICAL = 'vertical';\r\nvar LABEL_GAP = 5;\r\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\nvar REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n};\r\nvar SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$2({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$2({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$2({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$2({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$2({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n}(DataZoomView));\r\nfunction getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n}\r\nfunction getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\nComponentView.registerClass(SliderZoomView);\n\nvar InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(InsideZoomModel);\n\nvar inner$m = makeInner();\r\nregisterProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$m(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n});\r\nfunction setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$m(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n}\r\nfunction disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$m(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n}\r\nfunction createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction$1, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n}\r\nfunction dispatchAction$1(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n}\r\nfunction containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n}\r\nfunction mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n}\n\nvar InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n}(DataZoomView));\r\nvar getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n};\r\nfunction makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n}\r\nvar getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n};\r\nComponentView.registerClass(InsideZoomView);\n\nvar each$f = each;\r\nfunction visualMapPreprocessor(option) {\r\n var visualMap = option && option.visualMap;\r\n if (!isArray(visualMap)) {\r\n visualMap = visualMap ? [visualMap] : [];\r\n }\r\n each$f(visualMap, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) {\r\n opt.pieces = opt.splitList;\r\n delete opt.splitList;\r\n }\r\n var pieces = opt.pieces;\r\n if (pieces && isArray(pieces)) {\r\n each$f(pieces, function (piece) {\r\n if (isObject(piece)) {\r\n if (has$1(piece, 'start') && !has$1(piece, 'min')) {\r\n piece.min = piece.start;\r\n }\r\n if (has$1(piece, 'end') && !has$1(piece, 'max')) {\r\n piece.max = piece.end;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\r\nfunction has$1(obj, name) {\r\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\r\n}\n\nComponentModel.registerSubTypeDefaulter('visualMap', function (option) {\r\n return (!option.categories\r\n && (!(option.pieces\r\n ? option.pieces.length > 0\r\n : option.splitNumber > 0)\r\n || option.calculable))\r\n ? 'continuous' : 'piecewise';\r\n});\n\nvar VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT;\r\nregisterVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var resetDefines = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!visualMapModel.isTargetSeries(seriesModel)\r\n || (pipelineContext && pipelineContext.large)) {\r\n return;\r\n }\r\n resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\r\n });\r\n return resetDefines;\r\n }\r\n});\r\nregisterVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var visualMetaList = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n if (visualMapModel.isTargetSeries(seriesModel)) {\r\n var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {\r\n stops: [],\r\n outerColors: []\r\n };\r\n var concreteDim = visualMapModel.getDataDimension(data);\r\n var dimInfo = data.getDimensionInfo(concreteDim);\r\n if (dimInfo != null) {\r\n visualMeta.dimension = dimInfo.index;\r\n visualMetaList.push(visualMeta);\r\n }\r\n }\r\n });\r\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\r\n }\r\n});\r\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\r\n var mappings = visualMapModel.targetVisuals[valueState];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n var resultVisual = {\r\n color: getVisualFromData(seriesModel.getData(), 'color')\r\n };\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n var mapping = mappings[(type === 'opacity' ? '__alphaForOpacity' : type)];\r\n mapping && mapping.applyVisual(value, getVisual, setVisual);\r\n }\r\n return resultVisual.color;\r\n function getVisual(key) {\r\n return resultVisual[key];\r\n }\r\n function setVisual(key, value) {\r\n resultVisual[key] = value;\r\n }\r\n}\n\nvar visualDefault = {\r\n get: function (visualType, key, isCategory) {\r\n var value = clone((defaultOption$2[visualType] || {})[key]);\r\n return isCategory\r\n ? (isArray(value) ? value[value.length - 1] : value)\r\n : value;\r\n }\r\n};\r\nvar defaultOption$2 = {\r\n color: {\r\n active: ['#006edd', '#e0ffff'],\r\n inactive: ['rgba(0,0,0,0)']\r\n },\r\n colorHue: {\r\n active: [0, 360],\r\n inactive: [0, 0]\r\n },\r\n colorSaturation: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n colorLightness: {\r\n active: [0.9, 0.5],\r\n inactive: [0, 0]\r\n },\r\n colorAlpha: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n opacity: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n symbol: {\r\n active: ['circle', 'roundRect', 'diamond'],\r\n inactive: ['none']\r\n },\r\n symbolSize: {\r\n active: [10, 50],\r\n inactive: [0, 0]\r\n }\r\n};\n\nvar mapVisual$1 = VisualMapping.mapVisual;\r\nvar eachVisual = VisualMapping.eachVisual;\r\nvar isArray$1 = isArray;\r\nvar each$g = each;\r\nvar asc$2 = asc;\r\nvar linearMap$1 = linearMap;\r\nvar VisualMapModel = (function (_super) {\r\n __extends(VisualMapModel, _super);\r\n function VisualMapModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapModel.type;\r\n _this.stateList = ['inRange', 'outOfRange'];\r\n _this.replacableOptionKeys = [\r\n 'inRange', 'outOfRange', 'target', 'controller', 'color'\r\n ];\r\n _this.layoutMode = {\r\n type: 'box', ignoreSize: true\r\n };\r\n _this.dataBound = [-Infinity, Infinity];\r\n _this.targetVisuals = {};\r\n _this.controllerVisuals = {};\r\n return _this;\r\n }\r\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n if (!env.canvasSupported) {\r\n thisOption.realtime = false;\r\n }\r\n !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\r\n this.textStyleModel = this.getModel('textStyle');\r\n this.resetItemSize();\r\n this.completeVisualOption();\r\n };\r\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\r\n var stateList = this.stateList;\r\n supplementVisualOption = bind(supplementVisualOption, this);\r\n this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);\r\n this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);\r\n };\r\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\r\n var optionSeriesIndex = this.option.seriesIndex;\r\n var seriesIndices = [];\r\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\r\n this.ecModel.eachSeries(function (seriesModel, index) {\r\n seriesIndices.push(index);\r\n });\r\n }\r\n else {\r\n seriesIndices = normalizeToArray(optionSeriesIndex);\r\n }\r\n return seriesIndices;\r\n };\r\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\r\n each(this.getTargetSeriesIndices(), function (seriesIndex) {\r\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\r\n if (seriesModel) {\r\n callback.call(context, seriesModel);\r\n }\r\n }, this);\r\n };\r\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\r\n var is = false;\r\n this.eachTargetSeries(function (model) {\r\n model === seriesModel && (is = true);\r\n });\r\n return is;\r\n };\r\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\r\n var option = this.option;\r\n var precision = option.precision;\r\n var dataBound = this.dataBound;\r\n var formatter = option.formatter;\r\n var isMinMax;\r\n edgeSymbols = edgeSymbols || ['<', '>'];\r\n if (isArray(value)) {\r\n value = value.slice();\r\n isMinMax = true;\r\n }\r\n var textValue = isCategory\r\n ? value\r\n : (isMinMax\r\n ? [toFixed(value[0]), toFixed(value[1])]\r\n : toFixed(value));\r\n if (isString(formatter)) {\r\n return formatter\r\n .replace('{value}', isMinMax ? textValue[0] : textValue)\r\n .replace('{value2}', isMinMax ? textValue[1] : textValue);\r\n }\r\n else if (isFunction(formatter)) {\r\n return isMinMax\r\n ? formatter(value[0], value[1])\r\n : formatter(value);\r\n }\r\n if (isMinMax) {\r\n if (value[0] === dataBound[0]) {\r\n return edgeSymbols[0] + ' ' + textValue[1];\r\n }\r\n else if (value[1] === dataBound[1]) {\r\n return edgeSymbols[1] + ' ' + textValue[0];\r\n }\r\n else {\r\n return textValue[0] + ' - ' + textValue[1];\r\n }\r\n }\r\n else {\r\n return textValue;\r\n }\r\n function toFixed(val) {\r\n return val === dataBound[0]\r\n ? 'min'\r\n : val === dataBound[1]\r\n ? 'max'\r\n : (+val).toFixed(Math.min(precision, 20));\r\n }\r\n };\r\n VisualMapModel.prototype.resetExtent = function () {\r\n var thisOption = this.option;\r\n var extent = asc$2([thisOption.min, thisOption.max]);\r\n this._dataExtent = extent;\r\n };\r\n VisualMapModel.prototype.getDataDimension = function (list) {\r\n var optDim = this.option.dimension;\r\n var listDimensions = list.dimensions;\r\n if (optDim == null && !listDimensions.length) {\r\n return;\r\n }\r\n if (optDim != null) {\r\n return list.getDimension(optDim);\r\n }\r\n var dimNames = list.dimensions;\r\n for (var i = dimNames.length - 1; i >= 0; i--) {\r\n var dimName = dimNames[i];\r\n var dimInfo = list.getDimensionInfo(dimName);\r\n if (!dimInfo.isCalculationCoord) {\r\n return dimName;\r\n }\r\n }\r\n };\r\n VisualMapModel.prototype.getExtent = function () {\r\n return this._dataExtent.slice();\r\n };\r\n VisualMapModel.prototype.completeVisualOption = function () {\r\n var ecModel = this.ecModel;\r\n var thisOption = this.option;\r\n var base = {\r\n inRange: thisOption.inRange,\r\n outOfRange: thisOption.outOfRange\r\n };\r\n var target = thisOption.target || (thisOption.target = {});\r\n var controller = thisOption.controller || (thisOption.controller = {});\r\n merge(target, base);\r\n merge(controller, base);\r\n var isCategory = this.isCategory();\r\n completeSingle.call(this, target);\r\n completeSingle.call(this, controller);\r\n completeInactive.call(this, target, 'inRange', 'outOfRange');\r\n completeController.call(this, controller);\r\n function completeSingle(base) {\r\n if (isArray$1(thisOption.color)\r\n && !base.inRange) {\r\n base.inRange = { color: thisOption.color.slice().reverse() };\r\n }\r\n base.inRange = base.inRange || { color: ecModel.get('gradientColor') };\r\n }\r\n function completeInactive(base, stateExist, stateAbsent) {\r\n var optExist = base[stateExist];\r\n var optAbsent = base[stateAbsent];\r\n if (optExist && !optAbsent) {\r\n optAbsent = base[stateAbsent] = {};\r\n each$g(optExist, function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\r\n if (defa != null) {\r\n optAbsent[visualType] = defa;\r\n if (visualType === 'color'\r\n && !optAbsent.hasOwnProperty('opacity')\r\n && !optAbsent.hasOwnProperty('colorAlpha')) {\r\n optAbsent.opacity = [0, 0];\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function completeController(controller) {\r\n var symbolExists = (controller.inRange || {}).symbol\r\n || (controller.outOfRange || {}).symbol;\r\n var symbolSizeExists = (controller.inRange || {}).symbolSize\r\n || (controller.outOfRange || {}).symbolSize;\r\n var inactiveColor = this.get('inactiveColor');\r\n each$g(this.stateList, function (state) {\r\n var itemSize = this.itemSize;\r\n var visuals = controller[state];\r\n if (!visuals) {\r\n visuals = controller[state] = {\r\n color: isCategory ? inactiveColor : [inactiveColor]\r\n };\r\n }\r\n if (visuals.symbol == null) {\r\n visuals.symbol = symbolExists\r\n && clone(symbolExists)\r\n || (isCategory ? 'roundRect' : ['roundRect']);\r\n }\r\n if (visuals.symbolSize == null) {\r\n visuals.symbolSize = symbolSizeExists\r\n && clone(symbolSizeExists)\r\n || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\r\n }\r\n visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) {\r\n return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol;\r\n });\r\n var symbolSize = visuals.symbolSize;\r\n if (symbolSize != null) {\r\n var max_1 = -Infinity;\r\n eachVisual(symbolSize, function (value) {\r\n value > max_1 && (max_1 = value);\r\n });\r\n visuals.symbolSize = mapVisual$1(symbolSize, function (value) {\r\n return linearMap$1(value, [0, max_1], [0, itemSize[0]], true);\r\n });\r\n }\r\n }, this);\r\n }\r\n };\r\n VisualMapModel.prototype.resetItemSize = function () {\r\n this.itemSize = [\r\n parseFloat(this.get('itemWidth')),\r\n parseFloat(this.get('itemHeight'))\r\n ];\r\n };\r\n VisualMapModel.prototype.isCategory = function () {\r\n return !!this.option.categories;\r\n };\r\n VisualMapModel.prototype.setSelected = function (selected) { };\r\n VisualMapModel.prototype.getSelected = function () {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getValueState = function (value) {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\r\n return null;\r\n };\r\n VisualMapModel.type = 'visualMap';\r\n VisualMapModel.dependencies = ['series'];\r\n VisualMapModel.defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 4,\r\n seriesIndex: 'all',\r\n min: 0,\r\n max: 200,\r\n left: 0,\r\n right: null,\r\n top: null,\r\n bottom: 0,\r\n itemWidth: null,\r\n itemHeight: null,\r\n inverse: false,\r\n orient: 'vertical',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n contentColor: '#5793f3',\r\n inactiveColor: '#aaa',\r\n borderWidth: 0,\r\n padding: 5,\r\n textGap: 10,\r\n precision: 0,\r\n textStyle: {\r\n color: '#333'\r\n }\r\n };\r\n return VisualMapModel;\r\n}(ComponentModel));\n\nvar DEFAULT_BAR_BOUND = [20, 140];\r\nvar ContinuousModel = (function (_super) {\r\n __extends(ContinuousModel, _super);\r\n function ContinuousModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousModel.type;\r\n return _this;\r\n }\r\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n this.resetVisual(function (mappingOption) {\r\n mappingOption.mappingMethod = 'linear';\r\n mappingOption.dataExtent = this.getExtent();\r\n });\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.resetItemSize = function () {\r\n _super.prototype.resetItemSize.apply(this, arguments);\r\n var itemSize = this.itemSize;\r\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\r\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\r\n };\r\n ContinuousModel.prototype._resetRange = function () {\r\n var dataExtent = this.getExtent();\r\n var range = this.option.range;\r\n if (!range || range.auto) {\r\n dataExtent.auto = 1;\r\n this.option.range = dataExtent;\r\n }\r\n else if (isArray(range)) {\r\n if (range[0] > range[1]) {\r\n range.reverse();\r\n }\r\n range[0] = Math.max(range[0], dataExtent[0]);\r\n range[1] = Math.min(range[1], dataExtent[1]);\r\n }\r\n };\r\n ContinuousModel.prototype.completeVisualOption = function () {\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n each(this.stateList, function (state) {\r\n var symbolSize = this.option.controller[state].symbolSize;\r\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\r\n symbolSize[0] = symbolSize[1] / 3;\r\n }\r\n }, this);\r\n };\r\n ContinuousModel.prototype.setSelected = function (selected) {\r\n this.option.range = selected.slice();\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.getSelected = function () {\r\n var dataExtent = this.getExtent();\r\n var dataInterval = asc((this.get('range') || []).slice());\r\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\r\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\r\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\r\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\r\n return dataInterval;\r\n };\r\n ContinuousModel.prototype.getValueState = function (value) {\r\n var range = this.option.range;\r\n var dataExtent = this.getExtent();\r\n return ((range[0] <= dataExtent[0] || range[0] <= value)\r\n && (range[1] >= dataExtent[1] || value <= range[1])) ? 'inRange' : 'outOfRange';\r\n };\r\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\r\n var result = [];\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndices\r\n });\r\n }, this);\r\n return result;\r\n };\r\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\r\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\r\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\r\n var stops = [];\r\n function setStop(value, valueState) {\r\n stops.push({\r\n value: value,\r\n color: getColorVisual(value, valueState)\r\n });\r\n }\r\n var iIdx = 0;\r\n var oIdx = 0;\r\n var iLen = iVals.length;\r\n var oLen = oVals.length;\r\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\r\n if (oVals[oIdx] < iVals[iIdx]) {\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\r\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\r\n setStop(iVals[iIdx], 'inRange');\r\n }\r\n for (var first = 1; oIdx < oLen; oIdx++) {\r\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\r\n if (first) {\r\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\r\n first = 0;\r\n }\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n var stopsLen = stops.length;\r\n return {\r\n stops: stops,\r\n outerColors: [\r\n stopsLen ? stops[0].color : 'transparent',\r\n stopsLen ? stops[stopsLen - 1].color : 'transparent'\r\n ]\r\n };\r\n };\r\n ContinuousModel.type = 'visualMap.continuous';\r\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n align: 'auto',\r\n calculable: false,\r\n hoverLink: true,\r\n realtime: true,\r\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\r\n handleSize: '120%',\r\n handleStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n indicatorIcon: 'circle',\r\n indicatorSize: '50%',\r\n indicatorStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n });\r\n return ContinuousModel;\r\n}(VisualMapModel));\r\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\r\n if (dataExtent[0] === dataExtent[1]) {\r\n return dataExtent.slice();\r\n }\r\n var count = 200;\r\n var step = (dataExtent[1] - dataExtent[0]) / count;\r\n var value = dataExtent[0];\r\n var stopValues = [];\r\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\r\n stopValues.push(value);\r\n value += step;\r\n }\r\n stopValues.push(dataExtent[1]);\r\n return stopValues;\r\n}\r\nComponentModel.registerClass(ContinuousModel);\n\nvar VisualMapView = (function (_super) {\r\n __extends(VisualMapView, _super);\r\n function VisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapView.type;\r\n _this.autoPositionValues = { left: 1, right: 1, top: 1, bottom: 1 };\r\n return _this;\r\n }\r\n VisualMapView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload) {\r\n this.visualMapModel = visualMapModel;\r\n if (visualMapModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n this.doRender(visualMapModel, ecModel, api, payload);\r\n };\r\n VisualMapView.prototype.renderBackground = function (group) {\r\n var visualMapModel = this.visualMapModel;\r\n var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0);\r\n var rect = group.getBoundingRect();\r\n group.add(new Rect({\r\n z2: -1,\r\n silent: true,\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[3] + padding[1],\r\n height: rect.height + padding[0] + padding[2]\r\n },\r\n style: {\r\n fill: visualMapModel.get('backgroundColor'),\r\n stroke: visualMapModel.get('borderColor'),\r\n lineWidth: visualMapModel.get('borderWidth')\r\n }\r\n }));\r\n };\r\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\r\n opts = opts || {};\r\n var forceState = opts.forceState;\r\n var visualMapModel = this.visualMapModel;\r\n var visualObj = {};\r\n if (visualCluster === 'symbol') {\r\n visualObj.symbol = visualMapModel.get('itemSymbol');\r\n }\r\n if (visualCluster === 'color') {\r\n var defaultColor = visualMapModel.get('contentColor');\r\n visualObj.color = defaultColor;\r\n }\r\n function getter(key) {\r\n return visualObj[key];\r\n }\r\n function setter(key, value) {\r\n visualObj[key] = value;\r\n }\r\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n each(visualTypes, function (type) {\r\n var visualMapping = mappings[type];\r\n if (opts.convertOpacityToAlpha && type === 'opacity') {\r\n type = 'colorAlpha';\r\n visualMapping = mappings.__alphaForOpacity;\r\n }\r\n if (VisualMapping.dependsOn(type, visualCluster)) {\r\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\r\n }\r\n });\r\n return visualObj[visualCluster];\r\n };\r\n VisualMapView.prototype.positionGroup = function (group) {\r\n var model = this.visualMapModel;\r\n var api = this.api;\r\n positionElement(group, model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() });\r\n };\r\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { };\r\n VisualMapView.type = 'visualMap';\r\n return VisualMapView;\r\n}(ComponentView));\r\nComponentView.registerClass(VisualMapView);\n\nvar paramsSet = [\r\n ['left', 'right', 'width'],\r\n ['top', 'bottom', 'height']\r\n];\r\nfunction getItemAlign(visualMapModel, api, itemSize) {\r\n var modelOption = visualMapModel.option;\r\n var itemAlign = modelOption.align;\r\n if (itemAlign != null && itemAlign !== 'auto') {\r\n return itemAlign;\r\n }\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\r\n var reals = paramsSet[realIndex];\r\n var fakeValue = [0, null, 10];\r\n var layoutInput = {};\r\n for (var i = 0; i < 3; i++) {\r\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\r\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\r\n }\r\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\r\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\r\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5\r\n < ecSize[rParam[1]] * 0.5 ? 0 : 1];\r\n}\r\nfunction makeHighDownBatch(batch, visualMapModel) {\r\n each(batch || [], function (batchItem) {\r\n if (batchItem.dataIndex != null) {\r\n batchItem.dataIndexInside = batchItem.dataIndex;\r\n batchItem.dataIndex = null;\r\n }\r\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\r\n });\r\n return batch;\r\n}\n\nvar linearMap$2 = linearMap;\r\nvar each$h = each;\r\nvar mathMin$a = Math.min;\r\nvar mathMax$a = Math.max;\r\nvar HOVER_LINK_SIZE = 12;\r\nvar HOVER_LINK_OUT = 6;\r\nvar ContinuousView = (function (_super) {\r\n __extends(ContinuousView, _super);\r\n function ContinuousView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousView.type;\r\n _this._shapes = {};\r\n _this._dataInterval = [];\r\n _this._handleEnds = [];\r\n _this._hoverLinkDataIndices = [];\r\n return _this;\r\n }\r\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\r\n this._api = api;\r\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n };\r\n ContinuousView.prototype._buildView = function () {\r\n this.group.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var thisGroup = this.group;\r\n this._orient = visualMapModel.get('orient');\r\n this._useHandle = visualMapModel.get('calculable');\r\n this._resetInterval();\r\n this._renderBar(thisGroup);\r\n var dataRangeText = visualMapModel.get('text');\r\n this._renderEndsText(thisGroup, dataRangeText, 0);\r\n this._renderEndsText(thisGroup, dataRangeText, 1);\r\n this._updateView(true);\r\n this.renderBackground(thisGroup);\r\n this._updateView();\r\n this._enableHoverLinkToSeries();\r\n this._enableHoverLinkFromSeries();\r\n this.positionGroup(thisGroup);\r\n };\r\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\r\n if (!dataRangeText) {\r\n return;\r\n }\r\n var text = dataRangeText[1 - endsIndex];\r\n text = text != null ? text + '' : '';\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var itemSize = visualMapModel.itemSize;\r\n var barGroup = this._shapes.mainGroup;\r\n var position = this._applyTransform([\r\n itemSize[0] / 2,\r\n endsIndex === 0 ? -textGap : itemSize[1] + textGap\r\n ], barGroup);\r\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\r\n var orient = this._orient;\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n this.group.add(new ZRText({\r\n style: {\r\n x: position[0],\r\n y: position[1],\r\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\r\n align: orient === 'horizontal' ? align : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n };\r\n ContinuousView.prototype._renderBar = function (targetGroup) {\r\n var visualMapModel = this.visualMapModel;\r\n var shapes = this._shapes;\r\n var itemSize = visualMapModel.itemSize;\r\n var orient = this._orient;\r\n var useHandle = this._useHandle;\r\n var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);\r\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\r\n var gradientBarGroup = new Group();\r\n mainGroup.add(gradientBarGroup);\r\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\r\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true)));\r\n gradientBarGroup.setClipPath(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: itemSize[0],\r\n height: itemSize[1],\r\n r: 3\r\n }\r\n }));\r\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\r\n var textSize = mathMax$a(textRect.width, textRect.height);\r\n if (useHandle) {\r\n shapes.handleThumbs = [];\r\n shapes.handleLabels = [];\r\n shapes.handleLabelPoints = [];\r\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\r\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\r\n }\r\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\r\n targetGroup.add(mainGroup);\r\n };\r\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\r\n var onDrift = bind(this._dragHandle, this, handleIndex, false);\r\n var onDragEnd = bind(this._dragHandle, this, handleIndex, true);\r\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\r\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\r\n var cursor = getCursor$1(this._orient);\r\n handleThumb.attr({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n ondragend: onDragEnd,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n }\r\n });\r\n handleThumb.x = itemSize[0] / 2;\r\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\r\n handleThumb.setStyle({\r\n strokeNoScale: true,\r\n strokeFirst: true\r\n });\r\n handleThumb.style.lineWidth *= 2;\r\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n setAsHighDownDispatcher(handleThumb, true);\r\n mainGroup.add(handleThumb);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var handleLabel = new ZRText({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n handleLabel.ensureState('blur').style = {\r\n opacity: 0.1\r\n };\r\n handleLabel.stateTransition = { duration: 200 };\r\n this.group.add(handleLabel);\r\n var handleLabelPoint = [handleSize, 0];\r\n var shapes = this._shapes;\r\n shapes.handleThumbs[handleIndex] = handleThumb;\r\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\r\n shapes.handleLabels[handleIndex] = handleLabel;\r\n };\r\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\r\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\r\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\r\n indicator.attr({\r\n cursor: 'move',\r\n invisible: true,\r\n silent: true,\r\n x: itemSize[0] / 2\r\n });\r\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\r\n if (indicator instanceof ZRImage) {\r\n var pathStyle = indicator.style;\r\n indicator.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, indicatorStyle));\r\n }\r\n else {\r\n indicator.useStyle(indicatorStyle);\r\n }\r\n mainGroup.add(indicator);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var indicatorLabel = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n this.group.add(indicatorLabel);\r\n var indicatorLabelPoint = [\r\n (orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2,\r\n 0\r\n ];\r\n var shapes = this._shapes;\r\n shapes.indicator = indicator;\r\n shapes.indicatorLabel = indicatorLabel;\r\n shapes.indicatorLabelPoint = indicatorLabelPoint;\r\n this._firstShowIndicator = true;\r\n };\r\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, dx, dy) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n this._dragging = !isEnd;\r\n if (!isEnd) {\r\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\r\n this._updateInterval(handleIndex, vertex[1]);\r\n this._hideIndicator();\r\n this._updateView();\r\n }\r\n if (isEnd === !this.visualMapModel.get('realtime')) {\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: this._dataInterval.slice()\r\n });\r\n }\r\n if (isEnd) {\r\n !this._hovering && this._clearHoverLinkToSeries();\r\n }\r\n else if (useHoverLinkOnHandle(this.visualMapModel)) {\r\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\r\n }\r\n };\r\n ContinuousView.prototype._resetInterval = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\r\n var dataExtent = visualMapModel.getExtent();\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n this._handleEnds = [\r\n linearMap$2(dataInterval[0], dataExtent, sizeExtent, true),\r\n linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\r\n delta = delta || 0;\r\n var visualMapModel = this.visualMapModel;\r\n var handleEnds = this._handleEnds;\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, 0);\r\n var dataExtent = visualMapModel.getExtent();\r\n this._dataInterval = [\r\n linearMap$2(handleEnds[0], sizeExtent, dataExtent, true),\r\n linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateView = function (forSketch) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var shapes = this._shapes;\r\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\r\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\r\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\r\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\r\n shapes.inRange\r\n .setStyle({\r\n fill: visualInRange.barColor\r\n })\r\n .setShape('points', visualInRange.barPoints);\r\n shapes.outOfRange\r\n .setStyle({\r\n fill: visualOutOfRange.barColor\r\n })\r\n .setShape('points', visualOutOfRange.barPoints);\r\n this._updateHandle(inRangeHandleEnds, visualInRange);\r\n };\r\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\r\n var opts = {\r\n forceState: forceState,\r\n convertOpacityToAlpha: true\r\n };\r\n var colorStops = this._makeColorGradient(dataInterval, opts);\r\n var symbolSizes = [\r\n this.getControllerVisual(dataInterval[0], 'symbolSize', opts),\r\n this.getControllerVisual(dataInterval[1], 'symbolSize', opts)\r\n ];\r\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\r\n return {\r\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\r\n barPoints: barPoints,\r\n handlesColor: [\r\n colorStops[0].color,\r\n colorStops[colorStops.length - 1].color\r\n ]\r\n };\r\n };\r\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\r\n var sampleNumber = 100;\r\n var colorStops = [];\r\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\r\n offset: 0\r\n });\r\n for (var i = 1; i < sampleNumber; i++) {\r\n var currValue = dataInterval[0] + step * i;\r\n if (currValue > dataInterval[1]) {\r\n break;\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(currValue, 'color', opts),\r\n offset: i / sampleNumber\r\n });\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\r\n offset: 1\r\n });\r\n return colorStops;\r\n };\r\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\r\n var itemSize = this.visualMapModel.itemSize;\r\n return [\r\n [itemSize[0] - symbolSizes[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[1]],\r\n [itemSize[0] - symbolSizes[1], handleEnds[1]]\r\n ];\r\n };\r\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\r\n var orient = this._orient;\r\n var inverse = this.visualMapModel.get('inverse');\r\n return new Group((orient === 'horizontal' && !inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? 1 : -1, rotation: Math.PI / 2 }\r\n : (orient === 'horizontal' && inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? -1 : 1, rotation: -Math.PI / 2 }\r\n : (orient === 'vertical' && !inverse)\r\n ? { scaleX: itemAlign === 'left' ? 1 : -1, scaleY: -1 }\r\n : { scaleX: itemAlign === 'left' ? 1 : -1 });\r\n };\r\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n var shapes = this._shapes;\r\n var visualMapModel = this.visualMapModel;\r\n var handleThumbs = shapes.handleThumbs;\r\n var handleLabels = shapes.handleLabels;\r\n var itemSize = visualMapModel.itemSize;\r\n var dataExtent = visualMapModel.getExtent();\r\n each$h([0, 1], function (handleIndex) {\r\n var handleThumb = handleThumbs[handleIndex];\r\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\r\n handleThumb.y = handleEnds[handleIndex];\r\n var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\r\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\r\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\r\n handleThumb.x = itemSize[0] - symbolSize / 2;\r\n var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\r\n verticalAlign: 'middle',\r\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\r\n });\r\n }, this);\r\n };\r\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var itemSize = visualMapModel.itemSize;\r\n var sizeExtent = [0, itemSize[1]];\r\n var shapes = this._shapes;\r\n var indicator = shapes.indicator;\r\n if (!indicator) {\r\n return;\r\n }\r\n indicator.attr('invisible', false);\r\n var opts = { convertOpacityToAlpha: true };\r\n var color = this.getControllerVisual(cursorValue, 'color', opts);\r\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\r\n var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true);\r\n var x = itemSize[0] - symbolSize / 2;\r\n var oldIndicatorPos = { x: indicator.x, y: indicator.y };\r\n indicator.y = y;\r\n indicator.x = x;\r\n var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group));\r\n var indicatorLabel = shapes.indicatorLabel;\r\n indicatorLabel.attr('invisible', false);\r\n var align = this._applyTransform('left', shapes.mainGroup);\r\n var orient = this._orient;\r\n var isHorizontal = orient === 'horizontal';\r\n indicatorLabel.setStyle({\r\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\r\n verticalAlign: isHorizontal ? align : 'middle',\r\n align: isHorizontal ? 'center' : align\r\n });\r\n var indicatorNewProps = {\r\n x: x,\r\n y: y,\r\n style: {\r\n fill: color\r\n }\r\n };\r\n var labelNewProps = {\r\n style: {\r\n x: textPoint[0],\r\n y: textPoint[1]\r\n }\r\n };\r\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\r\n var animationCfg = {\r\n duration: 100,\r\n easing: 'cubicInOut',\r\n additive: true\r\n };\r\n indicator.x = oldIndicatorPos.x;\r\n indicator.y = oldIndicatorPos.y;\r\n indicator.animateTo(indicatorNewProps, animationCfg);\r\n indicatorLabel.animateTo(labelNewProps, animationCfg);\r\n }\r\n else {\r\n indicator.attr(indicatorNewProps);\r\n indicatorLabel.attr(labelNewProps);\r\n }\r\n this._firstShowIndicator = false;\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.enterBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\r\n var self = this;\r\n this._shapes.mainGroup\r\n .on('mousemove', function (e) {\r\n self._hovering = true;\r\n if (!self._dragging) {\r\n var itemSize = self.visualMapModel.itemSize;\r\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\r\n pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]);\r\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\r\n }\r\n })\r\n .on('mouseout', function () {\r\n self._hovering = false;\r\n !self._dragging && self._clearHoverLinkToSeries();\r\n });\r\n };\r\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\r\n var zr = this.api.getZr();\r\n if (this.visualMapModel.option.hoverLink) {\r\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\r\n zr.on('mouseout', this._hideIndicator, this);\r\n }\r\n else {\r\n this._clearHoverLinkFromSeries();\r\n }\r\n };\r\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\r\n var visualMapModel = this.visualMapModel;\r\n var itemSize = visualMapModel.itemSize;\r\n if (!visualMapModel.option.hoverLink) {\r\n return;\r\n }\r\n var sizeExtent = [0, itemSize[1]];\r\n var dataExtent = visualMapModel.getExtent();\r\n cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]);\r\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\r\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\r\n var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true);\r\n var valueRange = [\r\n linearMap$2(hoverRange[0], sizeExtent, dataExtent, true),\r\n linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)\r\n ];\r\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\r\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\r\n if (hoverOnBar) {\r\n if (valueRange[0] === -Infinity) {\r\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\r\n }\r\n else if (valueRange[1] === Infinity) {\r\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\r\n }\r\n else {\r\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\r\n }\r\n }\r\n var oldBatch = this._hoverLinkDataIndices;\r\n var newBatch = [];\r\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\r\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\r\n }\r\n var resultBatches = compressBatches(oldBatch, newBatch);\r\n this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel));\r\n this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel));\r\n };\r\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\r\n var el = e.target;\r\n var visualMapModel = this.visualMapModel;\r\n if (!el || getECData(el).dataIndex == null) {\r\n return;\r\n }\r\n var ecData = getECData(el);\r\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n if (!visualMapModel.isTargetSeries(dataModel)) {\r\n return;\r\n }\r\n var data = dataModel.getData(ecData.dataType);\r\n var value = data.get(visualMapModel.getDataDimension(data), ecData.dataIndex);\r\n if (!isNaN(value)) {\r\n this._showIndicator(value, value);\r\n }\r\n };\r\n ContinuousView.prototype._hideIndicator = function () {\r\n var shapes = this._shapes;\r\n shapes.indicator && shapes.indicator.attr('invisible', true);\r\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.leaveBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\r\n this._hideIndicator();\r\n var indices = this._hoverLinkDataIndices;\r\n this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel));\r\n indices.length = 0;\r\n };\r\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\r\n this._hideIndicator();\r\n var zr = this.api.getZr();\r\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\r\n zr.off('mouseout', this._hideIndicator);\r\n };\r\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\r\n var transform = getTransform(element, global ? null : this.group);\r\n return isArray(vertex)\r\n ? applyTransform$1(vertex, transform, inverse)\r\n : transformDirection(vertex, transform, inverse);\r\n };\r\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\r\n batch && batch.length && this.api.dispatchAction({\r\n type: type,\r\n batch: batch\r\n });\r\n };\r\n ContinuousView.prototype.dispose = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.prototype.remove = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.type = 'visualMap.continuous';\r\n return ContinuousView;\r\n}(VisualMapView));\r\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\r\n return new Polygon({\r\n shape: { points: points },\r\n draggable: !!onDrift,\r\n cursor: cursor,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd\r\n });\r\n}\r\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\r\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\r\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\r\n if (hoverLinkDataSize) {\r\n halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\r\n }\r\n return halfHoverLinkSize;\r\n}\r\nfunction useHoverLinkOnHandle(visualMapModel) {\r\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\r\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\r\n}\r\nfunction getCursor$1(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\nComponentView.registerClass(ContinuousView);\n\nvar actionInfo$2 = {\r\n type: 'selectDataRange',\r\n event: 'dataRangeSelected',\r\n update: 'update'\r\n};\r\nregisterAction(actionInfo$2, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'visualMap', query: payload }, function (model) {\r\n model.setSelected(payload.selected);\r\n });\r\n});\n\nregisterPreprocessor(visualMapPreprocessor);\n\nvar PiecewiseModel = (function (_super) {\r\n __extends(PiecewiseModel, _super);\r\n function PiecewiseModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseModel.type;\r\n _this._pieceList = [];\r\n return _this;\r\n }\r\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n var mode = this._mode = this._determineMode();\r\n this._pieceList = [];\r\n resetMethods[this._mode].call(this, this._pieceList);\r\n this._resetSelected(newOption, isInit);\r\n var categories = this.option.categories;\r\n this.resetVisual(function (mappingOption, state) {\r\n if (mode === 'categories') {\r\n mappingOption.mappingMethod = 'category';\r\n mappingOption.categories = clone(categories);\r\n }\r\n else {\r\n mappingOption.dataExtent = this.getExtent();\r\n mappingOption.mappingMethod = 'piecewise';\r\n mappingOption.pieceList = map(this._pieceList, function (piece) {\r\n piece = clone(piece);\r\n if (state !== 'inRange') {\r\n piece.visual = null;\r\n }\r\n return piece;\r\n });\r\n }\r\n });\r\n };\r\n PiecewiseModel.prototype.completeVisualOption = function () {\r\n var option = this.option;\r\n var visualTypesInPieces = {};\r\n var visualTypes = VisualMapping.listVisualTypes();\r\n var isCategory = this.isCategory();\r\n each(option.pieces, function (piece) {\r\n each(visualTypes, function (visualType) {\r\n if (piece.hasOwnProperty(visualType)) {\r\n visualTypesInPieces[visualType] = 1;\r\n }\r\n });\r\n });\r\n each(visualTypesInPieces, function (v, visualType) {\r\n var exists = false;\r\n each(this.stateList, function (state) {\r\n exists = exists || has(option, state, visualType)\r\n || has(option.target, state, visualType);\r\n }, this);\r\n !exists && each(this.stateList, function (state) {\r\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\r\n });\r\n }, this);\r\n function has(obj, state, visualType) {\r\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\r\n }\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n };\r\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var pieceList = this._pieceList;\r\n var selected = (isInit ? thisOption : newOption).selected || {};\r\n thisOption.selected = selected;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (!selected.hasOwnProperty(key)) {\r\n selected[key] = true;\r\n }\r\n }, this);\r\n if (thisOption.selectedMode === 'single') {\r\n var hasSel_1 = false;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (selected[key]) {\r\n hasSel_1\r\n ? (selected[key] = false)\r\n : (hasSel_1 = true);\r\n }\r\n }, this);\r\n }\r\n };\r\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\r\n return this._mode === 'categories'\r\n ? piece.value + '' : piece.index + '';\r\n };\r\n PiecewiseModel.prototype.getPieceList = function () {\r\n return this._pieceList;\r\n };\r\n PiecewiseModel.prototype._determineMode = function () {\r\n var option = this.option;\r\n return option.pieces && option.pieces.length > 0\r\n ? 'pieces'\r\n : this.option.categories\r\n ? 'categories'\r\n : 'splitNumber';\r\n };\r\n PiecewiseModel.prototype.setSelected = function (selected) {\r\n this.option.selected = clone(selected);\r\n };\r\n PiecewiseModel.prototype.getValueState = function (value) {\r\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\r\n return index != null\r\n ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]\r\n ? 'inRange' : 'outOfRange')\r\n : 'outOfRange';\r\n };\r\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\r\n var result = [];\r\n var pieceList = this._pieceList;\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\r\n pIdx === pieceIndex && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({ seriesId: seriesModel.id, dataIndex: dataIndices });\r\n }, this);\r\n return result;\r\n };\r\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\r\n var representValue;\r\n if (this.isCategory()) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n if (piece.value != null) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n var pieceInterval = piece.interval || [];\r\n representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)\r\n ? 0\r\n : (pieceInterval[0] + pieceInterval[1]) / 2;\r\n }\r\n }\r\n return representValue;\r\n };\r\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\r\n if (this.isCategory()) {\r\n return;\r\n }\r\n var stops = [];\r\n var outerColors = ['', ''];\r\n var visualMapModel = this;\r\n function setStop(interval, valueState) {\r\n var representValue = visualMapModel.getRepresentValue({\r\n interval: interval\r\n });\r\n if (!valueState) {\r\n valueState = visualMapModel.getValueState(representValue);\r\n }\r\n var color = getColorVisual(representValue, valueState);\r\n if (interval[0] === -Infinity) {\r\n outerColors[0] = color;\r\n }\r\n else if (interval[1] === Infinity) {\r\n outerColors[1] = color;\r\n }\r\n else {\r\n stops.push({ value: interval[0], color: color }, { value: interval[1], color: color });\r\n }\r\n }\r\n var pieceList = this._pieceList.slice();\r\n if (!pieceList.length) {\r\n pieceList.push({ interval: [-Infinity, Infinity] });\r\n }\r\n else {\r\n var edge = pieceList[0].interval[0];\r\n edge !== -Infinity && pieceList.unshift({ interval: [-Infinity, edge] });\r\n edge = pieceList[pieceList.length - 1].interval[1];\r\n edge !== Infinity && pieceList.push({ interval: [edge, Infinity] });\r\n }\r\n var curr = -Infinity;\r\n each(pieceList, function (piece) {\r\n var interval = piece.interval;\r\n if (interval) {\r\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\r\n setStop(interval.slice());\r\n curr = interval[1];\r\n }\r\n }, this);\r\n return { stops: stops, outerColors: outerColors };\r\n };\r\n PiecewiseModel.type = 'visualMap.piecewise';\r\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n selected: null,\r\n minOpen: false,\r\n maxOpen: false,\r\n align: 'auto',\r\n itemWidth: 20,\r\n itemHeight: 14,\r\n itemSymbol: 'roundRect',\r\n pieces: null,\r\n categories: null,\r\n splitNumber: 5,\r\n selectedMode: 'multiple',\r\n itemGap: 10,\r\n hoverLink: true\r\n });\r\n return PiecewiseModel;\r\n}(VisualMapModel));\r\nvar resetMethods = {\r\n splitNumber: function (outPieceList) {\r\n var thisOption = this.option;\r\n var precision = Math.min(thisOption.precision, 20);\r\n var dataExtent = this.getExtent();\r\n var splitNumber = thisOption.splitNumber;\r\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\r\n thisOption.splitNumber = splitNumber;\r\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\r\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\r\n precision++;\r\n }\r\n thisOption.precision = precision;\r\n splitStep = +splitStep.toFixed(precision);\r\n if (thisOption.minOpen) {\r\n outPieceList.push({\r\n interval: [-Infinity, dataExtent[0]],\r\n close: [0, 0]\r\n });\r\n }\r\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\r\n var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);\r\n outPieceList.push({\r\n interval: [curr, max],\r\n close: [1, 1]\r\n });\r\n }\r\n if (thisOption.maxOpen) {\r\n outPieceList.push({\r\n interval: [dataExtent[1], Infinity],\r\n close: [0, 0]\r\n });\r\n }\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece, index) {\r\n piece.index = index;\r\n piece.text = this.formatValueText(piece.interval);\r\n }, this);\r\n },\r\n categories: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.categories, function (cate) {\r\n outPieceList.push({\r\n text: this.formatValueText(cate, true),\r\n value: cate\r\n });\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n },\r\n pieces: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.pieces, function (pieceListItem, index) {\r\n if (!isObject(pieceListItem)) {\r\n pieceListItem = { value: pieceListItem };\r\n }\r\n var item = { text: '', index: index };\r\n if (pieceListItem.label != null) {\r\n item.text = pieceListItem.label;\r\n }\r\n if (pieceListItem.hasOwnProperty('value')) {\r\n var value = item.value = pieceListItem.value;\r\n item.interval = [value, value];\r\n item.close = [1, 1];\r\n }\r\n else {\r\n var interval = item.interval = [];\r\n var close_1 = item.close = [0, 0];\r\n var closeList = [1, 0, 1];\r\n var infinityList = [-Infinity, Infinity];\r\n var useMinMax = [];\r\n for (var lg = 0; lg < 2; lg++) {\r\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\r\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\r\n interval[lg] = pieceListItem[names[i]];\r\n close_1[lg] = closeList[i];\r\n useMinMax[lg] = i === 2;\r\n }\r\n interval[lg] == null && (interval[lg] = infinityList[lg]);\r\n }\r\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\r\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\r\n if (__DEV__) {\r\n if (interval[0] > interval[1]) {\r\n console.warn('Piece ' + index + 'is illegal: ' + interval\r\n + ' lower bound should not greater then uppper bound.');\r\n }\r\n }\r\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\r\n item.value = interval[0];\r\n }\r\n }\r\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\r\n outPieceList.push(item);\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece) {\r\n var close = piece.close;\r\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\r\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\r\n }, this);\r\n }\r\n};\r\nfunction normalizeReverse(thisOption, pieceList) {\r\n var inverse = thisOption.inverse;\r\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\r\n pieceList.reverse();\r\n }\r\n}\r\nComponentModel.registerClass(PiecewiseModel);\n\nvar PiecewiseVisualMapView = (function (_super) {\r\n __extends(PiecewiseVisualMapView, _super);\r\n function PiecewiseVisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseVisualMapView.type;\r\n return _this;\r\n }\r\n PiecewiseVisualMapView.prototype.doRender = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var textStyleModel = visualMapModel.textStyleModel;\r\n var textFont = textStyleModel.getFont();\r\n var textFill = textStyleModel.getTextColor();\r\n var itemAlign = this._getItemAlign();\r\n var itemSize = visualMapModel.itemSize;\r\n var viewData = this._getViewData();\r\n var endsText = viewData.endsText;\r\n var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText);\r\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\r\n each(viewData.viewPieceList, function (item) {\r\n var piece = item.piece;\r\n var itemGroup = new Group();\r\n itemGroup.onclick = bind(this._onItemClick, this, piece);\r\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\r\n var representValue = visualMapModel.getRepresentValue(piece);\r\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\r\n if (showLabel) {\r\n var visualState = this.visualMapModel.getValueState(representValue);\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\r\n y: itemSize[1] / 2,\r\n text: piece.text,\r\n verticalAlign: 'middle',\r\n align: itemAlign,\r\n font: textFont,\r\n fill: textFill,\r\n opacity: visualState === 'outOfRange' ? 0.5 : 1\r\n }\r\n }));\r\n }\r\n thisGroup.add(itemGroup);\r\n }, this);\r\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\r\n box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\r\n this.renderBackground(thisGroup);\r\n this.positionGroup(thisGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\r\n var _this = this;\r\n itemGroup\r\n .on('mouseover', function () { return onHoverLink('highlight'); })\r\n .on('mouseout', function () { return onHoverLink('downplay'); });\r\n var onHoverLink = function (method) {\r\n var visualMapModel = _this.visualMapModel;\r\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\r\n type: method,\r\n batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\r\n });\r\n };\r\n };\r\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var modelOption = visualMapModel.option;\r\n if (modelOption.orient === 'vertical') {\r\n return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\r\n }\r\n else {\r\n var align = modelOption.align;\r\n if (!align || align === 'auto') {\r\n align = 'left';\r\n }\r\n return align;\r\n }\r\n };\r\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\r\n if (!text) {\r\n return;\r\n }\r\n var itemGroup = new Group();\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2,\r\n y: itemSize[1] / 2,\r\n verticalAlign: 'middle',\r\n align: showLabel ? itemAlign : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n group.add(itemGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._getViewData = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) {\r\n return { piece: piece, indexInModelPieceList: index };\r\n });\r\n var endsText = visualMapModel.get('text');\r\n var orient = visualMapModel.get('orient');\r\n var inverse = visualMapModel.get('inverse');\r\n if (orient === 'horizontal' ? inverse : !inverse) {\r\n viewPieceList.reverse();\r\n }\r\n else if (endsText) {\r\n endsText = endsText.slice().reverse();\r\n }\r\n return { viewPieceList: viewPieceList, endsText: endsText };\r\n };\r\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\r\n group.add(createSymbol(this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, 'color')));\r\n };\r\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\r\n var visualMapModel = this.visualMapModel;\r\n var option = visualMapModel.option;\r\n var selected = clone(option.selected);\r\n var newKey = visualMapModel.getSelectedMapKey(piece);\r\n if (option.selectedMode === 'single') {\r\n selected[newKey] = true;\r\n each(selected, function (o, key) {\r\n selected[key] = key === newKey;\r\n });\r\n }\r\n else {\r\n selected[newKey] = !selected[newKey];\r\n }\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: selected\r\n });\r\n };\r\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\r\n return PiecewiseVisualMapView;\r\n}(VisualMapView));\r\nComponentView.registerClass(PiecewiseVisualMapView);\n\nregisterPreprocessor(visualMapPreprocessor);\n\nvar DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n};\r\nvar inner$n = makeInner();\r\nvar decalPaletteScope = {};\r\nfunction ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$n(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$n(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n}\n\nfunction ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n}\n\nvar PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\nregisterPreprocessor(ariaPreprocessor);\r\nregisterVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\nfunction createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n}\n\nvar NONE = 'none';\r\nvar mathRound = Math.round;\r\nvar mathSin$4 = Math.sin;\r\nvar mathCos$4 = Math.cos;\r\nvar PI$a = Math.PI;\r\nvar PI2$a = Math.PI * 2;\r\nvar degree = 180 / PI$a;\r\nvar EPSILON$4 = 1e-4;\r\nfunction round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n}\r\nfunction round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n}\r\nfunction isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n}\r\nfunction pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n}\r\nfunction pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n}\r\nfunction setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n}\r\nfunction attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n}\r\nfunction attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n}\r\nfunction attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n}\r\nfunction bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n}\r\nvar SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$a)\r\n || (clockwise ? dTheta >= PI2$a : -dTheta >= PI2$a);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$a : (dTheta % PI2$a + PI2$a);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$a) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$a - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$a + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n}());\r\nvar svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n};\r\nvar svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n};\r\nvar TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n};\r\nfunction adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n}\r\nvar svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n};\n\nfunction diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n}\r\nfunction extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n}\r\nfunction pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n}\r\nfunction buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n}\r\nfunction clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n}\r\nfunction arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n}\n\nvar MARK_UNUSED = '0';\r\nvar MARK_USED = '1';\r\nvar Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n}());\n\nfunction isLinearGradient(value) {\r\n return value.type === 'linear';\r\n}\r\nfunction isRadialGradient(value) {\r\n return value.type === 'radial';\r\n}\r\nvar GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (value\r\n && (value.type === 'linear'\r\n || value.type === 'radial')) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n}(Definable));\n\nfunction isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n}\r\nvar patternDomMap = new WeakMap();\r\nvar PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n}(Definable));\n\nfunction generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n}\r\nfunction hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n}\r\nvar ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n}(Definable));\n\nvar ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n}(Definable));\r\nfunction hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n}\r\nfunction getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n}\n\nfunction parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n}\r\nfunction getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n}\r\nfunction checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n}\r\nfunction insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n}\r\nfunction prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n}\r\nfunction remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n}\r\nfunction removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n}\r\nfunction getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n}\r\nvar SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n}());\r\nfunction createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n}\n\nregisterPainter('svg', SVGPainter);\n\nexport { Axis, List, Model, PRIORITY, color, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format$1 as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic$1 as graphic, helper, init$1 as init, brushSingle as innerDrawElementOnCanvas, matrix, number, parseGeoJSON, parseGeoJson, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerVisual, setCanvasCreator, throttle, time, ecUtil as util, vector, version$1 as version, zrender };\n\n"]} \ No newline at end of file +{"version":3,"sources":["unknown"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","self","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","global","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DILIMITER_REG","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","nodeParsers","SVGParser","_defs","_root","_isDefine","_isText","xml","viewBox","getAttribute","parseAttributes","_parseNode","viewBoxRect","viewBoxTransform","viewBoxArr","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","defineParsers","def","_parseText","_textX","_textY","inheritStyle","textStyle","fontSize","fontFamily","fontStyle","fontWeight","internalField","circle","line","pointsStr","pointsArr","parsePoints","polygon","polyline","img","gradient","_parseGradientColorStops","offsetStr","stopColor","__inheritedStyle","pointsString","attributesMap","defs","onlyInlineStyle","zrStyle","parseTransformAttribute","parseStyleAttribute","svgAttrName","attrValue","getPaint","urlRegex","urlMatch","url","transformRegex","transformOps_1","valueArr","styleRegex","styleList","styleRegResult","exec","parseSVG","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CMD$3","PI2$6","PROP_XY","PROP_WH","tmpArr","aroundEqual","pathToBezierCurves","bezierArray","currentSubpath","createNewSubpath","addLine","addArc","tan","c1","s1","c2","s2","x4","y4","hx","hy","nextAngle","alignSubpath","subpath1","subpath2","shorterPath","shorterLen","shorterBezierCount","eachCurveSubDivCount","newSubpath","remained","tmpSegX","tmpSegY","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastX","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","centroid","signedArea","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","score","newArr","findBestMorphingRotation","fromArr","toArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","tmpArr_1","sa","ca","newX1","newY1","i_1","to","morphPath","fromPath","toPath","animationOpts","fromPathProxy","toPathProxy","isIndividualMorphingPath","__oldBuildPath","fromBezierCurves","toBezierCurves","morphingData","becomeIndividualMorphingPath","oldDone","oldAborted","oldDuring","__morphT","restoreIndividualMorphingPath","morphingPathBuildPath","__morphingData","newCp","item","morphT","updateIndividualMorphingPath","morphingPath","isCombiningPath","__combiningSubList","isInAnyMorphing","combine","fromPathList","copyPropsIfDivided","fromIndividuals","separateCount","fromCombiningSubList","dividingMethod","toPathSplittedList","divideShape","doneCount","abortedCalled","morphAnimationOpts","restoreCombiningPath","becomeCombiningPath","toIndividuals","count","combiningSubList","updateCombiningPathSubList","combiningPath","__oldAddSelfToZr","__oldRemoveSelfFromZr","combiningAddSelfToZr","combiningRemoveSelfFromZr","combiningChildrenRef","combiningPathSubListAddRemoveWithZr","method","separate","toPathList","toPathListLen","copyProps","duplicateShape","splitShape","resultPaths","toPathShape","splitPropIdx","propWH","propXY","subWH","xyCurr","subShape","splitted","endAngleNormalized","normalizeRadian$1","angleCurr","ctor","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","getType","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","seriesIndices","airaOption","enabled","mergeTheme","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","define","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","setItemVisualFromData","PI2$7","CMD$4","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpArr$1","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","finderOpt","fromResult","toResult","toSeries","dimension","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","getLayoutOnAxis","baseAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","RegExp","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","getValue","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","dimLoose","sampleLog","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_1","errMsg_2","comparator","item0","item1","orderDef","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$8","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","IndicatorAxis","radiusExtent","Radar","radarModel","_indicatorAxes","getIndicatorModels","indicatorModel","indicatorAxis","getIndicatorAxes","indicatorIndex","coordToPoint","minRadianDiff","closestAxis","closestAxisIdx","viewSize","indicatorAxes","radarSeries","increaseInterval","fixedMin","fixedMax","nicedSplitNumber","pixel","radarList","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","indicator","axisBuilderAttrs$1","RadarView","_buildAxes","_buildSplitLineAndArea","axisBuilders","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","getColorIndex","areaOrLine","areaOrLineColorList","ticksRadius","realSplitNumber_1","axesTicksPoints","prevPoints","RadarSeriesModel","nameToDisplay","getTooltipPosition","radarIndex","normalizeSymbolSize","RadarView$1","createSymbol$1","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","radarLayout","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","polarIndex","geoCoord","points$1","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","geoCoordMap","fixGeoCoords","points$2","fixDiaoyuIsland","inner$6","geoJSONLoader","load","mapRecord","parsed","regionName","specialArea","getBoundingRect$1","regionRect","inner$7","geoSVGLoader","originRoot","buildGraphic","makeGraphic","hostKey","rootMap","originRootHostKey","removeGraphic","loaders","geoSourceManager","regionsMap","nameCoordMap","mapRecords","singleSource","results","mapNotExistsError","MapSeries","needsDrawMap","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","getMapType","getHostGeoModel","geoIndex","getRegionModel","seriesNames","otherIndex","originalData","setZoom","setCenter","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","areaColor","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","getFixedItemStyle","MapDraw","_controller","_controllerHost","_regionsGroup","mapOrGeoModel","fromView","isGeo","mapSeries","_updateBackground","regionsGroup","transformInfo","getTransformInfo","isFirstDraw","targetScaleX","targetScaleY","roamTransform","isVisualEncodedByVisualMap","regionGroup","compoundPath","regionModel","itemStyleModel","emphasisItemStyleModel","blurItemStyleModel","selectItemStyleModel","rawScaleX","rawScaleY","rawX","rawY","transformPoint","interior","points_1","showLabel","isDataNaN","centerPt","regionModel_1","groupRegions","__regions","_updateController","_updateMapSelectHandler","_mapName","getZoom","makeActionBase","_mouseDownFlag","getViewRectAfterRoam","mapDraw","MapView","mapModel","_mapDraw","_renderSymbols","originalDataIndex","fullData","mainSeries","fullIndex_1","updateCenterAndZoom","previousZoom","getCenter","fixX","fixY","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_viewRect","rawTransform","_updateTransform","centerCoord","_center","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","defaultCenter","roamTransformable","rawTransformable","_rawTransform","noRoam","getCoordSys","Geo","invertLongitute","_nameCoordMap","_regionsMap","_invertLongitute","containCoord","getRegionByCoord","addGeoCoord","getGeoCoord","getCoordSys$1","geoModel","resizeGeo","leftTop","rightBottom","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","inner$8","linkList","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","depth","viewChildren","isExpand","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","getAncestorsIndices","currNode","getDescendantIndices","childNode","getLevelModel","levelModels","isAncestorOf","isDescendantOf","Tree","_nodes","getNodeByDataIndex","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","addChild","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","getOrient","realRoot","edgeShape","edgeForkPosition","roam","nodeScaleRatio","curveness","init$2","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","getViewRect$1","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","symbolNeedsDraw$1","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","groupZoom","roamZoom","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","__radialOldRawX","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","rootLayout","isLeft","labelRotateRadian","focusDataIndices","drawEdge","__edge","parentEl","curvature","getEdgeShape","childLayout","removeAnimationOpt","sourceEdge","layoutOpt","radialCoor1","radialCoor2","radialCoor3","radialCoor4","eachAfter","eachBefore","treeLayout","commonLayout","separation$1","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","resetViewRoot","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","getViewRoot","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","normalStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","itemWidth","availableSize","itemNode","makeItemPoints","onclick","packEventData","itemHeight","selfType","AnimationWrap","_elExistsMap","_finishedCallback","checkTerminate","createWrap","Group$1","Rect$1","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z_BASE","Z_BG","Z_CONTENT","getStateItemStyle","getItemStyleNormal","inner$9","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","_doAnimation","renderFinally","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","els","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","renderContent","useUpperLabel","processInvisible","visualBorderColor","selectStyle","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","iconChar","isShow","addDrillDownIcon","textEmphasisState","lasts","prepareAnimationWhenHasOld","calculateZ","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","zInLevel","zb","noop$1","actionTypes","i$1","handleRootToNode","originViewRoot","each$4","isObject$4","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","inner$a","treemapVisual","travelTree","designatedVisual","viewRootAncestors","nodeLayout","nodeItemStyleModel","visuals","buildVisuals","thisNodeColor","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","mathMax$7","mathMin$7","each$5","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","treemapLayout","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","worst","orderBy","overLeafDepth","sort$1","statistic","filterByThreshold","orderedChildren","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","getNodeByIndex","addEdge","n1","n2","edgesMap","GraphEdge","outEdges","inEdges","getEdgeByIndex","getEdge","eachEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","degree","inDegree","outDegree","getAdjacentDataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getGraphicEl","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","GraphSeriesModel","getCategoriesData","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryIdx","categoryModel","oldGetModel","newGetModel","newPathArr","getGraph","getEdgeData","sourceName","nodeMarkup","categoriesData","circular","rotateLabel","initLayout","repulsion","gravity","friction","edgeLength","layoutAnimation","edgeSymbol","edgeSymbolSize","edgeLabel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","getNodeGlobalScale","v3","v2DistSquare","mathAbs$2","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide$1","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","forceLayout","_startForceLayoutIteration","warmUp","_layouting","setFixed","setUnfixed","circularRotateLabel","categoryFilter","graphSeries","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryStyle","visualList","normalize$2","graphEdgeVisual","simpleLayout","simpleLayoutEdge","graphSimpleLayout","PI$7","_symbolRadiansHalf","circularLayout","basedOn","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","graphCircularLayout","scaleAndAdd$1","inNodes","pp","initialFriction","beforeStepCallback","afterStepCallback","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","nodeDataExtent_1","edgeDataExtent_1","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getViewRect$2","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","GaugeSeriesModel","icon","PointerShape","PointerPath","parsePosition","formatLabel","PI2$9","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","FunnelSeriesModel","minSize","funnelAlign","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","getViewRect$3","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelIndex","parallelOption","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","each$6","mathMin$8","mathMax$8","mathFloor$2","mathCeil$1","round$2","PI$8","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","layoutExtent","axisCount","axisExpandWidth","restrict$1","axisExpandCount","axisExpandable","axisExpandWindow","winSize","axisExpandCenter","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","eachActiveState","dataDimensions","axisModels","hasActiveSet","hasAxisBrushed","activeState","getActiveState","axisLayout","getAxisLayout","getSlidedAxisExpandWindow","behavior","pointCoord","triggerArea","useJump","winSize2","create$2","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","defaultOption$1","areaSelectStyle","realtime","ParallelModel","_initDimensions","setAxisExpand","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","actionInfo$1","parallelAxisModel","BRUSH_PANEL_GLOBAL","mathMin$9","mathMax$9","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","parallelAxisId","CLICK_THRESHOLD","ParallelView","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","triggerOn","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","theActiveState","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","DEFAULT_SMOOTH","ParallelView$1","_dataGroup","dataGroup","makeSeriesScope$2","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","opacityAccessPath$1","parallelVisual","opacityMap","active","inactive","itemOpacity","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","localX","localY","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","sourceColor","targetColor","dragX","dragY","createGridClipShape$1","sankeyLayout","getViewRect$4","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","center$1","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","WhiskerBoxCommonMixin","xAxisType","yAxisType","addOrdinal","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotVisual","each$7","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","availableWidth","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","low","high","itemNameFormatter","outlier","boxplotTransform","CandlestickSeriesModel","getShadowDim","brushRect","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","createNormalBox$1","setBoxCommon","createLarge$1","NormalBoxPathShape","NormalBoxPath","__simpleBox","transInit$1","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","setLargeStyle$1","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","LargeArr$1","candlestickLayout","candleWidth","calculateCandleWidth","openDim","closeDim","lowestDim","highestDim","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","getSign","makeBrushRect","pmin","pmax","EffectScatterSeriesModel","effectType","showEffectOn","rippleEffect","period","EFFECT_RIPPLE_NUMBER","normalizeSymbolSize$1","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","EffectScatterView","effectSymbolDraw","_updateGroupTransform","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","getLineCoordsCount","getLineCoords","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","CoordSys","effect","constantSpeed","trailLength","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","delayExpr","_updateAnimationPoints","_getLineLength","_period","delayNum","__t","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt$1","__lastT","Polyline$1","_createPolyline","hoverLineStyle","lineEmphasisState","EffectPolyline","accLenArr","_length","_offsets","offsets","LargeLinesPathShape","LargeLinesPath","LargeLineDraw","lineEl","linesLayout","isPolyline","isLarge","lineCoords","totalCoordsCount","LinesView","_updateLineDraw","_lastZlevel","_showEffect","notInIndividual_1","otherSeriesModel","hasEffect","_hasEffet","_isPolyline","normalize$3","linesVisual","HeatmapSeriesModel","blurSize","pointSize","maxOpacity","minOpacity","GRADIENT_LEVELS","HeatmapLayer","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_incrementalDisplayable","_renderOnCartesianAndCalendar","_renderOnGeo","dataDimX","dataDimY","dataToRect","contentShape","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","PictorialBarSeriesModel","symbolPosition","symbolMargin","symbolRepeat","symbolRepeatDirection","symbolClip","symbolBoundingData","symbolPatternSize","BAR_BORDER_WIDTH_QUERY$1","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","updateCommon$1","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","categorySize","parsedSymbolSize","unitLength","pathLen","absBoundingLength","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","updateAttr","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","pathes","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","SingleAxis","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","getCoordSys$2","singleModel","create$3","singles","layout$2","positionMap","directionMap","axisBuilderAttrs$2","selfBuilderAttrs$1","SingleAxisView","axisElementBuilders$1","SingleAxisModel","findPointFromSeries","isStacked","inner$b","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$c","each$8","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","inner$d","clone$3","bind$1","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","elOption","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","XY","WH","SingleAxisPointer","getPointDimIndex","pointerShapeBuilder$1","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","getLayerSeries","lenCount","indexArr","timeDim","layerSeries","index1","index2","nearestIdx","pointNum","theValue","singleAxisIndex","ThemeRiverView","layersSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","layerGroup","createGridClipShape$2","themeRiverLayout","doThemeRiverLayout","layerPoints","singleLayer","computeBaseline","baseLine","baseY0","layerIndex","sums","temp","SunburstSeriesModel","completeTreeValue$1","renderLabelForZeroData","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_ecModel","labelMinAngle","isNormalShown","labelStateModel","isShown","getLabelAttr","sectorState","labelColor","labelPadding","rotateType","stateAttr","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","handleHighlight","UNHIGHLIGHT_ACTION","SunburstView","newRoot","newChildren","oldChildren","_oldChildren","renderRollUp","newNode","virtualPiece","targetFound","RADIAN$2","sunburstLayout","rootDepth","initChildren$1","renderRollupNode","rPerLevel","rStart","rEnd","siblingAngle_1","sortOrder","sort$2","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","dataToCoordSize$1","geoPrepareCustom","dataToCoordSize$2","singlePrepareCustom","dataToCoordSize$3","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","deprecatedLogs","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","warnDeprecated","deprecated","insteadApproach","inner$e","TRANSFORM_PROPS","transformPropNamesStr","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","GROUP_DIFF_PREFIX","attachedTxInfoTmp","LEGACY_TRANSFORM_PROPS","tmpTransformable","prepareCustoms","CustomSeriesModel","currentZLevel","currentZ","CustomSeriesView","customSeries","renderItem","makeRenderItem","doRemoveEl","createOrUpdateItem","morphPreparation_1","MorphPreparation","createGetKey","findAndAddFrom","hasFrom","removeElementDirectly","applyMorphing","oldIndices","newLen","setIncrementalAndHoverLayer","elementName","diffByDimName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","isMorphTo","styleOpt","attachedTxInfo","isTextContent","transFromProps","allPropsFinal","elDisplayable","prepareShapeOrExtraTransitionFrom","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareTransformAllPropsFinal","txCfgOpt","textOptionStyle","decalPattern","decalObj","isPath$1","__decalPattern","prepareStyleTransitionFrom","applyPropsFinal","applyTransitionFrom","originalDecalObj","userDuring","cfgDuringCall","duringCall","mainAttr","morphFromEl","attrOpt","elPropsInAttr","transFromPropsInAttr","enterFrom","enterFromKeys","transitionKeys","elVal","checkNonStyleTansitionRefer","elPropsInAttrKeys","isNonStyleTransitionEnabled","leaveTo","leaveToProps","getOrCreateLeaveToPropsFromEl","leaveToPropsInAttr","leaveToKeys","allProps","allPropsInAttr","keysInAttr","checkTransformPropRefer","fromTransformable","calcOldElLocalTransformBasedOnNewElParent","setTransformPropToTransitionFrom","setLagecyTransformProp","setTransformProp","fromEl","fromElStyle","transFromStyleProps","animationStyleProps","styleKeys","leaveToStyleProps","newEl","tmpM","oldGlobalTransform","newParent","optVal","usedIn","innerEl","tmpDuringScope","customDuringAPI","assertNotReserved","isShapeDirty","getShape","isStyleDirty","setExtra","getExtra","newstUserDuring","scopeUserDuring","updateElOnState","elStateOpt","isRoot","existingEmphasisState","updateZ$1","optZ2","updateZForEachState","retrieveStateOption","targetProps","legacyName","legacyArr","xyName","transitionFrom","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currDataIndexInside","currItemModel","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","morphPreparation","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","elIsNewCreated","canMorph","morph","thisElIsMorphTo","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","pendingAllPropsFinal","addTo","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","processAddUpdate","processRemove","childOption","_fromList","_toList","_toElOptionList","_allPropsFinalList","_toDataIndices","_morphConfigList","_transOpt","_type","fromList","toList","toListLen","fromListLen","toIdx","_oneToOneForSingleTo","fromSingleSegLen","fromIdxStart","fromCount","_manyToOneForSingleTo","toSingleSegLen","toIdxStart","fromIdx","toCount","_oneToManyForSingleFrom","toElOption","toDataIndex","elAnimationConfig","_getOrCreateMorphConfig","morphDuration","combineResult","copyPropsWhenDivided","_processResultIndividuals","morphFrom","combineFromList","separateToList","separateResult","combineSeparateResult","isSeparate","fromIndividual","toIndividual","morphConfigList","delayOption","srcPath","tarPath","willClone","getSeriesStackId$1","getAxisKey$1","barLayoutPolar","calRadialBar","clampLayout","radiusSpan","angleSpan","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","angleAxisExtraOption","radiusAxisExtraOption","RadiusAxis","radiusToData","inner$f","AngleAxis","angleToData","Polar","_radiusAxis","_angleAxis","maxAngle","getCoordSys$3","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","elementList$1","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","axisBuilderAttrs$3","selfBuilderAttrs$2","RadiusAxisView","newAxisGroup","axisAngle","layoutAxis","axisElementBuilders$2","prevRadius","PolarAxisPointer","coordValue","pointerShapeBuilder$2","getLabelPosition","GeoView","_handleRegionClick","updateSelectStatus","geoId","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","makeAction","PROXIMATE_ONE_DAY","Calendar","calendarModel","_rangeInfo","_sw","_sh","_orient","getFirstDayOfWeek","_firstDayOfWeek","getDateInfo","mStr","dStr","getDay","formatedDate","getNextNDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","cellSize","getCellSize","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tl","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","getCoordSys$4","normalizedRange","rangeStr","firstDay","setMonth","parsedRange","reversed","startDateNum","endDateNum","dateNum","fweek","lweek","nthDay","calendarList","calendarSeries","CalendarModel","mergeAndNormalizeLayoutParams","raw","cellSizeArr","MONTH_TEXT","EN","CN","WEEK_TEXT","CalendarView","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","weekText","inner$g","_nonShapeGraphicElements","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elExisting","parentId","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","createEl$1","removeEl","textContentExisting","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","layout$3","viewportSize","makeBackground","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","tooltipModel","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","each$9","inner$h","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","dataZoomModel","percentRange","getPercentRange","clear$1","snapshots","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SelectDataZoomModel","SelectDataZoomView","each$a","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","_dataExtent","percentExtent","percentWindow","valueWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","eachAxisModel","proxyList","valueRange","each$b","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers$1","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","ratioX","ratioY","visibility","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$c","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","each$d","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","PRIORITY_BRUSH","layoutCovers","brushModel","brushSelected","throttleDelay","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushView","$from","ICON_TYPES","BrushFeature","isBrushed","_brushMode","command","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","controlPosition","itemStyleEmphasis","labelNormal","excludeLabelAttr","currentIndex","setCurrentIndex","isIndexMax","setPlayState","playState","TimelineModel","_initData","autoPlay","getPlayState","dataArr","_names","processedDataArr","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","PI$9","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","labelPosOpt","getViewRect$5","parsedLabelPos","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","playPosition","prevBtnPosition","nextBtnPosition","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","createScaleByModel$1","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","makeBtn","_handlePlayClick","willRotate","iconSize","btn","makeControlIcon","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","fillLabel","inner$i","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$j","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","inner$k","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","toSymbolRotate","toSymbolSize","optData","dimValueGetter$1","MarkAreaModel","inner$l","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","allSelect","inverseSelect","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","curry$1","each$e","Group$2","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendSymbolType","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams$1","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","Group$3","WH$1","XY$1","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","zoomLock","brushSelect","Rect$2","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","InsideZoomModel","disabled","inner$m","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","dispatchAction$1","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","each$f","visualMapPreprocessor","has$1","pieces","splitList","calculable","VISUAL_PRIORITY","isTargetSeries","getDataDimension","getVisualMeta","getColorVisual","concreteDim","resultVisual","visualDefault","defaultOption$2","mapVisual$1","isArray$1","each$g","asc$2","linearMap$1","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getTargetSeriesIndices","optionSeriesIndex","is","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","optDim","listDimensions","completeSingle","completeInactive","completeController","stateExist","stateAbsent","optExist","optAbsent","defa","symbolExists","symbolSizeExists","max_1","setSelected","getSelected","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","linearMap$2","each$h","mathMin$a","mathMax$a","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","getCursor$1","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","currValue","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","hoverLinkDataSize","hoverLinkOnHandle","actionInfo$2","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","itemSymbol","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","DEFAULT_OPTION","inner$n","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$a","PI2$a","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","getElementsByTagName","defs_1","doUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","isGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAA;;;;;;;;;;;;;;;AAcA;AAEA,IAAIA,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,EAAAA,aAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,IAAAA,SAAS,EAAE;AAAb,eAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,IAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAkB,GAD/D,IAEZ,UAAUD,CAAV,EAAaC,CAAb,EAAgB;AAAE,SAAK,IAAIK,CAAT,IAAcL,CAAd,EAAiB,IAAIA,CAAC,CAACM,cAAF,CAAiBD,CAAjB,CAAJ,EAAyBN,CAAC,CAACM,CAAD,CAAD,GAAOL,CAAC,CAACK,CAAD,CAAR;AAAc,GAF9E;;AAGA,SAAOP,aAAa,CAACC,CAAD,EAAIC,CAAJ,CAApB;AACH,CALD;;AAOA,SAASO,SAAT,CAAmBR,CAAnB,EAAsBC,CAAtB,EAAyB;AACrBF,EAAAA,aAAa,CAACC,CAAD,EAAIC,CAAJ,CAAb;;AACA,WAASQ,EAAT,G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AtsB,EAA4sB36U,MAA5sB,EAAotB0+I,SAAS,IAAIlpJ,OAAjuB,EAA0uBgvE,OAA1uB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nvar Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n}());\r\nvar Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n}());\r\nvar env = new Env();\r\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n}\r\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n}\r\nelse if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n}\r\nelse {\r\n detect(navigator.userAgent, env);\r\n}\r\nfunction detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n}\n\nvar BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n};\r\nvar TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n};\r\nvar objToString = Object.prototype.toString;\r\nvar arrayProto = Array.prototype;\r\nvar nativeForEach = arrayProto.forEach;\r\nvar nativeFilter = arrayProto.filter;\r\nvar nativeSlice = arrayProto.slice;\r\nvar nativeMap = arrayProto.map;\r\nvar ctorFunction = (function () { }).constructor;\r\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\nvar methods = {};\r\nfunction $override(name, fn) {\r\n methods[name] = fn;\r\n}\r\nvar idStart = 0x0907;\r\nfunction guid() {\r\n return idStart++;\r\n}\r\nfunction logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(console, args);\r\n }\r\n}\r\nfunction clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\nfunction merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n}\r\nfunction mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n}\r\nfunction extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n}\r\nfunction defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n}\r\nvar createCanvas = function () {\r\n return methods.createCanvas();\r\n};\r\nmethods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n};\r\nfunction indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n}\r\nfunction inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n}\r\nfunction mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n}\r\nfunction isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n}\r\nfunction each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n}\r\nfunction map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n}\r\nfunction reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n}\r\nfunction filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\nfunction find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n}\r\nfunction keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n}\r\nfunction bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n}\r\nvar bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\nfunction curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n}\r\nfunction isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n}\r\nfunction isFunction(value) {\r\n return typeof value === 'function';\r\n}\r\nfunction isString(value) {\r\n return typeof value === 'string';\r\n}\r\nfunction isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n}\r\nfunction isNumber(value) {\r\n return typeof value === 'number';\r\n}\r\nfunction isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n}\r\nfunction isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n}\r\nfunction isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n}\r\nfunction isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n}\r\nfunction isGradientObject(value) {\r\n return value.colorStops != null;\r\n}\r\nfunction isPatternObject(value) {\r\n return value.image != null;\r\n}\r\nfunction isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n}\r\nfunction eqNaN(value) {\r\n return value !== value;\r\n}\r\nfunction retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n}\r\nfunction retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n}\r\nfunction retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n}\r\nfunction slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n}\r\nfunction normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n}\r\nfunction assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n}\r\nfunction trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n}\r\nvar primitiveKey = '__ec_primitive__';\r\nfunction setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n}\r\nfunction isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n}\r\nvar HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n}());\r\nfunction createHashMap(obj) {\r\n return new HashMap(obj);\r\n}\r\nfunction concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n}\r\nfunction createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n}\r\nfunction hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n}\r\nfunction noop() { }\n\nvar zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n});\n\nfunction create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n}\r\nfunction copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n}\r\nfunction clone$1(v) {\r\n return [v[0], v[1]];\r\n}\r\nfunction set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n}\r\nfunction add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n}\r\nfunction scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n}\r\nfunction sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n}\r\nfunction len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n}\r\nvar length = len;\r\nfunction lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n}\r\nvar lengthSquare = lenSquare;\r\nfunction mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n}\r\nfunction div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n}\r\nfunction dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n}\r\nfunction scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n}\r\nfunction normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n}\r\nfunction distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n}\r\nvar dist = distance;\r\nfunction distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n}\r\nvar distSquare = distanceSquare;\r\nfunction negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n}\r\nfunction lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n}\r\nfunction applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n}\r\nfunction min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n}\r\nfunction max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n}\n\nvar vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n});\n\nvar Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n}());\r\nvar Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n}());\n\nvar Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n}());\n\nvar LN2 = Math.log(2);\r\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n}\r\nfunction buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n}\n\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\nvar _calcOut = [];\r\nfunction transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n}\r\nfunction transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n}\r\nfunction preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n}\r\nfunction isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n}\n\nvar isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\nvar _calcOut$1 = [];\r\nfunction clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n}\r\nfunction calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n}\r\nfunction getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n}\r\nfunction normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n}\r\nfunction getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n}\r\nfunction addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n}\r\nfunction removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n}\r\nvar stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\nfunction isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n}\n\nvar GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n}());\r\nfunction dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n}\r\nfunction center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n}\r\nvar recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n};\n\nvar SILENT = 'silent';\r\nfunction makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n}\r\nfunction stopEvent() {\r\n stop(this.event);\r\n}\r\nvar EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n}(Eventful));\r\nvar HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n}());\r\nvar handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n];\r\nvar Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n}(Eventful));\r\neach(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n});\r\nfunction isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n}\r\nfunction isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n}\n\nfunction create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n}\r\nfunction identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n}\r\nfunction copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n}\r\nfunction mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n}\r\nfunction translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n}\r\nfunction rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n}\r\nfunction scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n}\r\nfunction invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n}\r\nfunction clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n}\n\nvar matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n});\n\nvar mIdentity = identity;\r\nvar EPSILON = 5e-5;\r\nfunction isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n}\r\nvar scaleTmp = [];\r\nvar tmpTransform = [];\r\nvar originTransform = create$1();\r\nvar abs = Math.abs;\r\nvar Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n}());\n\nvar easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n};\n\nvar Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n}());\n\nvar Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n}());\r\nvar LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n}());\r\nvar LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n}());\n\nvar kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n};\r\nfunction clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n}\r\nfunction clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n}\r\nfunction clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n}\r\nfunction parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n}\r\nfunction parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n}\r\nfunction cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n}\r\nfunction lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n}\r\nfunction setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n}\r\nfunction copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n}\r\nvar colorCache = new LRU(20);\r\nvar lastRemovedArr = null;\r\nfunction putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n}\r\nfunction parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n}\r\nfunction hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n}\r\nfunction rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n}\r\nfunction lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n}\r\nfunction toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n}\r\nfunction fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n}\r\nvar fastMapToColor = fastLerp;\r\nfunction lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n}\r\nvar mapToColor = lerp$1;\r\nfunction modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n}\r\nfunction modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n}\r\nfunction stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n}\r\nfunction lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n}\r\nfunction random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n}\n\nvar color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n});\n\nvar arraySlice = Array.prototype.slice;\r\nfunction interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n}\r\nfunction step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n}\r\nfunction interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n}\r\nfunction interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n}\r\nfunction add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n}\r\nfunction add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n}\r\nfunction fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n}\r\nfunction catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n}\r\nfunction catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n}\r\nfunction cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n}\r\nfunction rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n}\r\nfunction guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n}\r\nvar tmpRgba = [0, 0, 0, 0];\r\nvar Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n}());\r\nvar Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop && additiveTo) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n}());\n\nvar Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n}());\n\nvar mathMin = Math.min;\r\nvar mathMax = Math.max;\r\nvar lt = new Point();\r\nvar rb = new Point();\r\nvar lb = new Point();\r\nvar rt = new Point();\r\nvar minTv = new Point();\r\nvar maxTv = new Point();\r\nvar BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n}());\n\nvar textWidthCache = {};\r\nvar DEFAULT_FONT = '12px sans-serif';\r\nvar _ctx;\r\nvar _cachedFont;\r\nfunction defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n}\r\nvar methods$1 = {\r\n measureText: defaultMeasureText\r\n};\r\nfunction getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n}\r\nfunction innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n}\r\nfunction getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n}\r\nfunction adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n}\r\nfunction adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n}\r\nfunction getLineHeight(font) {\r\n return getWidth('国', font);\r\n}\r\nfunction parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n}\r\nfunction calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n}\n\nvar dpr = 1;\r\nif (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n}\r\nvar devicePixelRatio = dpr;\r\nvar DARK_MODE_THRESHOLD = 0.4;\r\nvar DARK_LABEL_COLOR = '#333';\r\nvar LIGHT_LABEL_COLOR = '#ccc';\r\nvar LIGHTER_LABEL_COLOR = '#eee';\n\nvar PRESERVED_NORMAL_STATE = '__zr_normal__';\r\nvar PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\nvar DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n};\r\nvar tmpTextPosCalcRes = {};\r\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\nvar Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n}());\r\nmixin(Element, Eventful);\r\nmixin(Element, Transformable);\r\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n}\r\nfunction copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n}\r\nfunction is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n}\r\nfunction copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n}\r\nfunction animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n}\n\nvar DEFAULT_MIN_MERGE = 32;\r\nvar DEFAULT_MIN_GALLOPING = 7;\r\nfunction minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n}\r\nfunction makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n}\r\nfunction reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n}\r\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n}\r\nfunction gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n}\r\nfunction gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n}\r\nfunction TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n}\r\nfunction sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n}\n\nvar invalidZErrorLogged = false;\r\nfunction logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n}\r\nfunction shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n}\r\nvar Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n}());\n\nvar requestAnimationFrame;\r\nrequestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n};\r\nvar requestAnimationFrame$1 = requestAnimationFrame;\n\nvar Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n}(Eventful));\n\nvar TOUCH_CLICK_DELAY = 300;\r\nvar globalEventSupported = env.domSupported;\r\nvar localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n})();\r\nvar globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n};\r\nvar wheelEventSupported = false;\r\nfunction isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n}\r\nfunction setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n}\r\nfunction markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n}\r\nfunction normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n}\r\nfunction isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n}\r\nvar FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n}());\r\nvar localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n};\r\neach(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n});\r\nvar globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n};\r\nfunction mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n}\r\nfunction mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n}\r\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n}\r\nfunction unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n}\r\nvar DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n}());\r\nvar HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n}(Eventful));\n\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\nvar DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n};\r\nvar DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n};\r\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\nvar PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\nvar Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n}(Element));\r\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\r\nvar viewRect = new BoundingRect(0, 0, 0, 0);\r\nfunction isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n}\n\nvar mathPow = Math.pow;\r\nvar mathSqrt = Math.sqrt;\r\nvar EPSILON$1 = 1e-8;\r\nvar EPSILON_NUMERIC = 1e-4;\r\nvar THREE_SQRT = mathSqrt(3);\r\nvar ONE_THIRD = 1 / 3;\r\nvar _v0 = create();\r\nvar _v1 = create();\r\nvar _v2 = create();\r\nfunction isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n}\r\nfunction isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n}\r\nfunction cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n}\r\nfunction cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n}\r\nfunction cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n}\r\nfunction cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n}\r\nfunction cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n}\r\nfunction quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n}\r\nfunction quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n}\r\nfunction quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n}\r\nfunction quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n}\r\nfunction quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n}\r\nfunction quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n}\r\nfunction quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n}\n\nvar mathMin$1 = Math.min;\r\nvar mathMax$1 = Math.max;\r\nvar mathSin = Math.sin;\r\nvar mathCos = Math.cos;\r\nvar PI2 = Math.PI * 2;\r\nvar start = create();\r\nvar end = create();\r\nvar extremity = create();\r\nfunction fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n}\r\nfunction fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n}\r\nvar xDim = [];\r\nvar yDim = [];\r\nfunction fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n}\r\nfunction fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n}\r\nfunction fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n}\n\nvar CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n};\r\nvar tmpOutX = [];\r\nvar tmpOutY = [];\r\nvar min$1 = [];\r\nvar max$1 = [];\r\nvar min2 = [];\r\nvar max2 = [];\r\nvar mathMin$2 = Math.min;\r\nvar mathMax$2 = Math.max;\r\nvar mathCos$1 = Math.cos;\r\nvar mathSin$1 = Math.sin;\r\nvar mathSqrt$1 = Math.sqrt;\r\nvar mathAbs = Math.abs;\r\nvar PI = Math.PI;\r\nvar PI2$1 = PI * 2;\r\nvar hasTypedArray = typeof Float32Array !== 'undefined';\r\nvar tmpAngles = [];\r\nfunction modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n}\r\nfunction normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n}\r\nvar PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n}());\n\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n}\n\nfunction containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n}\n\nfunction containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n}\n\nvar PI2$2 = Math.PI * 2;\r\nfunction normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n}\n\nvar PI2$3 = Math.PI * 2;\r\nfunction containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n}\n\nfunction windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n}\n\nvar CMD$1 = PathProxy.CMD;\r\nvar PI2$4 = Math.PI * 2;\r\nvar EPSILON$2 = 1e-4;\r\nfunction isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n}\r\nvar roots = [-1, -1, -1];\r\nvar extrema = [-1, -1];\r\nfunction swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n}\r\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n}\r\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n}\r\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n}\r\nfunction containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n}\r\nfunction contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n}\r\nfunction containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n}\n\nvar DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n}, DEFAULT_COMMON_STYLE);\r\nvar DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nvar pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n];\r\nvar Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n}(Displayable));\n\nvar CMD$2 = PathProxy.CMD;\r\nvar points = [[], [], []];\r\nvar mathSqrt$2 = Math.sqrt;\r\nvar mathAtan2 = Math.atan2;\r\nfunction transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n}\n\nvar mathSqrt$3 = Math.sqrt;\r\nvar mathSin$2 = Math.sin;\r\nvar mathCos$2 = Math.cos;\r\nvar PI$1 = Math.PI;\r\nfunction vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n}\r\nfunction vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n}\r\nfunction vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n}\r\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n}\r\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\nfunction createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n}\r\nvar SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n}(Path));\r\nfunction isPathProxy(path) {\r\n return path.setData != null;\r\n}\r\nfunction createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n}\r\nfunction createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n}\r\nfunction extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n}\r\nfunction mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n}\n\nvar Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n}(Element));\r\nGroup.prototype.type = 'group';\n\nvar DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n}, DEFAULT_COMMON_STYLE);\r\nvar DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nfunction isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n}\r\nvar ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n}(Displayable));\r\nZRImage.prototype.type = 'image';\n\nvar CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n}());\r\nvar Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n}(Path));\r\nCircle.prototype.type = 'circle';\n\nfunction buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n}\n\nvar round = Math.round;\r\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n}\r\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n}\r\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n}\n\nvar RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n}());\r\nvar subPixelOptimizeOutputShape = {};\r\nvar Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n}(Path));\r\nRect.prototype.type = 'rect';\n\nvar EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n}());\r\nvar Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n}(Path));\r\nEllipse.prototype.type = 'ellipse';\n\nvar subPixelOptimizeOutputShape$1 = {};\r\nvar LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n}());\r\nvar Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n}(Path));\r\nLine.prototype.type = 'line';\n\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n}\r\nfunction smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n}\n\nfunction smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n}\n\nfunction buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n}\n\nvar PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n}());\r\nvar Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n}(Path));\r\nPolygon.prototype.type = 'polygon';\n\nvar PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n}());\r\nvar Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n}(Path));\r\nPolyline.prototype.type = 'polyline';\n\nvar Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n}());\n\nvar LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n}(Gradient));\n\nvar DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n}, DEFAULT_PATH_STYLE);\r\nvar TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n}(Displayable));\r\nTSpan.prototype.type = 'tspan';\n\nvar DILIMITER_REG = /[\\s,]+/;\r\nfunction parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n}\r\nvar nodeParsers;\r\nvar SVGParser = (function () {\r\n function SVGParser() {\r\n this._defs = {};\r\n this._root = null;\r\n this._isDefine = false;\r\n this._isText = false;\r\n }\r\n SVGParser.prototype.parse = function (xml, opt) {\r\n opt = opt || {};\r\n var svg = parseXML(xml);\r\n if (!svg) {\r\n throw new Error('Illegal svg');\r\n }\r\n var root = new Group();\r\n this._root = root;\r\n var viewBox = svg.getAttribute('viewBox') || '';\r\n var width = parseFloat((svg.getAttribute('width') || opt.width));\r\n var height = parseFloat((svg.getAttribute('height') || opt.height));\r\n isNaN(width) && (width = null);\r\n isNaN(height) && (height = null);\r\n parseAttributes(svg, root, null, true);\r\n var child = svg.firstChild;\r\n while (child) {\r\n this._parseNode(child, root);\r\n child = child.nextSibling;\r\n }\r\n var viewBoxRect;\r\n var viewBoxTransform;\r\n if (viewBox) {\r\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG);\r\n if (viewBoxArr.length >= 4) {\r\n viewBoxRect = {\r\n x: parseFloat((viewBoxArr[0] || 0)),\r\n y: parseFloat((viewBoxArr[1] || 0)),\r\n width: parseFloat(viewBoxArr[2]),\r\n height: parseFloat(viewBoxArr[3])\r\n };\r\n }\r\n }\r\n if (viewBoxRect && width != null && height != null) {\r\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\r\n if (!opt.ignoreViewBox) {\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n }\r\n if (!opt.ignoreRootClip && width != null && height != null) {\r\n root.setClipPath(new Rect({\r\n shape: { x: 0, y: 0, width: width, height: height }\r\n }));\r\n }\r\n return {\r\n root: root,\r\n width: width,\r\n height: height,\r\n viewBoxRect: viewBoxRect,\r\n viewBoxTransform: viewBoxTransform\r\n };\r\n };\r\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\r\n var nodeName = xmlNode.nodeName.toLowerCase();\r\n if (nodeName === 'defs') {\r\n this._isDefine = true;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = true;\r\n }\r\n var el;\r\n if (this._isDefine) {\r\n var parser = defineParsers[nodeName];\r\n if (parser) {\r\n var def = parser.call(this, xmlNode);\r\n var id = xmlNode.getAttribute('id');\r\n if (id) {\r\n this._defs[id] = def;\r\n }\r\n }\r\n }\r\n else {\r\n var parser = nodeParsers[nodeName];\r\n if (parser) {\r\n el = parser.call(this, xmlNode, parentGroup);\r\n parentGroup.add(el);\r\n }\r\n }\r\n if (el) {\r\n var child = xmlNode.firstChild;\r\n while (child) {\r\n if (child.nodeType === 1) {\r\n this._parseNode(child, el);\r\n }\r\n if (child.nodeType === 3 && this._isText) {\r\n this._parseText(child, el);\r\n }\r\n child = child.nextSibling;\r\n }\r\n }\r\n if (nodeName === 'defs') {\r\n this._isDefine = false;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = false;\r\n }\r\n };\r\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\r\n if (xmlNode.nodeType === 1) {\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n this._textX += parseFloat(dx);\r\n this._textY += parseFloat(dy);\r\n }\r\n var text = new TSpan({\r\n style: {\r\n text: xmlNode.textContent\r\n },\r\n x: this._textX || 0,\r\n y: this._textY || 0\r\n });\r\n inheritStyle(parentGroup, text);\r\n parseAttributes(xmlNode, text, this._defs);\r\n var textStyle = text.style;\r\n var fontSize = textStyle.fontSize;\r\n if (fontSize && fontSize < 9) {\r\n textStyle.fontSize = 9;\r\n text.scaleX *= fontSize / 9;\r\n text.scaleY *= fontSize / 9;\r\n }\r\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\r\n textStyle.fontStyle,\r\n textStyle.fontWeight,\r\n (textStyle.fontSize || 12) + 'px',\r\n textStyle.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n textStyle.font = font;\r\n var rect = text.getBoundingRect();\r\n this._textX += rect.width;\r\n parentGroup.add(text);\r\n return text;\r\n };\r\n SVGParser.internalField = (function () {\r\n nodeParsers = {\r\n 'g': function (xmlNode, parentGroup) {\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'rect': function (xmlNode, parentGroup) {\r\n var rect = new Rect();\r\n inheritStyle(parentGroup, rect);\r\n parseAttributes(xmlNode, rect, this._defs);\r\n rect.setShape({\r\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\r\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\r\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\r\n height: parseFloat(xmlNode.getAttribute('height') || '0')\r\n });\r\n return rect;\r\n },\r\n 'circle': function (xmlNode, parentGroup) {\r\n var circle = new Circle();\r\n inheritStyle(parentGroup, circle);\r\n parseAttributes(xmlNode, circle, this._defs);\r\n circle.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n r: parseFloat(xmlNode.getAttribute('r') || '0')\r\n });\r\n return circle;\r\n },\r\n 'line': function (xmlNode, parentGroup) {\r\n var line = new Line();\r\n inheritStyle(parentGroup, line);\r\n parseAttributes(xmlNode, line, this._defs);\r\n line.setShape({\r\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\r\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\r\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\r\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\r\n });\r\n return line;\r\n },\r\n 'ellipse': function (xmlNode, parentGroup) {\r\n var ellipse = new Ellipse();\r\n inheritStyle(parentGroup, ellipse);\r\n parseAttributes(xmlNode, ellipse, this._defs);\r\n ellipse.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\r\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\r\n });\r\n return ellipse;\r\n },\r\n 'polygon': function (xmlNode, parentGroup) {\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polygon = new Polygon({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n inheritStyle(parentGroup, polygon);\r\n parseAttributes(xmlNode, polygon, this._defs);\r\n return polygon;\r\n },\r\n 'polyline': function (xmlNode, parentGroup) {\r\n var path = new Path();\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polyline = new Polyline({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n return polyline;\r\n },\r\n 'image': function (xmlNode, parentGroup) {\r\n var img = new ZRImage();\r\n inheritStyle(parentGroup, img);\r\n parseAttributes(xmlNode, img, this._defs);\r\n img.setStyle({\r\n image: xmlNode.getAttribute('xlink:href'),\r\n x: +xmlNode.getAttribute('x'),\r\n y: +xmlNode.getAttribute('y'),\r\n width: +xmlNode.getAttribute('width'),\r\n height: +xmlNode.getAttribute('height')\r\n });\r\n return img;\r\n },\r\n 'text': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x') || '0';\r\n var y = xmlNode.getAttribute('y') || '0';\r\n var dx = xmlNode.getAttribute('dx') || '0';\r\n var dy = xmlNode.getAttribute('dy') || '0';\r\n this._textX = parseFloat(x) + parseFloat(dx);\r\n this._textY = parseFloat(y) + parseFloat(dy);\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'tspan': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x');\r\n var y = xmlNode.getAttribute('y');\r\n if (x != null) {\r\n this._textX = parseFloat(x);\r\n }\r\n if (y != null) {\r\n this._textY = parseFloat(y);\r\n }\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n this._textX += dx;\r\n this._textY += dy;\r\n return g;\r\n },\r\n 'path': function (xmlNode, parentGroup) {\r\n var d = xmlNode.getAttribute('d') || '';\r\n var path = createFromString(d);\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n return path;\r\n }\r\n };\r\n })();\r\n return SVGParser;\r\n}());\r\nvar defineParsers = {\r\n 'lineargradient': function (xmlNode) {\r\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\r\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\r\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\r\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\r\n var gradient = new LinearGradient(x1, y1, x2, y2);\r\n _parseGradientColorStops(xmlNode, gradient);\r\n return gradient;\r\n }\r\n};\r\nfunction _parseGradientColorStops(xmlNode, gradient) {\r\n var stop = xmlNode.firstChild;\r\n while (stop) {\r\n if (stop.nodeType === 1) {\r\n var offsetStr = stop.getAttribute('offset');\r\n var offset = void 0;\r\n if (offsetStr.indexOf('%') > 0) {\r\n offset = parseInt(offsetStr, 10) / 100;\r\n }\r\n else if (offsetStr) {\r\n offset = parseFloat(offsetStr);\r\n }\r\n else {\r\n offset = 0;\r\n }\r\n var stopColor = stop.getAttribute('stop-color') || '#000000';\r\n gradient.colorStops.push({\r\n offset: offset,\r\n color: stopColor\r\n });\r\n }\r\n stop = stop.nextSibling;\r\n }\r\n}\r\nfunction inheritStyle(parent, child) {\r\n if (parent && parent.__inheritedStyle) {\r\n if (!child.__inheritedStyle) {\r\n child.__inheritedStyle = {};\r\n }\r\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\r\n }\r\n}\r\nfunction parsePoints(pointsString) {\r\n var list = trim(pointsString).split(DILIMITER_REG);\r\n var points = [];\r\n for (var i = 0; i < list.length; i += 2) {\r\n var x = parseFloat(list[i]);\r\n var y = parseFloat(list[i + 1]);\r\n points.push([x, y]);\r\n }\r\n return points;\r\n}\r\nvar attributesMap = {\r\n 'fill': 'fill',\r\n 'stroke': 'stroke',\r\n 'stroke-width': 'lineWidth',\r\n 'opacity': 'opacity',\r\n 'fill-opacity': 'fillOpacity',\r\n 'stroke-opacity': 'strokeOpacity',\r\n 'stroke-dasharray': 'lineDash',\r\n 'stroke-dashoffset': 'lineDashOffset',\r\n 'stroke-linecap': 'lineCap',\r\n 'stroke-linejoin': 'lineJoin',\r\n 'stroke-miterlimit': 'miterLimit',\r\n 'font-family': 'fontFamily',\r\n 'font-size': 'fontSize',\r\n 'font-style': 'fontStyle',\r\n 'font-weight': 'fontWeight',\r\n 'text-align': 'textAlign',\r\n 'alignment-baseline': 'textBaseline'\r\n};\r\nfunction parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\r\n var disp = el;\r\n var zrStyle = disp.__inheritedStyle || {};\r\n if (xmlNode.nodeType === 1) {\r\n parseTransformAttribute(xmlNode, el);\r\n extend(zrStyle, parseStyleAttribute(xmlNode));\r\n if (!onlyInlineStyle) {\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName)) {\r\n var attrValue = xmlNode.getAttribute(svgAttrName);\r\n if (attrValue != null) {\r\n zrStyle[attributesMap[svgAttrName]] = attrValue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n disp.style = disp.style || {};\r\n zrStyle.fill != null && (disp.style.fill = getPaint(zrStyle.fill, defs));\r\n zrStyle.stroke != null && (disp.style.stroke = getPaint(zrStyle.stroke, defs));\r\n each([\r\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = parseFloat(zrStyle[propName]));\r\n });\r\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\r\n zrStyle.textBaseline = 'alphabetic';\r\n }\r\n if (zrStyle.textBaseline === 'alphabetic') {\r\n zrStyle.textBaseline = 'bottom';\r\n }\r\n if (zrStyle.textAlign === 'start') {\r\n zrStyle.textAlign = 'left';\r\n }\r\n if (zrStyle.textAlign === 'end') {\r\n zrStyle.textAlign = 'right';\r\n }\r\n each(['lineDashOffset', 'lineCap', 'lineJoin',\r\n 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = zrStyle[propName]);\r\n });\r\n if (zrStyle.lineDash) {\r\n disp.style.lineDash = map(trim(zrStyle.lineDash).split(DILIMITER_REG), function (str) {\r\n return parseFloat(str);\r\n });\r\n }\r\n disp.__inheritedStyle = zrStyle;\r\n}\r\nvar urlRegex = /url\\(\\s*#(.*?)\\)/;\r\nfunction getPaint(str, defs) {\r\n var urlMatch = defs && str && str.match(urlRegex);\r\n if (urlMatch) {\r\n var url = trim(urlMatch[1]);\r\n var def = defs[url];\r\n return def;\r\n }\r\n return str;\r\n}\r\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\r\nfunction parseTransformAttribute(xmlNode, node) {\r\n var transform = xmlNode.getAttribute('transform');\r\n if (transform) {\r\n transform = transform.replace(/,/g, ' ');\r\n var transformOps_1 = [];\r\n var m = null;\r\n transform.replace(transformRegex, function (str, type, value) {\r\n transformOps_1.push(type, value);\r\n return '';\r\n });\r\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\r\n var value = transformOps_1[i];\r\n var type = transformOps_1[i - 1];\r\n var valueArr = void 0;\r\n m = m || create$1();\r\n switch (type) {\r\n case 'translate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n translate(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\r\n break;\r\n case 'scale':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n scale$1(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\r\n break;\r\n case 'rotate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n rotate(m, m, parseFloat(valueArr[0]));\r\n break;\r\n case 'skew':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n console.warn('Skew transform is not supported yet');\r\n break;\r\n case 'matrix':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n m[0] = parseFloat(valueArr[0]);\r\n m[1] = parseFloat(valueArr[1]);\r\n m[2] = parseFloat(valueArr[2]);\r\n m[3] = parseFloat(valueArr[3]);\r\n m[4] = parseFloat(valueArr[4]);\r\n m[5] = parseFloat(valueArr[5]);\r\n break;\r\n }\r\n }\r\n node.setLocalTransform(m);\r\n }\r\n}\r\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\r\nfunction parseStyleAttribute(xmlNode) {\r\n var style = xmlNode.getAttribute('style');\r\n var result = {};\r\n if (!style) {\r\n return result;\r\n }\r\n var styleList = {};\r\n styleRegex.lastIndex = 0;\r\n var styleRegResult;\r\n while ((styleRegResult = styleRegex.exec(style)) != null) {\r\n styleList[styleRegResult[1]] = styleRegResult[2];\r\n }\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\r\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\r\n }\r\n }\r\n return result;\r\n}\r\nfunction makeViewBoxTransform(viewBoxRect, width, height) {\r\n var scaleX = width / viewBoxRect.width;\r\n var scaleY = height / viewBoxRect.height;\r\n var scale = Math.min(scaleX, scaleY);\r\n return {\r\n scale: scale,\r\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2,\r\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2\r\n };\r\n}\r\nfunction parseSVG(xml, opt) {\r\n var parser = new SVGParser();\r\n return parser.parse(xml, opt);\r\n}\n\nvar PI$2 = Math.PI;\r\nvar PI2$5 = PI$2 * 2;\r\nvar mathSin$3 = Math.sin;\r\nvar mathCos$3 = Math.cos;\r\nvar mathACos = Math.acos;\r\nvar mathATan2 = Math.atan2;\r\nvar mathAbs$1 = Math.abs;\r\nvar mathSqrt$4 = Math.sqrt;\r\nvar mathMax$3 = Math.max;\r\nvar mathMin$3 = Math.min;\r\nvar e = 1e-4;\r\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n}\r\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n}\r\nfunction buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n}\n\nvar SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n}());\r\nvar Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n}(Path));\r\nSector.prototype.type = 'sector';\n\nvar CMD$3 = PathProxy.CMD;\r\nvar PI2$6 = Math.PI * 2;\r\nvar PROP_XY = ['x', 'y'];\r\nvar PROP_WH = ['width', 'height'];\r\nvar tmpArr = [];\r\nfunction aroundEqual(a, b) {\r\n return Math.abs(a - b) < 1e-5;\r\n}\r\nfunction pathToBezierCurves(path) {\r\n var data = path.data;\r\n var len = path.len();\r\n var bezierArray = [];\r\n var currentSubpath;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n function createNewSubpath(x, y) {\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n currentSubpath = [x, y];\r\n }\r\n function addLine(x0, y0, x1, y1) {\r\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\r\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\r\n }\r\n }\r\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\r\n var delta = Math.abs(endAngle - startAngle);\r\n var len = Math.tan(delta / 4) * 4 / 3;\r\n var dir = endAngle < startAngle ? -1 : 1;\r\n var c1 = Math.cos(startAngle);\r\n var s1 = Math.sin(startAngle);\r\n var c2 = Math.cos(endAngle);\r\n var s2 = Math.sin(endAngle);\r\n var x1 = c1 * rx + cx;\r\n var y1 = s1 * ry + cy;\r\n var x4 = c2 * rx + cx;\r\n var y4 = s2 * ry + cy;\r\n var hx = rx * len * dir;\r\n var hy = ry * len * dir;\r\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\r\n }\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n if (cmd === CMD$3.L || cmd === CMD$3.C || cmd === CMD$3.Q) {\r\n currentSubpath = [x0, y0];\r\n }\r\n }\r\n switch (cmd) {\r\n case CMD$3.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n createNewSubpath(x0, y0);\r\n break;\r\n case CMD$3.L:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n addLine(xi, yi, x1, y1);\r\n xi = x1;\r\n yi = y1;\r\n break;\r\n case CMD$3.C:\r\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\r\n break;\r\n case CMD$3.Q:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n x1 = Math.cos(startAngle) * rx + cx;\r\n y1 = Math.sin(startAngle) * ry + cy;\r\n if (isFirst) {\r\n x0 = x1;\r\n y0 = y1;\r\n createNewSubpath(x0, y0);\r\n }\r\n else {\r\n addLine(xi, yi, x1, y1);\r\n }\r\n xi = Math.cos(endAngle) * rx + cx;\r\n yi = Math.sin(endAngle) * ry + cy;\r\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\r\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\r\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\r\n : Math.min(angle + step, endAngle);\r\n addArc(angle, nextAngle, cx, cy, rx, ry);\r\n }\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n x1 = x0 + data[i++];\r\n y1 = y0 + data[i++];\r\n createNewSubpath(x1, y0);\r\n addLine(x1, y0, x1, y1);\r\n addLine(x1, y1, x0, y1);\r\n addLine(x0, y1, x0, y0);\r\n addLine(x0, y0, x1, y0);\r\n break;\r\n case CMD$3.Z:\r\n currentSubpath && addLine(xi, yi, x0, y0);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n return bezierArray;\r\n}\r\nfunction alignSubpath(subpath1, subpath2) {\r\n var len1 = subpath1.length;\r\n var len2 = subpath2.length;\r\n if (len1 === len2) {\r\n return [subpath1, subpath2];\r\n }\r\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\r\n var shorterLen = Math.min(len1, len2);\r\n var diff = Math.abs(len2 - len1) / 6;\r\n var shorterBezierCount = (shorterLen - 2) / 6;\r\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\r\n var newSubpath = [shorterPath[0], shorterPath[1]];\r\n var remained = diff;\r\n var tmpSegX = [];\r\n var tmpSegY = [];\r\n for (var i = 2; i < shorterLen;) {\r\n var x0 = shorterPath[i - 2];\r\n var y0 = shorterPath[i - 1];\r\n var x1 = shorterPath[i++];\r\n var y1 = shorterPath[i++];\r\n var x2 = shorterPath[i++];\r\n var y2 = shorterPath[i++];\r\n var x3 = shorterPath[i++];\r\n var y3 = shorterPath[i++];\r\n if (remained <= 0) {\r\n newSubpath.push(x1, y1, x2, y2, x3, y3);\r\n continue;\r\n }\r\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\r\n for (var k = 1; k <= actualSubDivCount; k++) {\r\n var p = k / actualSubDivCount;\r\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\r\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\r\n x0 = tmpSegX[3];\r\n y0 = tmpSegY[3];\r\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\r\n x1 = tmpSegX[5];\r\n y1 = tmpSegY[5];\r\n x2 = tmpSegX[6];\r\n y2 = tmpSegY[6];\r\n }\r\n remained -= actualSubDivCount - 1;\r\n }\r\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\r\n}\r\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\r\n var len = lastSubpathSubpath.length;\r\n var lastX = lastSubpathSubpath[len - 2];\r\n var lastY = lastSubpathSubpath[len - 1];\r\n var newSubpath = [];\r\n for (var i = 0; i < otherSubpath.length;) {\r\n newSubpath[i++] = lastX;\r\n newSubpath[i++] = lastY;\r\n }\r\n return newSubpath;\r\n}\r\nfunction alignBezierCurves(array1, array2) {\r\n var _a;\r\n var lastSubpath1;\r\n var lastSubpath2;\r\n var newArray1 = [];\r\n var newArray2 = [];\r\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\r\n var subpath1 = array1[i];\r\n var subpath2 = array2[i];\r\n var newSubpath1 = void 0;\r\n var newSubpath2 = void 0;\r\n if (!subpath1) {\r\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\r\n newSubpath2 = subpath2;\r\n }\r\n else if (!subpath2) {\r\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\r\n newSubpath1 = subpath1;\r\n }\r\n else {\r\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\r\n lastSubpath1 = newSubpath1;\r\n lastSubpath2 = newSubpath2;\r\n }\r\n newArray1.push(newSubpath1);\r\n newArray2.push(newSubpath2);\r\n }\r\n return [newArray1, newArray2];\r\n}\r\nfunction centroid(array) {\r\n var signedArea = 0;\r\n var cx = 0;\r\n var cy = 0;\r\n var len = array.length;\r\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\r\n var x0 = array[j];\r\n var y0 = array[j + 1];\r\n var x1 = array[i];\r\n var y1 = array[i + 1];\r\n var a = x0 * y1 - x1 * y0;\r\n signedArea += a;\r\n cx += (x0 + x1) * a;\r\n cy += (y0 + y1) * a;\r\n }\r\n if (signedArea === 0) {\r\n return [array[0] || 0, array[1] || 0];\r\n }\r\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\r\n}\r\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\r\n var bezierCount = (fromSubBeziers.length - 2) / 6;\r\n var bestScore = Infinity;\r\n var bestOffset = 0;\r\n var len = fromSubBeziers.length;\r\n var len2 = len - 2;\r\n for (var offset = 0; offset < bezierCount; offset++) {\r\n var cursorOffset = offset * 6;\r\n var score = 0;\r\n for (var k = 0; k < len; k += 2) {\r\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\r\n var x0 = fromSubBeziers[idx] - fromCp[0];\r\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\r\n var x1 = toSubBeziers[k] - toCp[0];\r\n var y1 = toSubBeziers[k + 1] - toCp[1];\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestOffset = offset;\r\n }\r\n }\r\n return bestOffset;\r\n}\r\nfunction reverse(array) {\r\n var newArr = [];\r\n var len = array.length;\r\n for (var i = 0; i < len; i += 2) {\r\n newArr[i] = array[len - i - 2];\r\n newArr[i + 1] = array[len - i - 1];\r\n }\r\n return newArr;\r\n}\r\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\r\n var result = [];\r\n var fromNeedsReverse;\r\n for (var i = 0; i < fromArr.length; i++) {\r\n var fromSubpathBezier = fromArr[i];\r\n var toSubpathBezier = toArr[i];\r\n var fromCp = centroid(fromSubpathBezier);\r\n var toCp = centroid(toSubpathBezier);\r\n if (fromNeedsReverse == null) {\r\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\r\n }\r\n var newFromSubpathBezier = [];\r\n var newToSubpathBezier = [];\r\n var bestAngle = 0;\r\n var bestScore = Infinity;\r\n var tmpArr_1 = [];\r\n var len = fromSubpathBezier.length;\r\n if (fromNeedsReverse) {\r\n fromSubpathBezier = reverse(fromSubpathBezier);\r\n }\r\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\r\n var len2 = len - 2;\r\n for (var k = 0; k < len2; k += 2) {\r\n var idx = (offset + k) % len2 + 2;\r\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\r\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\r\n }\r\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\r\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\r\n if (searchAngleIteration > 0) {\r\n var step = searchAngleRange / searchAngleIteration;\r\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n var score = 0;\r\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\r\n var x0 = newFromSubpathBezier[k];\r\n var y0 = newFromSubpathBezier[k + 1];\r\n var x1 = toSubpathBezier[k] - toCp[0];\r\n var y1 = toSubpathBezier[k + 1] - toCp[1];\r\n var newX1 = x1 * ca - y1 * sa;\r\n var newY1 = x1 * sa + y1 * ca;\r\n tmpArr_1[k] = newX1;\r\n tmpArr_1[k + 1] = newY1;\r\n var dx = newX1 - x0;\r\n var dy = newY1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestAngle = angle;\r\n for (var m = 0; m < tmpArr_1.length; m++) {\r\n newToSubpathBezier[m] = tmpArr_1[m];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\r\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\r\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\r\n }\r\n }\r\n result.push({\r\n from: newFromSubpathBezier,\r\n to: newToSubpathBezier,\r\n fromCp: fromCp,\r\n toCp: toCp,\r\n rotation: -bestAngle\r\n });\r\n }\r\n return result;\r\n}\r\nfunction morphPath(fromPath, toPath, animationOpts) {\r\n var fromPathProxy;\r\n var toPathProxy;\r\n if (!fromPath || !toPath) {\r\n return toPath;\r\n }\r\n !fromPath.path && fromPath.createPathProxy();\r\n fromPathProxy = fromPath.path;\r\n fromPathProxy.beginPath();\r\n fromPath.buildPath(fromPathProxy, fromPath.shape);\r\n !toPath.path && toPath.createPathProxy();\r\n toPathProxy = toPath.path;\r\n toPathProxy === fromPathProxy && (toPathProxy = new PathProxy(false));\r\n toPathProxy.beginPath();\r\n if (isIndividualMorphingPath(toPath)) {\r\n toPath.__oldBuildPath(toPathProxy, toPath.shape);\r\n }\r\n else {\r\n toPath.buildPath(toPathProxy, toPath.shape);\r\n }\r\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\r\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\r\n becomeIndividualMorphingPath(toPath, morphingData, 0);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n toPath.animateTo({\r\n __morphT: 1\r\n }, defaults({\r\n during: function (p) {\r\n toPath.dirtyShape();\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n restoreIndividualMorphingPath(toPath);\r\n toPath.createPathProxy();\r\n toPath.dirtyShape();\r\n oldDone && oldDone();\r\n },\r\n aborted: function () {\r\n oldAborted && oldAborted();\r\n }\r\n }, animationOpts));\r\n return toPath;\r\n}\r\nfunction morphingPathBuildPath(path) {\r\n var morphingData = this.__morphingData;\r\n var t = this.__morphT;\r\n var onet = 1 - t;\r\n var newCp = [];\r\n for (var i = 0; i < morphingData.length; i++) {\r\n var item = morphingData[i];\r\n var from = item.from;\r\n var to = item.to;\r\n var angle = item.rotation * t;\r\n var fromCp = item.fromCp;\r\n var toCp = item.toCp;\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n lerp(newCp, fromCp, toCp, t);\r\n for (var m = 0; m < from.length; m += 2) {\r\n var x0 = from[m];\r\n var y0 = from[m + 1];\r\n var x1 = to[m];\r\n var y1 = to[m + 1];\r\n var x = x0 * onet + x1 * t;\r\n var y = y0 * onet + y1 * t;\r\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\r\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\r\n }\r\n for (var m = 0; m < from.length;) {\r\n if (m === 0) {\r\n path.moveTo(tmpArr[m++], tmpArr[m++]);\r\n }\r\n path.bezierCurveTo(tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++]);\r\n }\r\n }\r\n}\r\nfunction becomeIndividualMorphingPath(path, morphingData, morphT) {\r\n if (isIndividualMorphingPath(path)) {\r\n updateIndividualMorphingPath(path, morphingData, morphT);\r\n return;\r\n }\r\n var morphingPath = path;\r\n morphingPath.__oldBuildPath = morphingPath.buildPath;\r\n morphingPath.buildPath = morphingPathBuildPath;\r\n updateIndividualMorphingPath(morphingPath, morphingData, morphT);\r\n}\r\nfunction updateIndividualMorphingPath(morphingPath, morphingData, morphT) {\r\n morphingPath.__morphingData = morphingData;\r\n morphingPath.__morphT = morphT;\r\n}\r\nfunction restoreIndividualMorphingPath(path) {\r\n if (isIndividualMorphingPath(path)) {\r\n path.buildPath = path.__oldBuildPath;\r\n path.__oldBuildPath = path.__morphingData = null;\r\n }\r\n}\r\nfunction isIndividualMorphingPath(path) {\r\n return path.__oldBuildPath != null;\r\n}\r\nfunction isCombiningPath(path) {\r\n return !!path.__combiningSubList;\r\n}\r\nfunction isInAnyMorphing(path) {\r\n return isIndividualMorphingPath(path) || isCombiningPath(path);\r\n}\r\nfunction combine(fromPathList, toPath, animationOpts, copyPropsIfDivided) {\r\n var fromIndividuals = [];\r\n var separateCount = 0;\r\n for (var i = 0; i < fromPathList.length; i++) {\r\n var fromPath = fromPathList[i];\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n for (var j = 0; j < fromCombiningSubList.length; j++) {\r\n fromIndividuals.push(fromCombiningSubList[j]);\r\n }\r\n separateCount += fromCombiningSubList.length;\r\n }\r\n else {\r\n fromIndividuals.push(fromPath);\r\n separateCount++;\r\n }\r\n }\r\n if (!separateCount) {\r\n return;\r\n }\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var toPathSplittedList = divideShape(toPath, separateCount, dividingMethod);\r\n assert(toPathSplittedList.length === separateCount);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n var doneCount = 0;\r\n var abortedCalled = false;\r\n var morphAnimationOpts = defaults({\r\n during: function (p) {\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n doneCount++;\r\n if (doneCount === toPathSplittedList.length) {\r\n restoreCombiningPath(toPath);\r\n oldDone && oldDone();\r\n }\r\n },\r\n aborted: function () {\r\n if (!abortedCalled) {\r\n abortedCalled = true;\r\n oldAborted && oldAborted();\r\n }\r\n }\r\n }, animationOpts);\r\n for (var i = 0; i < separateCount; i++) {\r\n var from = fromIndividuals[i];\r\n var to = toPathSplittedList[i];\r\n copyPropsIfDivided && copyPropsIfDivided(toPath, to, true);\r\n morphPath(from, to, morphAnimationOpts);\r\n }\r\n becomeCombiningPath(toPath, toPathSplittedList);\r\n return {\r\n fromIndividuals: fromIndividuals,\r\n toIndividuals: toPathSplittedList,\r\n count: separateCount\r\n };\r\n}\r\nfunction becomeCombiningPath(path, combiningSubList) {\r\n if (isCombiningPath(path)) {\r\n updateCombiningPathSubList(path, combiningSubList);\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, combiningSubList);\r\n combiningPath.__oldAddSelfToZr = path.addSelfToZr;\r\n combiningPath.__oldRemoveSelfFromZr = path.removeSelfFromZr;\r\n combiningPath.addSelfToZr = combiningAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningRemoveSelfFromZr;\r\n combiningPath.__oldBuildPath = combiningPath.buildPath;\r\n combiningPath.buildPath = noop;\r\n combiningPath.childrenRef = combiningChildrenRef;\r\n}\r\nfunction restoreCombiningPath(path) {\r\n if (!isCombiningPath(path)) {\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, null);\r\n combiningPath.addSelfToZr = combiningPath.__oldAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningPath.__oldRemoveSelfFromZr;\r\n combiningPath.buildPath = combiningPath.__oldBuildPath;\r\n combiningPath.childrenRef =\r\n combiningPath.__combiningSubList =\r\n combiningPath.__oldAddSelfToZr =\r\n combiningPath.__oldRemoveSelfFromZr =\r\n combiningPath.__oldBuildPath = null;\r\n}\r\nfunction updateCombiningPathSubList(combiningPath, combiningSubList) {\r\n if (combiningPath.__combiningSubList !== combiningSubList) {\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'removeSelfFromZr');\r\n combiningPath.__combiningSubList = combiningSubList;\r\n if (combiningSubList) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n combiningSubList[i].parent = combiningPath;\r\n }\r\n }\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'addSelfToZr');\r\n }\r\n}\r\nfunction combiningAddSelfToZr(zr) {\r\n this.__oldAddSelfToZr(zr);\r\n combiningPathSubListAddRemoveWithZr(this, 'addSelfToZr');\r\n}\r\nfunction combiningPathSubListAddRemoveWithZr(path, method) {\r\n var combiningSubList = path.__combiningSubList;\r\n var zr = path.__zr;\r\n if (combiningSubList && zr) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child[method](zr);\r\n }\r\n }\r\n}\r\nfunction combiningRemoveSelfFromZr(zr) {\r\n this.__oldRemoveSelfFromZr(zr);\r\n var combiningSubList = this.__combiningSubList;\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n}\r\nfunction combiningChildrenRef() {\r\n return this.__combiningSubList;\r\n}\r\nfunction separate(fromPath, toPathList, animationOpts, copyPropsIfDivided) {\r\n var toPathListLen = toPathList.length;\r\n var fromPathList;\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var copyProps = false;\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n if (fromCombiningSubList.length === toPathListLen) {\r\n fromPathList = fromCombiningSubList;\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n assert(fromPathList.length === toPathListLen);\r\n for (var i = 0; i < toPathListLen; i++) {\r\n if (copyProps && copyPropsIfDivided) {\r\n copyPropsIfDivided(fromPath, fromPathList[i], false);\r\n }\r\n morphPath(fromPathList[i], toPathList[i], animationOpts);\r\n }\r\n return {\r\n fromIndividuals: fromPathList,\r\n toIndividuals: toPathList,\r\n count: toPathListLen\r\n };\r\n}\r\nfunction divideShape(path, separateCount, dividingMethod) {\r\n return dividingMethod === 'duplicate'\r\n ? duplicateShape(path, separateCount)\r\n : splitShape(path, separateCount);\r\n}\r\nfunction splitShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n if (separateCount === 1) {\r\n return duplicateShape(path, separateCount);\r\n }\r\n if (path instanceof Rect) {\r\n var toPathShape = path.shape;\r\n var splitPropIdx = toPathShape.height > toPathShape.width ? 1 : 0;\r\n var propWH = PROP_WH[splitPropIdx];\r\n var propXY = PROP_XY[splitPropIdx];\r\n var subWH = toPathShape[propWH] / separateCount;\r\n var xyCurr = toPathShape[propXY];\r\n for (var i = 0; i < separateCount; i++, xyCurr += subWH) {\r\n var subShape = {\r\n x: toPathShape.x,\r\n y: toPathShape.y,\r\n width: toPathShape.width,\r\n height: toPathShape.height\r\n };\r\n subShape[propXY] = xyCurr;\r\n subShape[propWH] = i < separateCount - 1\r\n ? subWH\r\n : toPathShape[propXY] + toPathShape[propWH] - xyCurr;\r\n var splitted = new Rect({ shape: subShape });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else if (path instanceof Sector) {\r\n var toPathShape = path.shape;\r\n var clockwise = toPathShape.clockwise;\r\n var startAngle = toPathShape.startAngle;\r\n var endAngle = toPathShape.endAngle;\r\n var endAngleNormalized = normalizeRadian$1(startAngle, toPathShape.endAngle, clockwise);\r\n var step = (endAngleNormalized - startAngle) / separateCount;\r\n var angleCurr = startAngle;\r\n for (var i = 0; i < separateCount; i++, angleCurr += step) {\r\n var splitted = new Sector({\r\n shape: {\r\n cx: toPathShape.cx,\r\n cy: toPathShape.cy,\r\n r: toPathShape.r,\r\n r0: toPathShape.r0,\r\n clockwise: clockwise,\r\n startAngle: angleCurr,\r\n endAngle: i === separateCount - 1 ? endAngle : angleCurr + step\r\n }\r\n });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else {\r\n return duplicateShape(path, separateCount);\r\n }\r\n return resultPaths;\r\n}\r\nfunction duplicateShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n var ctor = path.constructor;\r\n for (var i = 0; i < separateCount; i++) {\r\n var sub = new ctor({\r\n shape: clone(path.shape)\r\n });\r\n resultPaths.push(sub);\r\n }\r\n return resultPaths;\r\n}\r\nfunction normalizeRadian$1(start, end, clockwise) {\r\n return end + PI2$6 * (Math[clockwise ? 'ceil' : 'floor']((start - end) / PI2$6));\r\n}\n\nvar CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n}(Path));\n\nvar m = [];\r\nvar IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n}(Displayable));\n\nvar globalImageCache = new LRU(50);\r\nfunction findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n}\r\nfunction createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n}\r\nfunction imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n}\r\nfunction isImageReady(image) {\r\n return image && image.width && image.height;\r\n}\n\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\nfunction truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n}\r\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n}\r\nfunction truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n}\r\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n}\r\nfunction parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n}\r\nvar RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n}());\r\nvar RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n}());\r\nvar RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n}());\r\nfunction parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n}\r\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n}\r\nfunction isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n}\r\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n}, {});\r\nfunction isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n}\r\nfunction parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n}\n\nvar DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n};\r\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\r\nvar DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n};\r\nvar ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n}(Displayable));\r\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\nfunction normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n}\r\nfunction normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n}\r\nfunction getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n}\r\nfunction getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n}\r\nfunction getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n}\r\nfunction getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n}\r\nfunction needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n}\n\nvar ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n}());\r\nvar Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n}(Path));\r\nArc.prototype.type = 'arc';\n\nvar out = [];\r\nvar BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n}());\r\nfunction someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n}\r\nvar BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n}(Path));\r\nBezierCurve.prototype.type = 'bezier-curve';\n\nvar DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n}());\r\nvar Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n}(Path));\r\nDroplet.prototype.type = 'droplet';\n\nvar HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n}());\r\nvar Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n}(Path));\r\nHeart.prototype.type = 'heart';\n\nvar PI$3 = Math.PI;\r\nvar sin = Math.sin;\r\nvar cos = Math.cos;\r\nvar IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n}());\r\nvar Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n}(Path));\r\nIsogon.prototype.type = 'isogon';\n\nvar RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n}());\r\nvar Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n}(Path));\r\nRing.prototype.type = 'ring';\n\nvar sin$1 = Math.sin;\r\nvar cos$1 = Math.cos;\r\nvar radian = Math.PI / 180;\r\nvar RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n}());\r\nvar Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n}(Path));\r\nRose.prototype.type = 'rose';\n\nvar PI$4 = Math.PI;\r\nvar cos$2 = Math.cos;\r\nvar sin$2 = Math.sin;\r\nvar StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n}());\r\nvar Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n}(Path));\r\nStar.prototype.type = 'star';\n\nvar cos$3 = Math.cos;\r\nvar sin$3 = Math.sin;\r\nvar TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n}());\r\nvar Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n}(Path));\r\nTrochoid.prototype.type = 'trochoid';\n\nvar RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n}(Gradient));\n\nvar extent = [0, 0];\r\nvar extent2 = [0, 0];\r\nvar minTv$1 = new Point();\r\nvar maxTv$1 = new Point();\r\nvar OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n}());\n\n/*!\r\n* ZRender, a high performance 2d drawing library.\r\n*\r\n* Copyright (c) 2013, Baidu Inc.\r\n* All rights reserved.\r\n*\r\n* LICENSE\r\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n*/\r\nvar useVML = !env.canvasSupported;\r\nvar painterCtors = {};\r\nvar instances = {};\r\nfunction delInstance(id) {\r\n delete instances[id];\r\n}\r\nfunction isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n}\r\nvar ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n}());\r\nfunction init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n}\r\nfunction dispose(zr) {\r\n zr.dispose();\r\n}\r\nfunction disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n}\r\nfunction getInstance(id) {\r\n return instances[id];\r\n}\r\nfunction registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n}\r\nvar version = '5.0.1';\n\nvar zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n});\n\nvar RADIAN_EPSILON = 1e-4;\r\nfunction _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\nfunction linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n}\r\nfunction parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n}\r\nfunction round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n}\r\nfunction asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n}\r\nfunction getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n}\r\nfunction getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n}\r\nfunction getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n}\r\nfunction getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n}\r\nvar MAX_SAFE_INTEGER = 9007199254740991;\r\nfunction remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n}\r\nfunction isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n}\r\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\nfunction parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n}\r\nfunction quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n}\r\nfunction quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n}\r\nfunction nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n}\r\nfunction quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n}\r\nfunction reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n}\r\nfunction numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n}\r\nfunction isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n}\r\nfunction getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n}\r\nfunction getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n}\r\nfunction getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n}\n\nvar numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n});\n\nvar ECHARTS_PREFIX = '[ECharts] ';\r\nvar storedLogs = {};\r\nvar hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\nfunction warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n}\r\nfunction error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n}\r\nfunction deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n}\r\nfunction deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n}\r\nfunction consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n}\r\nfunction makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n}\r\nfunction throwError(msg) {\r\n throw new Error(msg);\r\n}\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\nfunction normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n}\r\nfunction defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n}\r\nvar TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n];\r\nfunction getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n}\r\nfunction isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n}\r\nfunction mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n}\r\nfunction prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n}\r\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n}\r\nfunction mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n}\r\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n}\r\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n}\r\nfunction makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n}\r\nfunction keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n}\r\nfunction makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n}\r\nfunction convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n}\r\nfunction warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n}\r\nfunction isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n}\r\nfunction isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n}\r\nfunction isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n}\r\nfunction makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n}\r\nfunction setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n}\r\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n}\r\nfunction compressBatches(batchA, batchB) {\r\n var mapA = {};\r\n var mapB = {};\r\n makeMap(batchA || [], mapA);\r\n makeMap(batchB || [], mapB, mapA);\r\n return [mapToArray(mapA), mapToArray(mapB)];\r\n function makeMap(sourceBatch, map, otherMap) {\r\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\r\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\r\n if (seriesId == null) {\r\n return;\r\n }\r\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\r\n var otherDataIndices = otherMap && otherMap[seriesId];\r\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\r\n var dataIndex = dataIndices[j];\r\n if (otherDataIndices && otherDataIndices[dataIndex]) {\r\n otherDataIndices[dataIndex] = null;\r\n }\r\n else {\r\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\r\n }\r\n }\r\n }\r\n }\r\n function mapToArray(map, isData) {\r\n var result = [];\r\n for (var i in map) {\r\n if (map.hasOwnProperty(i) && map[i] != null) {\r\n if (isData) {\r\n result.push(+i);\r\n }\r\n else {\r\n var dataIndices = mapToArray(map[i], true);\r\n dataIndices.length && result.push({ seriesId: i, dataIndex: dataIndices });\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\nfunction queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n}\r\nfunction makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n}\r\nvar innerUniqueIndex = getRandomIdBase();\r\nfunction parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n}\r\nvar SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\nvar MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\nfunction queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n}\r\nfunction setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n}\r\nfunction getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n}\r\nfunction getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n}\r\nfunction groupData(array, getKey) {\r\n var buckets = createHashMap();\r\n var keys = [];\r\n each(array, function (item) {\r\n var key = getKey(item);\r\n (buckets.get(key)\r\n || (keys.push(key), buckets.set(key, []))).push(item);\r\n });\r\n return {\r\n keys: keys,\r\n buckets: buckets\r\n };\r\n}\r\nfunction interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n}\n\nvar TYPE_DELIMITER = '.';\r\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\nfunction parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n}\r\nfunction checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n}\r\nfunction isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n}\r\nfunction enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n}\r\nfunction isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n}\r\nfunction mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n}\r\nvar classBase = Math.round(Math.random() * 10);\r\nfunction enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n}\r\nfunction superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\nfunction superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\nfunction enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n}\n\nfunction makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n}\n\nvar AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n];\r\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\nvar AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n}());\n\nvar getECData = makeInner();\n\nvar _highlightNextDigit = 1;\r\nvar _highlightKeyMap = {};\r\nvar getSavedStates = makeInner();\r\nvar HOVER_STATE_NORMAL = 0;\r\nvar HOVER_STATE_BLUR = 1;\r\nvar HOVER_STATE_EMPHASIS = 2;\r\nvar SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\nvar DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\nvar Z2_EMPHASIS_LIFT = 10;\r\nvar Z2_SELECT_LIFT = 9;\r\nvar HIGHLIGHT_ACTION_TYPE = 'highlight';\r\nvar DOWNPLAY_ACTION_TYPE = 'downplay';\r\nvar SELECT_ACTION_TYPE = 'select';\r\nvar UNSELECT_ACTION_TYPE = 'unselect';\r\nvar TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\nfunction hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n}\r\nvar liftedColorCache = new LRU(100);\r\nfunction liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n}\r\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n}\r\nfunction singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n}\r\nfunction singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\nfunction singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n}\r\nfunction singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\nfunction singleEnterSelect(el) {\r\n el.selected = true;\r\n}\r\nfunction singleLeaveSelect(el) {\r\n el.selected = false;\r\n}\r\nfunction updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n}\r\nfunction traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n}\r\nfunction setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n}\r\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n}\r\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n}\r\nfunction elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n}\r\nfunction setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n}\r\nfunction enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n}\r\nfunction leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n}\r\nfunction enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n}\r\nfunction leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n}\r\nfunction enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n}\r\nfunction leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n}\r\nfunction enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n}\r\nfunction leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n}\r\nfunction shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n}\r\nfunction allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n}\r\nfunction toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n}\r\nfunction toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n}\r\nfunction toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n}\r\nfunction updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n}\r\nfunction getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n}\r\nfunction enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n}\r\nfunction enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n}\r\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\r\nvar defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n};\r\nfunction setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n}\r\nfunction setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n}\r\nfunction isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n}\r\nfunction getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n}\r\nfunction isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n}\r\nfunction isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n}\r\nfunction savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n}\n\nvar mathMax$4 = Math.max;\r\nvar mathMin$4 = Math.min;\r\nvar _customShapeMap = {};\r\nfunction extendShape(opts) {\r\n return Path.extend(opts);\r\n}\r\nvar extendPathFromString = extendFromString;\r\nfunction extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n}\r\nfunction registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n}\r\nfunction getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n}\r\nfunction makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n}\r\nfunction makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n}\r\nfunction centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n}\r\nvar mergePath$1 = mergePath;\r\nfunction resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n}\r\nfunction subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n}\r\nfunction subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n}\r\nvar subPixelOptimize$1 = subPixelOptimize;\r\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n}\r\nfunction updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n}\r\nfunction removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n}\r\nfunction isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n}\r\nfunction applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n}\r\nfunction transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n}\r\nfunction isNotGroup(el) {\r\n return !el.isGroup;\r\n}\r\nfunction isPath(el) {\r\n return el.shape != null;\r\n}\r\nfunction groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n}\r\nfunction clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n}\r\nfunction clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n}\r\nfunction createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n}\r\nfunction linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n}\r\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n}\r\nfunction nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n}\r\nregisterShape('circle', Circle);\r\nregisterShape('ellipse', Ellipse);\r\nregisterShape('sector', Sector);\r\nregisterShape('ring', Ring);\r\nregisterShape('polygon', Polygon);\r\nregisterShape('polyline', Polyline);\r\nregisterShape('rect', Rect);\r\nregisterShape('line', Line);\r\nregisterShape('bezierCurve', BezierCurve);\r\nregisterShape('arc', Arc);\n\nvar graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n});\n\nvar EMPTY_OBJ = {};\r\nfunction setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n}\r\nfunction getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n}\r\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n}\r\nfunction getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n}\r\nfunction createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n}\r\nfunction createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n}\r\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n}\r\nfunction getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n}\r\nvar TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n];\r\nvar TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n];\r\nvar TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n];\r\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n}\r\nfunction getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n}\r\nvar labelInner = makeInner();\r\nfunction setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n}\r\nfunction animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n}\n\nvar PATH_COLOR = ['textStyle', 'color'];\r\nvar tmpRichText = new ZRText();\r\nvar TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n}());\n\nvar LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n];\r\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\nvar LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n}());\n\nvar ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n];\r\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\nvar ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n}());\n\nvar Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n}());\r\nenableClassExtend(Model);\r\nenableClassCheck(Model);\r\nmixin(Model, LineStyleMixin);\r\nmixin(Model, ItemStyleMixin);\r\nmixin(Model, AreaStyleMixin);\r\nmixin(Model, TextStyleMixin);\n\nvar base = Math.round(Math.random() * 10);\r\nfunction getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n}\r\nfunction enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n}\r\nfunction enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n}\r\nfunction inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n}\n\nvar langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n};\n\nvar langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n};\n\nvar LOCALE_ZH = 'ZH';\r\nvar LOCALE_EN = 'EN';\r\nvar DEFAULT_LOCALE = LOCALE_EN;\r\nvar localeStorage = {};\r\nvar localeModels = {};\r\nvar SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n})();\r\nfunction registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n}\r\nfunction createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n}\r\nfunction getLocaleModel(lang) {\r\n return localeModels[lang];\r\n}\r\nfunction getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n}\r\nregisterLocale(LOCALE_EN, langEN);\r\nregisterLocale(LOCALE_ZH, langZH);\n\nvar ONE_SECOND = 1000;\r\nvar ONE_MINUTE = ONE_SECOND * 60;\r\nvar ONE_HOUR = ONE_MINUTE * 60;\r\nvar ONE_DAY = ONE_HOUR * 24;\r\nvar ONE_YEAR = ONE_DAY * 365;\r\nvar defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n};\r\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\nvar fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}-{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n};\r\nvar primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\nvar timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\nfunction pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n}\r\nfunction getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n}\r\nfunction isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n}\r\nfunction getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n}\r\nfunction format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n}\r\nfunction leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n}\r\nfunction getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n}\r\nfunction getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n}\r\nfunction fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n}\r\nfunction monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n}\r\nfunction dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n}\r\nfunction hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n}\r\nfunction minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n}\r\nfunction secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n}\r\nfunction millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n}\r\nfunction fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n}\r\nfunction monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n}\r\nfunction dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n}\r\nfunction hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n}\r\nfunction minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n}\r\nfunction secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n}\r\nfunction millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n}\n\nfunction getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n}\n\nfunction addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n}\r\nfunction toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n}\r\nvar normalizeCssArray$1 = normalizeCssArray;\r\nvar replaceReg = /([&<>\"'])/g;\r\nvar replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n};\r\nfunction encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n}\r\nfunction makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n}\r\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\nvar wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n};\r\nfunction formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n}\r\nfunction formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n}\r\nfunction getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n}\r\nfunction formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n}\r\nfunction capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n}\r\nfunction convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n}\r\nfunction windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n}\n\nvar formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n});\n\nvar each$1 = each;\r\nvar LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n];\r\nvar HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n];\r\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n}\r\nvar box = boxLayout;\r\nvar vbox = curry(boxLayout, 'vertical');\r\nvar hbox = curry(boxLayout, 'horizontal');\r\nfunction getAvailableSize(positionInfo, containerRect, margin) {\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var x = parsePercent$2(positionInfo.left, containerWidth);\r\n var y = parsePercent$2(positionInfo.top, containerHeight);\r\n var x2 = parsePercent$2(positionInfo.right, containerWidth);\r\n var y2 = parsePercent$2(positionInfo.bottom, containerHeight);\r\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\r\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\r\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\r\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\r\n margin = normalizeCssArray$1(margin || 0);\r\n return {\r\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\r\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\r\n };\r\n}\r\nfunction getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n}\r\nfunction positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n}\r\nfunction sizeCalculable(option, hvIdx) {\r\n return option[HV_NAMES[hvIdx][0]] != null\r\n || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null);\r\n}\r\nfunction fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n}\r\nfunction mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n}\r\nfunction getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n}\r\nfunction copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n}\n\nvar inner = makeInner();\r\nvar ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n}(Model));\r\nmountExtend(ComponentModel, Model);\r\nenableClassManagement(ComponentModel, { registerWhenExtend: true });\r\nenableSubTypeDefaulter(ComponentModel);\r\nenableTopologicalTravel(ComponentModel, getDependencies);\r\nfunction getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n}\n\nvar platform = '';\r\nif (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n}\r\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\r\nvar globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n};\n\nvar VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n]);\r\nvar SOURCE_FORMAT_ORIGINAL = 'original';\r\nvar SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\nvar SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\nvar SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\nvar SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\nvar SOURCE_FORMAT_UNKNOWN = 'unknown';\r\nvar SERIES_LAYOUT_BY_COLUMN = 'column';\r\nvar SERIES_LAYOUT_BY_ROW = 'row';\n\nvar BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n};\r\nvar innerGlobalModel = makeInner();\r\nfunction resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n}\r\nfunction inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n}\r\nfunction makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n}\r\nfunction makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n}\r\nfunction querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n}\r\nfunction queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n}\r\nfunction guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n}\r\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n}\n\nvar internalOptionCreatorMap = createHashMap();\r\nfunction registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n}\r\nfunction concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n}\n\nvar innerColor = makeInner();\r\nvar innerDecal = makeInner();\r\nvar PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n}());\r\nfunction getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n}\r\nfunction getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n}\r\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n}\r\nfunction clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n}\n\nvar reCreateSeriesIndices;\r\nvar assertSeriesInitialized;\r\nvar initBase;\r\nvar OPTION_INNER_KEY = '\\0_ec_inner';\r\nvar GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n}(Model));\r\nfunction isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n}\r\nfunction mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n}\r\nfunction queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n}\r\nfunction filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n}\r\nfunction normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n}\r\nmixin(GlobalModel, PaletteMixin);\n\nvar availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n];\r\nvar ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n}());\n\nvar coordinateSystemCreators = {};\r\nvar CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n}());\n\nvar QUERY_REG = /^(min|max)?(.+)$/;\r\nvar OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n}());\r\nfunction parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n}\r\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n}\r\nfunction compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n}\r\nfunction indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n}\n\nvar each$2 = each;\r\nvar isObject$1 = isObject;\r\nvar POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n];\r\nfunction compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n}\r\nfunction convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n}\r\nfunction removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n}\r\nfunction compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n}\r\nfunction compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n}\r\nfunction processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n}\r\nfunction toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n}\r\nfunction toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n}\r\nfunction globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n}\n\nfunction get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n}\r\nfunction set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n}\r\nfunction compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n}\r\nvar LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n];\r\nvar COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n];\r\nvar BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n];\r\nfunction compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n}\r\nfunction compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n}\r\nfunction compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n}\r\nfunction traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n}\r\nfunction globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n}\n\nfunction dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n}\r\nfunction calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n}\n\nvar SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n}());\r\nfunction isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n}\r\nfunction createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n}\r\nfunction createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n}\r\nfunction cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n}\r\nfunction makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n}\r\nfunction detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n}\r\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n}\r\nfunction objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n}\r\nfunction normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n}\r\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n}\n\nvar _a, _b, _c;\r\nvar providerMethods;\r\nvar mountMethods;\r\nvar DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n}());\r\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n};\r\nvar rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\nfunction getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\nvar countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n};\r\nvar rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\nfunction getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\nvar getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n};\r\nvar rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\nfunction getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n}\r\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n}\r\nfunction retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n}\n\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\nvar DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n}());\r\nfunction normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n}\n\nfunction createTask(define) {\r\n return new Task(define);\r\n}\r\nvar Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n}());\r\nvar iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n})();\n\nfunction parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n}\r\nvar valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n});\r\nfunction getRawValueParser(type) {\r\n return valueParserMap.get(type);\r\n}\r\nvar ORDER_COMPARISON_OP_MAP = {\r\n lt: function (lval, rval) { return lval < rval; },\r\n lte: function (lval, rval) { return lval <= rval; },\r\n gt: function (lval, rval) { return lval > rval; },\r\n gte: function (lval, rval) { return lval >= rval; }\r\n};\r\nvar FilterOrderComparator = (function () {\r\n function FilterOrderComparator(op, rval) {\r\n if (typeof rval !== 'number') {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\r\n }\r\n throwError(errMsg);\r\n }\r\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterOrderComparator.prototype.evaluate = function (lval) {\r\n return typeof lval === 'number'\r\n ? this._opFn(lval, this._rvalFloat)\r\n : this._opFn(numericToNumber(lval), this._rvalFloat);\r\n };\r\n return FilterOrderComparator;\r\n}());\r\nvar SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n}());\r\nvar FilterEqualityComparator = (function () {\r\n function FilterEqualityComparator(isEq, rval) {\r\n this._rval = rval;\r\n this._isEQ = isEq;\r\n this._rvalTypeof = typeof rval;\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterEqualityComparator.prototype.evaluate = function (lval) {\r\n var eqResult = lval === this._rval;\r\n if (!eqResult) {\r\n var lvalTypeof = typeof lval;\r\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\r\n eqResult = numericToNumber(lval) === this._rvalFloat;\r\n }\r\n }\r\n return this._isEQ ? eqResult : !eqResult;\r\n };\r\n return FilterEqualityComparator;\r\n}());\r\nfunction createFilterComparator(op, rval) {\r\n return (op === 'eq' || op === 'ne')\r\n ? new FilterEqualityComparator(op === 'eq', rval)\r\n : hasOwn(ORDER_COMPARISON_OP_MAP, op)\r\n ? new FilterOrderComparator(op, rval)\r\n : null;\r\n}\n\nvar ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n}());\r\nfunction createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n}\r\nfunction getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n}\r\nfunction cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n}\r\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n}\r\nfunction cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n}\r\nvar externalTransformMap = createHashMap();\r\nfunction registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n}\r\nfunction applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n}\r\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n}\n\nvar SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n}());\r\nfunction disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n}\r\nfunction isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n}\r\nfunction doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n}\n\nvar TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\nvar TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n};\r\nvar TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\nvar TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n};\r\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\nvar HTML_GAPS = [0, 10, 20, 30];\r\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\nfunction createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n}\r\nfunction getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n}\r\nvar builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n};\r\nfunction buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n}\r\nfunction buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n}\r\nfunction getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n}\r\nfunction wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n}\r\nfunction wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n}\r\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n}\r\nfunction wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n}\r\nfunction wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n}\r\nfunction retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n}\r\nfunction getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n}\r\nvar TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n}());\n\nfunction defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n}\r\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n}\n\nvar inner$1 = makeInner();\r\nfunction getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n}\r\nvar SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n}(ComponentModel));\r\nmixin(SeriesModel, DataFormatMixin);\r\nmixin(SeriesModel, PaletteMixin);\r\nmountExtend(SeriesModel, ComponentModel);\r\nfunction autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n}\r\nfunction getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n}\r\nfunction dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n}\r\nfunction dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n}\r\nfunction dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n}\r\nfunction wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n}\r\nfunction onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n}\r\nfunction getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n}\n\nvar ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n}());\r\nenableClassExtend(ComponentView);\r\nenableClassManagement(ComponentView, { registerWhenExtend: true });\n\nfunction createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n}\n\nvar inner$2 = makeInner();\r\nvar renderPlanner = createRenderPlanner();\r\nvar ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n}());\r\nfunction elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n}\r\nfunction toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n}\r\nenableClassExtend(ChartView, ['dispose']);\r\nenableClassManagement(ChartView, { registerWhenExtend: true });\r\nfunction renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n}\r\nfunction renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n}\r\nvar progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n};\n\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\nvar RATE = '\\0__throttleRate';\r\nvar THROTTLE_TYPE = '\\0__throttleType';\r\nfunction throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n}\r\nfunction createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n}\r\nfunction clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n}\n\nvar inner$3 = makeInner();\r\nvar defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n};\r\nvar defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n};\r\nfunction getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n}\r\nfunction getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n}\r\nvar seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n};\r\nvar sharedModel = new Model();\r\nvar dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n};\r\nvar dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n};\n\nvar PI$5 = Math.PI;\r\nfunction defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n}\n\nvar Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n}());\r\nfunction overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n}\r\nfunction stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n}\r\nfunction stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n}\r\nfunction stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n}\r\nfunction seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n}\r\nfunction seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n}\r\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\nfunction makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n}\r\nfunction seriesTaskCount(context) {\r\n return context.data.count();\r\n}\r\nfunction detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n}\r\nvar ecModelMock = {};\r\nvar apiMock = {};\r\nvar seriesType;\r\nmockMethods(ecModelMock, GlobalModel);\r\nmockMethods(apiMock, ExtensionAPI);\r\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n};\r\necModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n};\r\nfunction mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n}\n\nvar colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n];\r\nvar lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n};\n\nvar contrastColor = '#B9B8CE';\r\nvar backgroundColor = '#100C2A';\r\nvar axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n};\r\nvar colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n];\r\nvar theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n};\r\ntheme.categoryAxis.splitLine.show = false;\n\nvar DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(DatasetModel);\r\nvar DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n}(ComponentView));\r\nComponentView.registerClass(DatasetView);\n\nvar storage = createHashMap();\r\nvar mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n};\r\nvar parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n};\n\nvar ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n}());\n\nvar seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n};\r\nvar dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n};\n\nfunction getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\r\nfunction getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\r\nfunction setItemVisualFromData(data, dataIndex, key, value) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n style[data.getVisual('drawType')] = value;\r\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\r\n break;\r\n case 'opacity':\r\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\r\n break;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n data.setItemVisual(dataIndex, key, value);\r\n break;\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n}\n\nvar PI2$7 = Math.PI * 2;\r\nvar CMD$4 = PathProxy.CMD;\r\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n}\r\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$7 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$7;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$7;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$7 >= startAngle && angle + PI2$7 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n}\r\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\nvar tmpPt = [];\r\nfunction nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n}\r\nfunction nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$4.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$4.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$4.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$4.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n}\r\nvar pt0 = new Point();\r\nvar pt1 = new Point();\r\nvar pt2 = new Point();\r\nvar dir = new Point();\r\nvar dir2 = new Point();\r\nfunction updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n}\r\nvar tmpArr$1 = [];\r\nvar tmpProjPoint = new Point();\r\nfunction limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\nfunction limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n}\r\nfunction buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n}\r\nfunction setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n}\r\nfunction getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n}\n\nfunction prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n}\r\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n}\r\nfunction shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n}\r\nfunction shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n}\r\nfunction hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n}\n\nfunction cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n}\r\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n}\r\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\nvar dummyTransformable = new Transformable();\r\nvar labelLayoutInnerStore = makeInner();\r\nvar labelLineAnimationStore = makeInner();\r\nfunction extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n}\r\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\nvar LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n}());\n\nfunction createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n}\r\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n}\r\nfunction handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n}\n\nfunction createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n}\r\nfunction createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n}\r\nfunction getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n}\r\nfunction isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\nfunction normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n}\n\nvar pathProxyForDraw = new PathProxy(true);\r\nfunction styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n}\r\nfunction styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n}\r\nfunction doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n}\r\nfunction doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n}\r\nfunction createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n}\r\nfunction brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n}\r\nfunction brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n}\r\nfunction brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n}\r\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\nvar STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n];\r\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n}\r\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n}\r\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n}\r\nfunction setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n}\r\nfunction updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n}\r\nfunction isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar DRAW_TYPE_PATH = 1;\r\nvar DRAW_TYPE_IMAGE = 2;\r\nvar DRAW_TYPE_TEXT = 3;\r\nvar DRAW_TYPE_INCREMENTAL = 4;\r\nfunction canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n}\r\nfunction flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n}\r\nfunction getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n}\r\nfunction brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n}\r\nfunction brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n}\r\nfunction brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n}\n\nfunction returnFalse() {\r\n return false;\r\n}\r\nfunction createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n}\r\nvar Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n}(Eventful));\n\nvar HOVER_LAYER_ZLEVEL = 1e5;\r\nvar CANVAS_ZLEVEL = 314159;\r\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\r\nvar INCREMENTAL_INC = 0.001;\r\nfunction parseInt10(val) {\r\n return parseInt(val, 10);\r\n}\r\nfunction isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n}\r\nvar CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n}());\n\nregisterPainter('canvas', CanvasPainter);\n\nfunction findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n}\n\nvar wmUniqueIndex = Math.round(Math.random() * 9);\r\nvar WeakMap = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n}());\n\nvar Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n});\r\nvar Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n});\r\nvar Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n});\r\nvar Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n});\r\nvar symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n};\r\nvar symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n};\r\nvar symbolBuildProxies = {};\r\neach(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n});\r\nvar SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n});\r\nfunction symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n}\r\nfunction createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n}\n\nvar decalMap = new WeakMap();\r\nvar decalCache = new LRU(100);\r\nvar decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n];\r\nfunction createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n}\r\nfunction normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\nfunction normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n}\r\nfunction getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n}\r\nfunction getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n}\n\nfunction decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n}\n\nvar assert$1 = assert;\r\nvar each$3 = each;\r\nvar isFunction$1 = isFunction;\r\nvar isObject$2 = isObject;\r\nvar version$1 = '5.0.0';\r\nvar dependencies = {\r\n zrender: '5.0.1'\r\n};\r\nvar TEST_FRAME_REMAIN_TIME = 1;\r\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\nvar PRIORITY_PROCESSOR_DATASTACK = 900;\r\nvar PRIORITY_PROCESSOR_FILTER = 1000;\r\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\r\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\r\nvar PRIORITY_VISUAL_LAYOUT = 1000;\r\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\nvar PRIORITY_VISUAL_GLOBAL = 2000;\r\nvar PRIORITY_VISUAL_CHART = 3000;\r\nvar PRIORITY_VISUAL_COMPONENT = 4000;\r\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\nvar PRIORITY_VISUAL_BRUSH = 5000;\r\nvar PRIORITY_VISUAL_ARIA = 6000;\r\nvar PRIORITY_VISUAL_DECAL = 7000;\r\nvar PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n};\r\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\nvar OPTION_UPDATED_KEY = '__optionUpdated';\r\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\nvar CONNECT_STATUS_PENDING = 0;\r\nvar CONNECT_STATUS_UPDATING = 1;\r\nvar CONNECT_STATUS_UPDATED = 2;\r\nfunction createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n}\r\nvar MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n}(Eventful));\r\nvar messageCenterProto = MessageCenter.prototype;\r\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\nvar prepare;\r\nvar prepareView;\r\nvar updateDirectly;\r\nvar updateMethods;\r\nvar doConvertPixel;\r\nvar updateStreamModes;\r\nvar doDispatchAction;\r\nvar flushPendingActions;\r\nvar triggerUpdatedEvent;\r\nvar bindRenderedEvent;\r\nvar bindMouseEvent;\r\nvar clearColorPalette;\r\nvar render;\r\nvar renderComponents;\r\nvar renderSeries;\r\nvar performPostUpdateFuncs;\r\nvar createExtensionAPI;\r\nvar enableConnect;\r\nvar setTransitionOpt;\r\nvar markStatusToUpdate;\r\nvar applyChangedStates;\r\nvar ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n}(Eventful));\r\nvar echartsProto = ECharts.prototype;\r\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\nechartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n};\r\nvar MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n];\r\nfunction disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n}\r\nvar actions = {};\r\nvar eventActionMap = {};\r\nvar dataProcessorFuncs = [];\r\nvar optionPreprocessorFuncs = [];\r\nvar postInitFuncs = [];\r\nvar postUpdateFuncs = [];\r\nvar visualFuncs = [];\r\nvar themeStorage = {};\r\nvar loadingEffects = {};\r\nvar instances$1 = {};\r\nvar connectedGroups = {};\r\nvar idBase = +(new Date()) - 0;\r\nvar groupIdBase = +(new Date()) - 0;\r\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\nfunction init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n}\r\nfunction connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n}\r\nfunction disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n}\r\nvar disconnect = disConnect;\r\nfunction dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n}\r\nfunction getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n}\r\nfunction getInstanceById(key) {\r\n return instances$1[key];\r\n}\r\nfunction registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n}\r\nfunction registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n}\r\nfunction registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n}\r\nfunction registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n}\r\nfunction registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n}\r\nfunction registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n}\r\nfunction registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n}\r\nfunction getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n}\r\nfunction registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n}\r\nfunction registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n}\r\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n}\r\nfunction registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n}\r\nfunction extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n}\r\nfunction extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n}\r\nfunction extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n}\r\nfunction extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n}\r\nfunction setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n}\r\nfunction registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n}\r\nfunction getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n}\r\nvar registerTransform = registerExternalTransform;\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\nregisterVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\nregisterPreprocessor(globalBackwardCompat);\r\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\nregisterLoading('default', defaultLoading);\r\nregisterAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n}, noop);\r\nregisterAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n}, noop);\r\nregisterTheme('light', lightTheme);\r\nregisterTheme('dark', theme);\r\nvar dataTool = {};\n\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n}\r\nfunction defaultKeyGetter(item) {\r\n return item;\r\n}\r\nvar DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n}());\n\nfunction summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n}\r\nfunction getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n}\r\nfunction getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n}\r\nfunction mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n}\n\nvar DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n}());\n\nvar mathFloor = Math.floor;\r\nvar isObject$3 = isObject;\r\nvar map$1 = map;\r\nvar UNDEFINED = 'undefined';\r\nvar INDEX_NOT_FOUND = -1;\r\nvar ID_PREFIX = 'e\\0\\0';\r\nvar dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n};\r\nvar CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\nvar CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\nvar CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\nvar TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n];\r\nvar CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n];\r\nvar defaultDimValueGetters;\r\nvar prepareInvertedIndex;\r\nvar getIndicesCtor;\r\nvar prepareStorage;\r\nvar getRawIndexWithoutIndices;\r\nvar getRawIndexWithIndices;\r\nvar getId;\r\nvar getIdNameFromStore;\r\nvar makeIdFromName;\r\nvar normalizeDimensions;\r\nvar validateDimensions;\r\nvar cloneListForMapAndSample;\r\nvar getInitialExtent;\r\nvar setItemDataAndSeriesIndex;\r\nvar transferProperties;\r\nvar List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n}());\n\nfunction completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n}\r\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n}\r\nfunction genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n}\n\nfunction createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n}\n\nvar CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n}());\r\nfunction getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n}\r\nvar fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n};\r\nfunction isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n}\n\nfunction enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n}\r\nfunction isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n}\r\nfunction getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n}\n\nfunction createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n}\r\nfunction isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n}\r\nfunction firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n}\n\nvar Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n}());\r\nenableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n});\n\nvar OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n}());\r\nfunction getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n}\n\nvar roundNumber = round$1;\r\nfunction intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n}\r\nfunction getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n}\r\nfunction clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n}\r\nfunction fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n}\r\nfunction contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n}\r\nfunction normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n}\r\nfunction scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n}\n\nvar OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n}(Scale));\r\nScale.registerClass(OrdinalScale);\n\nvar roundNumber$1 = round$1;\r\nvar IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n}(Scale));\r\nScale.registerClass(IntervalScale);\n\nvar STACK_PREFIX = '__ec_stack_';\r\nvar LARGE_BAR_MIN_WIDTH = 0.5;\r\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\nfunction getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n}\r\nfunction getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n}\r\nfunction getLayoutOnAxis(opt) {\r\n var params = [];\r\n var baseAxis = opt.axis;\r\n var axisKey = 'axis0';\r\n if (baseAxis.type !== 'category') {\r\n return;\r\n }\r\n var bandWidth = baseAxis.getBandWidth();\r\n for (var i = 0; i < opt.count || 0; i++) {\r\n params.push(defaults({\r\n bandWidth: bandWidth,\r\n axisKey: axisKey,\r\n stackId: STACK_PREFIX + i\r\n }, opt));\r\n }\r\n var widthAndOffsets = doCalBarWidthAndOffset(params);\r\n var result = [];\r\n for (var i = 0; i < opt.count; i++) {\r\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\r\n item.offsetCenter = item.offset + item.width / 2;\r\n result.push(item);\r\n }\r\n return result;\r\n}\r\nfunction prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n}\r\nfunction getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n}\r\nfunction makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n}\r\nfunction doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n}\r\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n}\r\nfunction layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n}\r\nvar largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n};\r\nfunction isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n}\r\nfunction isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n}\r\nfunction getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n}\n\nvar bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n};\r\nvar TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n}(IntervalScale));\r\nvar scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n];\r\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n}\r\nfunction getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n}\r\nfunction getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\nfunction getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n}\r\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n}\r\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n}\r\nScale.registerClass(TimeScale);\n\nvar scaleProto = Scale.prototype;\r\nvar intervalScaleProto = IntervalScale.prototype;\r\nvar getPrecisionSafe$1 = getPrecisionSafe;\r\nvar roundingErrorFix = round$1;\r\nvar mathFloor$1 = Math.floor;\r\nvar mathCeil = Math.ceil;\r\nvar mathPow$1 = Math.pow;\r\nvar mathLog = Math.log;\r\nvar LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n}(Scale));\r\nvar proto = LogScale.prototype;\r\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\nproto.getLabel = intervalScaleProto.getLabel;\r\nfunction fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n}\r\nScale.registerClass(LogScale);\n\nvar ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n}());\r\nvar DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\nvar DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\nfunction ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n}\r\nfunction parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n}\n\nfunction getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n}\r\nfunction adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n}\r\nfunction niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n}\r\nfunction createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n}\r\nfunction ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n}\r\nfunction makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n}\r\nfunction getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n}\r\nfunction estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n}\r\nfunction rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n}\r\nfunction getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n}\r\nfunction shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n}\r\nfunction getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n}\r\nfunction unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n}\n\nvar AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n}());\n\nfunction createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n}\r\nvar dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n};\r\nfunction createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n}\r\nfunction mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n}\n\nvar helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n});\n\nvar EPSILON$3 = 1e-8;\r\nfunction isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n}\r\nfunction contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n}\n\nvar Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n}());\n\nfunction decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n}\r\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n}\r\nfunction parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n}\n\nvar inner$4 = makeInner();\r\nfunction createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n}\r\nfunction createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n}\r\nfunction makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n}\r\nfunction makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n}\r\nfunction makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n}\r\nfunction makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n}\r\nfunction getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n}\r\nfunction listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n}\r\nfunction listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n}\r\nfunction makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n}\r\nfunction calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n}\r\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n}\r\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n}\r\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n}\n\nvar NORMALIZED_EXTENT = [0, 1];\r\nvar Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n}());\r\nfunction fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n}\r\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n}\n\nvar parseGeoJson = parseGeoJSON;\r\nvar number = {};\r\neach([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n], function (name) {\r\n number[name] = numberUtil[name];\r\n});\r\nvar format$1 = {};\r\neach([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n], function (name) {\r\n format$1[name] = formatUtil[name];\r\n});\r\nvar time = {\r\n parse: parseDate,\r\n format: format\r\n};\r\nvar ecUtil = {};\r\neach([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n});\r\nvar GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n];\r\nvar graphic$1 = {};\r\neach(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n});\n\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\r\n value: 'eq',\r\n '<': 'lt',\r\n '<=': 'lte',\r\n '>': 'gt',\r\n '>=': 'gte',\r\n '=': 'eq',\r\n '!=': 'ne',\r\n '<>': 'ne'\r\n};\r\nvar RegExpEvaluator = (function () {\r\n function RegExpEvaluator(rVal) {\r\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal)\r\n : isRegExp(rVal) ? rVal\r\n : null;\r\n if (condValue == null) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n RegExpEvaluator.prototype.evaluate = function (lVal) {\r\n var type = typeof lVal;\r\n return type === 'string' ? this._condVal.test(lVal)\r\n : type === 'number' ? this._condVal.test(lVal + '')\r\n : false;\r\n };\r\n return RegExpEvaluator;\r\n}());\r\nvar ConstConditionInternal = (function () {\r\n function ConstConditionInternal() {\r\n }\r\n ConstConditionInternal.prototype.evaluate = function () {\r\n return this.value;\r\n };\r\n return ConstConditionInternal;\r\n}());\r\nvar AndConditionInternal = (function () {\r\n function AndConditionInternal() {\r\n }\r\n AndConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (!children[i].evaluate()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return AndConditionInternal;\r\n}());\r\nvar OrConditionInternal = (function () {\r\n function OrConditionInternal() {\r\n }\r\n OrConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].evaluate()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return OrConditionInternal;\r\n}());\r\nvar NotConditionInternal = (function () {\r\n function NotConditionInternal() {\r\n }\r\n NotConditionInternal.prototype.evaluate = function () {\r\n return !this.child.evaluate();\r\n };\r\n return NotConditionInternal;\r\n}());\r\nvar RelationalConditionInternal = (function () {\r\n function RelationalConditionInternal() {\r\n }\r\n RelationalConditionInternal.prototype.evaluate = function () {\r\n var needParse = !!this.valueParser;\r\n var getValue = this.getValue;\r\n var tarValRaw = getValue(this.valueGetterParam);\r\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\r\n for (var i = 0; i < this.subCondList.length; i++) {\r\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return RelationalConditionInternal;\r\n}());\r\nfunction parseOption(exprOption, getters) {\r\n if (exprOption === true || exprOption === false) {\r\n var cond = new ConstConditionInternal();\r\n cond.value = exprOption;\r\n return cond;\r\n }\r\n var errMsg = '';\r\n if (!isObjectNotArray(exprOption)) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n if (exprOption.and) {\r\n return parseAndOrOption('and', exprOption, getters);\r\n }\r\n else if (exprOption.or) {\r\n return parseAndOrOption('or', exprOption, getters);\r\n }\r\n else if (exprOption.not) {\r\n return parseNotOption(exprOption, getters);\r\n }\r\n return parseRelationalOption(exprOption, getters);\r\n}\r\nfunction parseAndOrOption(op, exprOption, getters) {\r\n var subOptionArr = exprOption[op];\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isArray(subOptionArr)) {\r\n throwError(errMsg);\r\n }\r\n if (!subOptionArr.length) {\r\n throwError(errMsg);\r\n }\r\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\r\n cond.children = map(subOptionArr, function (subOption) { return parseOption(subOption, getters); });\r\n if (!cond.children.length) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\nfunction parseNotOption(exprOption, getters) {\r\n var subOption = exprOption.not;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isObjectNotArray(subOption)) {\r\n throwError(errMsg);\r\n }\r\n var cond = new NotConditionInternal();\r\n cond.child = parseOption(subOption, getters);\r\n if (!cond.child) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\nfunction parseRelationalOption(exprOption, getters) {\r\n var errMsg = '';\r\n var valueGetterParam = getters.prepareGetValue(exprOption);\r\n var subCondList = [];\r\n var exprKeys = keys(exprOption);\r\n var parserName = exprOption.parser;\r\n var valueParser = parserName ? getRawValueParser(parserName) : null;\r\n for (var i = 0; i < exprKeys.length; i++) {\r\n var keyRaw = exprKeys[i];\r\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\r\n continue;\r\n }\r\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw)\r\n ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw]\r\n : keyRaw;\r\n var condValueRaw = exprOption[keyRaw];\r\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\r\n var evaluator = createFilterComparator(op, condValueParsed)\r\n || (op === 'reg' && new RegExpEvaluator(condValueParsed));\r\n if (!evaluator) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n subCondList.push(evaluator);\r\n }\r\n if (!subCondList.length) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var cond = new RelationalConditionInternal();\r\n cond.valueGetterParam = valueGetterParam;\r\n cond.valueParser = valueParser;\r\n cond.getValue = getters.getValue;\r\n cond.subCondList = subCondList;\r\n return cond;\r\n}\r\nfunction isObjectNotArray(val) {\r\n return isObject(val) && !isArrayLike(val);\r\n}\r\nvar ConditionalExpressionParsed = (function () {\r\n function ConditionalExpressionParsed(exprOption, getters) {\r\n this._cond = parseOption(exprOption, getters);\r\n }\r\n ConditionalExpressionParsed.prototype.evaluate = function () {\r\n return this._cond.evaluate();\r\n };\r\n return ConditionalExpressionParsed;\r\n}());\r\nfunction parseConditionalExpression(exprOption, getters) {\r\n return new ConditionalExpressionParsed(exprOption, getters);\r\n}\n\nvar filterTransform = {\r\n type: 'echarts:filter',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var rawItem;\r\n var condition = parseConditionalExpression(params.config, {\r\n valueGetterAttrMap: createHashMap({ dimension: true }),\r\n prepareGetValue: function (exprOption) {\r\n var errMsg = '';\r\n var dimLoose = exprOption.dimension;\r\n if (!hasOwn(exprOption, 'dimension')) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n return { dimIdx: dimInfo.index };\r\n },\r\n getValue: function (param) {\r\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\r\n }\r\n });\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n rawItem = upstream.getRawDataItem(i);\r\n if (condition.evaluate()) {\r\n resultData.push(rawItem);\r\n }\r\n }\r\n return {\r\n data: resultData\r\n };\r\n }\r\n};\n\nvar sampleLog = '';\r\nif (__DEV__) {\r\n sampleLog = [\r\n 'Valid config is like:',\r\n '{ dimension: \"age\", order: \"asc\" }',\r\n 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'\r\n ].join(' ');\r\n}\r\nvar sortTransform = {\r\n type: 'echarts:sort',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var config = params.config;\r\n var errMsg = '';\r\n var orderExprList = normalizeToArray(config);\r\n if (!orderExprList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Empty `config` in sort transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var orderDefList = [];\r\n each(orderExprList, function (orderExpr) {\r\n var dimLoose = orderExpr.dimension;\r\n var order = orderExpr.order;\r\n var parserName = orderExpr.parser;\r\n var incomparable = orderExpr.incomparable;\r\n if (dimLoose == null) {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (incomparable && (incomparable !== 'min' && incomparable !== 'max')) {\r\n var errMsg_1 = '';\r\n if (__DEV__) {\r\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\r\n }\r\n throwError(errMsg_1);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n var errMsg_2 = '';\r\n if (__DEV__) {\r\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\r\n }\r\n throwError(errMsg_2);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n var parser = parserName ? getRawValueParser(parserName) : null;\r\n if (parserName && !parser) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n orderDefList.push({\r\n dimIdx: dimInfo.index,\r\n parser: parser,\r\n comparator: new SortOrderComparator(order, incomparable)\r\n });\r\n });\r\n var sourceFormat = upstream.sourceFormat;\r\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (__DEV__) {\r\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n resultData.push(upstream.getRawDataItem(i));\r\n }\r\n resultData.sort(function (item0, item1) {\r\n for (var i = 0; i < orderDefList.length; i++) {\r\n var orderDef = orderDefList[i];\r\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\r\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\r\n if (orderDef.parser) {\r\n val0 = orderDef.parser(val0);\r\n val1 = orderDef.parser(val1);\r\n }\r\n var result = orderDef.comparator.evaluate(val0, val1);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n return 0;\r\n });\r\n return {\r\n data: resultData\r\n };\r\n }\r\n};\n\nregisterTransform(filterTransform);\r\nregisterTransform(sortTransform);\n\nvar LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(LineSeriesModel);\n\nfunction getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n}\r\nfunction getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n}\n\nvar Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n}(Group));\r\nfunction driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n}\n\nfunction symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n}\r\nfunction normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n}\r\nfunction makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n}\r\nvar SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n}());\n\nfunction prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n}\r\nfunction getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n}\r\nfunction getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n}\n\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\r\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\nfunction createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n}\n\nfunction diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n}\r\nfunction lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n}\n\nvar mathMin$5 = Math.min;\r\nvar mathMax$5 = Math.max;\r\nfunction isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n}\r\nvar ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n}());\r\nvar ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n}(Path));\r\nvar ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n}(ECPolylineShape));\r\nvar ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n}(Path));\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n}\r\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n}\r\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n}\n\nfunction isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n}\n\nfunction isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n}\r\nfunction getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n}\r\nfunction getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n}\r\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n}\r\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n}\r\nfunction getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n}\r\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n}\r\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\nfunction getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n}\r\nfunction getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n}\r\nfunction getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n}\r\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n}\r\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n}\r\nvar LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n}(ChartView));\r\nChartView.registerClass(LineView);\n\nfunction pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n}\n\nvar samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n};\r\nvar indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n};\r\nfunction dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\n\nvar defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n};\r\nvar categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n}, defaultOption);\r\nvar valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n}, defaultOption);\r\nvar timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n}, valueAxis);\r\nvar logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n}, valueAxis);\r\nvar axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n};\n\nvar AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\nfunction axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n}\r\nfunction getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n}\n\nvar CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n}(ComponentModel));\r\nmixin(CartesianAxisModel, AxisModelCommonMixin);\r\nvar extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n};\r\naxisModelCreator('x', CartesianAxisModel, extraOption);\r\naxisModelCreator('y', CartesianAxisModel, extraOption);\n\nvar PI$6 = Math.PI;\r\nvar AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n}());\r\nvar builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n};\r\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n}\r\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n}\r\nfunction ignoreEl(el) {\r\n el && (el.ignore = true);\r\n}\r\nfunction isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n}\r\nfunction isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n}\r\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n}\r\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n}\r\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n}\r\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n}\n\nfunction collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n}\r\nfunction collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n}\r\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n}\r\nfunction collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n}\r\nfunction getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n}\r\nfunction checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n}\r\nfunction fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n}\r\nfunction getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n}\r\nfunction getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n}\r\nfunction isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n}\r\nfunction makeKey(model) {\r\n return model.type + '||' + model.id;\r\n}\n\nvar axisPointerClazz = {};\r\nvar AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n}(ComponentView));\n\nfunction layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n}\r\nfunction isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n}\r\nfunction findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n}\n\nvar inner$5 = makeInner();\r\nfunction rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n}\r\nfunction rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n}\n\nvar axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n];\r\nvar CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n};\r\nvar CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n}(CartesianAxisView));\r\nvar CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n}(CartesianAxisView));\r\nComponentView.registerClass(CartesianXAxisView);\r\nComponentView.registerClass(CartesianYAxisView);\n\nregisterProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n});\r\nfunction prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n}\r\nfunction calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n}\r\nfunction shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n}\r\nfunction prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n}\r\nfunction initExtent() {\r\n return [Infinity, -Infinity];\r\n}\r\nfunction unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n}\n\nvar GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n}(ComponentModel));\n\nvar GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n}(ComponentView));\r\nComponentView.registerClass(GridView);\r\nComponentModel.registerClass(GridModel);\r\nregisterPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n});\n\nregisterLayout(pointsLayout('line', true));\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\nvar Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n}());\n\nvar cartesian2DDimensions = ['x', 'y'];\r\nfunction canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n}\r\nvar Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n}(Cartesian));\n\nvar Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n}(Axis));\n\nvar Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n}());\r\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n}\r\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n}\r\nfunction canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n}\r\nfunction updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n}\r\nCoordinateSystemManager.register('cartesian2d', Grid);\n\nvar BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(BaseBarSeriesModel);\n\nvar BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n}(BaseBarSeriesModel));\r\nSeriesModel.registerClass(BarSeriesModel);\n\nvar SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n}());\r\nvar SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n}(Path));\n\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\nvar BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\nvar _eventPos = [0, 0];\r\nvar mathMax$6 = Math.max;\r\nvar mathMin$6 = Math.min;\r\nfunction getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n}\r\nvar BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n}(ChartView));\r\nvar clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n};\r\nvar elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n};\r\nfunction updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n}\r\nvar getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n};\r\nfunction isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n}\r\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n}\r\nfunction getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n}\r\nvar LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n}());\r\nvar LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n}(Path));\r\nfunction createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n}\r\nvar largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n}, 30, false);\r\nfunction largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n}\r\nfunction setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n}\r\nfunction setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n}\r\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n}\r\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n}\r\nChartView.registerClass(BarView);\n\nregisterAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n});\n\nregisterLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\nregisterLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\nregisterVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n});\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\nfunction createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n}\n\nvar LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n}());\n\nvar PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(PieSeriesModel);\n\nvar RADIAN = Math.PI / 180;\r\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n}\r\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n}\r\nfunction isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n}\r\nfunction pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n}\n\nfunction getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n}\n\nvar PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n}(Sector));\r\nvar PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n}(ChartView));\r\nChartView.registerClass(PieView);\n\nvar PI2$8 = Math.PI * 2;\r\nvar RADIAN$1 = Math.PI / 180;\r\nfunction getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$8;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$8 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$8 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$8 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n}\n\nfunction dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n}\n\ncreateLegacyDataSelectAction('pie', registerAction);\r\nregisterLayout(curry(pieLayout, 'pie'));\r\nregisterProcessor(dataFilter('pie'));\n\nvar ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ScatterSeriesModel);\n\nvar BOOST_SIZE_THRESHOLD = 4;\r\nvar LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n}());\r\nvar LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n}(Path));\r\nvar LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n}());\n\nvar ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n}(ChartView));\r\nChartView.registerClass(ScatterView);\n\nregisterLayout(pointsLayout('scatter'));\n\nvar IndicatorAxis = (function (_super) {\r\n __extends(IndicatorAxis, _super);\r\n function IndicatorAxis(dim, scale, radiusExtent) {\r\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\r\n _this.type = 'value';\r\n _this.angle = 0;\r\n _this.name = '';\r\n return _this;\r\n }\r\n return IndicatorAxis;\r\n}(Axis));\n\nvar Radar = (function () {\r\n function Radar(radarModel, ecModel, api) {\r\n this.dimensions = [];\r\n this._model = radarModel;\r\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\r\n var dim = 'indicator_' + idx;\r\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());\r\n indicatorAxis.name = indicatorModel.get('name');\r\n indicatorAxis.model = indicatorModel;\r\n indicatorModel.axis = indicatorAxis;\r\n this.dimensions.push(dim);\r\n return indicatorAxis;\r\n }, this);\r\n this.resize(radarModel, api);\r\n }\r\n Radar.prototype.getIndicatorAxes = function () {\r\n return this._indicatorAxes;\r\n };\r\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\r\n };\r\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n var angle = indicatorAxis.angle;\r\n var x = this.cx + coord * Math.cos(angle);\r\n var y = this.cy - coord * Math.sin(angle);\r\n return [x, y];\r\n };\r\n Radar.prototype.pointToData = function (pt) {\r\n var dx = pt[0] - this.cx;\r\n var dy = pt[1] - this.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx);\r\n var minRadianDiff = Infinity;\r\n var closestAxis;\r\n var closestAxisIdx = -1;\r\n for (var i = 0; i < this._indicatorAxes.length; i++) {\r\n var indicatorAxis = this._indicatorAxes[i];\r\n var diff = Math.abs(radian - indicatorAxis.angle);\r\n if (diff < minRadianDiff) {\r\n closestAxis = indicatorAxis;\r\n closestAxisIdx = i;\r\n minRadianDiff = diff;\r\n }\r\n }\r\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\r\n };\r\n Radar.prototype.resize = function (radarModel, api) {\r\n var center = radarModel.get('center');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\r\n this.cx = parsePercent$2(center[0], viewWidth);\r\n this.cy = parsePercent$2(center[1], viewHeight);\r\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\r\n var radius = radarModel.get('radius');\r\n if (typeof radius === 'string' || typeof radius === 'number') {\r\n radius = [0, radius];\r\n }\r\n this.r0 = parsePercent$2(radius[0], viewSize);\r\n this.r = parsePercent$2(radius[1], viewSize);\r\n each(this._indicatorAxes, function (indicatorAxis, idx) {\r\n indicatorAxis.setExtent(this.r0, this.r);\r\n var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);\r\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\r\n indicatorAxis.angle = angle;\r\n }, this);\r\n };\r\n Radar.prototype.update = function (ecModel, api) {\r\n var indicatorAxes = this._indicatorAxes;\r\n var radarModel = this._model;\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\r\n if (radarSeries.get('coordinateSystem') !== 'radar'\r\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\r\n return;\r\n }\r\n var data = radarSeries.getData();\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\r\n });\r\n }, this);\r\n var splitNumber = radarModel.get('splitNumber');\r\n function increaseInterval(interval) {\r\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10));\r\n var f = interval / exp10;\r\n if (f === 2) {\r\n f = 5;\r\n }\r\n else {\r\n f *= 2;\r\n }\r\n return f * exp10;\r\n }\r\n each(indicatorAxes, function (indicatorAxis, idx) {\r\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\r\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\r\n var axisModel = indicatorAxis.model;\r\n var scale = indicatorAxis.scale;\r\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\r\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\r\n var interval = scale.getInterval();\r\n if (fixedMin != null && fixedMax != null) {\r\n scale.setExtent(+fixedMin, +fixedMax);\r\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\r\n }\r\n else if (fixedMin != null) {\r\n var max = void 0;\r\n do {\r\n max = fixedMin + interval * splitNumber;\r\n scale.setExtent(+fixedMin, max);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\r\n }\r\n else if (fixedMax != null) {\r\n var min = void 0;\r\n do {\r\n min = fixedMax - interval * splitNumber;\r\n scale.setExtent(min, +fixedMax);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\r\n }\r\n else {\r\n var nicedSplitNumber = scale.getTicks().length - 1;\r\n if (nicedSplitNumber > splitNumber) {\r\n interval = increaseInterval(interval);\r\n }\r\n var max = Math.ceil(rawExtent[1] / interval) * interval;\r\n var min = round$1(max - interval * splitNumber);\r\n scale.setExtent(min, max);\r\n scale.setInterval(interval);\r\n }\r\n });\r\n };\r\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Radar.create = function (ecModel, api) {\r\n var radarList = [];\r\n ecModel.eachComponent('radar', function (radarModel) {\r\n var radar = new Radar(radarModel, ecModel, api);\r\n radarList.push(radar);\r\n radarModel.coordinateSystem = radar;\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries) {\r\n if (radarSeries.get('coordinateSystem') === 'radar') {\r\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\r\n }\r\n });\r\n return radarList;\r\n };\r\n Radar.dimensions = [];\r\n return Radar;\r\n}());\r\nCoordinateSystemManager.register('radar', Radar);\n\nvar valueAxisDefault = axisDefault.value;\r\nfunction defaultsShow(opt, show) {\r\n return defaults({\r\n show: show\r\n }, opt);\r\n}\r\nvar RadarModel = (function (_super) {\r\n __extends(RadarModel, _super);\r\n function RadarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarModel.type;\r\n return _this;\r\n }\r\n RadarModel.prototype.optionUpdated = function () {\r\n var boundaryGap = this.get('boundaryGap');\r\n var splitNumber = this.get('splitNumber');\r\n var scale = this.get('scale');\r\n var axisLine = this.get('axisLine');\r\n var axisTick = this.get('axisTick');\r\n var axisLabel = this.get('axisLabel');\r\n var nameTextStyle = this.get('axisName');\r\n var showName = this.get(['axisName', 'show']);\r\n var nameFormatter = this.get(['axisName', 'formatter']);\r\n var nameGap = this.get('axisNameGap');\r\n var triggerEvent = this.get('triggerEvent');\r\n var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) {\r\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\r\n indicatorOpt.min = 0;\r\n }\r\n else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\r\n indicatorOpt.max = 0;\r\n }\r\n var iNameTextStyle = nameTextStyle;\r\n if (indicatorOpt.color != null) {\r\n iNameTextStyle = defaults({\r\n color: indicatorOpt.color\r\n }, nameTextStyle);\r\n }\r\n var innerIndicatorOpt = merge(clone(indicatorOpt), {\r\n boundaryGap: boundaryGap,\r\n splitNumber: splitNumber,\r\n scale: scale,\r\n axisLine: axisLine,\r\n axisTick: axisTick,\r\n axisLabel: axisLabel,\r\n name: indicatorOpt.text,\r\n nameLocation: 'end',\r\n nameGap: nameGap,\r\n nameTextStyle: iNameTextStyle,\r\n triggerEvent: triggerEvent\r\n }, false);\r\n if (!showName) {\r\n innerIndicatorOpt.name = '';\r\n }\r\n if (typeof nameFormatter === 'string') {\r\n var indName = innerIndicatorOpt.name;\r\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\r\n }\r\n else if (typeof nameFormatter === 'function') {\r\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\r\n }\r\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\r\n mixin(model, AxisModelCommonMixin.prototype);\r\n model.mainType = 'radar';\r\n model.componentIndex = this.componentIndex;\r\n return model;\r\n }, this);\r\n this._indicatorModels = indicatorModels;\r\n };\r\n RadarModel.prototype.getIndicatorModels = function () {\r\n return this._indicatorModels;\r\n };\r\n RadarModel.type = 'radar';\r\n RadarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '75%',\r\n startAngle: 90,\r\n axisName: {\r\n show: true\r\n },\r\n boundaryGap: [0, 0],\r\n splitNumber: 5,\r\n axisNameGap: 15,\r\n scale: false,\r\n shape: 'polygon',\r\n axisLine: merge({\r\n lineStyle: {\r\n color: '#bbb'\r\n }\r\n }, valueAxisDefault.axisLine),\r\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\r\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\r\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\r\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\r\n indicator: []\r\n };\r\n return RadarModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(RadarModel);\n\nvar axisBuilderAttrs$1 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar RadarView = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (radarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n this._buildAxes(radarModel);\r\n this._buildSplitLineAndArea(radarModel);\r\n };\r\n RadarView.prototype._buildAxes = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n var axisBuilders = map(indicatorAxes, function (indicatorAxis) {\r\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\r\n position: [radar.cx, radar.cy],\r\n rotation: indicatorAxis.angle,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1\r\n });\r\n return axisBuilder;\r\n });\r\n each(axisBuilders, function (axisBuilder) {\r\n each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder);\r\n this.group.add(axisBuilder.getGroup());\r\n }, this);\r\n };\r\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n if (!indicatorAxes.length) {\r\n return;\r\n }\r\n var shape = radarModel.get('shape');\r\n var splitLineModel = radarModel.getModel('splitLine');\r\n var splitAreaModel = radarModel.getModel('splitArea');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var showSplitLine = splitLineModel.get('show');\r\n var showSplitArea = splitAreaModel.get('show');\r\n var splitLineColors = lineStyleModel.get('color');\r\n var splitAreaColors = areaStyleModel.get('color');\r\n var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors];\r\n var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\r\n var splitLines = [];\r\n var splitAreas = [];\r\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\r\n var colorIndex = idx % areaOrLineColorList.length;\r\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\r\n return colorIndex;\r\n }\r\n if (shape === 'circle') {\r\n var ticksRadius = indicatorAxes[0].getTicksCoords();\r\n var cx = radar.cx;\r\n var cy = radar.cy;\r\n for (var i = 0; i < ticksRadius.length; i++) {\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r: ticksRadius[i].coord\r\n }\r\n }));\r\n }\r\n if (showSplitArea && i < ticksRadius.length - 1) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\r\n splitAreas[colorIndex].push(new Ring({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r0: ticksRadius[i].coord,\r\n r: ticksRadius[i + 1].coord\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n else {\r\n var realSplitNumber_1;\r\n var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) {\r\n var ticksCoords = indicatorAxis.getTicksCoords();\r\n realSplitNumber_1 = realSplitNumber_1 == null\r\n ? ticksCoords.length - 1\r\n : Math.min(ticksCoords.length - 1, realSplitNumber_1);\r\n return map(ticksCoords, function (tickCoord) {\r\n return radar.coordToPoint(tickCoord.coord, idx);\r\n });\r\n });\r\n var prevPoints = [];\r\n for (var i = 0; i <= realSplitNumber_1; i++) {\r\n var points = [];\r\n for (var j = 0; j < indicatorAxes.length; j++) {\r\n points.push(axesTicksPoints[j][i]);\r\n }\r\n if (points[0]) {\r\n points.push(points[0].slice());\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.error('Can\\'t draw value axis ' + i);\r\n }\r\n }\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n }\r\n if (showSplitArea && prevPoints) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\r\n splitAreas[colorIndex].push(new Polygon({\r\n shape: {\r\n points: points.concat(prevPoints)\r\n }\r\n }));\r\n }\r\n prevPoints = points.slice().reverse();\r\n }\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n each(splitAreas, function (splitAreas, idx) {\r\n this.group.add(mergePath$1(splitAreas, {\r\n style: defaults({\r\n stroke: 'none',\r\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\r\n }, areaStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n each(splitLines, function (splitLines, idx) {\r\n this.group.add(mergePath$1(splitLines, {\r\n style: defaults({\r\n fill: 'none',\r\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n}(ComponentView));\r\nComponentView.registerClass(RadarView);\n\nvar RadarSeriesModel = (function (_super) {\r\n __extends(RadarSeriesModel, _super);\r\n function RadarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n RadarSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n generateCoord: 'indicator_',\r\n generateCoordCount: Infinity\r\n });\r\n };\r\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n var name = this.getData().getName(dataIndex);\r\n var nameToDisplay = name === '' ? this.name : name;\r\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: nameToDisplay,\r\n sortBlocks: true,\r\n blocks: map(indicatorAxes, function (axis) {\r\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\r\n return createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: markerColor,\r\n name: axis.name,\r\n value: val,\r\n sortParam: val\r\n });\r\n })\r\n });\r\n };\r\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var data_1 = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var values = data_1.getValues(map(coordSys.dimensions, function (dim) {\r\n return data_1.mapDimension(dim);\r\n }), dataIndex);\r\n for (var i = 0, len = values.length; i < len; i++) {\r\n if (!isNaN(values[i])) {\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\r\n }\r\n }\r\n }\r\n };\r\n RadarSeriesModel.type = 'series.radar';\r\n RadarSeriesModel.dependencies = ['radar'];\r\n RadarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'radar',\r\n legendHoverLink: true,\r\n radarIndex: 0,\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n label: {\r\n position: 'top'\r\n },\r\n symbol: 'emptyCircle',\r\n symbolSize: 4\r\n };\r\n return RadarSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(RadarSeriesModel);\n\nfunction normalizeSymbolSize(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n}\r\nvar RadarView$1 = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var polar = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n function createSymbol$1(data, idx) {\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n if (symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2);\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\r\n symbolPath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 100,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2,\r\n rotation: symbolRotate * Math.PI / 180 || 0\r\n });\r\n return symbolPath;\r\n }\r\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\r\n symbolGroup.removeAll();\r\n for (var i = 0; i < newPoints.length - 1; i++) {\r\n var symbolPath = createSymbol$1(data, idx);\r\n if (symbolPath) {\r\n symbolPath.__dimIdx = i;\r\n if (oldPoints[i]) {\r\n symbolPath.setPosition(oldPoints[i]);\r\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\r\n x: newPoints[i][0],\r\n y: newPoints[i][1]\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n symbolPath.setPosition(newPoints[i]);\r\n }\r\n symbolGroup.add(symbolPath);\r\n }\r\n }\r\n }\r\n function getInitialPoints(points) {\r\n return map(points, function (pt) {\r\n return [polar.cx, polar.cy];\r\n });\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var points = data.getItemLayout(idx);\r\n if (!points) {\r\n return;\r\n }\r\n var polygon = new Polygon();\r\n var polyline = new Polyline();\r\n var target = {\r\n shape: {\r\n points: points\r\n }\r\n };\r\n polygon.shape.points = getInitialPoints(points);\r\n polyline.shape.points = getInitialPoints(points);\r\n initProps(polygon, target, seriesModel, idx);\r\n initProps(polyline, target, seriesModel, idx);\r\n var itemGroup = new Group();\r\n var symbolGroup = new Group();\r\n itemGroup.add(polyline);\r\n itemGroup.add(polygon);\r\n itemGroup.add(symbolGroup);\r\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\r\n data.setItemGraphicEl(idx, itemGroup);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var target = {\r\n shape: {\r\n points: data.getItemLayout(newIdx)\r\n }\r\n };\r\n if (!target.shape.points) {\r\n return;\r\n }\r\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\r\n updateProps(polyline, target, seriesModel);\r\n updateProps(polygon, target, seriesModel);\r\n data.setItemGraphicEl(newIdx, itemGroup);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n data.eachItemGraphicEl(function (itemGroup, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var itemStyle = data.getItemVisual(idx, 'style');\r\n var color = itemStyle.fill;\r\n group.add(itemGroup);\r\n polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), {\r\n fill: 'none',\r\n stroke: color\r\n }));\r\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\r\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\r\n var areaStyleModel = itemModel.getModel('areaStyle');\r\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\r\n polygon.ignore = polygonIgnore;\r\n each(['emphasis', 'select', 'blur'], function (stateName) {\r\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\r\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\r\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\r\n });\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: color,\r\n opacity: 0.7,\r\n decal: itemStyle.decal\r\n }));\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n symbolGroup.eachChild(function (symbolPath) {\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, itemStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(itemStyle);\r\n symbolPath.setColor(color);\r\n }\r\n var pathEmphasisState = symbolPath.ensureState('emphasis');\r\n pathEmphasisState.style = clone(itemHoverStyle);\r\n var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);\r\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\r\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n labelDimIndex: symbolPath.__dimIdx,\r\n defaultText: defaultText,\r\n inheritColor: color,\r\n defaultOpacity: itemStyle.opacity\r\n });\r\n });\r\n enableHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n });\r\n this._data = data;\r\n };\r\n RadarView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n}(ChartView));\r\nChartView.registerClass(RadarView$1);\n\nfunction radarLayout(ecModel) {\r\n ecModel.eachSeriesByType('radar', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var axes = coordSys.getIndicatorAxes();\r\n each(axes, function (axis, axisIndex) {\r\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\r\n points[dataIndex] = points[dataIndex] || [];\r\n var point = coordSys.dataToPoint(val, axisIndex);\r\n points[dataIndex][axisIndex] = isValidPoint(point)\r\n ? point : getValueMissingPoint(coordSys);\r\n });\r\n });\r\n data.each(function (idx) {\r\n var firstPoint = find(points[idx], function (point) {\r\n return isValidPoint(point);\r\n }) || getValueMissingPoint(coordSys);\r\n points[idx].push(firstPoint.slice());\r\n data.setItemLayout(idx, points[idx]);\r\n });\r\n });\r\n}\r\nfunction isValidPoint(point) {\r\n return !isNaN(point[0]) && !isNaN(point[1]);\r\n}\r\nfunction getValueMissingPoint(coordSys) {\r\n return [coordSys.cx, coordSys.cy];\r\n}\n\nfunction radarBackwardCompat(option) {\r\n var polarOptArr = option.polar;\r\n if (polarOptArr) {\r\n if (!isArray(polarOptArr)) {\r\n polarOptArr = [polarOptArr];\r\n }\r\n var polarNotRadar_1 = [];\r\n each(polarOptArr, function (polarOpt, idx) {\r\n if (polarOpt.indicator) {\r\n if (polarOpt.type && !polarOpt.shape) {\r\n polarOpt.shape = polarOpt.type;\r\n }\r\n option.radar = option.radar || [];\r\n if (!isArray(option.radar)) {\r\n option.radar = [option.radar];\r\n }\r\n option.radar.push(polarOpt);\r\n }\r\n else {\r\n polarNotRadar_1.push(polarOpt);\r\n }\r\n });\r\n option.polar = polarNotRadar_1;\r\n }\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\r\n seriesOpt.radarIndex = seriesOpt.polarIndex;\r\n }\r\n });\r\n}\n\nregisterLayout(radarLayout);\r\nregisterProcessor(dataFilter('radar'));\r\nregisterPreprocessor(radarBackwardCompat);\n\nvar geoCoord = [126, 25];\r\nvar points$1 = [\r\n [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7],\r\n [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]],\r\n [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]],\r\n [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]],\r\n [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]],\r\n [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]],\r\n [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]],\r\n [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]],\r\n [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]],\r\n [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]],\r\n [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]],\r\n [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]],\r\n [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4],\r\n [1, 92.4], [1, 3.5], [0, 3.5]]\r\n];\r\nfor (var i = 0; i < points$1.length; i++) {\r\n for (var k = 0; k < points$1[i].length; k++) {\r\n points$1[i][k][0] /= 10.5;\r\n points$1[i][k][1] /= -10.5 / 0.75;\r\n points$1[i][k][0] += geoCoord[0];\r\n points$1[i][k][1] += geoCoord[1];\r\n }\r\n}\r\nfunction fixNanhai(mapType, regions) {\r\n if (mapType === 'china') {\r\n regions.push(new Region('南海诸岛', map(points$1, function (exterior) {\r\n return {\r\n type: 'polygon',\r\n exterior: exterior\r\n };\r\n }), geoCoord));\r\n }\r\n}\n\nvar coordsOffsetMap = {\r\n '南海诸岛': [32, 80],\r\n '广东': [0, -10],\r\n '香港': [10, 5],\r\n '澳门': [-10, 10],\r\n '天津': [5, 5]\r\n};\r\nfunction fixTextCoords(mapType, region) {\r\n if (mapType === 'china') {\r\n var coordFix = coordsOffsetMap[region.name];\r\n if (coordFix) {\r\n var cp = region.center;\r\n cp[0] += coordFix[0] / 10.5;\r\n cp[1] += -coordFix[1] / (10.5 / 0.75);\r\n }\r\n }\r\n}\n\nvar geoCoordMap = {\r\n 'Russia': [100, 60],\r\n 'United States': [-99, 38],\r\n 'United States of America': [-99, 38]\r\n};\r\nfunction fixGeoCoords(mapType, region) {\r\n if (mapType === 'world') {\r\n var geoCoord = geoCoordMap[region.name];\r\n if (geoCoord) {\r\n var cp = region.center;\r\n cp[0] = geoCoord[0];\r\n cp[1] = geoCoord[1];\r\n }\r\n }\r\n}\n\nvar points$2 = [\r\n [\r\n [123.45165252685547, 25.73527164402261],\r\n [123.49731445312499, 25.73527164402261],\r\n [123.49731445312499, 25.750734064600884],\r\n [123.45165252685547, 25.750734064600884],\r\n [123.45165252685547, 25.73527164402261]\r\n ]\r\n];\r\nfunction fixDiaoyuIsland(mapType, region) {\r\n if (mapType === 'china' && region.name === '台湾') {\r\n region.geometries.push({\r\n type: 'polygon',\r\n exterior: points$2[0]\r\n });\r\n }\r\n}\n\nvar inner$6 = makeInner();\r\nvar geoJSONLoader = {\r\n load: function (mapName, mapRecord, nameProperty) {\r\n var parsed = inner$6(mapRecord).parsed;\r\n if (parsed) {\r\n return parsed;\r\n }\r\n var specialAreas = mapRecord.specialAreas || {};\r\n var geoJSON = mapRecord.geoJSON;\r\n var regions;\r\n try {\r\n regions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];\r\n }\r\n catch (e) {\r\n throw new Error('Invalid geoJson format\\n' + e.message);\r\n }\r\n fixNanhai(mapName, regions);\r\n each(regions, function (region) {\r\n var regionName = region.name;\r\n fixTextCoords(mapName, region);\r\n fixGeoCoords(mapName, region);\r\n fixDiaoyuIsland(mapName, region);\r\n var specialArea = specialAreas[regionName];\r\n if (specialArea) {\r\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\r\n }\r\n });\r\n return (inner$6(mapRecord).parsed = {\r\n regions: regions,\r\n boundingRect: getBoundingRect$1(regions)\r\n });\r\n }\r\n};\r\nfunction getBoundingRect$1(regions) {\r\n var rect;\r\n for (var i = 0; i < regions.length; i++) {\r\n var regionRect = regions[i].getBoundingRect();\r\n rect = rect || regionRect.clone();\r\n rect.union(regionRect);\r\n }\r\n return rect;\r\n}\n\nvar inner$7 = makeInner();\r\nvar geoSVGLoader = {\r\n load: function (mapName, mapRecord) {\r\n var originRoot = inner$7(mapRecord).originRoot;\r\n if (originRoot) {\r\n return {\r\n root: originRoot,\r\n boundingRect: inner$7(mapRecord).boundingRect\r\n };\r\n }\r\n var graphic = buildGraphic(mapRecord);\r\n inner$7(mapRecord).originRoot = graphic.root;\r\n inner$7(mapRecord).boundingRect = graphic.boundingRect;\r\n return graphic;\r\n },\r\n makeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap || (field.rootMap = createHashMap());\r\n var root = rootMap.get(hostKey);\r\n if (root) {\r\n return root;\r\n }\r\n var originRoot = field.originRoot;\r\n var boundingRect = field.boundingRect;\r\n if (!field.originRootHostKey) {\r\n field.originRootHostKey = hostKey;\r\n root = originRoot;\r\n }\r\n else {\r\n root = buildGraphic(mapRecord, boundingRect).root;\r\n }\r\n return rootMap.set(hostKey, root);\r\n },\r\n removeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap;\r\n rootMap && rootMap.removeKey(hostKey);\r\n if (hostKey === field.originRootHostKey) {\r\n field.originRootHostKey = null;\r\n }\r\n }\r\n};\r\nfunction buildGraphic(mapRecord, boundingRect) {\r\n var svgXML = mapRecord.svgXML;\r\n var result;\r\n var root;\r\n try {\r\n result = svgXML && parseSVG(svgXML, {\r\n ignoreViewBox: true,\r\n ignoreRootClip: true\r\n }) || {};\r\n root = result.root;\r\n assert(root != null);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid svg format\\n' + e.message);\r\n }\r\n var svgWidth = result.width;\r\n var svgHeight = result.height;\r\n var viewBoxRect = result.viewBoxRect;\r\n if (!boundingRect) {\r\n boundingRect = (svgWidth == null || svgHeight == null)\r\n ? root.getBoundingRect()\r\n : new BoundingRect(0, 0, 0, 0);\r\n if (svgWidth != null) {\r\n boundingRect.width = svgWidth;\r\n }\r\n if (svgHeight != null) {\r\n boundingRect.height = svgHeight;\r\n }\r\n }\r\n if (viewBoxRect) {\r\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height);\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n root.setClipPath(new Rect({\r\n shape: boundingRect.plain()\r\n }));\r\n return {\r\n root: root,\r\n boundingRect: boundingRect\r\n };\r\n}\n\nvar loaders = {\r\n geoJSON: geoJSONLoader,\r\n svg: geoSVGLoader\r\n};\r\nvar geoSourceManager = {\r\n load: function (mapName, nameMap, nameProperty) {\r\n var regions = [];\r\n var regionsMap = createHashMap();\r\n var nameCoordMap = createHashMap();\r\n var boundingRect;\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var singleSource = loaders[record.type].load(mapName, record, nameProperty);\r\n each(singleSource.regions, function (region) {\r\n var regionName = region.name;\r\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\r\n region = region.cloneShallow(regionName = nameMap[regionName]);\r\n }\r\n regions.push(region);\r\n regionsMap.set(regionName, region);\r\n nameCoordMap.set(regionName, region.center);\r\n });\r\n var rect = singleSource.boundingRect;\r\n if (rect) {\r\n boundingRect\r\n ? boundingRect.union(rect)\r\n : (boundingRect = rect.clone());\r\n }\r\n });\r\n return {\r\n regions: regions,\r\n regionsMap: regionsMap,\r\n nameCoordMap: nameCoordMap,\r\n boundingRect: boundingRect || new BoundingRect(0, 0, 0, 0)\r\n };\r\n },\r\n makeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n var results = [];\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && results.push(method(mapName, record, hostKey));\r\n });\r\n return results;\r\n },\r\n removeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && method(mapName, record, hostKey);\r\n });\r\n }\r\n};\r\nfunction mapNotExistsError(mapName) {\r\n if (__DEV__) {\r\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\r\n }\r\n}\r\nfunction retrieveMap(mapName) {\r\n var mapRecords = mapDataStorage.retrieveMap(mapName) || [];\r\n if (__DEV__) {\r\n if (!mapRecords.length) {\r\n mapNotExistsError(mapName);\r\n }\r\n }\r\n return mapRecords;\r\n}\n\nvar MapSeries = (function (_super) {\r\n __extends(MapSeries, _super);\r\n function MapSeries() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapSeries.type;\r\n _this.needsDrawMap = false;\r\n _this.seriesGroup = [];\r\n _this.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var name_1 = this.getData().getName(dataIndex);\r\n var geo = this.coordinateSystem;\r\n var region = geo.getRegion(name_1);\r\n return region && geo.dataToPoint(region.center);\r\n }\r\n };\r\n return _this;\r\n }\r\n MapSeries.prototype.getInitialData = function (option) {\r\n var data = createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n var dataNameMap = createHashMap();\r\n var toAppendNames = [];\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n var name_2 = data.getName(i);\r\n dataNameMap.set(name_2, true);\r\n }\r\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\r\n each(geoSource.regions, function (region) {\r\n var name = region.name;\r\n if (!dataNameMap.get(name)) {\r\n toAppendNames.push(name);\r\n }\r\n });\r\n data.appendValues([], toAppendNames);\r\n return data;\r\n };\r\n MapSeries.prototype.getHostGeoModel = function () {\r\n var geoIndex = this.option.geoIndex;\r\n return geoIndex != null\r\n ? this.ecModel.getComponent('geo', geoIndex)\r\n : null;\r\n };\r\n MapSeries.prototype.getMapType = function () {\r\n return (this.getHostGeoModel() || this).option.map;\r\n };\r\n MapSeries.prototype.getRawValue = function (dataIndex) {\r\n var data = this.getData();\r\n return data.get(data.mapDimension('value'), dataIndex);\r\n };\r\n MapSeries.prototype.getRegionModel = function (regionName) {\r\n var data = this.getData();\r\n return data.getItemModel(data.indexOfName(regionName));\r\n };\r\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var seriesGroup = this.seriesGroup;\r\n var seriesNames = [];\r\n for (var i = 0; i < seriesGroup.length; i++) {\r\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\r\n var valueDim = data.mapDimension('value');\r\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\r\n seriesNames.push(seriesGroup[i].name);\r\n }\r\n }\r\n return createTooltipMarkup('section', {\r\n header: seriesNames.join(', '),\r\n noHeader: !seriesNames.length,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: name, value: value\r\n })]\r\n });\r\n };\r\n MapSeries.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n MapSeries.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n MapSeries.type = 'series.map';\r\n MapSeries.dependencies = ['geo'];\r\n MapSeries.layoutMode = 'box';\r\n MapSeries.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'geo',\r\n map: '',\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: 0.75,\r\n showLegendSymbol: true,\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n selectedMode: true,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n areaColor: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n areaColor: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n nameProperty: 'name'\r\n };\r\n return MapSeries;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(MapSeries);\n\nvar ATTR = '\\0_ec_interaction_mutex';\r\nfunction take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n}\r\nfunction release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n}\r\nfunction isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n}\r\nfunction getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n}\r\nregisterAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\nvar RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n}(Eventful));\r\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n}\r\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n}\r\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n}\n\nfunction updateViewOnPan(controllerHost, dx, dy) {\r\n var target = controllerHost.target;\r\n target.x += dx;\r\n target.y += dy;\r\n target.dirty();\r\n}\r\nfunction updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\r\n var target = controllerHost.target;\r\n var zoomLimit = controllerHost.zoomLimit;\r\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\r\n }\r\n var zoomScale = newZoom / controllerHost.zoom;\r\n controllerHost.zoom = newZoom;\r\n target.x -= (zoomX - target.x) * (zoomScale - 1);\r\n target.y -= (zoomY - target.y) * (zoomScale - 1);\r\n target.scaleX *= zoomScale;\r\n target.scaleY *= zoomScale;\r\n target.dirty();\r\n}\n\nvar IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\nfunction onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n}\n\nfunction getFixedItemStyle(model) {\r\n var itemStyle = model.getItemStyle();\r\n var areaColor = model.get('areaColor');\r\n if (areaColor != null) {\r\n itemStyle.fill = areaColor;\r\n }\r\n return itemStyle;\r\n}\r\nvar MapDraw = (function () {\r\n function MapDraw(api) {\r\n var group = new Group();\r\n this.uid = getUID('ec_map_draw');\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = { target: group };\r\n this.group = group;\r\n group.add(this._regionsGroup = new Group());\r\n group.add(this._backgroundGroup = new Group());\r\n }\r\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\r\n var isGeo = mapOrGeoModel.mainType === 'geo';\r\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\r\n isGeo && ecModel.eachComponent({ mainType: 'series', subType: 'map' }, function (mapSeries) {\r\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\r\n data = mapSeries.getData();\r\n }\r\n });\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n this._updateBackground(geo);\r\n var regionsGroup = this._regionsGroup;\r\n var group = this.group;\r\n var transformInfo = geo.getTransformInfo();\r\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\r\n var targetScaleX;\r\n var targetScaleY;\r\n if (isFirstDraw) {\r\n group.transform = transformInfo.roamTransform;\r\n group.decomposeTransform();\r\n group.dirty();\r\n }\r\n else {\r\n var target = new Transformable();\r\n target.transform = transformInfo.roamTransform;\r\n target.decomposeTransform();\r\n var props = {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n x: target.x,\r\n y: target.y\r\n };\r\n targetScaleX = target.scaleX;\r\n targetScaleY = target.scaleY;\r\n updateProps(group, props, mapOrGeoModel);\r\n }\r\n regionsGroup.removeAll();\r\n var nameMap = createHashMap();\r\n var isVisualEncodedByVisualMap = data\r\n && data.getVisual('visualMeta')\r\n && data.getVisual('visualMeta').length > 0;\r\n each(geo.regions, function (region) {\r\n var regionGroup = nameMap.get(region.name)\r\n || nameMap.set(region.name, new Group());\r\n var compoundPath = new CompoundPath({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n paths: []\r\n }\r\n });\r\n regionGroup.add(compoundPath);\r\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\r\n var itemStyleModel = regionModel.getModel('itemStyle');\r\n var emphasisModel = regionModel.getModel('emphasis');\r\n var emphasisItemStyleModel = emphasisModel.getModel('itemStyle');\r\n var blurItemStyleModel = regionModel.getModel(['blur', 'itemStyle']);\r\n var selectItemStyleModel = regionModel.getModel(['select', 'itemStyle']);\r\n var itemStyle = getFixedItemStyle(itemStyleModel);\r\n var emphasisItemStyle = getFixedItemStyle(emphasisItemStyleModel);\r\n var blurItemStyle = getFixedItemStyle(blurItemStyleModel);\r\n var selectItemStyle = getFixedItemStyle(selectItemStyleModel);\r\n var dataIdx;\r\n if (data) {\r\n dataIdx = data.indexOfName(region.name);\r\n var style = data.getItemVisual(dataIdx, 'style');\r\n var decal = data.getItemVisual(dataIdx, 'decal');\r\n if (isVisualEncodedByVisualMap && style.fill) {\r\n itemStyle.fill = style.fill;\r\n }\r\n if (decal) {\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n }\r\n var sx = transformInfo.rawScaleX;\r\n var sy = transformInfo.rawScaleY;\r\n var offsetX = transformInfo.rawX;\r\n var offsetY = transformInfo.rawY;\r\n var transformPoint = function (point) {\r\n return [\r\n point[0] * sx + offsetX,\r\n point[1] * sy + offsetY\r\n ];\r\n };\r\n each(region.geometries, function (geometry) {\r\n if (geometry.type !== 'polygon') {\r\n return;\r\n }\r\n var points = [];\r\n for (var i = 0; i < geometry.exterior.length; ++i) {\r\n points.push(transformPoint(geometry.exterior[i]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\r\n var interior = geometry.interiors[i];\r\n var points_1 = [];\r\n for (var j = 0; j < interior.length; ++j) {\r\n points_1.push(transformPoint(interior[j]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points_1\r\n }\r\n }));\r\n }\r\n });\r\n compoundPath.setStyle(itemStyle);\r\n compoundPath.style.strokeNoScale = true;\r\n compoundPath.culling = true;\r\n compoundPath.ensureState('emphasis').style = emphasisItemStyle;\r\n compoundPath.ensureState('blur').style = blurItemStyle;\r\n compoundPath.ensureState('select').style = selectItemStyle;\r\n var showLabel = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n if (regionModel.get(stateName === 'normal' ? ['label', 'show'] : [stateName, 'label', 'show'])) {\r\n showLabel = true;\r\n break;\r\n }\r\n }\r\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\r\n var itemLayout = data && data.getItemLayout(dataIdx);\r\n if ((isGeo || isDataNaN && (showLabel))\r\n || (itemLayout && itemLayout.showLabel)) {\r\n var query = !isGeo ? dataIdx : region.name;\r\n var labelFetcher = void 0;\r\n if (!data || dataIdx >= 0) {\r\n labelFetcher = mapOrGeoModel;\r\n }\r\n var centerPt = transformPoint(region.center);\r\n var textEl = new ZRText({\r\n x: centerPt[0],\r\n y: centerPt[1],\r\n scaleX: 1 / group.scaleX,\r\n scaleY: 1 / group.scaleY,\r\n z2: 10,\r\n silent: true\r\n });\r\n setLabelStyle(textEl, getLabelStatesModels(regionModel), {\r\n labelFetcher: labelFetcher,\r\n labelDataIndex: query,\r\n defaultText: region.name\r\n }, { normal: {\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n } });\r\n compoundPath.setTextContent(textEl);\r\n compoundPath.setTextConfig({\r\n local: true\r\n });\r\n compoundPath.disableLabelAnimation = true;\r\n if (!isFirstDraw) {\r\n updateProps(textEl, {\r\n scaleX: 1 / targetScaleX,\r\n scaleY: 1 / targetScaleY\r\n }, mapOrGeoModel);\r\n }\r\n }\r\n if (data) {\r\n data.setItemGraphicEl(dataIdx, regionGroup);\r\n }\r\n else {\r\n var regionModel_1 = mapOrGeoModel.getRegionModel(region.name);\r\n getECData(compoundPath).eventData = {\r\n componentType: 'geo',\r\n componentIndex: mapOrGeoModel.componentIndex,\r\n geoIndex: mapOrGeoModel.componentIndex,\r\n name: region.name,\r\n region: (regionModel_1 && regionModel_1.option) || {}\r\n };\r\n }\r\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\r\n groupRegions.push(region);\r\n regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\r\n enableHoverEmphasis(regionGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n regionsGroup.add(regionGroup);\r\n });\r\n this._updateController(mapOrGeoModel, ecModel, api);\r\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\r\n };\r\n MapDraw.prototype.remove = function () {\r\n this._regionsGroup.removeAll();\r\n this._backgroundGroup.removeAll();\r\n this._controller.dispose();\r\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\r\n this._mapName = null;\r\n this._controllerHost = null;\r\n };\r\n MapDraw.prototype._updateBackground = function (geo) {\r\n var mapName = geo.map;\r\n if (this._mapName !== mapName) {\r\n each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\r\n this._backgroundGroup.add(root);\r\n }, this);\r\n }\r\n this._mapName = mapName;\r\n };\r\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\r\n controllerHost.zoom = geo.getZoom();\r\n controller.enable(mapOrGeoModel.get('roam') || false);\r\n var mainType = mapOrGeoModel.mainType;\r\n function makeActionBase() {\r\n var action = {\r\n type: 'geoRoam',\r\n componentType: mainType\r\n };\r\n action[mainType + 'Id'] = mapOrGeoModel.id;\r\n return action;\r\n }\r\n controller.off('pan').on('pan', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n dx: e.dx,\r\n dy: e.dy\r\n }));\r\n }, this);\r\n controller.off('zoom').on('zoom', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n }));\r\n var group = this.group;\r\n this._regionsGroup.traverse(function (el) {\r\n var textContent = el.getTextContent();\r\n if (textContent) {\r\n textContent.scaleX = 1 / group.scaleX;\r\n textContent.scaleY = 1 / group.scaleY;\r\n textContent.markRedraw();\r\n }\r\n });\r\n }, this);\r\n controller.setPointerChecker(function (e, x, y) {\r\n return geo.getViewRectAfterRoam().contain(x, y)\r\n && !onIrrelevantElement(e, api, mapOrGeoModel);\r\n });\r\n };\r\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\r\n var mapDraw = this;\r\n regionsGroup.off('mousedown');\r\n if (mapOrGeoModel.get('selectedMode')) {\r\n regionsGroup.on('mousedown', function () {\r\n mapDraw._mouseDownFlag = true;\r\n });\r\n regionsGroup.on('click', function (e) {\r\n if (!mapDraw._mouseDownFlag) {\r\n return;\r\n }\r\n mapDraw._mouseDownFlag = false;\r\n });\r\n }\r\n };\r\n return MapDraw;\r\n}());\n\nvar MapView = (function (_super) {\r\n __extends(MapView, _super);\r\n function MapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapView.type;\r\n return _this;\r\n }\r\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\r\n if (payload && payload.type === 'mapToggleSelect'\r\n && payload.from === this.uid) {\r\n return;\r\n }\r\n var group = this.group;\r\n group.removeAll();\r\n if (mapModel.getHostGeoModel()) {\r\n return;\r\n }\r\n if (!(payload && payload.type === 'geoRoam'\r\n && payload.componentType === 'series'\r\n && payload.seriesId === mapModel.id)) {\r\n if (mapModel.needsDrawMap) {\r\n var mapDraw = this._mapDraw || new MapDraw(api);\r\n group.add(mapDraw.group);\r\n mapDraw.draw(mapModel, ecModel, api, this, payload);\r\n this._mapDraw = mapDraw;\r\n }\r\n else {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n }\r\n else {\r\n var mapDraw = this._mapDraw;\r\n mapDraw && group.add(mapDraw.group);\r\n }\r\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')\r\n && this._renderSymbols(mapModel, ecModel, api);\r\n };\r\n MapView.prototype.remove = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n this.group.removeAll();\r\n };\r\n MapView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n };\r\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\r\n var originalData = mapModel.originalData;\r\n var group = this.group;\r\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n var layout = originalData.getItemLayout(originalDataIndex);\r\n if (!layout || !layout.point) {\r\n return;\r\n }\r\n var point = layout.point;\r\n var offset = layout.offset;\r\n var circle = new Circle({\r\n style: {\r\n fill: mapModel.getData().getVisual('style').fill\r\n },\r\n shape: {\r\n cx: point[0] + offset * 9,\r\n cy: point[1],\r\n r: 3\r\n },\r\n silent: true,\r\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\r\n });\r\n if (!offset) {\r\n var fullData = mapModel.mainSeries.getData();\r\n var name_1 = originalData.getName(originalDataIndex);\r\n var fullIndex_1 = fullData.indexOfName(name_1);\r\n var itemModel = originalData.getItemModel(originalDataIndex);\r\n var labelModel = itemModel.getModel('label');\r\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\r\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\r\n labelFetcher: {\r\n getFormattedLabel: function (idx, state) {\r\n return mapModel.getFormattedLabel(fullIndex_1, state);\r\n }\r\n }\r\n });\r\n circle.disableLabelAnimation = true;\r\n if (!labelModel.get('position')) {\r\n circle.setTextConfig({\r\n position: 'bottom'\r\n });\r\n }\r\n regionGroup.onHoverStateChange = function (toState) {\r\n circle.useState(toState);\r\n };\r\n }\r\n group.add(circle);\r\n });\r\n };\r\n MapView.type = 'map';\r\n return MapView;\r\n}(ChartView));\r\nChartView.registerClass(MapView);\n\nfunction updateCenterAndZoom(view, payload, zoomLimit) {\r\n var previousZoom = view.getZoom();\r\n var center = view.getCenter();\r\n var zoom = payload.zoom;\r\n var point = view.dataToPoint(center);\r\n if (payload.dx != null && payload.dy != null) {\r\n point[0] -= payload.dx;\r\n point[1] -= payload.dy;\r\n view.setCenter(view.pointToData(point));\r\n }\r\n if (zoom != null) {\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\r\n }\r\n view.scaleX *= zoom;\r\n view.scaleY *= zoom;\r\n var fixX = (payload.originX - view.x) * (zoom - 1);\r\n var fixY = (payload.originY - view.y) * (zoom - 1);\r\n view.x -= fixX;\r\n view.y -= fixY;\r\n view.updateTransform();\r\n view.setCenter(view.pointToData(point));\r\n view.setZoom(zoom * previousZoom);\r\n }\r\n return {\r\n center: view.getCenter(),\r\n zoom: view.getZoom()\r\n };\r\n}\n\nregisterAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n}, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n var geo = componentModel.coordinateSystem;\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\r\n componentModel.setCenter\r\n && componentModel.setCenter(res.center);\r\n componentModel.setZoom\r\n && componentModel.setZoom(res.zoom);\r\n if (componentType === 'series') {\r\n each(componentModel.seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n });\r\n});\n\nvar v2ApplyTransform = applyTransform;\r\nvar View = (function (_super) {\r\n __extends(View, _super);\r\n function View(name) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'view';\r\n _this.dimensions = ['x', 'y'];\r\n _this._roamTransformable = new Transformable();\r\n _this._rawTransformable = new Transformable();\r\n _this.name = name;\r\n return _this;\r\n }\r\n View.prototype.setBoundingRect = function (x, y, width, height) {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n };\r\n View.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n View.prototype.setViewRect = function (x, y, width, height) {\r\n this.transformTo(x, y, width, height);\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n };\r\n View.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var rawTransform = this._rawTransformable;\r\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransform.decomposeTransform();\r\n this._updateTransform();\r\n };\r\n View.prototype.setCenter = function (centerCoord) {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n this._center = centerCoord;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.setZoom = function (zoom) {\r\n zoom = zoom || 1;\r\n var zoomLimit = this.zoomLimit;\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n this._zoom = zoom;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.getDefaultCenter = function () {\r\n var rawRect = this.getBoundingRect();\r\n var cx = rawRect.x + rawRect.width / 2;\r\n var cy = rawRect.y + rawRect.height / 2;\r\n return [cx, cy];\r\n };\r\n View.prototype.getCenter = function () {\r\n return this._center || this.getDefaultCenter();\r\n };\r\n View.prototype.getZoom = function () {\r\n return this._zoom || 1;\r\n };\r\n View.prototype.getRoamTransform = function () {\r\n return this._roamTransformable.getLocalTransform();\r\n };\r\n View.prototype._updateCenterAndZoom = function () {\r\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n var roamTransform = this._roamTransformable;\r\n var defaultCenter = this.getDefaultCenter();\r\n var center = this.getCenter();\r\n var zoom = this.getZoom();\r\n center = applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix);\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n this._updateTransform();\r\n };\r\n View.prototype._updateTransform = function () {\r\n var roamTransformable = this._roamTransformable;\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1());\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n this.invTransform = this.invTransform || [];\r\n invert(this.invTransform, this.transform);\r\n this.decomposeTransform();\r\n };\r\n View.prototype.getTransformInfo = function () {\r\n var roamTransform = this._roamTransformable.transform;\r\n var rawTransformable = this._rawTransformable;\r\n return {\r\n roamTransform: roamTransform ? slice(roamTransform) : create$1(),\r\n rawScaleX: rawTransformable.scaleX,\r\n rawScaleY: rawTransformable.scaleY,\r\n rawX: rawTransformable.x,\r\n rawY: rawTransformable.y\r\n };\r\n };\r\n View.prototype.getViewRect = function () {\r\n return this._viewRect;\r\n };\r\n View.prototype.getViewRectAfterRoam = function () {\r\n var rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n };\r\n View.prototype.dataToPoint = function (data, noRoam, out) {\r\n var transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform\r\n ? v2ApplyTransform(out, data, transform)\r\n : copy(out, data);\r\n };\r\n View.prototype.pointToData = function (point) {\r\n var invTransform = this.invTransform;\r\n return invTransform\r\n ? v2ApplyTransform([], point, invTransform)\r\n : [point[0], point[1]];\r\n };\r\n View.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n View.prototype.containPoint = function (point) {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n };\r\n View.dimensions = ['x', 'y'];\r\n return View;\r\n}(Transformable));\r\nfunction getCoordSys(finder) {\r\n var seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem : null;\r\n}\n\nvar Geo = (function (_super) {\r\n __extends(Geo, _super);\r\n function Geo(name, map, nameMap, invertLongitute) {\r\n var _this = _super.call(this, name) || this;\r\n _this.dimensions = ['lng', 'lat'];\r\n _this.type = 'geo';\r\n _this.map = map;\r\n var source = geoSourceManager.load(map, nameMap);\r\n _this._nameCoordMap = source.nameCoordMap;\r\n _this._regionsMap = source.regionsMap;\r\n _this._invertLongitute = invertLongitute == null ? true : invertLongitute;\r\n _this.regions = source.regions;\r\n _this._rect = source.boundingRect;\r\n return _this;\r\n }\r\n Geo.prototype.containCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Geo.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var invertLongitute = this._invertLongitute;\r\n rect = rect.clone();\r\n if (invertLongitute) {\r\n rect.y = -rect.y - rect.height;\r\n }\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransformable.decomposeTransform();\r\n if (invertLongitute) {\r\n rawTransformable.scaleY = -rawTransformable.scaleY;\r\n }\r\n rawTransformable.updateTransform();\r\n this._updateTransform();\r\n };\r\n Geo.prototype.getRegion = function (name) {\r\n return this._regionsMap.get(name);\r\n };\r\n Geo.prototype.getRegionByCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return regions[i];\r\n }\r\n }\r\n };\r\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\r\n this._nameCoordMap.set(name, geoCoord);\r\n };\r\n Geo.prototype.getGeoCoord = function (name) {\r\n return this._nameCoordMap.get(name);\r\n };\r\n Geo.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\r\n if (typeof data === 'string') {\r\n data = this.getGeoCoord(data);\r\n }\r\n if (data) {\r\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\r\n }\r\n };\r\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n return Geo;\r\n}(View));\r\nmixin(Geo, View);\r\nfunction getCoordSys$1(finder) {\r\n var geoModel = finder.geoModel;\r\n var seriesModel = finder.seriesModel;\r\n return geoModel\r\n ? geoModel.coordinateSystem\r\n : seriesModel\r\n ? (seriesModel.coordinateSystem\r\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem)\r\n : null;\r\n}\n\nfunction resizeGeo(geoModel, api) {\r\n var boundingCoords = geoModel.get('boundingCoords');\r\n if (boundingCoords != null) {\r\n var leftTop = boundingCoords[0];\r\n var rightBottom = boundingCoords[1];\r\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\r\n if (__DEV__) {\r\n console.error('Invalid boundingCoords');\r\n }\r\n }\r\n else {\r\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\r\n }\r\n }\r\n var rect = this.getBoundingRect();\r\n var centerOption = geoModel.get('layoutCenter');\r\n var sizeOption = geoModel.get('layoutSize');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var aspect = rect.width / rect.height * this.aspectScale;\r\n var useCenterAndSize = false;\r\n var center;\r\n var size;\r\n if (centerOption && sizeOption) {\r\n center = [\r\n parsePercent$2(centerOption[0], viewWidth),\r\n parsePercent$2(centerOption[1], viewHeight)\r\n ];\r\n size = parsePercent$2(sizeOption, Math.min(viewWidth, viewHeight));\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n var viewRect;\r\n if (useCenterAndSize) {\r\n viewRect = {};\r\n if (aspect > 1) {\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n }\r\n else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n }\r\n else {\r\n var boxLayoutOption = geoModel.getBoxLayoutParams();\r\n boxLayoutOption.aspect = aspect;\r\n viewRect = getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n this.setCenter(geoModel.get('center'));\r\n this.setZoom(geoModel.get('zoom'));\r\n}\r\nfunction setGeoCoords(geo, model) {\r\n each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n}\r\nvar GeoCreator = (function () {\r\n function GeoCreator() {\r\n this.dimensions = Geo.prototype.dimensions;\r\n }\r\n GeoCreator.prototype.create = function (ecModel, api) {\r\n var geoList = [];\r\n ecModel.eachComponent('geo', function (geoModel, idx) {\r\n var name = geoModel.get('map');\r\n var aspectScale = geoModel.get('aspectScale');\r\n var invertLongitute = true;\r\n var mapRecords = mapDataStorage.retrieveMap(name);\r\n if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') {\r\n aspectScale == null && (aspectScale = 1);\r\n invertLongitute = false;\r\n }\r\n else {\r\n aspectScale == null && (aspectScale = 0.75);\r\n }\r\n var geo = new Geo(name + idx, name, geoModel.get('nameMap'), invertLongitute);\r\n geo.aspectScale = aspectScale;\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo);\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel;\r\n geo.resize = resizeGeo;\r\n geo.resize(geoModel, api);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n if (coordSys === 'geo') {\r\n var geoIndex = seriesModel.get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n });\r\n var mapModelGroupBySeries = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n var mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n var nameMapList = map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n var geo = new Geo(mapType, mapType, mergeAll(nameMapList));\r\n geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo);\r\n geo.resize = resizeGeo;\r\n geo.aspectScale = mapSeries[0].get('aspectScale');\r\n geo.resize(mapSeries[0], api);\r\n each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n return geoList;\r\n };\r\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap) {\r\n var regionsArr = (originRegionArr || []).slice();\r\n var dataNameMap = createHashMap();\r\n for (var i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n var source = geoSourceManager.load(mapName, nameMap);\r\n each(source.regions, function (region) {\r\n var name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({ name: name });\r\n });\r\n return regionsArr;\r\n };\r\n return GeoCreator;\r\n}());\r\nvar geoCreator = new GeoCreator();\r\nregisterCoordinateSystem('geo', geoCreator);\n\nfunction mapSymbolLayout(ecModel) {\r\n var processedMapType = {};\r\n ecModel.eachSeriesByType('map', function (mapSeries) {\r\n var mapType = mapSeries.getMapType();\r\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\r\n return;\r\n }\r\n var mapSymbolOffsets = {};\r\n each(mapSeries.seriesGroup, function (subMapSeries) {\r\n var geo = subMapSeries.coordinateSystem;\r\n var data = subMapSeries.originalData;\r\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var name = data.getName(idx);\r\n var region = geo.getRegion(name);\r\n if (!region || isNaN(value)) {\r\n return;\r\n }\r\n var offset = mapSymbolOffsets[name] || 0;\r\n var point = geo.dataToPoint(region.center);\r\n mapSymbolOffsets[name] = offset + 1;\r\n data.setItemLayout(idx, {\r\n point: point,\r\n offset: offset\r\n });\r\n });\r\n }\r\n });\r\n var data = mapSeries.getData();\r\n data.each(function (idx) {\r\n var name = data.getName(idx);\r\n var layout = data.getItemLayout(idx) || {};\r\n layout.showLabel = !mapSymbolOffsets[name];\r\n data.setItemLayout(idx, layout);\r\n });\r\n processedMapType[mapType] = true;\r\n });\r\n}\n\nfunction dataStatistics(datas, statisticType) {\r\n var dataNameMap = {};\r\n each(datas, function (data) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + data.getName(idx);\r\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\r\n if (!isNaN(value)) {\r\n dataNameMap[mapKey].push(value);\r\n }\r\n });\r\n });\r\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + datas[0].getName(idx);\r\n var sum = 0;\r\n var min = Infinity;\r\n var max = -Infinity;\r\n var len = dataNameMap[mapKey].length;\r\n for (var i = 0; i < len; i++) {\r\n min = Math.min(min, dataNameMap[mapKey][i]);\r\n max = Math.max(max, dataNameMap[mapKey][i]);\r\n sum += dataNameMap[mapKey][i];\r\n }\r\n var result;\r\n if (statisticType === 'min') {\r\n result = min;\r\n }\r\n else if (statisticType === 'max') {\r\n result = max;\r\n }\r\n else if (statisticType === 'average') {\r\n result = sum / len;\r\n }\r\n else {\r\n result = sum;\r\n }\r\n return len === 0 ? NaN : result;\r\n });\r\n}\r\nfunction mapDataStatistic(ecModel) {\r\n var seriesGroups = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n var hostGeoModel = seriesModel.getHostGeoModel();\r\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\r\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\r\n });\r\n each(seriesGroups, function (seriesList, key) {\r\n var data = dataStatistics(map(seriesList, function (seriesModel) {\r\n return seriesModel.getData();\r\n }), seriesList[0].get('mapValueCalculation'));\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].originalData = seriesList[i].getData();\r\n }\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].seriesGroup = seriesList;\r\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\r\n seriesList[i].setData(data.cloneShallow());\r\n seriesList[i].mainSeries = seriesList[0];\r\n }\r\n });\r\n}\n\nregisterLayout(mapSymbolLayout);\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\r\ncreateLegacyDataSelectAction('map', registerAction);\n\nvar inner$8 = makeInner();\r\nfunction linkList(opt) {\r\n var mainData = opt.mainData;\r\n var datas = opt.datas;\r\n if (!datas) {\r\n datas = { main: mainData };\r\n opt.datasAttr = { main: 'data' };\r\n }\r\n opt.datas = opt.mainData = null;\r\n linkAll(mainData, datas, opt);\r\n each(datas, function (data) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n });\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n });\r\n assert(datas[mainData.dataType] === mainData);\r\n}\r\nfunction transferInjection(opt, res) {\r\n if (isMainData(this)) {\r\n var datas = extend({}, inner$8(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n }\r\n else {\r\n linkSingle(res, this.dataType, inner$8(this).mainData, opt);\r\n }\r\n return res;\r\n}\r\nfunction changeInjection(opt, res) {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n}\r\nfunction cloneShallowInjection(opt, res) {\r\n each(inner$8(res).datas, function (data, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n}\r\nfunction getLinkedData(dataType) {\r\n var mainData = inner$8(this).mainData;\r\n return (dataType == null || mainData == null)\r\n ? mainData\r\n : inner$8(mainData).datas[dataType];\r\n}\r\nfunction getLinkedDataAll() {\r\n var mainData = inner$8(this).mainData;\r\n return (mainData == null)\r\n ? [{ data: mainData }]\r\n : map(keys(inner$8(mainData).datas), function (type) {\r\n return {\r\n type: type,\r\n data: inner$8(mainData).datas[type]\r\n };\r\n });\r\n}\r\nfunction isMainData(data) {\r\n return inner$8(data).mainData === data;\r\n}\r\nfunction linkAll(mainData, datas, opt) {\r\n inner$8(mainData).datas = {};\r\n each(datas, function (data, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n}\r\nfunction linkSingle(data, dataType, mainData, opt) {\r\n inner$8(mainData).datas[dataType] = data;\r\n inner$8(data).mainData = mainData;\r\n data.dataType = dataType;\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n }\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n}\n\nvar TreeNode = (function () {\r\n function TreeNode(name, hostTree) {\r\n this.depth = 0;\r\n this.height = 0;\r\n this.dataIndex = -1;\r\n this.children = [];\r\n this.viewChildren = [];\r\n this.isExpand = false;\r\n this.name = name || '';\r\n this.hostTree = hostTree;\r\n }\r\n TreeNode.prototype.isRemoved = function () {\r\n return this.dataIndex < 0;\r\n };\r\n TreeNode.prototype.eachNode = function (options, cb, context) {\r\n if (typeof options === 'function') {\r\n context = cb;\r\n cb = options;\r\n options = null;\r\n }\r\n options = options || {};\r\n if (isString(options)) {\r\n options = { order: options };\r\n }\r\n var order = options.order || 'preorder';\r\n var children = this[options.attr || 'children'];\r\n var suppressVisitSub;\r\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\r\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\r\n children[i].eachNode(options, cb, context);\r\n }\r\n order === 'postorder' && cb.call(context, this);\r\n };\r\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\r\n var height = 0;\r\n this.depth = depth;\r\n for (var i = 0; i < this.children.length; i++) {\r\n var child = this.children[i];\r\n child.updateDepthAndHeight(depth + 1);\r\n if (child.height > height) {\r\n height = child.height;\r\n }\r\n }\r\n this.height = height + 1;\r\n };\r\n TreeNode.prototype.getNodeById = function (id) {\r\n if (this.getId() === id) {\r\n return this;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].getNodeById(id);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.contains = function (node) {\r\n if (node === this) {\r\n return true;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].contains(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.getAncestors = function (includeSelf) {\r\n var ancestors = [];\r\n var node = includeSelf ? this : this.parentNode;\r\n while (node) {\r\n ancestors.push(node);\r\n node = node.parentNode;\r\n }\r\n ancestors.reverse();\r\n return ancestors;\r\n };\r\n TreeNode.prototype.getAncestorsIndices = function () {\r\n var indices = [];\r\n var currNode = this;\r\n while (currNode) {\r\n indices.push(currNode.dataIndex);\r\n currNode = currNode.parentNode;\r\n }\r\n indices.reverse();\r\n return indices;\r\n };\r\n TreeNode.prototype.getDescendantIndices = function () {\r\n var indices = [];\r\n this.eachNode(function (childNode) {\r\n indices.push(childNode.dataIndex);\r\n });\r\n return indices;\r\n };\r\n TreeNode.prototype.getValue = function (dimension) {\r\n var data = this.hostTree.data;\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n };\r\n TreeNode.prototype.setLayout = function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\r\n };\r\n TreeNode.prototype.getLayout = function () {\r\n return this.hostTree.data.getItemLayout(this.dataIndex);\r\n };\r\n TreeNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var hostTree = this.hostTree;\r\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n TreeNode.prototype.getLevelModel = function () {\r\n return (this.hostTree.levelModels || [])[this.depth];\r\n };\r\n TreeNode.prototype.setVisual = function (key, value) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\r\n };\r\n TreeNode.prototype.getVisual = function (key) {\r\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\r\n };\r\n TreeNode.prototype.getRawIndex = function () {\r\n return this.hostTree.data.getRawIndex(this.dataIndex);\r\n };\r\n TreeNode.prototype.getId = function () {\r\n return this.hostTree.data.getId(this.dataIndex);\r\n };\r\n TreeNode.prototype.isAncestorOf = function (node) {\r\n var parent = node.parentNode;\r\n while (parent) {\r\n if (parent === this) {\r\n return true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return false;\r\n };\r\n TreeNode.prototype.isDescendantOf = function (node) {\r\n return node !== this && node.isAncestorOf(this);\r\n };\r\n return TreeNode;\r\n}());\r\nvar Tree = (function () {\r\n function Tree(hostModel) {\r\n this.type = 'tree';\r\n this._nodes = [];\r\n this.hostModel = hostModel;\r\n }\r\n Tree.prototype.eachNode = function (options, cb, context) {\r\n this.root.eachNode(options, cb, context);\r\n };\r\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\r\n var rawIndex = this.data.getRawIndex(dataIndex);\r\n return this._nodes[rawIndex];\r\n };\r\n Tree.prototype.getNodeById = function (name) {\r\n return this.root.getNodeById(name);\r\n };\r\n Tree.prototype.update = function () {\r\n var data = this.data;\r\n var nodes = this._nodes;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Tree.prototype.clearLayouts = function () {\r\n this.data.clearItemLayouts();\r\n };\r\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\r\n var tree = new Tree(hostModel);\r\n var listData = [];\r\n var dimMax = 1;\r\n buildHierarchy(dataRoot);\r\n function buildHierarchy(dataNode, parentNode) {\r\n var value = dataNode.value;\r\n dimMax = Math.max(dimMax, isArray(value) ? value.length : 1);\r\n listData.push(dataNode);\r\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\r\n parentNode\r\n ? addChild(node, parentNode)\r\n : (tree.root = node);\r\n tree._nodes.push(node);\r\n var children = dataNode.children;\r\n if (children) {\r\n for (var i = 0; i < children.length; i++) {\r\n buildHierarchy(children[i], node);\r\n }\r\n }\r\n }\r\n tree.root.updateDepthAndHeight(0);\r\n var dimensionsInfo = createDimensions(listData, {\r\n coordDimensions: ['value'],\r\n dimensionsCount: dimMax\r\n });\r\n var list = new List(dimensionsInfo, hostModel);\r\n list.initData(listData);\r\n beforeLink && beforeLink(list);\r\n linkList({\r\n mainData: list,\r\n struct: tree,\r\n structAttr: 'tree'\r\n });\r\n tree.update();\r\n return tree;\r\n };\r\n return Tree;\r\n}());\r\nfunction addChild(child, node) {\r\n var children = node.children;\r\n if (child.parentNode === node) {\r\n return;\r\n }\r\n children.push(child);\r\n child.parentNode = node;\r\n}\n\nvar TreeSeriesModel = (function (_super) {\r\n __extends(TreeSeriesModel, _super);\r\n function TreeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.hasSymbolVisual = true;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n TreeSeriesModel.prototype.getInitialData = function (option) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n var leaves = option.leaves || {};\r\n var leavesModel = new Model(leaves, this, this.ecModel);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n if (!node.children.length || !node.isExpand) {\r\n model.parentModel = leavesModel;\r\n }\r\n return model;\r\n });\r\n }\r\n var treeDepth = 0;\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n var expandAndCollapse = option.expandAndCollapse;\r\n var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0)\r\n ? option.initialTreeDepth : treeDepth;\r\n tree.root.eachNode('preorder', function (node) {\r\n var item = node.hostTree.data.getRawDataItem(node.dataIndex);\r\n node.isExpand = (item && item.collapsed != null)\r\n ? !item.collapsed\r\n : node.depth <= expandTreeDepth;\r\n });\r\n return tree.data;\r\n };\r\n TreeSeriesModel.prototype.getOrient = function () {\r\n var orient = this.get('orient');\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n }\r\n else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n return orient;\r\n };\r\n TreeSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n TreeSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var tree = this.getData().tree;\r\n var realRoot = tree.root.children[0];\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n var value = node.getValue();\r\n var name = node.name;\r\n while (node && (node !== realRoot)) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value) || value == null\r\n });\r\n };\r\n TreeSeriesModel.type = 'series.tree';\r\n TreeSeriesModel.layoutMode = 'box';\r\n TreeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n layout: 'orthogonal',\r\n edgeShape: 'curve',\r\n edgeForkPosition: '50%',\r\n roam: false,\r\n nodeScaleRatio: 0.4,\r\n center: null,\r\n zoom: 1,\r\n orient: 'LR',\r\n symbol: 'emptyCircle',\r\n symbolSize: 7,\r\n expandAndCollapse: true,\r\n initialTreeDepth: 2,\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n label: {\r\n show: true\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 700,\r\n animationDurationUpdate: 500\r\n };\r\n return TreeSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(TreeSeriesModel);\n\nfunction init$2(inRoot) {\r\n var root = inRoot;\r\n root.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: root,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: 0,\r\n thread: null\r\n };\r\n var nodes = [root];\r\n var node;\r\n var children;\r\n while (node = nodes.pop()) {\r\n children = node.children;\r\n if (node.isExpand && children.length) {\r\n var n = children.length;\r\n for (var i = n - 1; i >= 0; i--) {\r\n var child = children[i];\r\n child.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: child,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: i,\r\n thread: null\r\n };\r\n nodes.push(child);\r\n }\r\n }\r\n }\r\n}\r\nfunction firstWalk(node, separation) {\r\n var children = node.isExpand ? node.children : [];\r\n var siblings = node.parentNode.children;\r\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\r\n if (children.length) {\r\n executeShifts(node);\r\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\r\n if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\r\n }\r\n else {\r\n node.hierNode.prelim = midPoint;\r\n }\r\n }\r\n else if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n }\r\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\r\n}\r\nfunction secondWalk(node) {\r\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\r\n node.setLayout({ x: nodeX }, true);\r\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\r\n}\r\nfunction separation(cb) {\r\n return arguments.length ? cb : defaultSeparation;\r\n}\r\nfunction radialCoordinate(rad, r) {\r\n rad -= Math.PI / 2;\r\n return {\r\n x: r * Math.cos(rad),\r\n y: r * Math.sin(rad)\r\n };\r\n}\r\nfunction getViewRect$1(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction executeShifts(node) {\r\n var children = node.children;\r\n var n = children.length;\r\n var shift = 0;\r\n var change = 0;\r\n while (--n >= 0) {\r\n var child = children[n];\r\n child.hierNode.prelim += shift;\r\n child.hierNode.modifier += shift;\r\n change += child.hierNode.change;\r\n shift += child.hierNode.shift + change;\r\n }\r\n}\r\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\r\n if (subtreeW) {\r\n var nodeOutRight = subtreeV;\r\n var nodeInRight = subtreeV;\r\n var nodeOutLeft = nodeInRight.parentNode.children[0];\r\n var nodeInLeft = subtreeW;\r\n var sumOutRight = nodeOutRight.hierNode.modifier;\r\n var sumInRight = nodeInRight.hierNode.modifier;\r\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\r\n var sumInLeft = nodeInLeft.hierNode.modifier;\r\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\r\n nodeOutRight = nextRight(nodeOutRight);\r\n nodeOutLeft = nextLeft(nodeOutLeft);\r\n nodeOutRight.hierNode.ancestor = subtreeV;\r\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim\r\n - sumInRight + separation(nodeInLeft, nodeInRight);\r\n if (shift > 0) {\r\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\r\n sumInRight += shift;\r\n sumOutRight += shift;\r\n }\r\n sumInLeft += nodeInLeft.hierNode.modifier;\r\n sumInRight += nodeInRight.hierNode.modifier;\r\n sumOutRight += nodeOutRight.hierNode.modifier;\r\n sumOutLeft += nodeOutLeft.hierNode.modifier;\r\n }\r\n if (nodeInLeft && !nextRight(nodeOutRight)) {\r\n nodeOutRight.hierNode.thread = nodeInLeft;\r\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\r\n }\r\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\r\n nodeOutLeft.hierNode.thread = nodeInRight;\r\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\r\n ancestor = subtreeV;\r\n }\r\n }\r\n return ancestor;\r\n}\r\nfunction nextRight(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\r\n}\r\nfunction nextLeft(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\r\n}\r\nfunction nextAncestor(nodeInLeft, node, ancestor) {\r\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode\r\n ? nodeInLeft.hierNode.ancestor : ancestor;\r\n}\r\nfunction moveSubtree(wl, wr, shift) {\r\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\r\n wr.hierNode.change -= change;\r\n wr.hierNode.shift += shift;\r\n wr.hierNode.modifier += shift;\r\n wr.hierNode.prelim += shift;\r\n wl.hierNode.change += change;\r\n}\r\nfunction defaultSeparation(node1, node2) {\r\n return node1.parentNode === node2.parentNode ? 1 : 2;\r\n}\n\nvar TreeEdgeShape = (function () {\r\n function TreeEdgeShape() {\r\n this.parentPoint = [];\r\n this.childPoints = [];\r\n }\r\n return TreeEdgeShape;\r\n}());\r\nvar TreePath = (function (_super) {\r\n __extends(TreePath, _super);\r\n function TreePath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n TreePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n TreePath.prototype.getDefaultShape = function () {\r\n return new TreeEdgeShape();\r\n };\r\n TreePath.prototype.buildPath = function (ctx, shape) {\r\n var childPoints = shape.childPoints;\r\n var childLen = childPoints.length;\r\n var parentPoint = shape.parentPoint;\r\n var firstChildPos = childPoints[0];\r\n var lastChildPos = childPoints[childLen - 1];\r\n if (childLen === 1) {\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\r\n return;\r\n }\r\n var orient = shape.orient;\r\n var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;\r\n var otherDim = 1 - forkDim;\r\n var forkPosition = parsePercent$2(shape.forkPosition, 1);\r\n var tmpPoint = [];\r\n tmpPoint[forkDim] = parentPoint[forkDim];\r\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\r\n tmpPoint[forkDim] = firstChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n tmpPoint[forkDim] = lastChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\r\n for (var i = 1; i < childLen - 1; i++) {\r\n var point = childPoints[i];\r\n ctx.moveTo(point[0], point[1]);\r\n tmpPoint[forkDim] = point[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n }\r\n };\r\n return TreePath;\r\n}(Path));\r\nvar TreeView = (function (_super) {\r\n __extends(TreeView, _super);\r\n function TreeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreeView.type;\r\n _this._mainGroup = new Group();\r\n return _this;\r\n }\r\n TreeView.prototype.init = function (ecModel, api) {\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: this.group\r\n };\r\n this.group.add(this._mainGroup);\r\n };\r\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var group = this._mainGroup;\r\n var layout = seriesModel.get('layout');\r\n if (layout === 'radial') {\r\n group.x = layoutInfo.x + layoutInfo.width / 2;\r\n group.y = layoutInfo.y + layoutInfo.height / 2;\r\n }\r\n else {\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n }\r\n this._updateViewCoordSys(seriesModel);\r\n this._updateController(seriesModel, ecModel, api);\r\n var oldData = this._data;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (symbolNeedsDraw$1(data, newIdx)) {\r\n updateNode(data, newIdx, null, group, seriesModel);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!symbolNeedsDraw$1(data, newIdx)) {\r\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n return;\r\n }\r\n updateNode(data, newIdx, symbolEl, group, seriesModel);\r\n })\r\n .remove(function (oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (symbolEl) {\r\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n }\r\n })\r\n .execute();\r\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\r\n this._updateNodeAndLinkScale(seriesModel);\r\n if (seriesModel.get('expandAndCollapse') === true) {\r\n data.eachItemGraphicEl(function (el, dataIndex) {\r\n el.off('click').on('click', function () {\r\n api.dispatchAction({\r\n type: 'treeExpandAndCollapse',\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndex\r\n });\r\n });\r\n });\r\n }\r\n this._data = data;\r\n };\r\n TreeView.prototype._updateViewCoordSys = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n data.each(function (idx) {\r\n var layout = data.getItemLayout(idx);\r\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\r\n points.push([+layout.x, +layout.y]);\r\n }\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(points, min, max);\r\n var oldMin = this._min;\r\n var oldMax = this._max;\r\n if (max[0] - min[0] === 0) {\r\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\r\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\r\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\r\n }\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n this.group.attr({\r\n x: viewCoordSys.x,\r\n y: viewCoordSys.y,\r\n scaleX: viewCoordSys.scaleX,\r\n scaleY: viewCoordSys.scaleY\r\n });\r\n this._min = min;\r\n this._max = max;\r\n };\r\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale(seriesModel);\r\n api.updateLabelLayout();\r\n });\r\n };\r\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var nodeScale = this._getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = this._nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX || 1;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n };\r\n TreeView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n TreeView.prototype.remove = function () {\r\n this._mainGroup.removeAll();\r\n this._data = null;\r\n };\r\n TreeView.type = 'tree';\r\n return TreeView;\r\n}(ChartView));\r\nfunction symbolNeedsDraw$1(data, dataIndex) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return layout\r\n && !isNaN(layout.x) && !isNaN(layout.y);\r\n}\r\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var isInit = !symbolEl;\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var itemModel = node.getModel();\r\n var visualColor = node.getVisual('style').fill;\r\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0\r\n ? visualColor : '#fff';\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceLayout = source.getLayout();\r\n var sourceOldLayout = sourceSymbolEl\r\n ? {\r\n x: sourceSymbolEl.__oldX,\r\n y: sourceSymbolEl.__oldY,\r\n rawX: sourceSymbolEl.__radialOldRawX,\r\n rawY: sourceSymbolEl.__radialOldRawY\r\n }\r\n : sourceLayout;\r\n var targetLayout = node.getLayout();\r\n if (isInit) {\r\n symbolEl = new Symbol(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n symbolEl.x = sourceOldLayout.x;\r\n symbolEl.y = sourceOldLayout.y;\r\n }\r\n else {\r\n symbolEl.updateData(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n }\r\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\r\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\r\n symbolEl.__radialRawX = targetLayout.rawX;\r\n symbolEl.__radialRawY = targetLayout.rawY;\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(dataIndex, symbolEl);\r\n symbolEl.__oldX = symbolEl.x;\r\n symbolEl.__oldY = symbolEl.y;\r\n updateProps(symbolEl, {\r\n x: targetLayout.x,\r\n y: targetLayout.y\r\n }, seriesModel);\r\n var symbolPath = symbolEl.getSymbolPath();\r\n if (seriesModel.get('layout') === 'radial') {\r\n var realRoot = virtualRoot.children[0];\r\n var rootLayout = realRoot.getLayout();\r\n var length_1 = realRoot.children.length;\r\n var rad = void 0;\r\n var isLeft = void 0;\r\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\r\n var center = {\r\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\r\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\r\n };\r\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n isLeft = center.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {\r\n isLeft = targetLayout.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n isLeft = targetLayout.x > rootLayout.x;\r\n if (!isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n var normalLabelModel = itemModel.getModel('label');\r\n var rotate = normalLabelModel.get('rotate');\r\n var labelRotateRadian = rotate * (Math.PI / 180);\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n symbolPath.setTextConfig({\r\n position: normalLabelModel.get('position') || textPosition,\r\n rotation: rotate == null ? -rad : labelRotateRadian,\r\n origin: 'center'\r\n });\r\n textContent.setStyle('verticalAlign', 'middle');\r\n }\r\n }\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n if (focusDataIndices) {\r\n getECData(symbolEl).focus = focusDataIndices;\r\n }\r\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\r\n if (symbolEl.__edge) {\r\n symbolEl.onHoverStateChange = function (toState) {\r\n if (toState !== 'blur') {\r\n var parentEl = node.parentNode\r\n && data.getItemGraphicEl(node.parentNode.dataIndex);\r\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\r\n setStatesFlag(symbolEl.__edge, toState);\r\n }\r\n }\r\n };\r\n }\r\n}\r\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\r\n var itemModel = node.getModel();\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layout = seriesModel.get('layout');\r\n var orient = seriesModel.getOrient();\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\r\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\r\n var edge = symbolEl.__edge;\r\n if (edgeShape === 'curve') {\r\n if (node.parentNode && node.parentNode !== virtualRoot) {\r\n if (!edge) {\r\n edge = symbolEl.__edge = new BezierCurve({\r\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\r\n }, seriesModel);\r\n }\r\n }\r\n else if (edgeShape === 'polyline') {\r\n if (layout === 'orthogonal') {\r\n if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {\r\n var children = node.children;\r\n var childPoints = [];\r\n for (var i = 0; i < children.length; i++) {\r\n var childLayout = children[i].getLayout();\r\n childPoints.push([childLayout.x, childLayout.y]);\r\n }\r\n if (!edge) {\r\n edge = symbolEl.__edge = new TreePath({\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: [[targetLayout.x, targetLayout.y]],\r\n orient: orient,\r\n forkPosition: edgeForkPosition\r\n }\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: childPoints\r\n }\r\n }, seriesModel);\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\r\n }\r\n }\r\n }\r\n if (edge) {\r\n edge.useStyle(defaults({\r\n strokeNoScale: true, fill: null\r\n }, lineStyle));\r\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\r\n setDefaultStateProxy(edge);\r\n group.add(edge);\r\n }\r\n}\r\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceLayout;\r\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\r\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\r\n }\r\n var removeAnimationOpt = {\r\n duration: seriesModel.get('animationDurationUpdate'),\r\n easing: seriesModel.get('animationEasingUpdate')\r\n };\r\n removeElement(symbolEl, {\r\n x: sourceLayout.x + 1,\r\n y: sourceLayout.y + 1\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(symbolEl);\r\n data.setItemGraphicEl(dataIndex, null);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n symbolEl.fadeOut(null, {\r\n fadeLabel: true,\r\n animation: removeAnimationOpt\r\n });\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceEdge = sourceSymbolEl.__edge;\r\n var edge = symbolEl.__edge\r\n || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layoutOpt = seriesModel.get('layout');\r\n var orient = seriesModel.get('orient');\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n if (edge) {\r\n if (edgeShape === 'curve') {\r\n removeElement(edge, {\r\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\r\n removeElement(edge, {\r\n shape: {\r\n parentPoint: [sourceLayout.x, sourceLayout.y],\r\n childPoints: [[sourceLayout.x, sourceLayout.y]]\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n }\r\n}\r\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n var x1;\r\n var x2;\r\n var y1;\r\n var y2;\r\n if (layoutOpt === 'radial') {\r\n x1 = sourceLayout.rawX;\r\n y1 = sourceLayout.rawY;\r\n x2 = targetLayout.rawX;\r\n y2 = targetLayout.rawY;\r\n var radialCoor1 = radialCoordinate(x1, y1);\r\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\r\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\r\n var radialCoor4 = radialCoordinate(x2, y2);\r\n return {\r\n x1: radialCoor1.x || 0,\r\n y1: radialCoor1.y || 0,\r\n x2: radialCoor4.x || 0,\r\n y2: radialCoor4.y || 0,\r\n cpx1: radialCoor2.x || 0,\r\n cpy1: radialCoor2.y || 0,\r\n cpx2: radialCoor3.x || 0,\r\n cpy2: radialCoor3.y || 0\r\n };\r\n }\r\n else {\r\n x1 = sourceLayout.x;\r\n y1 = sourceLayout.y;\r\n x2 = targetLayout.x;\r\n y2 = targetLayout.y;\r\n if (orient === 'LR' || orient === 'RL') {\r\n cpx1 = x1 + (x2 - x1) * curvature;\r\n cpy1 = y1;\r\n cpx2 = x2 + (x1 - x2) * curvature;\r\n cpy2 = y2;\r\n }\r\n if (orient === 'TB' || orient === 'BT') {\r\n cpx1 = x1;\r\n cpy1 = y1 + (y2 - y1) * curvature;\r\n cpx2 = x2;\r\n cpy2 = y2 + (y1 - y2) * curvature;\r\n }\r\n }\r\n return {\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n };\r\n}\r\nChartView.registerClass(TreeView);\n\nregisterAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var dataIndex = payload.dataIndex;\r\n var tree = seriesModel.getData().tree;\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n});\r\nregisterAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n update: 'none'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n});\n\nfunction eachAfter(root, callback, separation) {\r\n var nodes = [root];\r\n var next = [];\r\n var node;\r\n while (node = nodes.pop()) {\r\n next.push(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = 0; i < children.length; i++) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n while (node = next.pop()) {\r\n callback(node, separation);\r\n }\r\n}\r\nfunction eachBefore(root, callback) {\r\n var nodes = [root];\r\n var node;\r\n while (node = nodes.pop()) {\r\n callback(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n}\n\nfunction treeLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n commonLayout(seriesModel, api);\r\n });\r\n}\r\nfunction commonLayout(seriesModel, api) {\r\n var layoutInfo = getViewRect$1(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var layout = seriesModel.get('layout');\r\n var width = 0;\r\n var height = 0;\r\n var separation$1 = null;\r\n if (layout === 'radial') {\r\n width = 2 * Math.PI;\r\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\r\n separation$1 = separation(function (node1, node2) {\r\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\r\n });\r\n }\r\n else {\r\n width = layoutInfo.width;\r\n height = layoutInfo.height;\r\n separation$1 = separation();\r\n }\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var realRoot = virtualRoot.children[0];\r\n if (realRoot) {\r\n init$2(virtualRoot);\r\n eachAfter(realRoot, firstWalk, separation$1);\r\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\r\n eachBefore(realRoot, secondWalk);\r\n var left_1 = realRoot;\r\n var right_1 = realRoot;\r\n var bottom_1 = realRoot;\r\n eachBefore(realRoot, function (node) {\r\n var x = node.getLayout().x;\r\n if (x < left_1.getLayout().x) {\r\n left_1 = node;\r\n }\r\n if (x > right_1.getLayout().x) {\r\n right_1 = node;\r\n }\r\n if (node.depth > bottom_1.depth) {\r\n bottom_1 = node;\r\n }\r\n });\r\n var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2;\r\n var tx_1 = delta - left_1.getLayout().x;\r\n var kx_1 = 0;\r\n var ky_1 = 0;\r\n var coorX_1 = 0;\r\n var coorY_1 = 0;\r\n if (layout === 'radial') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = (node.depth - 1) * ky_1;\r\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\r\n node.setLayout({ x: finalCoor.x, y: finalCoor.y, rawX: coorX_1, rawY: coorY_1 }, true);\r\n });\r\n }\r\n else {\r\n var orient_1 = seriesModel.getOrient();\r\n if (orient_1 === 'RL' || orient_1 === 'LR') {\r\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\r\n kx_1 = width / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\r\n coorX_1 = orient_1 === 'LR'\r\n ? (node.depth - 1) * kx_1\r\n : width - (node.depth - 1) * kx_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n else if (orient_1 === 'TB' || orient_1 === 'BT') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = orient_1 === 'TB'\r\n ? (node.depth - 1) * ky_1\r\n : height - (node.depth - 1) * ky_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n }\r\n }\r\n}\n\nfunction treeVisual(ecModel) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\n\nregisterLayout(treeLayout);\r\nregisterVisual(treeVisual);\n\nfunction retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\r\n if (payload && indexOf(validPayloadTypes, payload.type) >= 0) {\r\n var root = seriesModel.getData().tree.root;\r\n var targetNode = payload.targetNode;\r\n if (typeof targetNode === 'string') {\r\n targetNode = root.getNodeById(targetNode);\r\n }\r\n if (targetNode && root.contains(targetNode)) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n var targetNodeId = payload.targetNodeId;\r\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n }\r\n}\r\nfunction getPathToRoot(node) {\r\n var path = [];\r\n while (node) {\r\n node = node.parentNode;\r\n node && path.push(node);\r\n }\r\n return path.reverse();\r\n}\r\nfunction aboveViewRoot(viewRoot, node) {\r\n var viewPath = getPathToRoot(viewRoot);\r\n return indexOf(viewPath, node) >= 0;\r\n}\r\nfunction wrapTreePathInfo(node, seriesModel) {\r\n var treePathInfo = [];\r\n while (node) {\r\n var nodeDataIndex = node.dataIndex;\r\n treePathInfo.push({\r\n name: node.name,\r\n dataIndex: nodeDataIndex,\r\n value: seriesModel.getRawValue(nodeDataIndex)\r\n });\r\n node = node.parentNode;\r\n }\r\n treePathInfo.reverse();\r\n return treePathInfo;\r\n}\n\nfunction enableAriaDecalForTree(seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n var decalPaletteScope = {};\r\n tree.eachNode(function (node) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\r\n node.setVisual('decal', decal);\r\n });\r\n}\n\nvar TreemapSeriesModel = (function (_super) {\r\n __extends(TreemapSeriesModel, _super);\r\n function TreemapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapSeriesModel.type;\r\n _this.preventUsingHoverLayer = true;\r\n return _this;\r\n }\r\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n completeTreeValue(root);\r\n var levels = option.levels || [];\r\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\r\n var designatedVisualModel = new Model({ itemStyle: designatedVisualItemStyle }, this, ecModel);\r\n levels = option.levels = setDefault(levels, ecModel);\r\n var levelModels = map(levels || [], function (levelDefine) {\r\n return new Model(levelDefine, designatedVisualModel, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n model.parentModel = levelModel || designatedVisualModel;\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n TreemapSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\r\n this.layoutInfo = this.layoutInfo || {};\r\n extend(this.layoutInfo, layoutInfo);\r\n };\r\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\r\n var idIndexMap = this._idIndexMap;\r\n if (!idIndexMap) {\r\n idIndexMap = this._idIndexMap = createHashMap();\r\n this._idIndexMapCount = 0;\r\n }\r\n var index = idIndexMap.get(id);\r\n if (index == null) {\r\n idIndexMap.set(id, index = this._idIndexMapCount++);\r\n }\r\n return index;\r\n };\r\n TreemapSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n TreemapSeriesModel.type = 'series.treemap';\r\n TreemapSeriesModel.layoutMode = 'box';\r\n TreemapSeriesModel.defaultOption = {\r\n progressive: 0,\r\n left: 'center',\r\n top: 'middle',\r\n width: '80%',\r\n height: '80%',\r\n sort: true,\r\n clipWindow: 'origin',\r\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\r\n leafDepth: null,\r\n drillDownIcon: '▶',\r\n zoomToNodeRatio: 0.32 * 0.32,\r\n roam: true,\r\n nodeClick: 'zoomToNode',\r\n animation: true,\r\n animationDurationUpdate: 900,\r\n animationEasing: 'quinticInOut',\r\n breadcrumb: {\r\n show: true,\r\n height: 22,\r\n left: 'center',\r\n top: 'bottom',\r\n emptyItemWidth: 25,\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.7)',\r\n textStyle: {\r\n color: '#fff'\r\n }\r\n }\r\n },\r\n label: {\r\n show: true,\r\n distance: 0,\r\n padding: 5,\r\n position: 'inside',\r\n color: '#fff',\r\n overflow: 'truncate'\r\n },\r\n upperLabel: {\r\n show: false,\r\n position: [0, '50%'],\r\n height: 20,\r\n overflow: 'truncate',\r\n verticalAlign: 'middle'\r\n },\r\n itemStyle: {\r\n color: null,\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n borderWidth: 0,\r\n gapWidth: 0,\r\n borderColor: '#fff',\r\n borderColorSaturation: null\r\n },\r\n emphasis: {\r\n upperLabel: {\r\n show: true,\r\n position: [0, '50%'],\r\n ellipsis: true,\r\n verticalAlign: 'middle'\r\n }\r\n },\r\n visualDimension: 0,\r\n visualMin: null,\r\n visualMax: null,\r\n color: [],\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n colorMappingBy: 'index',\r\n visibleMin: 10,\r\n childrenVisibleMin: null,\r\n levels: []\r\n };\r\n return TreemapSeriesModel;\r\n}(SeriesModel));\r\nfunction completeTreeValue(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\nfunction setDefault(levels, ecModel) {\r\n var globalColorList = normalizeToArray(ecModel.get('color'));\r\n var globalDecalList = normalizeToArray(ecModel.get('decals'));\r\n if (!globalColorList) {\r\n return;\r\n }\r\n levels = levels || [];\r\n var hasColorDefine;\r\n var hasDecalDefine;\r\n each(levels, function (levelDefine) {\r\n var model = new Model(levelDefine);\r\n var modelColor = model.get('color');\r\n var modelDecal = model.get('decal');\r\n if (model.get(['itemStyle', 'color'])\r\n || (modelColor && modelColor !== 'none')) {\r\n hasColorDefine = true;\r\n }\r\n if (model.get(['itemStyle', 'decal'])\r\n || (modelDecal && modelDecal !== 'none')) {\r\n hasDecalDefine = true;\r\n }\r\n });\r\n var level0 = levels[0] || (levels[0] = {});\r\n if (!hasColorDefine) {\r\n level0.color = globalColorList.slice();\r\n }\r\n if (!hasDecalDefine && globalDecalList) {\r\n level0.decal = globalDecalList.slice();\r\n }\r\n return levels;\r\n}\r\nSeriesModel.registerClass(TreemapSeriesModel);\n\nvar TEXT_PADDING = 8;\r\nvar ITEM_GAP = 8;\r\nvar ARRAY_LENGTH = 5;\r\nvar Breadcrumb = (function () {\r\n function Breadcrumb(containerGroup) {\r\n this.group = new Group();\r\n containerGroup.add(this.group);\r\n }\r\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\r\n var model = seriesModel.getModel('breadcrumb');\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n var normalStyleModel = model.getModel('itemStyle');\r\n var textStyleModel = normalStyleModel.getModel('textStyle');\r\n var layoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\r\n positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n };\r\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\r\n for (var node = targetNode; node; node = node.parentNode) {\r\n var text = convertOptionIdName(node.getModel().get('name'), '');\r\n var textRect = textStyleModel.getTextRect(text);\r\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n };\r\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\r\n var lastX = 0;\r\n var emptyItemWidth = layoutParam.emptyItemWidth;\r\n var height = seriesModel.get(['breadcrumb', 'height']);\r\n var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box);\r\n var totalWidth = layoutParam.totalWidth;\r\n var renderList = layoutParam.renderList;\r\n for (var i = renderList.length - 1; i >= 0; i--) {\r\n var item = renderList[i];\r\n var itemNode = item.node;\r\n var itemWidth = item.width;\r\n var text = item.text;\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n var el = new Polygon({\r\n shape: {\r\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\r\n },\r\n style: defaults(normalStyleModel.getItemStyle(), {\r\n lineJoin: 'bevel'\r\n }),\r\n textContent: new ZRText({\r\n style: {\r\n text: text,\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z: 10,\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n el.disableLabelAnimation = true;\r\n this.group.add(el);\r\n packEventData(el, seriesModel, itemNode);\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n };\r\n Breadcrumb.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n return Breadcrumb;\r\n}());\r\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\r\n var points = [\r\n [head ? x : x - ARRAY_LENGTH, y],\r\n [x + itemWidth, y],\r\n [x + itemWidth, y + itemHeight],\r\n [head ? x : x - ARRAY_LENGTH, y + itemHeight]\r\n ];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n}\r\nfunction packEventData(el, seriesModel, itemNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.componentIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb',\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n}\n\nvar AnimationWrap = (function () {\r\n function AnimationWrap() {\r\n this._storage = [];\r\n this._elExistsMap = {};\r\n }\r\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\r\n if (this._elExistsMap[el.id]) {\r\n return false;\r\n }\r\n this._elExistsMap[el.id] = true;\r\n this._storage.push({\r\n el: el,\r\n target: target,\r\n duration: duration,\r\n delay: delay,\r\n easing: easing\r\n });\r\n return true;\r\n };\r\n AnimationWrap.prototype.finished = function (callback) {\r\n this._finishedCallback = callback;\r\n return this;\r\n };\r\n AnimationWrap.prototype.start = function () {\r\n var _this = this;\r\n var count = this._storage.length;\r\n var checkTerminate = function () {\r\n count--;\r\n if (count <= 0) {\r\n _this._storage.length = 0;\r\n _this._elExistsMap = {};\r\n _this._finishedCallback && _this._finishedCallback();\r\n }\r\n };\r\n for (var i = 0, len = this._storage.length; i < len; i++) {\r\n var item = this._storage[i];\r\n item.el.animateTo(item.target, {\r\n duration: item.duration,\r\n delay: item.delay,\r\n easing: item.easing,\r\n setToFinal: true,\r\n done: checkTerminate,\r\n aborted: checkTerminate\r\n });\r\n }\r\n return this;\r\n };\r\n return AnimationWrap;\r\n}());\r\nfunction createWrap() {\r\n return new AnimationWrap();\r\n}\n\nvar Group$1 = Group;\r\nvar Rect$1 = Rect;\r\nvar DRAG_THRESHOLD = 3;\r\nvar PATH_LABEL_NOAMAL = 'label';\r\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel';\r\nvar Z_BASE = 10;\r\nvar Z_BG = 1;\r\nvar Z_CONTENT = 2;\r\nvar getStateItemStyle = makeStyleMapper([\r\n ['fill', 'color'],\r\n ['stroke', 'strokeColor'],\r\n ['lineWidth', 'strokeWidth'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor']\r\n]);\r\nvar getItemStyleNormal = function (model) {\r\n var itemStyle = getStateItemStyle(model);\r\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\r\n return itemStyle;\r\n};\r\nvar inner$9 = makeInner();\r\nvar TreemapView = (function (_super) {\r\n __extends(TreemapView, _super);\r\n function TreemapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapView.type;\r\n _this._state = 'ready';\r\n _this._storage = createStorage();\r\n return _this;\r\n }\r\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var models = ecModel.findComponents({\r\n mainType: 'series', subType: 'treemap', query: payload\r\n });\r\n if (indexOf(models, seriesModel) < 0) {\r\n return;\r\n }\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var payloadType = payload && payload.type;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var isInit = !this._oldTree;\r\n var thisStorage = this._storage;\r\n var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)\r\n ? {\r\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\r\n direction: payload.direction\r\n }\r\n : null;\r\n var containerGroup = this._giveContainerGroup(layoutInfo);\r\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\r\n (!isInit && (!payloadType\r\n || payloadType === 'treemapZoomToNode'\r\n || payloadType === 'treemapRootToNode'))\r\n ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)\r\n : renderResult.renderFinally();\r\n this._resetController(api);\r\n this._renderBreadcrumb(seriesModel, api, targetInfo);\r\n };\r\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\r\n var containerGroup = this._containerGroup;\r\n if (!containerGroup) {\r\n containerGroup = this._containerGroup = new Group$1();\r\n this._initEvents(containerGroup);\r\n this.group.add(containerGroup);\r\n }\r\n containerGroup.x = layoutInfo.x;\r\n containerGroup.y = layoutInfo.y;\r\n return containerGroup;\r\n };\r\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\r\n var thisTree = seriesModel.getData().tree;\r\n var oldTree = this._oldTree;\r\n var lastsForAnimation = createStorage();\r\n var thisStorage = createStorage();\r\n var oldStorage = this._storage;\r\n var willInvisibleEls = [];\r\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\r\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\r\n }\r\n dualTravel(thisTree.root ? [thisTree.root] : [], (oldTree && oldTree.root) ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\r\n var willDeleteEls = clearStorage(oldStorage);\r\n this._oldTree = thisTree;\r\n this._storage = thisStorage;\r\n return {\r\n lastsForAnimation: lastsForAnimation,\r\n willDeleteEls: willDeleteEls,\r\n renderFinally: renderFinally\r\n };\r\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\r\n if (sameTree) {\r\n oldViewChildren = thisViewChildren;\r\n each(thisViewChildren, function (child, index) {\r\n !child.isRemoved() && processNode(index, index);\r\n });\r\n }\r\n else {\r\n (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n }\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIndex, oldIndex) {\r\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\r\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\r\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\r\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\r\n }\r\n }\r\n function clearStorage(storage) {\r\n var willDeleteEls = createStorage();\r\n storage && each(storage, function (store, storageName) {\r\n var delEls = willDeleteEls[storageName];\r\n each(store, function (el) {\r\n el && (delEls.push(el), inner$9(el).willDelete = true);\r\n });\r\n });\r\n return willDeleteEls;\r\n }\r\n function renderFinally() {\r\n each(willDeleteEls, function (els) {\r\n each(els, function (el) {\r\n el.parent && el.parent.remove(el);\r\n });\r\n });\r\n each(willInvisibleEls, function (el) {\r\n el.invisible = true;\r\n el.dirty();\r\n });\r\n }\r\n };\r\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\r\n if (!seriesModel.get('animation')) {\r\n return;\r\n }\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n var easingOption = seriesModel.get('animationEasing');\r\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\r\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\r\n var animationWrap = createWrap();\r\n each(renderResult.willDeleteEls, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n if (el.invisible) {\r\n return;\r\n }\r\n var parent = el.parent;\r\n var target;\r\n var innerStore = inner$9(parent);\r\n if (reRoot && reRoot.direction === 'drillDown') {\r\n target = parent === reRoot.rootNodeGroup\r\n ? {\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: innerStore.nodeWidth,\r\n height: innerStore.nodeHeight\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }\r\n : { style: { opacity: 0 } };\r\n }\r\n else {\r\n var targetX = 0;\r\n var targetY = 0;\r\n if (!innerStore.willDelete) {\r\n targetX = innerStore.nodeWidth / 2;\r\n targetY = innerStore.nodeHeight / 2;\r\n }\r\n target = storageName === 'nodeGroup'\r\n ? { x: targetX, y: targetY, style: { opacity: 0 } }\r\n : {\r\n shape: { x: targetX, y: targetY, width: 0, height: 0 },\r\n style: { opacity: 0 }\r\n };\r\n }\r\n target && animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n });\r\n each(this._storage, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\r\n var target = {};\r\n if (!last) {\r\n return;\r\n }\r\n if (el instanceof Group) {\r\n if (last.oldX != null) {\r\n target.x = el.x;\r\n target.y = el.y;\r\n el.x = last.oldX;\r\n el.y = last.oldY;\r\n }\r\n }\r\n else {\r\n if (last.oldShape) {\r\n target.shape = extend({}, el.shape);\r\n el.setShape(last.oldShape);\r\n }\r\n if (last.fadein) {\r\n el.setStyle('opacity', 0);\r\n target.style = { opacity: 1 };\r\n }\r\n else if (el.style.opacity !== 1) {\r\n target.style = { opacity: 1 };\r\n }\r\n }\r\n animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n }, this);\r\n this._state = 'animating';\r\n animationWrap\r\n .finished(bind(function () {\r\n this._state = 'ready';\r\n renderResult.renderFinally();\r\n }, this))\r\n .start();\r\n };\r\n TreemapView.prototype._resetController = function (api) {\r\n var controller = this._controller;\r\n if (!controller) {\r\n controller = this._controller = new RoamController(api.getZr());\r\n controller.enable(this.seriesModel.get('roam'));\r\n controller.on('pan', bind(this._onPan, this));\r\n controller.on('zoom', bind(this._onZoom, this));\r\n }\r\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\r\n controller.setPointerChecker(function (e, x, y) {\r\n return rect.contain(x, y);\r\n });\r\n };\r\n TreemapView.prototype._clearController = function () {\r\n var controller = this._controller;\r\n if (controller) {\r\n controller.dispose();\r\n controller = null;\r\n }\r\n };\r\n TreemapView.prototype._onPan = function (e) {\r\n if (this._state !== 'animating'\r\n && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n this.api.dispatchAction({\r\n type: 'treemapMove',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rootLayout.x + e.dx, y: rootLayout.y + e.dy,\r\n width: rootLayout.width, height: rootLayout.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._onZoom = function (e) {\r\n var mouseX = e.originX;\r\n var mouseY = e.originY;\r\n if (this._state !== 'animating') {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\r\n var layoutInfo = this.seriesModel.layoutInfo;\r\n mouseX -= layoutInfo.x;\r\n mouseY -= layoutInfo.y;\r\n var m = create$1();\r\n translate(m, m, [-mouseX, -mouseY]);\r\n scale$1(m, m, [e.scale, e.scale]);\r\n translate(m, m, [mouseX, mouseY]);\r\n rect.applyTransform(m);\r\n this.api.dispatchAction({\r\n type: 'treemapRender',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rect.x, y: rect.y,\r\n width: rect.width, height: rect.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._initEvents = function (containerGroup) {\r\n var _this = this;\r\n containerGroup.on('click', function (e) {\r\n if (_this._state !== 'ready') {\r\n return;\r\n }\r\n var nodeClick = _this.seriesModel.get('nodeClick', true);\r\n if (!nodeClick) {\r\n return;\r\n }\r\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\r\n if (!targetInfo) {\r\n return;\r\n }\r\n var node = targetInfo.node;\r\n if (node.getLayout().isLeafRoot) {\r\n _this._rootToNode(targetInfo);\r\n }\r\n else {\r\n if (nodeClick === 'zoomToNode') {\r\n _this._zoomToNode(targetInfo);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\r\n var link = itemModel.get('link', true);\r\n var linkTarget = itemModel.get('target', true) || 'blank';\r\n link && windowOpen(link, linkTarget);\r\n }\r\n }\r\n }, this);\r\n };\r\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\r\n var _this = this;\r\n if (!targetInfo) {\r\n targetInfo = seriesModel.get('leafDepth', true) != null\r\n ? { node: seriesModel.getViewRoot() }\r\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\r\n if (!targetInfo) {\r\n targetInfo = { node: seriesModel.getData().tree.root };\r\n }\r\n }\r\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group)))\r\n .render(seriesModel, api, targetInfo.node, function (node) {\r\n if (_this._state !== 'animating') {\r\n aboveViewRoot(seriesModel.getViewRoot(), node)\r\n ? _this._rootToNode({ node: node })\r\n : _this._zoomToNode({ node: node });\r\n }\r\n });\r\n };\r\n TreemapView.prototype.remove = function () {\r\n this._clearController();\r\n this._containerGroup && this._containerGroup.removeAll();\r\n this._storage = createStorage();\r\n this._state = 'ready';\r\n this._breadcrumb && this._breadcrumb.remove();\r\n };\r\n TreemapView.prototype.dispose = function () {\r\n this._clearController();\r\n };\r\n TreemapView.prototype._zoomToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapZoomToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype._rootToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapRootToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype.findTarget = function (x, y) {\r\n var targetInfo;\r\n var viewRoot = this.seriesModel.getViewRoot();\r\n viewRoot.eachNode({ attr: 'viewChildren', order: 'preorder' }, function (node) {\r\n var bgEl = this._storage.background[node.getRawIndex()];\r\n if (bgEl) {\r\n var point = bgEl.transformCoordToLocal(x, y);\r\n var shape = bgEl.shape;\r\n if (shape.x <= point[0]\r\n && point[0] <= shape.x + shape.width\r\n && shape.y <= point[1]\r\n && point[1] <= shape.y + shape.height) {\r\n targetInfo = {\r\n node: node,\r\n offsetX: point[0],\r\n offsetY: point[1]\r\n };\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }, this);\r\n return targetInfo;\r\n };\r\n TreemapView.type = 'treemap';\r\n return TreemapView;\r\n}(ChartView));\r\nfunction createStorage() {\r\n return {\r\n nodeGroup: [],\r\n background: [],\r\n content: []\r\n };\r\n}\r\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\r\n if (!thisNode) {\r\n return;\r\n }\r\n var thisLayout = thisNode.getLayout();\r\n var data = seriesModel.getData();\r\n var nodeModel = thisNode.getModel();\r\n data.setItemGraphicEl(thisNode.dataIndex, null);\r\n if (!thisLayout || !thisLayout.isInView) {\r\n return;\r\n }\r\n var thisWidth = thisLayout.width;\r\n var thisHeight = thisLayout.height;\r\n var borderWidth = thisLayout.borderWidth;\r\n var thisInvisible = thisLayout.invisible;\r\n var thisRawIndex = thisNode.getRawIndex();\r\n var oldRawIndex = oldNode && oldNode.getRawIndex();\r\n var thisViewChildren = thisNode.viewChildren;\r\n var upperHeight = thisLayout.upperHeight;\r\n var isParent = thisViewChildren && thisViewChildren.length;\r\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\r\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\r\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\r\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\r\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\r\n var group = giveGraphic('nodeGroup', Group$1);\r\n if (!group) {\r\n return;\r\n }\r\n parentGroup.add(group);\r\n group.x = thisLayout.x || 0;\r\n group.y = thisLayout.y || 0;\r\n group.markRedraw();\r\n inner$9(group).nodeWidth = thisWidth;\r\n inner$9(group).nodeHeight = thisHeight;\r\n if (thisLayout.isAboveViewRoot) {\r\n return group;\r\n }\r\n var bg = giveGraphic('background', Rect$1, depth, Z_BG);\r\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\r\n var focus = nodeModel.get(['emphasis', 'focus']);\r\n var blurScope = nodeModel.get(['emphasis', 'blurScope']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? thisNode.getAncestorsIndices()\r\n : focus === 'descendant' ? thisNode.getDescendantIndices() : null;\r\n if (isParent) {\r\n if (isHighDownDispatcher(group)) {\r\n setAsHighDownDispatcher(group, false);\r\n }\r\n if (bg) {\r\n setAsHighDownDispatcher(bg, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, bg);\r\n enableHoverFocus(bg, focusDataIndices || focus, blurScope);\r\n }\r\n }\r\n else {\r\n var content = giveGraphic('content', Rect$1, depth, Z_CONTENT);\r\n content && renderContent(group, content);\r\n if (bg && isHighDownDispatcher(bg)) {\r\n setAsHighDownDispatcher(bg, false);\r\n }\r\n setAsHighDownDispatcher(group, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, group);\r\n enableHoverFocus(group, focusDataIndices || focus, blurScope);\r\n }\r\n return group;\r\n function renderBackground(group, bg, useUpperLabel) {\r\n var ecData = getECData(bg);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius });\r\n if (thisInvisible) {\r\n processInvisible(bg);\r\n }\r\n else {\r\n bg.invisible = false;\r\n var style = thisNode.getVisual('style');\r\n var visualBorderColor = style.stroke;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualBorderColor;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\r\n if (useUpperLabel) {\r\n var upperLabelWidth = thisWidth - 2 * borderWidth;\r\n prepareText(bg, visualBorderColor, upperLabelWidth, upperHeight, style.opacity, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight });\r\n }\r\n else {\r\n bg.removeTextContent();\r\n }\r\n bg.setStyle(normalStyle);\r\n bg.ensureState('emphasis').style = emphasisStyle;\r\n bg.ensureState('blur').style = blurStyle;\r\n bg.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(bg);\r\n }\r\n group.add(bg);\r\n }\r\n function renderContent(group, content) {\r\n var ecData = getECData(content);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\r\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\r\n content.culling = true;\r\n content.setShape({\r\n x: borderWidth,\r\n y: borderWidth,\r\n width: contentWidth,\r\n height: contentHeight,\r\n r: borderRadius\r\n });\r\n if (thisInvisible) {\r\n processInvisible(content);\r\n }\r\n else {\r\n content.invisible = false;\r\n var nodeStyle = thisNode.getVisual('style');\r\n var visualColor = nodeStyle.fill;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualColor;\r\n normalStyle.decal = nodeStyle.decal;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n prepareText(content, visualColor, contentWidth, nodeStyle.opacity);\r\n content.setStyle(normalStyle);\r\n content.ensureState('emphasis').style = emphasisStyle;\r\n content.ensureState('blur').style = blurStyle;\r\n content.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(content);\r\n }\r\n group.add(content);\r\n }\r\n function processInvisible(element) {\r\n !element.invisible && willInvisibleEls.push(element);\r\n }\r\n function prepareText(rectEl, visualColor, visualOpacity, width, height, upperLabelRect) {\r\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\r\n var text = retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, normalLabelModel.get('formatter')), convertOptionIdName(nodeModel.get('name'), null));\r\n if (!upperLabelRect && thisLayout.isLeafRoot) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n var isShow = normalLabelModel.getShallow('show');\r\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\r\n defaultText: isShow ? text : null,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: thisNode.dataIndex\r\n });\r\n var textEl = rectEl.getTextContent();\r\n var textStyle = textEl.style;\r\n var textPadding = normalizeCssArray(textStyle.padding || 0);\r\n if (upperLabelRect) {\r\n rectEl.setTextConfig({\r\n layoutRect: upperLabelRect\r\n });\r\n textEl.disableLabelLayout = true;\r\n }\r\n textEl.beforeUpdate = function () {\r\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\r\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\r\n if (textStyle.width !== width || textStyle.height !== height) {\r\n textEl.setStyle({\r\n width: width,\r\n height: height\r\n });\r\n }\r\n };\r\n textStyle.truncateMinChar = 2;\r\n textStyle.lineOverflow = 'truncate';\r\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\r\n var textEmphasisState = textEl.getState('emphasis');\r\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\r\n }\r\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\r\n var text = style ? style.text : null;\r\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n style.text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n }\r\n function giveGraphic(storageName, Ctor, depth, z) {\r\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\r\n var lasts = lastsForAnimation[storageName];\r\n if (element) {\r\n oldStorage[storageName][oldRawIndex] = null;\r\n prepareAnimationWhenHasOld(lasts, element);\r\n }\r\n else if (!thisInvisible) {\r\n element = new Ctor();\r\n if (element instanceof Displayable) {\r\n element.z = calculateZ(depth, z);\r\n }\r\n prepareAnimationWhenNoOld(lasts, element);\r\n }\r\n return (thisStorage[storageName][thisRawIndex] = element);\r\n }\r\n function prepareAnimationWhenHasOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n if (element instanceof Group$1) {\r\n lastCfg.oldX = element.x;\r\n lastCfg.oldY = element.y;\r\n }\r\n else {\r\n lastCfg.oldShape = extend({}, element.shape);\r\n }\r\n }\r\n function prepareAnimationWhenNoOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n var parentNode = thisNode.parentNode;\r\n var isGroup = element instanceof Group;\r\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\r\n var parentOldX = 0;\r\n var parentOldY = 0;\r\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\r\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\r\n parentOldX = parentOldBg.oldShape.width;\r\n parentOldY = parentOldBg.oldShape.height;\r\n }\r\n if (isGroup) {\r\n lastCfg.oldX = 0;\r\n lastCfg.oldY = parentOldY;\r\n }\r\n else {\r\n lastCfg.oldShape = { x: parentOldX, y: parentOldY, width: 0, height: 0 };\r\n }\r\n }\r\n lastCfg.fadein = !isGroup;\r\n }\r\n}\r\nfunction calculateZ(depth, zInLevel) {\r\n var zb = depth * Z_BASE + zInLevel;\r\n return (zb - 1) / zb;\r\n}\r\nChartView.registerClass(TreemapView);\n\nvar noop$1 = function () { };\r\nvar actionTypes = [\r\n 'treemapZoomToNode',\r\n 'treemapRender',\r\n 'treemapMove'\r\n];\r\nfor (var i$1 = 0; i$1 < actionTypes.length; i$1++) {\r\n registerAction({\r\n type: actionTypes[i$1],\r\n update: 'updateView'\r\n }, noop$1);\r\n}\r\nregisterAction({ type: 'treemapRootToNode', update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'treemap', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n});\n\nvar each$4 = each;\r\nvar isObject$4 = isObject;\r\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\r\nvar VisualMapping = (function () {\r\n function VisualMapping(option) {\r\n var mappingMethod = option.mappingMethod;\r\n var visualType = option.type;\r\n var thisOption = this.option = clone(option);\r\n this.type = visualType;\r\n this.mappingMethod = mappingMethod;\r\n this._normalizeData = normalizers[mappingMethod];\r\n var visualHandler = VisualMapping.visualHandlers[visualType];\r\n this.applyVisual = visualHandler.applyVisual;\r\n this.getColorMapper = visualHandler.getColorMapper;\r\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\r\n if (mappingMethod === 'piecewise') {\r\n normalizeVisualRange(thisOption);\r\n preprocessForPiecewise(thisOption);\r\n }\r\n else if (mappingMethod === 'category') {\r\n thisOption.categories\r\n ? preprocessForSpecifiedCategory(thisOption)\r\n : normalizeVisualRange(thisOption, true);\r\n }\r\n else {\r\n assert(mappingMethod !== 'linear' || thisOption.dataExtent);\r\n normalizeVisualRange(thisOption);\r\n }\r\n }\r\n VisualMapping.prototype.mapValueToVisual = function (value) {\r\n var normalized = this._normalizeData(value);\r\n return this._normalizedToVisual(normalized, value);\r\n };\r\n VisualMapping.prototype.getNormalizer = function () {\r\n return bind(this._normalizeData, this);\r\n };\r\n VisualMapping.listVisualTypes = function () {\r\n return keys(VisualMapping.visualHandlers);\r\n };\r\n VisualMapping.isValidType = function (visualType) {\r\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\r\n };\r\n VisualMapping.eachVisual = function (visual, callback, context) {\r\n if (isObject(visual)) {\r\n each(visual, callback, context);\r\n }\r\n else {\r\n callback.call(context, visual);\r\n }\r\n };\r\n VisualMapping.mapVisual = function (visual, callback, context) {\r\n var isPrimary;\r\n var newVisual = isArray(visual)\r\n ? []\r\n : isObject(visual)\r\n ? {}\r\n : (isPrimary = true, null);\r\n VisualMapping.eachVisual(visual, function (v, key) {\r\n var newVal = callback.call(context, v, key);\r\n isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal);\r\n });\r\n return newVisual;\r\n };\r\n VisualMapping.retrieveVisuals = function (obj) {\r\n var ret = {};\r\n var hasVisual;\r\n obj && each$4(VisualMapping.visualHandlers, function (h, visualType) {\r\n if (obj.hasOwnProperty(visualType)) {\r\n ret[visualType] = obj[visualType];\r\n hasVisual = true;\r\n }\r\n });\r\n return hasVisual ? ret : null;\r\n };\r\n VisualMapping.prepareVisualTypes = function (visualTypes) {\r\n if (isArray(visualTypes)) {\r\n visualTypes = visualTypes.slice();\r\n }\r\n else if (isObject$4(visualTypes)) {\r\n var types_1 = [];\r\n each$4(visualTypes, function (item, type) {\r\n types_1.push(type);\r\n });\r\n visualTypes = types_1;\r\n }\r\n else {\r\n return [];\r\n }\r\n visualTypes.sort(function (type1, type2) {\r\n return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)\r\n ? 1 : -1;\r\n });\r\n return visualTypes;\r\n };\r\n VisualMapping.dependsOn = function (visualType1, visualType2) {\r\n return visualType2 === 'color'\r\n ? !!(visualType1 && visualType1.indexOf(visualType2) === 0)\r\n : visualType1 === visualType2;\r\n };\r\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\r\n var possibleI;\r\n var abs = Infinity;\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var pieceValue = pieceList[i].value;\r\n if (pieceValue != null) {\r\n if (pieceValue === value\r\n || (typeof pieceValue === 'string' && pieceValue === value + '')) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(pieceValue, i);\r\n }\r\n }\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var piece = pieceList[i];\r\n var interval = piece.interval;\r\n var close_1 = piece.close;\r\n if (interval) {\r\n if (interval[0] === -Infinity) {\r\n if (littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n }\r\n else if (interval[1] === Infinity) {\r\n if (littleThan(close_1[0], interval[0], value)) {\r\n return i;\r\n }\r\n }\r\n else if (littleThan(close_1[0], interval[0], value)\r\n && littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(interval[0], i);\r\n findClosestWhenOutside && updatePossible(interval[1], i);\r\n }\r\n }\r\n if (findClosestWhenOutside) {\r\n return value === Infinity\r\n ? pieceList.length - 1\r\n : value === -Infinity\r\n ? 0\r\n : possibleI;\r\n }\r\n function updatePossible(val, index) {\r\n var newAbs = Math.abs(val - value);\r\n if (newAbs < abs) {\r\n abs = newAbs;\r\n possibleI = index;\r\n }\r\n }\r\n };\r\n VisualMapping.visualHandlers = {\r\n color: {\r\n applyVisual: makeApplyVisual('color'),\r\n getColorMapper: function () {\r\n var thisOption = this.option;\r\n return bind(thisOption.mappingMethod === 'category'\r\n ? function (value, isNormalized) {\r\n !isNormalized && (value = this._normalizeData(value));\r\n return doMapCategory.call(this, value);\r\n }\r\n : function (value, isNormalized, out) {\r\n var returnRGBArray = !!out;\r\n !isNormalized && (value = this._normalizeData(value));\r\n out = fastLerp(value, thisOption.parsedVisual, out);\r\n return returnRGBArray ? out : stringify(out, 'rgba');\r\n }, this);\r\n },\r\n _normalizedToVisual: {\r\n linear: function (normalized) {\r\n return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n colorHue: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, value);\r\n }),\r\n colorSaturation: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, value);\r\n }),\r\n colorLightness: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, null, value);\r\n }),\r\n colorAlpha: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyAlpha(color$1, value);\r\n }),\r\n decal: {\r\n applyVisual: makeApplyVisual('decal'),\r\n _normalizedToVisual: {\r\n linear: null,\r\n category: doMapCategory,\r\n piecewise: null,\r\n fixed: null\r\n }\r\n },\r\n opacity: {\r\n applyVisual: makeApplyVisual('opacity'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n },\r\n liftZ: {\r\n applyVisual: makeApplyVisual('liftZ'),\r\n _normalizedToVisual: {\r\n linear: doMapFixed,\r\n category: doMapFixed,\r\n piecewise: doMapFixed,\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbol: {\r\n applyVisual: function (value, getter, setter) {\r\n var symbolCfg = this.mapValueToVisual(value);\r\n setter('symbol', symbolCfg);\r\n },\r\n _normalizedToVisual: {\r\n linear: doMapToArray,\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = doMapToArray.call(this, normalized);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbolSize: {\r\n applyVisual: makeApplyVisual('symbolSize'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n }\r\n };\r\n return VisualMapping;\r\n}());\r\nfunction preprocessForPiecewise(thisOption) {\r\n var pieceList = thisOption.pieceList;\r\n thisOption.hasSpecialVisual = false;\r\n each(pieceList, function (piece, index) {\r\n piece.originIndex = index;\r\n if (piece.visual != null) {\r\n thisOption.hasSpecialVisual = true;\r\n }\r\n });\r\n}\r\nfunction preprocessForSpecifiedCategory(thisOption) {\r\n var categories = thisOption.categories;\r\n var categoryMap = thisOption.categoryMap = {};\r\n var visual = thisOption.visual;\r\n each$4(categories, function (cate, index) {\r\n categoryMap[cate] = index;\r\n });\r\n if (!isArray(visual)) {\r\n var visualArr_1 = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v, cate) {\r\n var index = categoryMap[cate];\r\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\r\n });\r\n }\r\n else {\r\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\r\n }\r\n visual = setVisualToOption(thisOption, visualArr_1);\r\n }\r\n for (var i = categories.length - 1; i >= 0; i--) {\r\n if (visual[i] == null) {\r\n delete categoryMap[categories[i]];\r\n categories.pop();\r\n }\r\n }\r\n}\r\nfunction normalizeVisualRange(thisOption, isCategory) {\r\n var visual = thisOption.visual;\r\n var visualArr = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v) {\r\n visualArr.push(v);\r\n });\r\n }\r\n else if (visual != null) {\r\n visualArr.push(visual);\r\n }\r\n var doNotNeedPair = { color: 1, symbol: 1 };\r\n if (!isCategory\r\n && visualArr.length === 1\r\n && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\r\n visualArr[1] = visualArr[0];\r\n }\r\n setVisualToOption(thisOption, visualArr);\r\n}\r\nfunction makePartialColorVisualHandler(applyValue) {\r\n return {\r\n applyVisual: function (value, getter, setter) {\r\n var colorChannel = this.mapValueToVisual(value);\r\n setter('color', applyValue(getter('color'), colorChannel));\r\n },\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n };\r\n}\r\nfunction doMapToArray(normalized) {\r\n var visual = this.option.visual;\r\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};\r\n}\r\nfunction makeApplyVisual(visualType) {\r\n return function (value, getter, setter) {\r\n setter(visualType, this.mapValueToVisual(value));\r\n };\r\n}\r\nfunction doMapCategory(normalized) {\r\n var visual = this.option.visual;\r\n return visual[(this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)\r\n ? normalized % visual.length\r\n : normalized];\r\n}\r\nfunction doMapFixed() {\r\n return this.option.visual[0];\r\n}\r\nfunction createNormalizedToNumericVisual(sourceExtent) {\r\n return {\r\n linear: function (normalized) {\r\n return linearMap(normalized, sourceExtent, this.option.visual, true);\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n };\r\n}\r\nfunction getSpecifiedVisual(value) {\r\n var thisOption = this.option;\r\n var pieceList = thisOption.pieceList;\r\n if (thisOption.hasSpecialVisual) {\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\r\n var piece = pieceList[pieceIndex];\r\n if (piece && piece.visual) {\r\n return piece.visual[this.type];\r\n }\r\n }\r\n}\r\nfunction setVisualToOption(thisOption, visualArr) {\r\n thisOption.visual = visualArr;\r\n if (thisOption.type === 'color') {\r\n thisOption.parsedVisual = map(visualArr, function (item) {\r\n return parse(item);\r\n });\r\n }\r\n return visualArr;\r\n}\r\nvar normalizers = {\r\n linear: function (value) {\r\n return linearMap(value, this.option.dataExtent, [0, 1], true);\r\n },\r\n piecewise: function (value) {\r\n var pieceList = this.option.pieceList;\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\r\n if (pieceIndex != null) {\r\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\r\n }\r\n },\r\n category: function (value) {\r\n var index = this.option.categories\r\n ? this.option.categoryMap[value]\r\n : value;\r\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\r\n },\r\n fixed: noop\r\n};\r\nfunction littleThan(close, a, b) {\r\n return close ? a <= b : a < b;\r\n}\n\nvar ITEM_STYLE_NORMAL = 'itemStyle';\r\nvar inner$a = makeInner();\r\nvar treemapVisual = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel) {\r\n var tree = seriesModel.getData().tree;\r\n var root = tree.root;\r\n if (root.isRemoved()) {\r\n return;\r\n }\r\n travelTree(root, {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\r\n }\r\n};\r\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\r\n var nodeModel = node.getModel();\r\n var nodeLayout = node.getLayout();\r\n var data = node.hostTree.data;\r\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\r\n return;\r\n }\r\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\r\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n var borderColor = nodeItemStyleModel.get('borderColor');\r\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\r\n var thisNodeColor;\r\n if (borderColorSaturation != null) {\r\n thisNodeColor = calculateColor(visuals);\r\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\r\n }\r\n existsStyle.stroke = borderColor;\r\n var viewChildren = node.viewChildren;\r\n if (!viewChildren || !viewChildren.length) {\r\n thisNodeColor = calculateColor(visuals);\r\n existsStyle.fill = thisNodeColor;\r\n }\r\n else {\r\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\r\n each(viewChildren, function (child, index) {\r\n if (child.depth >= viewRootAncestors.length\r\n || child === viewRootAncestors[child.depth]) {\r\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\r\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\r\n }\r\n });\r\n }\r\n}\r\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\r\n var visuals = extend({}, designatedVisual);\r\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\r\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\r\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\r\n var val = nodeItemStyleModel.get(visualName);\r\n designatedVisualItemStyle[visualName] = null;\r\n val != null && (visuals[visualName] = val);\r\n });\r\n return visuals;\r\n}\r\nfunction calculateColor(visuals) {\r\n var color = getValueVisualDefine(visuals, 'color');\r\n if (color) {\r\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\r\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\r\n if (colorSaturation) {\r\n color = modifyHSL(color, null, null, colorSaturation);\r\n }\r\n if (colorAlpha) {\r\n color = modifyAlpha(color, colorAlpha);\r\n }\r\n return color;\r\n }\r\n}\r\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\r\n return thisNodeColor != null\r\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation)\r\n : null;\r\n}\r\nfunction getValueVisualDefine(visuals, name) {\r\n var value = visuals[name];\r\n if (value != null && value !== 'none') {\r\n return value;\r\n }\r\n}\r\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\r\n if (!viewChildren || !viewChildren.length) {\r\n return;\r\n }\r\n var rangeVisual = getRangeVisual(nodeModel, 'color')\r\n || (visuals.color != null\r\n && visuals.color !== 'none'\r\n && (getRangeVisual(nodeModel, 'colorAlpha')\r\n || getRangeVisual(nodeModel, 'colorSaturation')));\r\n if (!rangeVisual) {\r\n return;\r\n }\r\n var visualMin = nodeModel.get('visualMin');\r\n var visualMax = nodeModel.get('visualMax');\r\n var dataExtent = nodeLayout.dataExtent.slice();\r\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\r\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\r\n var colorMappingBy = nodeModel.get('colorMappingBy');\r\n var opt = {\r\n type: rangeVisual.name,\r\n dataExtent: dataExtent,\r\n visual: rangeVisual.range\r\n };\r\n if (opt.type === 'color'\r\n && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\r\n opt.mappingMethod = 'category';\r\n opt.loop = true;\r\n }\r\n else {\r\n opt.mappingMethod = 'linear';\r\n }\r\n var mapping = new VisualMapping(opt);\r\n inner$a(mapping).drColorMappingBy = colorMappingBy;\r\n return mapping;\r\n}\r\nfunction getRangeVisual(nodeModel, name) {\r\n var range = nodeModel.get(name);\r\n return (isArray(range) && range.length) ? {\r\n name: name,\r\n range: range\r\n } : null;\r\n}\r\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\r\n var childVisuals = extend({}, visuals);\r\n if (mapping) {\r\n var mappingType = mapping.type;\r\n var colorMappingBy = mappingType === 'color' && inner$a(mapping).drColorMappingBy;\r\n var value = colorMappingBy === 'index'\r\n ? index\r\n : colorMappingBy === 'id'\r\n ? seriesModel.mapIdToIndex(child.getId())\r\n : child.getValue(nodeModel.get('visualDimension'));\r\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\r\n }\r\n return childVisuals;\r\n}\n\nvar mathMax$7 = Math.max;\r\nvar mathMin$7 = Math.min;\r\nvar retrieveValue = retrieve;\r\nvar each$5 = each;\r\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\r\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\r\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\r\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\r\nvar treemapLayout = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel, ecModel, api, payload) {\r\n var ecWidth = api.getWidth();\r\n var ecHeight = api.getHeight();\r\n var seriesOption = seriesModel.option;\r\n var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n var size = seriesOption.size || [];\r\n var containerWidth = parsePercent$2(retrieveValue(layoutInfo.width, size[0]), ecWidth);\r\n var containerHeight = parsePercent$2(retrieveValue(layoutInfo.height, size[1]), ecHeight);\r\n var payloadType = payload && payload.type;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')\r\n ? payload.rootRect : null;\r\n var viewRoot = seriesModel.getViewRoot();\r\n var viewAbovePath = getPathToRoot(viewRoot);\r\n if (payloadType !== 'treemapMove') {\r\n var rootSize = payloadType === 'treemapZoomToNode'\r\n ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight)\r\n : rootRect\r\n ? [rootRect.width, rootRect.height]\r\n : [containerWidth, containerHeight];\r\n var sort_1 = seriesOption.sort;\r\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\r\n sort_1 = 'desc';\r\n }\r\n var options = {\r\n squareRatio: seriesOption.squareRatio,\r\n sort: sort_1,\r\n leafDepth: seriesOption.leafDepth\r\n };\r\n viewRoot.hostTree.clearLayouts();\r\n var viewRootLayout_1 = {\r\n x: 0,\r\n y: 0,\r\n width: rootSize[0],\r\n height: rootSize[1],\r\n area: rootSize[0] * rootSize[1]\r\n };\r\n viewRoot.setLayout(viewRootLayout_1);\r\n squarify(viewRoot, options, false, 0);\r\n viewRootLayout_1 = viewRoot.getLayout();\r\n each$5(viewAbovePath, function (node, index) {\r\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\r\n node.setLayout(extend({\r\n dataExtent: [childValue, childValue],\r\n borderWidth: 0,\r\n upperHeight: 0\r\n }, viewRootLayout_1));\r\n });\r\n }\r\n var treeRoot = seriesModel.getData().tree.root;\r\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\r\n seriesModel.setLayoutInfo(layoutInfo);\r\n prunning(treeRoot, new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\r\n }\r\n};\r\nfunction squarify(node, options, hideChildren, depth) {\r\n var width;\r\n var height;\r\n if (node.isRemoved()) {\r\n return;\r\n }\r\n var thisLayout = node.getLayout();\r\n width = thisLayout.width;\r\n height = thisLayout.height;\r\n var nodeModel = node.getModel();\r\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\r\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\r\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\r\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\r\n var layoutOffset = borderWidth - halfGapWidth;\r\n var layoutOffsetUpper = upperHeight - halfGapWidth;\r\n node.setLayout({\r\n borderWidth: borderWidth,\r\n upperHeight: upperHeight,\r\n upperLabelHeight: upperLabelHeight\r\n }, true);\r\n width = mathMax$7(width - 2 * layoutOffset, 0);\r\n height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0);\r\n var totalArea = width * height;\r\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\r\n if (!viewChildren.length) {\r\n return;\r\n }\r\n var rect = { x: layoutOffset, y: layoutOffsetUpper, width: width, height: height };\r\n var rowFixedLength = mathMin$7(width, height);\r\n var best = Infinity;\r\n var row = [];\r\n row.area = 0;\r\n for (var i = 0, len = viewChildren.length; i < len;) {\r\n var child = viewChildren[i];\r\n row.push(child);\r\n row.area += child.getLayout().area;\r\n var score = worst(row, rowFixedLength, options.squareRatio);\r\n if (score <= best) {\r\n i++;\r\n best = score;\r\n }\r\n else {\r\n row.area -= row.pop().getLayout().area;\r\n position(row, rowFixedLength, rect, halfGapWidth, false);\r\n rowFixedLength = mathMin$7(rect.width, rect.height);\r\n row.length = row.area = 0;\r\n best = Infinity;\r\n }\r\n }\r\n if (row.length) {\r\n position(row, rowFixedLength, rect, halfGapWidth, true);\r\n }\r\n if (!hideChildren) {\r\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\r\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\r\n hideChildren = true;\r\n }\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n squarify(viewChildren[i], options, hideChildren, depth + 1);\r\n }\r\n}\r\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\r\n var viewChildren = node.children || [];\r\n var orderBy = options.sort;\r\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\r\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\r\n if (hideChildren && !overLeafDepth) {\r\n return (node.viewChildren = []);\r\n }\r\n viewChildren = filter(viewChildren, function (child) {\r\n return !child.isRemoved();\r\n });\r\n sort$1(viewChildren, orderBy);\r\n var info = statistic(nodeModel, viewChildren, orderBy);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n var area = viewChildren[i].getValue() / info.sum * totalArea;\r\n viewChildren[i].setLayout({\r\n area: area\r\n });\r\n }\r\n if (overLeafDepth) {\r\n viewChildren.length && node.setLayout({\r\n isLeafRoot: true\r\n }, true);\r\n viewChildren.length = 0;\r\n }\r\n node.viewChildren = viewChildren;\r\n node.setLayout({\r\n dataExtent: info.dataExtent\r\n }, true);\r\n return viewChildren;\r\n}\r\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\r\n if (!orderBy) {\r\n return sum;\r\n }\r\n var visibleMin = nodeModel.get('visibleMin');\r\n var len = orderedChildren.length;\r\n var deletePoint = len;\r\n for (var i = len - 1; i >= 0; i--) {\r\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\r\n if (value / sum * totalArea < visibleMin) {\r\n deletePoint = i;\r\n sum -= value;\r\n }\r\n }\r\n orderBy === 'asc'\r\n ? orderedChildren.splice(0, len - deletePoint)\r\n : orderedChildren.splice(deletePoint, len - deletePoint);\r\n return sum;\r\n}\r\nfunction sort$1(viewChildren, orderBy) {\r\n if (orderBy) {\r\n viewChildren.sort(function (a, b) {\r\n var diff = orderBy === 'asc'\r\n ? a.getValue() - b.getValue()\r\n : b.getValue() - a.getValue();\r\n return diff === 0\r\n ? (orderBy === 'asc'\r\n ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex)\r\n : diff;\r\n });\r\n }\r\n return viewChildren;\r\n}\r\nfunction statistic(nodeModel, children, orderBy) {\r\n var sum = 0;\r\n for (var i = 0, len = children.length; i < len; i++) {\r\n sum += children[i].getValue();\r\n }\r\n var dimension = nodeModel.get('visualDimension');\r\n var dataExtent;\r\n if (!children || !children.length) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n else if (dimension === 'value' && orderBy) {\r\n dataExtent = [\r\n children[children.length - 1].getValue(),\r\n children[0].getValue()\r\n ];\r\n orderBy === 'asc' && dataExtent.reverse();\r\n }\r\n else {\r\n dataExtent = [Infinity, -Infinity];\r\n each$5(children, function (child) {\r\n var value = child.getValue(dimension);\r\n value < dataExtent[0] && (dataExtent[0] = value);\r\n value > dataExtent[1] && (dataExtent[1] = value);\r\n });\r\n }\r\n return { sum: sum, dataExtent: dataExtent };\r\n}\r\nfunction worst(row, rowFixedLength, ratio) {\r\n var areaMax = 0;\r\n var areaMin = Infinity;\r\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\r\n area = row[i].getLayout().area;\r\n if (area) {\r\n area < areaMin && (areaMin = area);\r\n area > areaMax && (areaMax = area);\r\n }\r\n }\r\n var squareArea = row.area * row.area;\r\n var f = rowFixedLength * rowFixedLength * ratio;\r\n return squareArea\r\n ? mathMax$7((f * areaMax) / squareArea, squareArea / (f * areaMin))\r\n : Infinity;\r\n}\r\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\r\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\r\n var idx1WhenH = 1 - idx0WhenH;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var last = rect[xy[idx0WhenH]];\r\n var rowOtherLength = rowFixedLength\r\n ? row.area / rowFixedLength : 0;\r\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\r\n rowOtherLength = rect[wh[idx1WhenH]];\r\n }\r\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\r\n var node = row[i];\r\n var nodeLayout = {};\r\n var step = rowOtherLength\r\n ? node.getLayout().area / rowOtherLength : 0;\r\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0);\r\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\r\n var modWH = (i === rowLen - 1 || remain < step) ? remain : step;\r\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0);\r\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2);\r\n nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2);\r\n last += modWH;\r\n node.setLayout(nodeLayout, true);\r\n }\r\n rect[xy[idx1WhenH]] += rowOtherLength;\r\n rect[wh[idx1WhenH]] -= rowOtherLength;\r\n}\r\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\r\n var currNode = (targetInfo || {}).node;\r\n var defaultSize = [containerWidth, containerHeight];\r\n if (!currNode || currNode === viewRoot) {\r\n return defaultSize;\r\n }\r\n var parent;\r\n var viewArea = containerWidth * containerHeight;\r\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\r\n while (parent = currNode.parentNode) {\r\n var sum = 0;\r\n var siblings = parent.children;\r\n for (var i = 0, len = siblings.length; i < len; i++) {\r\n sum += siblings[i].getValue();\r\n }\r\n var currNodeValue = currNode.getValue();\r\n if (currNodeValue === 0) {\r\n return defaultSize;\r\n }\r\n area *= sum / currNodeValue;\r\n var parentModel = parent.getModel();\r\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\r\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\r\n area += 4 * borderWidth * borderWidth\r\n + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\r\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\r\n currNode = parent;\r\n }\r\n area < viewArea && (area = viewArea);\r\n var scale = Math.pow(area / viewArea, 0.5);\r\n return [containerWidth * scale, containerHeight * scale];\r\n}\r\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\r\n if (rootRect) {\r\n return { x: rootRect.x, y: rootRect.y };\r\n }\r\n var defaultPosition = { x: 0, y: 0 };\r\n if (!targetInfo) {\r\n return defaultPosition;\r\n }\r\n var targetNode = targetInfo.node;\r\n var layout = targetNode.getLayout();\r\n if (!layout) {\r\n return defaultPosition;\r\n }\r\n var targetCenter = [layout.width / 2, layout.height / 2];\r\n var node = targetNode;\r\n while (node) {\r\n var nodeLayout = node.getLayout();\r\n targetCenter[0] += nodeLayout.x;\r\n targetCenter[1] += nodeLayout.y;\r\n node = node.parentNode;\r\n }\r\n return {\r\n x: layoutInfo.width / 2 - targetCenter[0],\r\n y: layoutInfo.height / 2 - targetCenter[1]\r\n };\r\n}\r\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\r\n var nodeLayout = node.getLayout();\r\n var nodeInViewAbovePath = viewAbovePath[depth];\r\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\r\n if ((nodeInViewAbovePath && !isAboveViewRoot)\r\n || (depth === viewAbovePath.length && node !== viewRoot)) {\r\n return;\r\n }\r\n node.setLayout({\r\n isInView: true,\r\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\r\n isAboveViewRoot: isAboveViewRoot\r\n }, true);\r\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\r\n each$5(node.viewChildren || [], function (child) {\r\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\r\n });\r\n}\r\nfunction getUpperLabelHeight(model) {\r\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\r\n}\n\nregisterVisual(treemapVisual);\r\nregisterLayout(treemapLayout);\n\nfunction generateNodeKey(id) {\r\n return '_EC_' + id;\r\n}\r\nvar Graph = (function () {\r\n function Graph(directed) {\r\n this.type = 'graph';\r\n this.nodes = [];\r\n this.edges = [];\r\n this._nodesMap = {};\r\n this._edgesMap = {};\r\n this._directed = directed || false;\r\n }\r\n Graph.prototype.isDirected = function () {\r\n return this._directed;\r\n };\r\n Graph.prototype.addNode = function (id, dataIndex) {\r\n id = id == null ? ('' + dataIndex) : ('' + id);\r\n var nodesMap = this._nodesMap;\r\n if (nodesMap[generateNodeKey(id)]) {\r\n if (__DEV__) {\r\n console.error('Graph nodes have duplicate name or id');\r\n }\r\n return;\r\n }\r\n var node = new GraphNode(id, dataIndex);\r\n node.hostGraph = this;\r\n this.nodes.push(node);\r\n nodesMap[generateNodeKey(id)] = node;\r\n return node;\r\n };\r\n Graph.prototype.getNodeByIndex = function (dataIndex) {\r\n var rawIdx = this.data.getRawIndex(dataIndex);\r\n return this.nodes[rawIdx];\r\n };\r\n Graph.prototype.getNodeById = function (id) {\r\n return this._nodesMap[generateNodeKey(id)];\r\n };\r\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\r\n var nodesMap = this._nodesMap;\r\n var edgesMap = this._edgesMap;\r\n if (typeof n1 === 'number') {\r\n n1 = this.nodes[n1];\r\n }\r\n if (typeof n2 === 'number') {\r\n n2 = this.nodes[n2];\r\n }\r\n if (!(n1 instanceof GraphNode)) {\r\n n1 = nodesMap[generateNodeKey(n1)];\r\n }\r\n if (!(n2 instanceof GraphNode)) {\r\n n2 = nodesMap[generateNodeKey(n2)];\r\n }\r\n if (!n1 || !n2) {\r\n return;\r\n }\r\n var key = n1.id + '-' + n2.id;\r\n var edge = new GraphEdge(n1, n2, dataIndex);\r\n edge.hostGraph = this;\r\n if (this._directed) {\r\n n1.outEdges.push(edge);\r\n n2.inEdges.push(edge);\r\n }\r\n n1.edges.push(edge);\r\n if (n1 !== n2) {\r\n n2.edges.push(edge);\r\n }\r\n this.edges.push(edge);\r\n edgesMap[key] = edge;\r\n return edge;\r\n };\r\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\r\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\r\n return this.edges[rawIdx];\r\n };\r\n Graph.prototype.getEdge = function (n1, n2) {\r\n if (n1 instanceof GraphNode) {\r\n n1 = n1.id;\r\n }\r\n if (n2 instanceof GraphNode) {\r\n n2 = n2.id;\r\n }\r\n var edgesMap = this._edgesMap;\r\n if (this._directed) {\r\n return edgesMap[n1 + '-' + n2];\r\n }\r\n else {\r\n return edgesMap[n1 + '-' + n2]\r\n || edgesMap[n2 + '-' + n1];\r\n }\r\n };\r\n Graph.prototype.eachNode = function (cb, context) {\r\n var nodes = this.nodes;\r\n var len = nodes.length;\r\n for (var i = 0; i < len; i++) {\r\n if (nodes[i].dataIndex >= 0) {\r\n cb.call(context, nodes[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.eachEdge = function (cb, context) {\r\n var edges = this.edges;\r\n var len = edges.length;\r\n for (var i = 0; i < len; i++) {\r\n if (edges[i].dataIndex >= 0\r\n && edges[i].node1.dataIndex >= 0\r\n && edges[i].node2.dataIndex >= 0) {\r\n cb.call(context, edges[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\r\n if (!(startNode instanceof GraphNode)) {\r\n startNode = this._nodesMap[generateNodeKey(startNode)];\r\n }\r\n if (!startNode) {\r\n return;\r\n }\r\n var edgeType = direction === 'out'\r\n ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');\r\n for (var i = 0; i < this.nodes.length; i++) {\r\n this.nodes[i].__visited = false;\r\n }\r\n if (cb.call(context, startNode, null)) {\r\n return;\r\n }\r\n var queue = [startNode];\r\n while (queue.length) {\r\n var currentNode = queue.shift();\r\n var edges = currentNode[edgeType];\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n var otherNode = e.node1 === currentNode\r\n ? e.node2 : e.node1;\r\n if (!otherNode.__visited) {\r\n if (cb.call(context, otherNode, currentNode)) {\r\n return;\r\n }\r\n queue.push(otherNode);\r\n otherNode.__visited = true;\r\n }\r\n }\r\n }\r\n };\r\n Graph.prototype.update = function () {\r\n var data = this.data;\r\n var edgeData = this.edgeData;\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n edgeData.filterSelf(function (idx) {\r\n var edge = edges[edgeData.getRawIndex(idx)];\r\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\r\n });\r\n for (var i = 0, len = edges.length; i < len; i++) {\r\n edges[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = edgeData.count(); i < len; i++) {\r\n edges[edgeData.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Graph.prototype.clone = function () {\r\n var graph = new Graph(this._directed);\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\r\n }\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\r\n }\r\n return graph;\r\n };\r\n return Graph;\r\n}());\r\nvar GraphNode = (function () {\r\n function GraphNode(id, dataIndex) {\r\n this.inEdges = [];\r\n this.outEdges = [];\r\n this.edges = [];\r\n this.dataIndex = -1;\r\n this.id = id == null ? '' : id;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphNode.prototype.degree = function () {\r\n return this.edges.length;\r\n };\r\n GraphNode.prototype.inDegree = function () {\r\n return this.inEdges.length;\r\n };\r\n GraphNode.prototype.outDegree = function () {\r\n return this.outEdges.length;\r\n };\r\n GraphNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphNode.prototype.getAdjacentDataIndices = function () {\r\n var dataIndices = {\r\n edge: [],\r\n node: []\r\n };\r\n for (var i = 0; i < this.edges.length; i++) {\r\n var adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n dataIndices.edge.push(adjacentEdge.dataIndex);\r\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\r\n }\r\n return dataIndices;\r\n };\r\n return GraphNode;\r\n}());\r\nvar GraphEdge = (function () {\r\n function GraphEdge(n1, n2, dataIndex) {\r\n this.dataIndex = -1;\r\n this.node1 = n1;\r\n this.node2 = n2;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphEdge.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphEdge.prototype.getAdjacentDataIndices = function () {\r\n return {\r\n edge: [this.dataIndex],\r\n node: [this.node1.dataIndex, this.node2.dataIndex]\r\n };\r\n };\r\n return GraphEdge;\r\n}());\r\nfunction createGraphDataProxyMixin(hostName, dataName) {\r\n return {\r\n getValue: function (dimension) {\r\n var data = this[hostName][dataName];\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n },\r\n setVisual: function (key, value) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\r\n },\r\n getVisual: function (key) {\r\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\r\n },\r\n setLayout: function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\r\n },\r\n getLayout: function () {\r\n return this[hostName][dataName].getItemLayout(this.dataIndex);\r\n },\r\n getGraphicEl: function () {\r\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\r\n },\r\n getRawIndex: function () {\r\n return this[hostName][dataName].getRawIndex(this.dataIndex);\r\n }\r\n };\r\n}\r\nmixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\r\nmixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\n\nfunction createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\r\n var graph = new Graph(directed);\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(retrieve(nodes[i].id, nodes[i].name, i), i);\r\n }\r\n var linkNameList = [];\r\n var validEdges = [];\r\n var linkCount = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n var link = edges[i];\r\n var source = link.source;\r\n var target = link.target;\r\n if (graph.addEdge(source, target, linkCount)) {\r\n validEdges.push(link);\r\n linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\r\n linkCount++;\r\n }\r\n }\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n var nodeData;\r\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\r\n nodeData = createListFromArray(nodes, seriesModel);\r\n }\r\n else {\r\n var coordSysCtor = CoordinateSystemManager.get(coordSys);\r\n var coordDimensions = coordSysCtor\r\n ? (coordSysCtor.dimensions || []) : [];\r\n if (indexOf(coordDimensions, 'value') < 0) {\r\n coordDimensions.concat(['value']);\r\n }\r\n var dimensionNames = createDimensions(nodes, {\r\n coordDimensions: coordDimensions\r\n });\r\n nodeData = new List(dimensionNames, seriesModel);\r\n nodeData.initData(nodes);\r\n }\r\n var edgeData = new List(['value'], seriesModel);\r\n edgeData.initData(validEdges, linkNameList);\r\n beforeLink && beforeLink(nodeData, edgeData);\r\n linkList({\r\n mainData: nodeData,\r\n struct: graph,\r\n structAttr: 'graph',\r\n datas: { node: nodeData, edge: edgeData },\r\n datasAttr: { node: 'data', edge: 'edgeData' }\r\n });\r\n graph.update();\r\n return graph;\r\n}\n\nvar KEY_DELIMITER = '-->';\r\nvar getAutoCurvenessParams = function (seriesModel) {\r\n return seriesModel.get('autoCurveness') || null;\r\n};\r\nvar createCurveness = function (seriesModel, appendLength) {\r\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\r\n var length = 20;\r\n var curvenessList = [];\r\n if (typeof autoCurvenessParmas === 'number') {\r\n length = autoCurvenessParmas;\r\n }\r\n else if (isArray(autoCurvenessParmas)) {\r\n seriesModel.__curvenessList = autoCurvenessParmas;\r\n return;\r\n }\r\n if (appendLength > length) {\r\n length = appendLength;\r\n }\r\n var len = length % 2 ? length + 2 : length + 3;\r\n curvenessList = [];\r\n for (var i = 0; i < len; i++) {\r\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\r\n }\r\n seriesModel.__curvenessList = curvenessList;\r\n};\r\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\r\n var source = [n1.id, n1.dataIndex].join('.');\r\n var target = [n2.id, n2.dataIndex].join('.');\r\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\r\n};\r\nvar getOppositeKey = function (key) {\r\n var keys = key.split(KEY_DELIMITER);\r\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\r\n};\r\nvar getEdgeFromMap = function (edge, seriesModel) {\r\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n return seriesModel.__edgeMap[key];\r\n};\r\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\r\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\r\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\r\n return len + lenV;\r\n};\r\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\r\n var edgeMap = seriesModel.__edgeMap;\r\n return edgeMap[key] ? edgeMap[key].length : 0;\r\n};\r\nfunction initCurvenessList(seriesModel) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n seriesModel.__curvenessList = [];\r\n seriesModel.__edgeMap = {};\r\n createCurveness(seriesModel);\r\n}\r\nfunction createEdgeMapForCurveness(n1, n2, seriesModel, index) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n var key = getKeyOfEdges(n1, n2, seriesModel);\r\n var edgeMap = seriesModel.__edgeMap;\r\n var oppositeEdges = edgeMap[getOppositeKey(key)];\r\n if (edgeMap[key] && !oppositeEdges) {\r\n edgeMap[key].isForward = true;\r\n }\r\n else if (oppositeEdges && edgeMap[key]) {\r\n oppositeEdges.isForward = true;\r\n edgeMap[key].isForward = false;\r\n }\r\n edgeMap[key] = edgeMap[key] || [];\r\n edgeMap[key].push(index);\r\n}\r\nfunction getCurvenessForEdge(edge, seriesModel, index, needReverse) {\r\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\r\n var isArrayParam = isArray(autoCurvenessParams);\r\n if (!autoCurvenessParams) {\r\n return null;\r\n }\r\n var edgeArray = getEdgeFromMap(edge, seriesModel);\r\n if (!edgeArray) {\r\n return null;\r\n }\r\n var edgeIndex = -1;\r\n for (var i = 0; i < edgeArray.length; i++) {\r\n if (edgeArray[i] === index) {\r\n edgeIndex = i;\r\n break;\r\n }\r\n }\r\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\r\n createCurveness(seriesModel, totalLen);\r\n edge.lineStyle = edge.lineStyle || {};\r\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n var curvenessList = seriesModel.__curvenessList;\r\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\r\n if (!edgeArray.isForward) {\r\n var oppositeKey = getOppositeKey(curKey);\r\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\r\n var resValue = curvenessList[edgeIndex + len + parityCorrection];\r\n if (needReverse) {\r\n if (isArrayParam) {\r\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n else {\r\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return curvenessList[edgeIndex + len + parityCorrection];\r\n }\r\n }\r\n else {\r\n return curvenessList[parityCorrection + edgeIndex];\r\n }\r\n}\n\nvar GraphSeriesModel = (function (_super) {\r\n __extends(GraphSeriesModel, _super);\r\n function GraphSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n GraphSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n var self = this;\r\n function getCategoriesData() {\r\n return self._categoriesData;\r\n }\r\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\r\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\r\n defaultEmphasis(option, 'edgeLabel', ['show']);\r\n };\r\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var edges = option.edges || option.links || [];\r\n var nodes = option.data || option.nodes || [];\r\n var self = this;\r\n if (nodes && edges) {\r\n initCurvenessList(this);\r\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\r\n each(graph.edges, function (edge) {\r\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\r\n }, this);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model) {\r\n var categoriesModels = self._categoriesModels;\r\n var categoryIdx = model.getShallow('category');\r\n var categoryModel = categoriesModels[categoryIdx];\r\n if (categoryModel) {\r\n categoryModel.parentModel = model.parentModel;\r\n model.parentModel = categoryModel;\r\n }\r\n return model;\r\n });\r\n var oldGetModel = Model.prototype.getModel;\r\n function newGetModel(path, parentModel) {\r\n var model = oldGetModel.call(this, path, parentModel);\r\n model.resolveParentPath = resolveParentPath;\r\n return model;\r\n }\r\n edgeData.wrapMethod('getItemModel', function (model) {\r\n model.resolveParentPath = resolveParentPath;\r\n model.getModel = newGetModel;\r\n return model;\r\n });\r\n function resolveParentPath(pathArr) {\r\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\r\n var newPathArr = pathArr.slice();\r\n if (pathArr[0] === 'label') {\r\n newPathArr[0] = 'edgeLabel';\r\n }\r\n else if (pathArr[1] === 'label') {\r\n newPathArr[1] = 'edgeLabel';\r\n }\r\n return newPathArr;\r\n }\r\n return pathArr;\r\n }\r\n }\r\n };\r\n GraphSeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n GraphSeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n GraphSeriesModel.prototype.getCategoriesData = function () {\r\n return this._categoriesData;\r\n };\r\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n if (dataType === 'edge') {\r\n var nodeData = this.getData();\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\r\n var sourceName = nodeData.getName(edge.node1.dataIndex);\r\n var targetName = nodeData.getName(edge.node2.dataIndex);\r\n var nameArr = [];\r\n sourceName != null && nameArr.push(sourceName);\r\n targetName != null && nameArr.push(targetName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > '),\r\n value: params.value,\r\n noValue: params.value == null\r\n });\r\n }\r\n var nodeMarkup = defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n return nodeMarkup;\r\n };\r\n GraphSeriesModel.prototype._updateCategoriesData = function () {\r\n var categories = map(this.option.categories || [], function (category) {\r\n return category.value != null ? category : extend({\r\n value: 0\r\n }, category);\r\n });\r\n var categoriesData = new List(['value'], this);\r\n categoriesData.initData(categories);\r\n this._categoriesData = categoriesData;\r\n this._categoriesModels = categoriesData.mapArray(function (idx) {\r\n return categoriesData.getItemModel(idx);\r\n });\r\n };\r\n GraphSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GraphSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\r\n return _super.prototype.isAnimationEnabled.call(this)\r\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\r\n };\r\n GraphSeriesModel.type = 'series.graph';\r\n GraphSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n legendHoverLink: true,\r\n layout: null,\r\n focusNodeAdjacency: false,\r\n circular: {\r\n rotateLabel: false\r\n },\r\n force: {\r\n initLayout: null,\r\n repulsion: [0, 50],\r\n gravity: 0.1,\r\n friction: 0.6,\r\n edgeLength: 30,\r\n layoutAnimation: true\r\n },\r\n left: 'center',\r\n top: 'center',\r\n symbol: 'circle',\r\n symbolSize: 10,\r\n edgeSymbol: ['none', 'none'],\r\n edgeSymbolSize: 10,\r\n edgeLabel: {\r\n position: 'middle',\r\n distance: 5\r\n },\r\n draggable: false,\r\n roam: false,\r\n center: null,\r\n zoom: 1,\r\n nodeScaleRatio: 0.6,\r\n label: {\r\n show: false,\r\n formatter: '{b}'\r\n },\r\n itemStyle: {},\r\n lineStyle: {\r\n color: '#aaa',\r\n width: 1,\r\n opacity: 0.5\r\n },\r\n emphasis: {\r\n scale: true,\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return GraphSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(GraphSeriesModel);\n\nvar straightLineProto = Line.prototype;\r\nvar bezierCurveProto = BezierCurve.prototype;\r\nvar StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n}());\r\nvar CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n}(StraightLineShape));\r\nfunction isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n}\r\nvar ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n}(Path));\n\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\nfunction makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n}\r\nfunction createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n}\r\nfunction createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n}\r\nfunction setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n}\r\nvar Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n}(Group));\n\nvar LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n}());\r\nfunction isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n}\r\nfunction makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n}\r\nfunction isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n}\r\nfunction lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n}\n\nfunction getNodeGlobalScale(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n}\r\nfunction getSymbolSize(node) {\r\n var symbolSize = node.getVisual('symbolSize');\r\n if (symbolSize instanceof Array) {\r\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\r\n }\r\n return +symbolSize;\r\n}\n\nvar v1 = [];\r\nvar v2 = [];\r\nvar v3 = [];\r\nvar quadraticAt$1 = quadraticAt;\r\nvar v2DistSquare = distSquare;\r\nvar mathAbs$2 = Math.abs;\r\nfunction intersectCurveCircle(curvePoints, center, radius) {\r\n var p0 = curvePoints[0];\r\n var p1 = curvePoints[1];\r\n var p2 = curvePoints[2];\r\n var d = Infinity;\r\n var t;\r\n var radiusSquare = radius * radius;\r\n var interval = 0.1;\r\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\r\n v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t);\r\n v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t);\r\n var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare);\r\n if (diff < d) {\r\n d = diff;\r\n t = _t;\r\n }\r\n }\r\n for (var i = 0; i < 32; i++) {\r\n var next = t + interval;\r\n v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t);\r\n v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t);\r\n v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next);\r\n v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next);\r\n var diff = v2DistSquare(v2, center) - radiusSquare;\r\n if (mathAbs$2(diff) < 1e-2) {\r\n break;\r\n }\r\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\r\n interval /= 2;\r\n if (diff < 0) {\r\n if (nextDiff >= 0) {\r\n t = t + interval;\r\n }\r\n else {\r\n t = t - interval;\r\n }\r\n }\r\n else {\r\n if (nextDiff >= 0) {\r\n t = t - interval;\r\n }\r\n else {\r\n t = t + interval;\r\n }\r\n }\r\n }\r\n return t;\r\n}\r\nfunction adjustEdge(graph, scale) {\r\n var tmp0 = [];\r\n var quadraticSubdivide$1 = quadraticSubdivide;\r\n var pts = [[], [], []];\r\n var pts2 = [[], []];\r\n var v = [];\r\n scale /= 2;\r\n graph.eachEdge(function (edge, idx) {\r\n var linePoints = edge.getLayout();\r\n var fromSymbol = edge.getVisual('fromSymbol');\r\n var toSymbol = edge.getVisual('toSymbol');\r\n if (!linePoints.__original) {\r\n linePoints.__original = [\r\n clone$1(linePoints[0]),\r\n clone$1(linePoints[1])\r\n ];\r\n if (linePoints[2]) {\r\n linePoints.__original.push(clone$1(linePoints[2]));\r\n }\r\n }\r\n var originalPoints = linePoints.__original;\r\n if (linePoints[2] != null) {\r\n copy(pts[0], originalPoints[0]);\r\n copy(pts[1], originalPoints[2]);\r\n copy(pts[2], originalPoints[1]);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[0][0] = tmp0[3];\r\n pts[1][0] = tmp0[4];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[0][1] = tmp0[3];\r\n pts[1][1] = tmp0[4];\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[1][0] = tmp0[1];\r\n pts[2][0] = tmp0[2];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[1][1] = tmp0[1];\r\n pts[2][1] = tmp0[2];\r\n }\r\n copy(linePoints[0], pts[0]);\r\n copy(linePoints[1], pts[2]);\r\n copy(linePoints[2], pts[1]);\r\n }\r\n else {\r\n copy(pts2[0], originalPoints[0]);\r\n copy(pts2[1], originalPoints[1]);\r\n sub(v, pts2[1], pts2[0]);\r\n normalize(v, v);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\r\n }\r\n copy(linePoints[0], pts2[0]);\r\n copy(linePoints[1], pts2[1]);\r\n }\r\n });\r\n}\n\nfunction isViewCoordSys(coordSys) {\r\n return coordSys.type === 'view';\r\n}\r\nvar GraphView = (function (_super) {\r\n __extends(GraphView, _super);\r\n function GraphView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphView.type;\r\n return _this;\r\n }\r\n GraphView.prototype.init = function (ecModel, api) {\r\n var symbolDraw = new SymbolDraw();\r\n var lineDraw = new LineDraw();\r\n var group = this.group;\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: group\r\n };\r\n group.add(symbolDraw.group);\r\n group.add(lineDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineDraw = lineDraw;\r\n this._firstRender = true;\r\n };\r\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n this._model = seriesModel;\r\n var symbolDraw = this._symbolDraw;\r\n var lineDraw = this._lineDraw;\r\n var group = this.group;\r\n if (isViewCoordSys(coordSys)) {\r\n var groupNewProp = {\r\n x: coordSys.x, y: coordSys.y,\r\n scaleX: coordSys.scaleX, scaleY: coordSys.scaleY\r\n };\r\n if (this._firstRender) {\r\n group.attr(groupNewProp);\r\n }\r\n else {\r\n updateProps(group, groupNewProp, seriesModel);\r\n }\r\n }\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n var data = seriesModel.getData();\r\n symbolDraw.updateData(data);\r\n var edgeData = seriesModel.getEdgeData();\r\n lineDraw.updateData(edgeData);\r\n this._updateNodeAndLinkScale();\r\n this._updateController(seriesModel, ecModel, api);\r\n clearTimeout(this._layoutTimeout);\r\n var forceLayout = seriesModel.forceLayout;\r\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\r\n if (forceLayout) {\r\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n }\r\n data.graph.eachNode(function (node) {\r\n var idx = node.dataIndex;\r\n var el = node.getGraphicEl();\r\n var itemModel = node.getModel();\r\n el.off('drag').off('dragend');\r\n var draggable = itemModel.get('draggable');\r\n if (draggable) {\r\n el.on('drag', function () {\r\n if (forceLayout) {\r\n forceLayout.warmUp();\r\n !_this._layouting\r\n && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n forceLayout.setFixed(idx);\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n }\r\n }).on('dragend', function () {\r\n if (forceLayout) {\r\n forceLayout.setUnfixed(idx);\r\n }\r\n });\r\n }\r\n el.setDraggable(draggable && !!forceLayout);\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = node.getAdjacentDataIndices();\r\n }\r\n });\r\n data.graph.eachEdge(function (edge) {\r\n var el = edge.getGraphicEl();\r\n var focus = edge.getModel().get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = {\r\n edge: [edge.dataIndex],\r\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\r\n };\r\n }\r\n });\r\n var circularRotateLabel = seriesModel.get('layout') === 'circular'\r\n && seriesModel.get(['circular', 'rotateLabel']);\r\n var cx = data.getLayout('cx');\r\n var cy = data.getLayout('cy');\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelRotate = itemModel.get(['label', 'rotate']) || 0;\r\n var symbolPath = el.getSymbolPath();\r\n if (circularRotateLabel) {\r\n var pos = data.getItemLayout(idx);\r\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n var isLeft = pos[0] < cx;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n symbolPath.setTextConfig({\r\n rotation: -rad,\r\n position: textPosition,\r\n origin: 'center'\r\n });\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\r\n position: textPosition\r\n });\r\n }\r\n else {\r\n symbolPath.setTextConfig({\r\n rotation: labelRotate *= Math.PI / 180\r\n });\r\n }\r\n });\r\n this._firstRender = false;\r\n };\r\n GraphView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\r\n var self = this;\r\n (function step() {\r\n forceLayout.step(function (stopped) {\r\n self.updateLayout(self._model);\r\n (self._layouting = !stopped) && (layoutAnimation\r\n ? (self._layoutTimeout = setTimeout(step, 16))\r\n : step());\r\n });\r\n })();\r\n };\r\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\r\n controller.disable();\r\n return;\r\n }\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale();\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n _this._lineDraw.updateLayout();\r\n api.updateLabelLayout();\r\n });\r\n };\r\n GraphView.prototype._updateNodeAndLinkScale = function () {\r\n var seriesModel = this._model;\r\n var data = seriesModel.getData();\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n GraphView.prototype.updateLayout = function (seriesModel) {\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n this._symbolDraw.updateLayout();\r\n this._lineDraw.updateLayout();\r\n };\r\n GraphView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove();\r\n this._lineDraw && this._lineDraw.remove();\r\n };\r\n GraphView.type = 'graph';\r\n return GraphView;\r\n}(ChartView));\r\nChartView.registerClass(GraphView);\n\nregisterAction({\r\n type: 'focusNodeAdjacency',\r\n event: 'focusNodeAdjacency',\r\n update: 'series:focusNodeAdjacency'\r\n}, function () { });\r\nregisterAction({\r\n type: 'unfocusNodeAdjacency',\r\n event: 'unfocusNodeAdjacency',\r\n update: 'series:unfocusNodeAdjacency'\r\n}, function () { });\n\nvar actionInfo = {\r\n type: 'graphRoam',\r\n event: 'graphRoam',\r\n update: 'none'\r\n};\r\nregisterAction(actionInfo, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n});\n\nfunction categoryFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var categoriesData = graphSeries.getCategoriesData();\r\n var graph = graphSeries.getGraph();\r\n var data = graph.data;\r\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n data.filterSelf(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var category = model.getShallow('category');\r\n if (category != null) {\r\n if (typeof category === 'number') {\r\n category = categoryNames[category];\r\n }\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n });\r\n}\n\nfunction categoryVisual(ecModel) {\r\n var paletteScope = {};\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var categoriesData = seriesModel.getCategoriesData();\r\n var data = seriesModel.getData();\r\n var categoryNameIdxMap = {};\r\n categoriesData.each(function (idx) {\r\n var name = categoriesData.getName(idx);\r\n categoryNameIdxMap['ec-' + name] = idx;\r\n var itemModel = categoriesData.getItemModel(idx);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\r\n }\r\n categoriesData.setItemVisual(idx, 'style', style);\r\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < symbolVisualList.length; i++) {\r\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\r\n if (symbolVisual != null) {\r\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\r\n }\r\n }\r\n });\r\n if (categoriesData.count()) {\r\n data.each(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var categoryIdx = model.getShallow('category');\r\n if (categoryIdx != null) {\r\n if (typeof categoryIdx === 'string') {\r\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\r\n }\r\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\r\n var style = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(style, categoryStyle);\r\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < visualList.length; i++) {\r\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\n\nfunction normalize$2(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\nfunction graphEdgeVisual(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var edgeData = seriesModel.getEdgeData();\r\n var symbolType = normalize$2(seriesModel.get('edgeSymbol'));\r\n var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize'));\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n edgeData.each(function (idx) {\r\n var itemModel = edgeData.getItemModel(idx);\r\n var edge = graph.getEdgeByIndex(idx);\r\n var symbolType = normalize$2(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true));\r\n var style = itemModel.getModel('lineStyle').getLineStyle();\r\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n switch (existsStyle.stroke) {\r\n case 'source': {\r\n var nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n case 'target': {\r\n var nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n}\n\nfunction simpleLayout(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var graph = seriesModel.getGraph();\r\n graph.eachNode(function (node) {\r\n var model = node.getModel();\r\n node.setLayout([+model.get('x'), +model.get('y')]);\r\n });\r\n simpleLayoutEdge(graph, seriesModel);\r\n}\r\nfunction simpleLayoutEdge(graph, seriesModel) {\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var points = [p1, p2];\r\n if (+curveness) {\r\n points.push([\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness\r\n ]);\r\n }\r\n edge.setLayout(points);\r\n });\r\n}\n\nfunction graphSimpleLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var layout = seriesModel.get('layout');\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n var data_1 = seriesModel.getData();\r\n var dimensions_1 = [];\r\n each(coordSys.dimensions, function (coordDim) {\r\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\r\n });\r\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\r\n var value = [];\r\n var hasValue = false;\r\n for (var i = 0; i < dimensions_1.length; i++) {\r\n var val = data_1.get(dimensions_1[i], dataIndex);\r\n if (!isNaN(val)) {\r\n hasValue = true;\r\n }\r\n value.push(val);\r\n }\r\n if (hasValue) {\r\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\r\n }\r\n else {\r\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\r\n }\r\n }\r\n simpleLayoutEdge(data_1.graph, seriesModel);\r\n }\r\n else if (!layout || layout === 'none') {\r\n simpleLayout(seriesModel);\r\n }\r\n });\r\n}\n\nvar PI$7 = Math.PI;\r\nvar _symbolRadiansHalf = [];\r\nfunction circularLayout(seriesModel, basedOn) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var rect = coordSys.getBoundingRect();\r\n var nodeData = seriesModel.getData();\r\n var graph = nodeData.graph;\r\n var cx = rect.width / 2 + rect.x;\r\n var cy = rect.height / 2 + rect.y;\r\n var r = Math.min(rect.width, rect.height) / 2;\r\n var count = nodeData.count();\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n if (!count) {\r\n return;\r\n }\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var cp1;\r\n var x12 = (p1[0] + p2[0]) / 2;\r\n var y12 = (p1[1] + p2[1]) / 2;\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [\r\n cx * curveness + x12 * (1 - curveness),\r\n cy * curveness + y12 * (1 - curveness)\r\n ];\r\n }\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n}\r\nvar _layoutNodesBasedOn = {\r\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var angle = 0;\r\n var sum = nodeData.getSum('value');\r\n var unitAngle = Math.PI * 2 / (sum || count);\r\n graph.eachNode(function (node) {\r\n var value = node.getValue('value');\r\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n },\r\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n graph.eachNode(function (node) {\r\n var symbolSize = getSymbolSize(node);\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n symbolSize *= nodeScale;\r\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$7 / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n var halfRemainRadian = (2 * PI$7 - sumRadian) / count / 2;\r\n var angle = 0;\r\n graph.eachNode(function (node) {\r\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n }\r\n};\n\nfunction graphCircularLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n if (seriesModel.get('layout') === 'circular') {\r\n circularLayout(seriesModel, 'symbolSize');\r\n }\r\n });\r\n}\n\nvar scaleAndAdd$1 = scaleAndAdd;\r\nfunction forceLayout(inNodes, inEdges, opts) {\r\n var nodes = inNodes;\r\n var edges = inEdges;\r\n var rect = opts.rect;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var center = [rect.x + width / 2, rect.y + height / 2];\r\n var gravity = opts.gravity == null ? 0.1 : opts.gravity;\r\n for (var i = 0; i < nodes.length; i++) {\r\n var n = nodes[i];\r\n if (!n.p) {\r\n n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\r\n }\r\n n.pp = clone$1(n.p);\r\n n.edges = null;\r\n }\r\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\r\n var friction = initialFriction;\r\n var beforeStepCallback;\r\n var afterStepCallback;\r\n return {\r\n warmUp: function () {\r\n friction = initialFriction * 0.8;\r\n },\r\n setFixed: function (idx) {\r\n nodes[idx].fixed = true;\r\n },\r\n setUnfixed: function (idx) {\r\n nodes[idx].fixed = false;\r\n },\r\n beforeStep: function (cb) {\r\n beforeStepCallback = cb;\r\n },\r\n afterStep: function (cb) {\r\n afterStepCallback = cb;\r\n },\r\n step: function (cb) {\r\n beforeStepCallback && beforeStepCallback(nodes, edges);\r\n var v12 = [];\r\n var nLen = nodes.length;\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n if (e.ignoreForceLayout) {\r\n continue;\r\n }\r\n var n1 = e.n1;\r\n var n2 = e.n2;\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12) - e.d;\r\n var w = n2.w / (n1.w + n2.w);\r\n if (isNaN(w)) {\r\n w = 0;\r\n }\r\n normalize(v12, v12);\r\n !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction);\r\n !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction);\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v12, center, n.p);\r\n scaleAndAdd$1(n.p, n.p, v12, gravity * friction);\r\n }\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n1 = nodes[i];\r\n for (var j = i + 1; j < nLen; j++) {\r\n var n2 = nodes[j];\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12);\r\n if (d === 0) {\r\n set(v12, Math.random() - 0.5, Math.random() - 0.5);\r\n d = 1;\r\n }\r\n var repFact = (n1.rep + n2.rep) / d / d;\r\n !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact);\r\n !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact);\r\n }\r\n }\r\n var v = [];\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v, n.p, n.pp);\r\n scaleAndAdd$1(n.p, n.p, v, friction);\r\n copy(n.pp, n.p);\r\n }\r\n }\r\n friction = friction * 0.992;\r\n var finished = friction < 0.01;\r\n afterStepCallback && afterStepCallback(nodes, edges, finished);\r\n cb && cb(finished);\r\n }\r\n };\r\n}\n\nfunction graphForceLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var coordSys = graphSeries.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n if (graphSeries.get('layout') === 'force') {\r\n var preservedPoints_1 = graphSeries.preservedPoints || {};\r\n var graph_1 = graphSeries.getGraph();\r\n var nodeData_1 = graph_1.data;\r\n var edgeData = graph_1.edgeData;\r\n var forceModel = graphSeries.getModel('force');\r\n var initLayout = forceModel.get('initLayout');\r\n if (graphSeries.preservedPoints) {\r\n nodeData_1.each(function (idx) {\r\n var id = nodeData_1.getId(idx);\r\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\r\n });\r\n }\r\n else if (!initLayout || initLayout === 'none') {\r\n simpleLayout(graphSeries);\r\n }\r\n else if (initLayout === 'circular') {\r\n circularLayout(graphSeries, 'value');\r\n }\r\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\r\n var edgeDataExtent_1 = edgeData.getDataExtent('value');\r\n var repulsion = forceModel.get('repulsion');\r\n var edgeLength = forceModel.get('edgeLength');\r\n var repulsionArr_1 = isArray(repulsion)\r\n ? repulsion : [repulsion, repulsion];\r\n var edgeLengthArr_1 = isArray(edgeLength)\r\n ? edgeLength : [edgeLength, edgeLength];\r\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\r\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\r\n var point = nodeData_1.getItemLayout(idx);\r\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\r\n if (isNaN(rep)) {\r\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\r\n }\r\n return {\r\n w: rep,\r\n rep: rep,\r\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\r\n p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point\r\n };\r\n });\r\n var edges = edgeData.mapArray('value', function (value, idx) {\r\n var edge = graph_1.getEdgeByIndex(idx);\r\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\r\n if (isNaN(d)) {\r\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\r\n }\r\n var edgeModel = edge.getModel();\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\r\n return {\r\n n1: nodes_1[edge.node1.dataIndex],\r\n n2: nodes_1[edge.node2.dataIndex],\r\n d: d,\r\n curveness: curveness,\r\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\r\n };\r\n });\r\n var rect = coordSys.getBoundingRect();\r\n var forceInstance = forceLayout(nodes_1, edges, {\r\n rect: rect,\r\n gravity: forceModel.get('gravity'),\r\n friction: forceModel.get('friction')\r\n });\r\n forceInstance.beforeStep(function (nodes, edges) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (nodes[i].fixed) {\r\n copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\r\n }\r\n }\r\n });\r\n forceInstance.afterStep(function (nodes, edges, stopped) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (!nodes[i].fixed) {\r\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\r\n }\r\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\r\n }\r\n for (var i = 0, l = edges.length; i < l; i++) {\r\n var e = edges[i];\r\n var edge = graph_1.getEdgeByIndex(i);\r\n var p1 = e.n1.p;\r\n var p2 = e.n2.p;\r\n var points = edge.getLayout();\r\n points = points ? points.slice() : [];\r\n points[0] = points[0] || [];\r\n points[1] = points[1] || [];\r\n copy(points[0], p1);\r\n copy(points[1], p2);\r\n if (+e.curveness) {\r\n points[2] = [\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness\r\n ];\r\n }\r\n edge.setLayout(points);\r\n }\r\n });\r\n graphSeries.forceLayout = forceInstance;\r\n graphSeries.preservedPoints = preservedPoints_1;\r\n forceInstance.step();\r\n }\r\n else {\r\n graphSeries.forceLayout = null;\r\n }\r\n });\r\n}\n\nfunction getViewRect$2(seriesModel, api, aspect) {\r\n var option = extend(seriesModel.getBoxLayoutParams(), {\r\n aspect: aspect\r\n });\r\n return getLayoutRect(option, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction createViewCoordSys(ecModel, api) {\r\n var viewList = [];\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var coordSysType = seriesModel.get('coordinateSystem');\r\n if (!coordSysType || coordSysType === 'view') {\r\n var data_1 = seriesModel.getData();\r\n var positions = data_1.mapArray(function (idx) {\r\n var itemModel = data_1.getItemModel(idx);\r\n return [+itemModel.get('x'), +itemModel.get('y')];\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(positions, min, max);\r\n if (max[0] - min[0] === 0) {\r\n max[0] += 1;\r\n min[0] -= 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n max[1] += 1;\r\n min[1] -= 1;\r\n }\r\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\r\n var viewRect = getViewRect$2(seriesModel, api, aspect);\r\n if (isNaN(aspect)) {\r\n min = [viewRect.x, viewRect.y];\r\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\r\n }\r\n var bbWidth = max[0] - min[0];\r\n var bbHeight = max[1] - min[1];\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\r\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n viewList.push(viewCoordSys);\r\n }\r\n });\r\n return viewList;\r\n}\n\nregisterProcessor(categoryFilter);\r\nregisterVisual(categoryVisual);\r\nregisterVisual(graphEdgeVisual);\r\nregisterLayout(graphSimpleLayout);\r\nregisterLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);\r\nregisterLayout(graphForceLayout);\r\nregisterCoordinateSystem('graphView', {\r\n dimensions: View.dimensions,\r\n create: createViewCoordSys\r\n});\n\nvar GaugeSeriesModel = (function (_super) {\r\n __extends(GaugeSeriesModel, _super);\r\n function GaugeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeSeriesModel.type;\r\n _this.visualStyleAccessPath = 'itemStyle';\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, ['value']);\r\n };\r\n GaugeSeriesModel.type = 'series.gauge';\r\n GaugeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n legendHoverLink: true,\r\n radius: '75%',\r\n startAngle: 225,\r\n endAngle: -45,\r\n clockwise: true,\r\n min: 0,\r\n max: 100,\r\n splitNumber: 10,\r\n axisLine: {\r\n show: true,\r\n roundCap: false,\r\n lineStyle: {\r\n color: [[1, '#E6EBF8']],\r\n width: 10\r\n }\r\n },\r\n progress: {\r\n show: false,\r\n overlap: true,\r\n width: 10,\r\n roundCap: false,\r\n clip: true\r\n },\r\n splitLine: {\r\n show: true,\r\n length: 10,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 3,\r\n type: 'solid'\r\n }\r\n },\r\n axisTick: {\r\n show: true,\r\n splitNumber: 5,\r\n length: 6,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n distance: 15,\r\n color: '#464646',\r\n fontSize: 12\r\n },\r\n pointer: {\r\n icon: null,\r\n offsetCenter: [0, 0],\r\n show: true,\r\n length: '60%',\r\n width: 6,\r\n keepAspect: false\r\n },\r\n anchor: {\r\n show: false,\r\n showAbove: false,\r\n size: 6,\r\n icon: 'circle',\r\n offsetCenter: [0, 0],\r\n keepAspect: false,\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 0,\r\n borderColor: '#5470c6'\r\n }\r\n },\r\n title: {\r\n show: true,\r\n offsetCenter: [0, '20%'],\r\n color: '#464646',\r\n fontSize: 16,\r\n valueAnimation: false\r\n },\r\n detail: {\r\n show: true,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 0,\r\n borderColor: '#ccc',\r\n width: 100,\r\n height: null,\r\n padding: [5, 10],\r\n offsetCenter: [0, '40%'],\r\n color: '#464646',\r\n fontSize: 30,\r\n fontWeight: 'bold',\r\n lineHeight: 30,\r\n valueAnimation: false\r\n }\r\n };\r\n return GaugeSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(GaugeSeriesModel);\n\nvar PointerShape = (function () {\r\n function PointerShape() {\r\n this.angle = 0;\r\n this.width = 10;\r\n this.r = 10;\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n return PointerShape;\r\n}());\r\nvar PointerPath = (function (_super) {\r\n __extends(PointerPath, _super);\r\n function PointerPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'pointer';\r\n return _this;\r\n }\r\n PointerPath.prototype.getDefaultShape = function () {\r\n return new PointerShape();\r\n };\r\n PointerPath.prototype.buildPath = function (ctx, shape) {\r\n var mathCos = Math.cos;\r\n var mathSin = Math.sin;\r\n var r = shape.r;\r\n var width = shape.width;\r\n var angle = shape.angle;\r\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\r\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\r\n angle = shape.angle - Math.PI / 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\r\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\r\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\r\n ctx.lineTo(x, y);\r\n };\r\n return PointerPath;\r\n}(Path));\n\nfunction parsePosition(seriesModel, api) {\r\n var center = seriesModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], api.getWidth());\r\n var cy = parsePercent$2(center[1], api.getHeight());\r\n var r = parsePercent$2(seriesModel.get('radius'), size / 2);\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r: r\r\n };\r\n}\r\nfunction formatLabel(value, labelFormatter) {\r\n var label = value == null ? '' : (value + '');\r\n if (labelFormatter) {\r\n if (typeof labelFormatter === 'string') {\r\n label = labelFormatter.replace('{value}', label);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n label = labelFormatter(value);\r\n }\r\n }\r\n return label;\r\n}\r\nvar PI2$9 = Math.PI * 2;\r\nvar GaugeView = (function (_super) {\r\n __extends(GaugeView, _super);\r\n function GaugeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeView.type;\r\n return _this;\r\n }\r\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\r\n var posInfo = parsePosition(seriesModel, api);\r\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\r\n this._data = seriesModel.getData();\r\n };\r\n GaugeView.prototype.dispose = function () { };\r\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\r\n var group = this.group;\r\n var clockwise = seriesModel.get('clockwise');\r\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\r\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\r\n var axisLineModel = seriesModel.getModel('axisLine');\r\n var roundCap = axisLineModel.get('roundCap');\r\n var MainPath = roundCap ? SausagePath : Sector;\r\n var showAxis = axisLineModel.get('show');\r\n var lineStyleModel = axisLineModel.getModel('lineStyle');\r\n var axisLineWidth = lineStyleModel.get('width');\r\n var angleRangeSpan = !((endAngle - startAngle) % PI2$9) && endAngle !== startAngle\r\n ? PI2$9 : (endAngle - startAngle) % PI2$9;\r\n var prevEndAngle = startAngle;\r\n for (var i = 0; showAxis && i < colorList.length; i++) {\r\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\r\n endAngle = startAngle + angleRangeSpan * percent;\r\n var sector = new MainPath({\r\n shape: {\r\n startAngle: prevEndAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: posInfo.r - axisLineWidth,\r\n r: posInfo.r\r\n },\r\n silent: true\r\n });\r\n sector.setStyle({\r\n fill: colorList[i][1]\r\n });\r\n sector.setStyle(lineStyleModel.getLineStyle(['color', 'width']));\r\n group.add(sector);\r\n prevEndAngle = endAngle;\r\n }\r\n var getColor = function (percent) {\r\n if (percent <= 0) {\r\n return colorList[0][1];\r\n }\r\n var i;\r\n for (i = 0; i < colorList.length; i++) {\r\n if (colorList[i][0] >= percent\r\n && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\r\n return colorList[i][1];\r\n }\r\n }\r\n return colorList[i - 1][1];\r\n };\r\n if (!clockwise) {\r\n var tmp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp;\r\n }\r\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\r\n this._renderAnchor(seriesModel, posInfo);\r\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n };\r\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var cx = posInfo.cx;\r\n var cy = posInfo.cy;\r\n var r = posInfo.r;\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var splitLineModel = seriesModel.getModel('splitLine');\r\n var tickModel = seriesModel.getModel('axisTick');\r\n var labelModel = seriesModel.getModel('axisLabel');\r\n var splitNumber = seriesModel.get('splitNumber');\r\n var subSplitNumber = tickModel.get('splitNumber');\r\n var splitLineLen = parsePercent$2(splitLineModel.get('length'), r);\r\n var tickLen = parsePercent$2(tickModel.get('length'), r);\r\n var angle = startAngle;\r\n var step = (endAngle - startAngle) / splitNumber;\r\n var subStep = step / subSplitNumber;\r\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\r\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\r\n var splitLineDistance = splitLineModel.get('distance');\r\n var unitX;\r\n var unitY;\r\n for (var i = 0; i <= splitNumber; i++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n if (splitLineModel.get('show')) {\r\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\r\n var splitLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - splitLineLen - distance) + cx,\r\n y2: unitY * (r - splitLineLen - distance) + cy\r\n },\r\n style: splitLineStyle,\r\n silent: true\r\n });\r\n if (splitLineStyle.stroke === 'auto') {\r\n splitLine.setStyle({\r\n stroke: getColor(i / splitNumber)\r\n });\r\n }\r\n group.add(splitLine);\r\n }\r\n if (labelModel.get('show')) {\r\n var distance = labelModel.get('distance') + splitLineDistance;\r\n var label = formatLabel(round$1(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\r\n var autoColor = getColor(i / splitNumber);\r\n group.add(new ZRText({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: unitX * (r - splitLineLen - distance) + cx,\r\n y: unitY * (r - splitLineLen - distance) + cy,\r\n verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'),\r\n align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true\r\n }));\r\n }\r\n if (tickModel.get('show') && i !== splitNumber) {\r\n var distance = tickModel.get('distance');\r\n distance = distance ? distance + axisLineWidth : axisLineWidth;\r\n for (var j = 0; j <= subSplitNumber; j++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n var tickLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - tickLen - distance) + cx,\r\n y2: unitY * (r - tickLen - distance) + cy\r\n },\r\n silent: true,\r\n style: tickLineStyle\r\n });\r\n if (tickLineStyle.stroke === 'auto') {\r\n tickLine.setStyle({\r\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\r\n });\r\n }\r\n group.add(tickLine);\r\n angle += subStep;\r\n }\r\n angle -= subStep;\r\n }\r\n else {\r\n angle += step;\r\n }\r\n }\r\n };\r\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n var oldProgressData = this._progressEls;\r\n var progressList = [];\r\n var showPointer = seriesModel.get(['pointer', 'show']);\r\n var progressModel = seriesModel.getModel('progress');\r\n var showProgress = progressModel.get('show');\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var valueExtent = [minVal, maxVal];\r\n var angleExtent = [startAngle, endAngle];\r\n function createPointer(idx, angle) {\r\n var itemModel = data.getItemModel(idx);\r\n var pointerModel = itemModel.getModel('pointer');\r\n var pointerWidth = parsePercent$2(pointerModel.get('width'), posInfo.r);\r\n var pointerLength = parsePercent$2(pointerModel.get('length'), posInfo.r);\r\n var pointerStr = seriesModel.get(['pointer', 'icon']);\r\n var pointerOffset = pointerModel.get('offsetCenter');\r\n var pointerKeepAspect = pointerModel.get('keepAspect');\r\n var pointer;\r\n if (pointerStr) {\r\n pointer = createSymbol(pointerStr, parsePercent$2(pointerOffset[0], posInfo.r) - pointerWidth / 2, parsePercent$2(pointerOffset[1], posInfo.r) - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\r\n }\r\n else {\r\n pointer = new PointerPath({\r\n shape: {\r\n angle: -Math.PI / 2,\r\n width: parsePercent$2(pointerModel.get('width'), posInfo.r),\r\n r: parsePercent$2(pointerModel.get('length'), posInfo.r)\r\n }\r\n });\r\n }\r\n pointer.rotation = -(angle + Math.PI / 2);\r\n pointer.x = posInfo.cx;\r\n pointer.y = posInfo.cy;\r\n return pointer;\r\n }\r\n function createProgress(idx, endAngle) {\r\n var roundCap = progressModel.get('roundCap');\r\n var ProgressPath = roundCap ? SausagePath : Sector;\r\n var isOverlap = progressModel.get('overlap');\r\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\r\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\r\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\r\n var progress = new ProgressPath({\r\n shape: {\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: r0,\r\n r: r\r\n }\r\n });\r\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\r\n return progress;\r\n }\r\n if (showProgress || showPointer) {\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n if (showPointer) {\r\n var pointer = createPointer(idx, startAngle);\r\n initProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(idx, pointer);\r\n }\r\n if (showProgress) {\r\n var progress = createProgress(idx, startAngle);\r\n var isClip = progressModel.get('clip');\r\n initProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[idx] = progress;\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n if (showPointer) {\r\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\r\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\r\n var pointer = createPointer(newIdx, previousRotate);\r\n pointer.rotation = previousRotate;\r\n updateProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(newIdx, pointer);\r\n }\r\n if (showProgress) {\r\n var previousProgress = oldProgressData[oldIdx];\r\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\r\n var progress = createProgress(newIdx, previousEndAngle);\r\n var isClip = progressModel.get('clip');\r\n updateProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[newIdx] = progress;\r\n }\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n if (showPointer) {\r\n var pointer = data.getItemGraphicEl(idx);\r\n pointer.useStyle(data.getItemVisual(idx, 'style'));\r\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\r\n if (pointer.style.fill === 'auto') {\r\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\r\n }\r\n pointer.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(pointer, itemModel);\r\n enableHoverEmphasis(pointer, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n if (showProgress) {\r\n var progress = progressList[idx];\r\n progress.useStyle(data.getItemVisual(idx, 'style'));\r\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\r\n progress.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(progress, itemModel);\r\n enableHoverEmphasis(progress, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n });\r\n this._progressEls = progressList;\r\n }\r\n };\r\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\r\n var anchorModel = seriesModel.getModel('anchor');\r\n var showAnchor = anchorModel.get('show');\r\n if (showAnchor) {\r\n var anchorSize = anchorModel.get('size');\r\n var anchorType = anchorModel.get('icon');\r\n var offsetCenter = anchorModel.get('offsetCenter');\r\n var anchorKeepAspect = anchorModel.get('keepAspect');\r\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$2(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$2(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\r\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\r\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\r\n this.group.add(anchor);\r\n }\r\n };\r\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\r\n var _this = this;\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var contentGroup = new Group();\r\n var newTitleEls = [];\r\n var newDetailEls = [];\r\n var hasAnimation = seriesModel.isAnimationEnabled();\r\n data.diff(this._data)\r\n .add(function (idx) {\r\n newTitleEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n newDetailEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n })\r\n .update(function (idx, oldIdx) {\r\n newTitleEls[idx] = _this._titleEls[oldIdx];\r\n newDetailEls[idx] = _this._detailEls[oldIdx];\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var value = data.get(valueDim, idx);\r\n var itemGroup = new Group();\r\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\r\n var itemTitleModel = itemModel.getModel('title');\r\n if (itemTitleModel.get('show')) {\r\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\r\n var titleX = posInfo.cx + parsePercent$2(titleOffsetCenter[0], posInfo.r);\r\n var titleY = posInfo.cy + parsePercent$2(titleOffsetCenter[1], posInfo.r);\r\n var labelEl = newTitleEls[idx];\r\n labelEl.attr({\r\n style: createTextStyle(itemTitleModel, {\r\n x: titleX,\r\n y: titleY,\r\n text: data.getName(idx),\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: autoColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemTitleModel }, seriesModel.getRawValue(idx), function () { return data.getName(idx); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n var itemDetailModel = itemModel.getModel('detail');\r\n if (itemDetailModel.get('show')) {\r\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\r\n var detailX = posInfo.cx + parsePercent$2(detailOffsetCenter[0], posInfo.r);\r\n var detailY = posInfo.cy + parsePercent$2(detailOffsetCenter[1], posInfo.r);\r\n var width = parsePercent$2(itemDetailModel.get('width'), posInfo.r);\r\n var height = parsePercent$2(itemDetailModel.get('height'), posInfo.r);\r\n var detailColor = (seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor);\r\n var labelEl = newDetailEls[idx];\r\n var formatter_1 = itemDetailModel.get('formatter');\r\n labelEl.attr({\r\n style: createTextStyle(itemDetailModel, {\r\n x: detailX,\r\n y: detailY,\r\n text: formatLabel(value, formatter_1),\r\n width: isNaN(width) ? null : width,\r\n height: isNaN(height) ? null : height,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: detailColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemDetailModel }, seriesModel.getRawValue(idx), function (value) { return formatLabel(value, formatter_1); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n contentGroup.add(itemGroup);\r\n });\r\n this.group.add(contentGroup);\r\n this._titleEls = newTitleEls;\r\n this._detailEls = newDetailEls;\r\n };\r\n GaugeView.type = 'gauge';\r\n return GaugeView;\r\n}(ChartView));\r\nChartView.registerClass(GaugeView);\n\nvar FunnelSeriesModel = (function (_super) {\r\n __extends(FunnelSeriesModel, _super);\r\n function FunnelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n FunnelSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueDim = data.mapDimension('value');\r\n var sum = data.getSum(valueDim);\r\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n FunnelSeriesModel.type = 'series.funnel';\r\n FunnelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n minSize: '0%',\r\n maxSize: '100%',\r\n sort: 'descending',\r\n orient: 'vertical',\r\n gap: 0,\r\n funnelAlign: 'center',\r\n label: {\r\n show: true,\r\n position: 'outer'\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 20,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n itemStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return FunnelSeriesModel;\r\n}(SeriesModel));\r\nComponentModel.registerClass(FunnelSeriesModel);\n\nvar opacityAccessPath = ['itemStyle', 'opacity'];\r\nvar FunnelPiece = (function (_super) {\r\n __extends(FunnelPiece, _super);\r\n function FunnelPiece(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var polygon = _this;\r\n var labelLine = new Polyline();\r\n var text = new ZRText();\r\n polygon.setTextContent(text);\r\n _this.setTextGuideLine(labelLine);\r\n _this.updateData(data, idx, true);\r\n return _this;\r\n }\r\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\r\n var polygon = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var opacity = itemModel.get(opacityAccessPath);\r\n opacity = opacity == null ? 1 : opacity;\r\n polygon.useStyle(data.getItemVisual(idx, 'style'));\r\n polygon.style.lineJoin = 'round';\r\n if (firstCreate) {\r\n polygon.setShape({\r\n points: layout.points\r\n });\r\n polygon.style.opacity = 0;\r\n initProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n updateProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n },\r\n shape: {\r\n points: layout.points\r\n }\r\n }, seriesModel, idx);\r\n }\r\n setStatesStylesFromModel(polygon, itemModel);\r\n this._updateLabel(data, idx);\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n FunnelPiece.prototype._updateLabel = function (data, idx) {\r\n var polygon = this;\r\n var labelLine = this.getTextGuideLine();\r\n var labelText = polygon.getTextContent();\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var labelLayout = layout.label;\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style.fill;\r\n setLabelStyle(labelText, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: data.getName(idx)\r\n }, { normal: {\r\n align: labelLayout.textAlign,\r\n verticalAlign: labelLayout.verticalAlign\r\n } });\r\n polygon.setTextConfig({\r\n local: true,\r\n inside: !!labelLayout.inside,\r\n insideStroke: visualColor,\r\n outsideFill: visualColor\r\n });\r\n var linePoints = labelLayout.linePoints;\r\n labelLine.setShape({\r\n points: linePoints\r\n });\r\n polygon.textGuideLineConfig = {\r\n anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null\r\n };\r\n updateProps(labelText, {\r\n style: {\r\n x: labelLayout.x,\r\n y: labelLayout.y\r\n }\r\n }, seriesModel, idx);\r\n labelText.attr({\r\n rotation: labelLayout.rotation,\r\n originX: labelLayout.x,\r\n originY: labelLayout.y,\r\n z2: 10\r\n });\r\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor\r\n });\r\n };\r\n return FunnelPiece;\r\n}(Polygon));\r\nvar FunnelView = (function (_super) {\r\n __extends(FunnelView, _super);\r\n function FunnelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelView.type;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var funnelPiece = new FunnelPiece(data, idx);\r\n data.setItemGraphicEl(idx, funnelPiece);\r\n group.add(funnelPiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piece = oldData.getItemGraphicEl(oldIdx);\r\n piece.updateData(data, newIdx);\r\n group.add(piece);\r\n data.setItemGraphicEl(newIdx, piece);\r\n })\r\n .remove(function (idx) {\r\n var piece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piece, seriesModel, idx);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n FunnelView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n FunnelView.prototype.dispose = function () { };\r\n FunnelView.type = 'funnel';\r\n return FunnelView;\r\n}(ChartView));\r\nChartView.registerClass(FunnelView);\n\nfunction getViewRect$3(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction getSortedIndices(data, sort) {\r\n var valueDim = data.mapDimension('value');\r\n var valueArr = data.mapArray(valueDim, function (val) {\r\n return val;\r\n });\r\n var indices = [];\r\n var isAscending = sort === 'ascending';\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n indices[i] = i;\r\n }\r\n if (typeof sort === 'function') {\r\n indices.sort(sort);\r\n }\r\n else if (sort !== 'none') {\r\n indices.sort(function (a, b) {\r\n return isAscending\r\n ? valueArr[a] - valueArr[b]\r\n : valueArr[b] - valueArr[a];\r\n });\r\n }\r\n return indices;\r\n}\r\nfunction labelLayout(data) {\r\n var seriesModel = data.hostModel;\r\n var orient = seriesModel.get('orient');\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var layout = data.getItemLayout(idx);\r\n var points = layout.points;\r\n var isLabelInside = labelPosition === 'inner'\r\n || labelPosition === 'inside' || labelPosition === 'center'\r\n || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\r\n var textAlign;\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n if (isLabelInside) {\r\n if (labelPosition === 'insideLeft') {\r\n textX = (points[0][0] + points[3][0]) / 2 + 5;\r\n textY = (points[0][1] + points[3][1]) / 2;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'insideRight') {\r\n textX = (points[1][0] + points[2][0]) / 2 - 5;\r\n textY = (points[1][1] + points[2][1]) / 2;\r\n textAlign = 'right';\r\n }\r\n else {\r\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\r\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\r\n textAlign = 'center';\r\n }\r\n linePoints = [\r\n [textX, textY], [textX, textY]\r\n ];\r\n }\r\n else {\r\n var x1 = void 0;\r\n var y1 = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var labelLineLen = labelLineModel.get('length');\r\n if (__DEV__) {\r\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'left';\r\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\r\n }\r\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'bottom';\r\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\r\n }\r\n }\r\n if (labelPosition === 'left') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n else if (labelPosition === 'right') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'top') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'bottom') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'rightTop') {\r\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\r\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'top';\r\n }\r\n }\r\n else if (labelPosition === 'rightBottom') {\r\n x1 = points[2][0];\r\n y1 = points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'bottom';\r\n }\r\n }\r\n else if (labelPosition === 'leftTop') {\r\n x1 = points[0][0];\r\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (labelPosition === 'leftBottom') {\r\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\r\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n }\r\n if (orient === 'horizontal') {\r\n x2 = x1;\r\n textX = x2;\r\n }\r\n else {\r\n y2 = y1;\r\n textY = y2;\r\n }\r\n linePoints = [[x1, y1], [x2, y2]];\r\n }\r\n layout.label = {\r\n linePoints: linePoints,\r\n x: textX,\r\n y: textY,\r\n verticalAlign: 'middle',\r\n textAlign: textAlign,\r\n inside: isLabelInside\r\n };\r\n });\r\n}\r\nfunction funnelLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var sort = seriesModel.get('sort');\r\n var viewRect = getViewRect$3(seriesModel, api);\r\n var orient = seriesModel.get('orient');\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var indices = getSortedIndices(data, sort);\r\n var x = viewRect.x;\r\n var y = viewRect.y;\r\n var sizeExtent = orient === 'horizontal' ? [\r\n parsePercent$2(seriesModel.get('minSize'), viewHeight),\r\n parsePercent$2(seriesModel.get('maxSize'), viewHeight)\r\n ] : [\r\n parsePercent$2(seriesModel.get('minSize'), viewWidth),\r\n parsePercent$2(seriesModel.get('maxSize'), viewWidth)\r\n ];\r\n var dataExtent = data.getDataExtent(valueDim);\r\n var min = seriesModel.get('min');\r\n var max = seriesModel.get('max');\r\n if (min == null) {\r\n min = Math.min(dataExtent[0], 0);\r\n }\r\n if (max == null) {\r\n max = dataExtent[1];\r\n }\r\n var funnelAlign = seriesModel.get('funnelAlign');\r\n var gap = seriesModel.get('gap');\r\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\r\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\r\n var getLinePoints = function (idx, offset) {\r\n if (orient === 'horizontal') {\r\n var val_1 = data.get(valueDim, idx) || 0;\r\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\r\n var y0 = void 0;\r\n switch (funnelAlign) {\r\n case 'top':\r\n y0 = y;\r\n break;\r\n case 'center':\r\n y0 = y + (viewHeight - itemHeight) / 2;\r\n break;\r\n case 'bottom':\r\n y0 = y + (viewHeight - itemHeight);\r\n break;\r\n }\r\n return [\r\n [offset, y0],\r\n [offset, y0 + itemHeight]\r\n ];\r\n }\r\n var val = data.get(valueDim, idx) || 0;\r\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\r\n var x0;\r\n switch (funnelAlign) {\r\n case 'left':\r\n x0 = x;\r\n break;\r\n case 'center':\r\n x0 = x + (viewWidth - itemWidth) / 2;\r\n break;\r\n case 'right':\r\n x0 = x + viewWidth - itemWidth;\r\n break;\r\n }\r\n return [\r\n [x0, offset],\r\n [x0 + itemWidth, offset]\r\n ];\r\n };\r\n if (sort === 'ascending') {\r\n itemSize = -itemSize;\r\n gap = -gap;\r\n if (orient === 'horizontal') {\r\n x += viewWidth;\r\n }\r\n else {\r\n y += viewHeight;\r\n }\r\n indices = indices.reverse();\r\n }\r\n for (var i = 0; i < indices.length; i++) {\r\n var idx = indices[i];\r\n var nextIdx = indices[i + 1];\r\n var itemModel = data.getItemModel(idx);\r\n if (orient === 'horizontal') {\r\n var width = itemModel.get(['itemStyle', 'width']);\r\n if (width == null) {\r\n width = itemSize;\r\n }\r\n else {\r\n width = parsePercent$2(width, viewWidth);\r\n if (sort === 'ascending') {\r\n width = -width;\r\n }\r\n }\r\n var start = getLinePoints(idx, x);\r\n var end = getLinePoints(nextIdx, x + width);\r\n x += width + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n else {\r\n var height = itemModel.get(['itemStyle', 'height']);\r\n if (height == null) {\r\n height = itemSize;\r\n }\r\n else {\r\n height = parsePercent$2(height, viewHeight);\r\n if (sort === 'ascending') {\r\n height = -height;\r\n }\r\n }\r\n var start = getLinePoints(idx, y);\r\n var end = getLinePoints(nextIdx, y + height);\r\n y += height + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n }\r\n labelLayout(data);\r\n });\r\n}\n\nregisterLayout(funnelLayout);\r\nregisterProcessor(dataFilter('funnel'));\n\nfunction parallelPreprocessor(option) {\r\n createParallelIfNeeded(option);\r\n mergeAxisOptionFromParallel(option);\r\n}\r\nfunction createParallelIfNeeded(option) {\r\n if (option.parallel) {\r\n return;\r\n }\r\n var hasParallelSeries = false;\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'parallel') {\r\n hasParallelSeries = true;\r\n }\r\n });\r\n if (hasParallelSeries) {\r\n option.parallel = [{}];\r\n }\r\n}\r\nfunction mergeAxisOptionFromParallel(option) {\r\n var axes = normalizeToArray(option.parallelAxis);\r\n each(axes, function (axisOption) {\r\n if (!isObject(axisOption)) {\r\n return;\r\n }\r\n var parallelIndex = axisOption.parallelIndex || 0;\r\n var parallelOption = normalizeToArray(option.parallel)[parallelIndex];\r\n if (parallelOption && parallelOption.parallelAxisDefault) {\r\n merge(axisOption, parallelOption.parallelAxisDefault, false);\r\n }\r\n });\r\n}\n\nvar ParallelAxis = (function (_super) {\r\n __extends(ParallelAxis, _super);\r\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.axisIndex = axisIndex;\r\n return _this;\r\n }\r\n ParallelAxis.prototype.isHorizontal = function () {\r\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\r\n };\r\n return ParallelAxis;\r\n}(Axis));\n\nfunction sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n}\r\nfunction getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n}\r\nfunction restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n}\n\nvar each$6 = each;\r\nvar mathMin$8 = Math.min;\r\nvar mathMax$8 = Math.max;\r\nvar mathFloor$2 = Math.floor;\r\nvar mathCeil$1 = Math.ceil;\r\nvar round$2 = round$1;\r\nvar PI$8 = Math.PI;\r\nvar Parallel = (function () {\r\n function Parallel(parallelModel, ecModel, api) {\r\n this.type = 'parallel';\r\n this._axesMap = createHashMap();\r\n this._axesLayout = {};\r\n this.dimensions = parallelModel.dimensions;\r\n this._model = parallelModel;\r\n this._init(parallelModel, ecModel, api);\r\n }\r\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\r\n var dimensions = parallelModel.dimensions;\r\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\r\n each$6(dimensions, function (dim, idx) {\r\n var axisIndex = parallelAxisIndex[idx];\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = axisModel.coordinateSystem = this;\r\n }, this);\r\n };\r\n Parallel.prototype.update = function (ecModel, api) {\r\n this._updateAxesFromSeries(this._model, ecModel);\r\n };\r\n Parallel.prototype.containPoint = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var axisBase = layoutInfo.axisBase;\r\n var layoutBase = layoutInfo.layoutBase;\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var pAxis = point[1 - pixelDimIndex];\r\n var pLayout = point[pixelDimIndex];\r\n return pAxis >= axisBase\r\n && pAxis <= axisBase + layoutInfo.axisLength\r\n && pLayout >= layoutBase\r\n && pLayout <= layoutBase + layoutInfo.layoutLength;\r\n };\r\n Parallel.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!parallelModel.contains(seriesModel, ecModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n each$6(this.dimensions, function (dim) {\r\n var axis = this._axesMap.get(dim);\r\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\r\n niceScaleExtent(axis.scale, axis.model);\r\n }, this);\r\n }, this);\r\n };\r\n Parallel.prototype.resize = function (parallelModel, api) {\r\n this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._layoutAxes();\r\n };\r\n Parallel.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Parallel.prototype._makeLayoutInfo = function () {\r\n var parallelModel = this._model;\r\n var rect = this._rect;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var layout = parallelModel.get('layout');\r\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\r\n var layoutLength = rect[wh[pixelDimIndex]];\r\n var layoutExtent = [0, layoutLength];\r\n var axisCount = this.dimensions.length;\r\n var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent);\r\n var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\r\n var axisExpandable = parallelModel.get('axisExpandable')\r\n && axisCount > 3\r\n && axisCount > axisExpandCount\r\n && axisExpandCount > 1\r\n && axisExpandWidth > 0\r\n && layoutLength > 0;\r\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\r\n var winSize;\r\n if (!axisExpandWindow) {\r\n winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\r\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2);\r\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n else {\r\n winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\r\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\r\n var winInnerIndices = [\r\n mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,\r\n mathCeil$1(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1\r\n ];\r\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\r\n return {\r\n layout: layout,\r\n pixelDimIndex: pixelDimIndex,\r\n layoutBase: rect[xy[pixelDimIndex]],\r\n layoutLength: layoutLength,\r\n axisBase: rect[xy[1 - pixelDimIndex]],\r\n axisLength: rect[wh[1 - pixelDimIndex]],\r\n axisExpandable: axisExpandable,\r\n axisExpandWidth: axisExpandWidth,\r\n axisCollapseWidth: axisCollapseWidth,\r\n axisExpandWindow: axisExpandWindow,\r\n axisCount: axisCount,\r\n winInnerIndices: winInnerIndices,\r\n axisExpandWindow0Pos: axisExpandWindow0Pos\r\n };\r\n };\r\n Parallel.prototype._layoutAxes = function () {\r\n var rect = this._rect;\r\n var axes = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var layoutInfo = this._makeLayoutInfo();\r\n var layout = layoutInfo.layout;\r\n axes.each(function (axis) {\r\n var axisExtent = [0, layoutInfo.axisLength];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\r\n });\r\n each$6(dimensions, function (dim, idx) {\r\n var posInfo = (layoutInfo.axisExpandable\r\n ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\r\n var positionTable = {\r\n horizontal: {\r\n x: posInfo.position,\r\n y: layoutInfo.axisLength\r\n },\r\n vertical: {\r\n x: 0,\r\n y: posInfo.position\r\n }\r\n };\r\n var rotationTable = {\r\n horizontal: PI$8 / 2,\r\n vertical: 0\r\n };\r\n var position = [\r\n positionTable[layout].x + rect.x,\r\n positionTable[layout].y + rect.y\r\n ];\r\n var rotation = rotationTable[layout];\r\n var transform = create$1();\r\n rotate(transform, transform, rotation);\r\n translate(transform, transform, position);\r\n this._axesLayout[dim] = {\r\n position: position,\r\n rotation: rotation,\r\n transform: transform,\r\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\r\n axisLabelShow: posInfo.axisLabelShow,\r\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\r\n tickDirection: 1,\r\n labelDirection: 1\r\n };\r\n }, this);\r\n };\r\n Parallel.prototype.getAxis = function (dim) {\r\n return this._axesMap.get(dim);\r\n };\r\n Parallel.prototype.dataToPoint = function (value, dim) {\r\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\r\n };\r\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\r\n start == null && (start = 0);\r\n end == null && (end = data.count());\r\n var axesMap = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var dataDimensions = [];\r\n var axisModels = [];\r\n each(dimensions, function (axisDim) {\r\n dataDimensions.push(data.mapDimension(axisDim));\r\n axisModels.push(axesMap.get(axisDim).model);\r\n });\r\n var hasActiveSet = this.hasAxisBrushed();\r\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\r\n var activeState = void 0;\r\n if (!hasActiveSet) {\r\n activeState = 'normal';\r\n }\r\n else {\r\n activeState = 'active';\r\n var values = data.getValues(dataDimensions, dataIndex);\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n var state = axisModels[j].getActiveState(values[j]);\r\n if (state === 'inactive') {\r\n activeState = 'inactive';\r\n break;\r\n }\r\n }\r\n }\r\n callback(activeState, dataIndex);\r\n }\r\n };\r\n Parallel.prototype.hasAxisBrushed = function () {\r\n var dimensions = this.dimensions;\r\n var axesMap = this._axesMap;\r\n var hasActiveSet = false;\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\r\n hasActiveSet = true;\r\n }\r\n }\r\n return hasActiveSet;\r\n };\r\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\r\n var axisLayout = this._axesLayout[dim];\r\n return applyTransform$1([coord, 0], axisLayout.transform);\r\n };\r\n Parallel.prototype.getAxisLayout = function (dim) {\r\n return clone(this._axesLayout[dim]);\r\n };\r\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\r\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\r\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\r\n if (!this.containPoint(point)) {\r\n return { behavior: 'none', axisExpandWindow: axisExpandWindow };\r\n }\r\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\r\n var delta;\r\n var behavior = 'slide';\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var triggerArea = this._model.get('axisExpandSlideTriggerArea');\r\n var useJump = triggerArea[0] != null;\r\n if (axisCollapseWidth) {\r\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * triggerArea[2];\r\n }\r\n else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * (1 - triggerArea[2]);\r\n }\r\n else {\r\n (delta = pointCoord - winSize * triggerArea[1]) >= 0\r\n && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0\r\n && (delta = 0);\r\n }\r\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\r\n delta\r\n ? sliderMove(delta, axisExpandWindow, extent, 'all')\r\n : (behavior = 'none');\r\n }\r\n else {\r\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\r\n var pos = extent[1] * pointCoord / winSize2;\r\n axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)];\r\n axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2);\r\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\r\n }\r\n return {\r\n axisExpandWindow: axisExpandWindow,\r\n behavior: behavior\r\n };\r\n };\r\n return Parallel;\r\n}());\r\nfunction restrict$1(len, extent) {\r\n return mathMin$8(mathMax$8(len, extent[0]), extent[1]);\r\n}\r\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\r\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\r\n return {\r\n position: step * axisIndex,\r\n axisNameAvailableWidth: step,\r\n axisLabelShow: true\r\n };\r\n}\r\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\r\n var layoutLength = layoutInfo.layoutLength;\r\n var axisExpandWidth = layoutInfo.axisExpandWidth;\r\n var axisCount = layoutInfo.axisCount;\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var winInnerIndices = layoutInfo.winInnerIndices;\r\n var position;\r\n var axisNameAvailableWidth = axisCollapseWidth;\r\n var axisLabelShow = false;\r\n var nameTruncateMaxWidth;\r\n if (axisIndex < winInnerIndices[0]) {\r\n position = axisIndex * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n else if (axisIndex <= winInnerIndices[1]) {\r\n position = layoutInfo.axisExpandWindow0Pos\r\n + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\r\n axisNameAvailableWidth = axisExpandWidth;\r\n axisLabelShow = true;\r\n }\r\n else {\r\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n return {\r\n position: position,\r\n axisNameAvailableWidth: axisNameAvailableWidth,\r\n axisLabelShow: axisLabelShow,\r\n nameTruncateMaxWidth: nameTruncateMaxWidth\r\n };\r\n}\n\nfunction create$2(ecModel, api) {\r\n var coordSysList = [];\r\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\r\n var coordSys = new Parallel(parallelModel, ecModel, api);\r\n coordSys.name = 'parallel_' + idx;\r\n coordSys.resize(parallelModel, api);\r\n parallelModel.coordinateSystem = coordSys;\r\n coordSys.model = parallelModel;\r\n coordSysList.push(coordSys);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'parallel') {\r\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\r\n }\r\n });\r\n return coordSysList;\r\n}\r\nCoordinateSystemManager.register('parallel', { create: create$2 });\n\nvar ParallelAxisModel = (function (_super) {\r\n __extends(ParallelAxisModel, _super);\r\n function ParallelAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisModel.type;\r\n _this.activeIntervals = [];\r\n return _this;\r\n }\r\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\r\n return makeStyleMapper([\r\n ['fill', 'color'],\r\n ['lineWidth', 'borderWidth'],\r\n ['stroke', 'borderColor'],\r\n ['width', 'width'],\r\n ['opacity', 'opacity']\r\n ])(this.getModel('areaSelectStyle'));\r\n };\r\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\r\n var activeIntervals = this.activeIntervals = clone(intervals);\r\n if (activeIntervals) {\r\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\r\n asc(activeIntervals[i]);\r\n }\r\n }\r\n };\r\n ParallelAxisModel.prototype.getActiveState = function (value) {\r\n var activeIntervals = this.activeIntervals;\r\n if (!activeIntervals.length) {\r\n return 'normal';\r\n }\r\n if (value == null || isNaN(+value)) {\r\n return 'inactive';\r\n }\r\n if (activeIntervals.length === 1) {\r\n var interval = activeIntervals[0];\r\n if (interval[0] <= value && value <= interval[1]) {\r\n return 'active';\r\n }\r\n }\r\n else {\r\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\r\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\r\n return 'active';\r\n }\r\n }\r\n }\r\n return 'inactive';\r\n };\r\n return ParallelAxisModel;\r\n}(ComponentModel));\r\nvar defaultOption$1 = {\r\n type: 'value',\r\n areaSelectStyle: {\r\n width: 20,\r\n borderWidth: 1,\r\n borderColor: 'rgba(160,197,232)',\r\n color: 'rgba(160,197,232)',\r\n opacity: 0.3\r\n },\r\n realtime: true,\r\n z: 10\r\n};\r\nComponentModel.registerClass(ParallelAxisModel);\r\nmixin(ParallelAxisModel, AxisModelCommonMixin);\r\naxisModelCreator('parallel', ParallelAxisModel, defaultOption$1);\n\nvar ParallelModel = (function (_super) {\r\n __extends(ParallelModel, _super);\r\n function ParallelModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelModel.type;\r\n return _this;\r\n }\r\n ParallelModel.prototype.init = function () {\r\n _super.prototype.init.apply(this, arguments);\r\n this.mergeOption({});\r\n };\r\n ParallelModel.prototype.mergeOption = function (newOption) {\r\n var thisOption = this.option;\r\n newOption && merge(thisOption, newOption, true);\r\n this._initDimensions();\r\n };\r\n ParallelModel.prototype.contains = function (model, ecModel) {\r\n var parallelIndex = model.get('parallelIndex');\r\n return parallelIndex != null\r\n && ecModel.getComponent('parallel', parallelIndex) === this;\r\n };\r\n ParallelModel.prototype.setAxisExpand = function (opt) {\r\n each([\r\n 'axisExpandable',\r\n 'axisExpandCenter',\r\n 'axisExpandCount',\r\n 'axisExpandWidth',\r\n 'axisExpandWindow'\r\n ], function (name) {\r\n if (opt.hasOwnProperty(name)) {\r\n this.option[name] = opt[name];\r\n }\r\n }, this);\r\n };\r\n ParallelModel.prototype._initDimensions = function () {\r\n var dimensions = this.dimensions = [];\r\n var parallelAxisIndex = this.parallelAxisIndex = [];\r\n var axisModels = filter(this.ecModel.queryComponents({ mainType: 'parallelAxis' }), function (axisModel) {\r\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\r\n }, this);\r\n each(axisModels, function (axisModel) {\r\n dimensions.push('dim' + axisModel.get('dim'));\r\n parallelAxisIndex.push(axisModel.componentIndex);\r\n });\r\n };\r\n ParallelModel.type = 'parallel';\r\n ParallelModel.dependencies = ['parallelAxis'];\r\n ParallelModel.layoutMode = 'box';\r\n ParallelModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n layout: 'horizontal',\r\n axisExpandable: false,\r\n axisExpandCenter: null,\r\n axisExpandCount: 0,\r\n axisExpandWidth: 50,\r\n axisExpandRate: 17,\r\n axisExpandDebounce: 50,\r\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\r\n axisExpandTriggerOn: 'click',\r\n parallelAxisDefault: null\r\n };\r\n return ParallelModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(ParallelModel);\n\nvar actionInfo$1 = {\r\n type: 'axisAreaSelect',\r\n event: 'axisAreaSelected'\r\n};\r\nregisterAction(actionInfo$1, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallelAxis', query: payload }, function (parallelAxisModel) {\r\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\r\n });\r\n});\r\nregisterAction('parallelAxisExpand', function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallel', query: payload }, function (parallelModel) {\r\n parallelModel.setAxisExpand(payload);\r\n });\r\n});\n\nvar BRUSH_PANEL_GLOBAL = true;\r\nvar mathMin$9 = Math.min;\r\nvar mathMax$9 = Math.max;\r\nvar mathPow$2 = Math.pow;\r\nvar COVER_Z = 10000;\r\nvar UNSELECT_THRESHOLD = 6;\r\nvar MIN_RESIZE_LINE_WIDTH = 6;\r\nvar MUTEX_RESOURCE_KEY = 'globalPan';\r\nvar DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n};\r\nvar CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n};\r\nvar DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n};\r\nvar baseUID = 0;\r\nvar BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n}(Eventful));\r\nfunction createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n}\r\nfunction endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n}\r\nfunction updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n}\r\nfunction updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n}\r\nfunction updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n}\r\nfunction getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n}\r\nfunction getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n}\r\nfunction getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n}\r\nfunction clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n}\r\nfunction trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n}\r\nfunction shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n}\r\nfunction getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n}\r\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n}\r\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n}\r\nfunction updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n}\r\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n}\r\nfunction makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n}\r\nfunction formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$9(x, x2), mathMin$9(y, y2)];\r\n var max = [mathMax$9(x, x2), mathMax$9(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n}\r\nfunction getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n}\r\nfunction getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n}\r\nfunction getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n}\r\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n}\r\nfunction driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n}\r\nfunction toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n}\r\nfunction clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n}\r\nfunction pointsToRect(points) {\r\n var xmin = mathMin$9(points[0][0], points[1][0]);\r\n var ymin = mathMin$9(points[0][1], points[1][1]);\r\n var xmax = mathMax$9(points[0][0], points[1][0]);\r\n var ymax = mathMax$9(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n}\r\nfunction resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n}\r\nfunction preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n}\r\nfunction mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n}\r\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n}\r\nfunction determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n}\r\nvar pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n};\r\nfunction handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n}\r\nfunction isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n}\r\nvar coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n};\r\nfunction getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n}\n\nfunction makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n}\r\nfunction makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n}\r\nfunction makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n}\r\nfunction normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n}\n\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\r\nvar ParallelAxisView = (function (_super) {\r\n __extends(ParallelAxisView, _super);\r\n function ParallelAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisView.type;\r\n return _this;\r\n }\r\n ParallelAxisView.prototype.init = function (ecModel, api) {\r\n _super.prototype.init.apply(this, arguments);\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this));\r\n };\r\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\r\n return;\r\n }\r\n this.axisModel = axisModel;\r\n this.api = api;\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\r\n var coordSys = coordSysModel.coordinateSystem;\r\n var areaSelectStyle = axisModel.getAreaSelectStyle();\r\n var areaWidth = areaSelectStyle.width;\r\n var dim = axisModel.axis.dim;\r\n var axisLayout = coordSys.getAxisLayout(dim);\r\n var builderOpt = extend({ strokeContainThreshold: areaWidth }, axisLayout);\r\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\r\n each(elementList, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n };\r\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\r\n var extent = axisModel.axis.getExtent();\r\n var extentLen = extent[1] - extent[0];\r\n var extra = Math.min(30, Math.abs(extentLen) * 0.1);\r\n var rect = BoundingRect.create({\r\n x: extent[0],\r\n y: -areaWidth / 2,\r\n width: extentLen,\r\n height: areaWidth\r\n });\r\n rect.x -= extra;\r\n rect.width += 2 * extra;\r\n this._brushController\r\n .mount({\r\n enableGlobalPan: true,\r\n rotation: builderOpt.rotation,\r\n x: builderOpt.position[0],\r\n y: builderOpt.position[1]\r\n })\r\n .setPanels([{\r\n panelId: 'pl',\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)\r\n }])\r\n .enableBrush({\r\n brushType: 'lineX',\r\n brushStyle: areaSelectStyle,\r\n removeOnClick: true\r\n })\r\n .updateCovers(getCoverInfoList(axisModel));\r\n };\r\n ParallelAxisView.prototype._onBrush = function (eventParam) {\r\n var coverInfoList = eventParam.areas;\r\n var axisModel = this.axisModel;\r\n var axis = axisModel.axis;\r\n var intervals = map(coverInfoList, function (coverInfo) {\r\n return [\r\n axis.coordToData(coverInfo.range[0], true),\r\n axis.coordToData(coverInfo.range[1], true)\r\n ];\r\n });\r\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\r\n this.api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n parallelAxisId: axisModel.id,\r\n intervals: intervals\r\n });\r\n }\r\n };\r\n ParallelAxisView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n ParallelAxisView.type = 'parallelAxis';\r\n return ParallelAxisView;\r\n}(ComponentView));\r\nComponentView.registerClass(ParallelAxisView);\r\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\r\n return payload\r\n && payload.type === 'axisAreaSelect'\r\n && ecModel.findComponents({ mainType: 'parallelAxis', query: payload })[0] === axisModel;\r\n}\r\nfunction getCoverInfoList(axisModel) {\r\n var axis = axisModel.axis;\r\n return map(axisModel.activeIntervals, function (interval) {\r\n return {\r\n brushType: 'lineX',\r\n panelId: 'pl',\r\n range: [\r\n axis.dataToCoord(interval[0], true),\r\n axis.dataToCoord(interval[1], true)\r\n ]\r\n };\r\n });\r\n}\r\nfunction getCoordSysModel(axisModel, ecModel) {\r\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\r\n}\n\nvar CLICK_THRESHOLD = 5;\r\nvar ParallelView = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n return _this;\r\n }\r\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\r\n this._model = parallelModel;\r\n this._api = api;\r\n if (!this._handlers) {\r\n this._handlers = {};\r\n each(handlers, function (handler, eventName) {\r\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\r\n }, this);\r\n }\r\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\r\n };\r\n ParallelView.prototype.dispose = function (ecModel, api) {\r\n each(this._handlers, function (handler, eventName) {\r\n api.getZr().off(eventName, handler);\r\n });\r\n this._handlers = null;\r\n };\r\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\r\n this._dispatchExpand(opt);\r\n };\r\n ParallelView.prototype._dispatchExpand = function (opt) {\r\n opt && this._api.dispatchAction(extend({ type: 'parallelAxisExpand' }, opt));\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n}(ComponentView));\r\nComponentView.registerClass(ParallelView);\r\nvar handlers = {\r\n mousedown: function (e) {\r\n if (checkTrigger(this, 'click')) {\r\n this._mouseDownPoint = [e.offsetX, e.offsetY];\r\n }\r\n },\r\n mouseup: function (e) {\r\n var mouseDownPoint = this._mouseDownPoint;\r\n if (checkTrigger(this, 'click') && mouseDownPoint) {\r\n var point = [e.offsetX, e.offsetY];\r\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2)\r\n + Math.pow(mouseDownPoint[1] - point[1], 2);\r\n if (dist > CLICK_THRESHOLD) {\r\n return;\r\n }\r\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n result.behavior !== 'none' && this._dispatchExpand({\r\n axisExpandWindow: result.axisExpandWindow\r\n });\r\n }\r\n this._mouseDownPoint = null;\r\n },\r\n mousemove: function (e) {\r\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\r\n return;\r\n }\r\n var model = this._model;\r\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n var behavior = result.behavior;\r\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\r\n this._throttledDispatchExpand(behavior === 'none'\r\n ? null\r\n : {\r\n axisExpandWindow: result.axisExpandWindow,\r\n animation: behavior === 'jump' ? null : {\r\n duration: 0\r\n }\r\n });\r\n }\r\n};\r\nfunction checkTrigger(view, triggerOn) {\r\n var model = view._model;\r\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\r\n}\r\nregisterPreprocessor(parallelPreprocessor);\n\nvar ParallelSeriesModel = (function (_super) {\r\n __extends(ParallelSeriesModel, _super);\r\n function ParallelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\r\n });\r\n };\r\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\r\n var coordSys = this.coordinateSystem;\r\n var data = this.getData();\r\n var indices = [];\r\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\r\n if (activeState === theActiveState) {\r\n indices.push(data.getRawIndex(dataIndex));\r\n }\r\n });\r\n return indices;\r\n };\r\n ParallelSeriesModel.type = 'series.parallel';\r\n ParallelSeriesModel.dependencies = ['parallel'];\r\n ParallelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'parallel',\r\n parallelIndex: 0,\r\n label: {\r\n show: false\r\n },\r\n inactiveOpacity: 0.05,\r\n activeOpacity: 1,\r\n lineStyle: {\r\n width: 1,\r\n opacity: 0.45,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n label: {\r\n show: false\r\n }\r\n },\r\n progressive: 500,\r\n smooth: false,\r\n animationEasing: 'linear'\r\n };\r\n return ParallelSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ParallelSeriesModel);\r\nfunction makeDefaultEncode(seriesModel) {\r\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n if (!parallelModel) {\r\n return;\r\n }\r\n var encodeDefine = {};\r\n each(parallelModel.dimensions, function (axisDim) {\r\n var dataDimIndex = convertDimNameToNumber(axisDim);\r\n encodeDefine[axisDim] = dataDimIndex;\r\n });\r\n return encodeDefine;\r\n}\r\nfunction convertDimNameToNumber(dimName) {\r\n return +dimName.replace('dim', '');\r\n}\n\nvar DEFAULT_SMOOTH = 0.3;\r\nvar ParallelView$1 = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n _this._dataGroup = new Group();\r\n _this._initialized = false;\r\n return _this;\r\n }\r\n ParallelView.prototype.init = function () {\r\n this.group.add(this._dataGroup);\r\n };\r\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var dataGroup = this._dataGroup;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n data.diff(oldData)\r\n .add(add)\r\n .update(update)\r\n .remove(remove)\r\n .execute();\r\n function add(newDataIndex) {\r\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function update(newDataIndex, oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\r\n data.setItemGraphicEl(newDataIndex, line);\r\n updateProps(line, { shape: { points: points } }, seriesModel, newDataIndex);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function remove(oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n dataGroup.remove(line);\r\n }\r\n if (!this._initialized) {\r\n this._initialized = true;\r\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\r\n setTimeout(function () {\r\n dataGroup.removeClipPath();\r\n });\r\n });\r\n dataGroup.setClipPath(clipPath);\r\n }\r\n this._data = data;\r\n };\r\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._initialized = true;\r\n this._data = null;\r\n this._dataGroup.removeAll();\r\n };\r\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\r\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\r\n line.incremental = true;\r\n updateElCommon(line, data, dataIndex, seriesScope);\r\n }\r\n };\r\n ParallelView.prototype.remove = function () {\r\n this._dataGroup && this._dataGroup.removeAll();\r\n this._data = null;\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n}(ChartView));\r\nfunction createGridClipShape(coordSys, seriesModel, cb) {\r\n var parallelModel = coordSys.model;\r\n var rect = coordSys.getRect();\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n });\r\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\r\n rectEl.setShape(dim, 0);\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\r\n var points = [];\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimName = dimensions[i];\r\n var value = data.get(data.mapDimension(dimName), dataIndex);\r\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\r\n points.push(coordSys.dataToPoint(value, dimName));\r\n }\r\n }\r\n return points;\r\n}\r\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\r\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\r\n var line = new Polyline({\r\n shape: { points: points },\r\n z2: 10\r\n });\r\n dataGroup.add(line);\r\n data.setItemGraphicEl(dataIndex, line);\r\n return line;\r\n}\r\nfunction makeSeriesScope$2(seriesModel) {\r\n var smooth = seriesModel.get('smooth', true);\r\n smooth === true && (smooth = DEFAULT_SMOOTH);\r\n smooth = numericToNumber(smooth);\r\n eqNaN(smooth) && (smooth = 0);\r\n return { smooth: smooth };\r\n}\r\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.fill = null;\r\n el.setShape('smooth', seriesScope.smooth);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n}\r\nfunction isEmptyValue(val, axisType) {\r\n return axisType === 'category'\r\n ? val == null\r\n : (val == null || isNaN(val));\r\n}\r\nChartView.registerClass(ParallelView$1);\n\nvar opacityAccessPath$1 = ['lineStyle', 'opacity'];\r\nvar parallelVisual = {\r\n seriesType: 'parallel',\r\n reset: function (seriesModel, ecModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var opacityMap = {\r\n normal: seriesModel.get(['lineStyle', 'opacity']),\r\n active: seriesModel.get('activeOpacity'),\r\n inactive: seriesModel.get('inactiveOpacity')\r\n };\r\n return {\r\n progress: function (params, data) {\r\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\r\n var opacity = opacityMap[activeState];\r\n if (activeState === 'normal' && data.hasItemOption) {\r\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true);\r\n itemOpacity != null && (opacity = itemOpacity);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n existsStyle.opacity = opacity;\r\n }, params.start, params.end);\r\n }\r\n };\r\n }\r\n};\n\nregisterVisual(PRIORITY.VISUAL.BRUSH, parallelVisual);\n\nvar SankeySeriesModel = (function (_super) {\r\n __extends(SankeySeriesModel, _super);\r\n function SankeySeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeySeriesModel.type;\r\n return _this;\r\n }\r\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var links = option.edges || option.links;\r\n var nodes = option.data || option.nodes;\r\n var levels = option.levels;\r\n this.levelModels = [];\r\n var levelModels = this.levelModels;\r\n for (var i = 0; i < levels.length; i++) {\r\n if (levels[i].depth != null && levels[i].depth >= 0) {\r\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('levels[i].depth is mandatory and should be natural number');\r\n }\r\n }\r\n }\r\n if (nodes && links) {\r\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var layout = seriesModel.getData().getItemLayout(idx);\r\n if (layout) {\r\n var nodeDepth = layout.depth;\r\n var levelModel = seriesModel.levelModels[nodeDepth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n edgeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\r\n var layout = edge.node1.getLayout();\r\n if (layout) {\r\n var depth = layout.depth;\r\n var levelModel = seriesModel.levelModels[depth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\r\n var dataItem = this.option.data[dataIndex];\r\n dataItem.localX = localPosition[0];\r\n dataItem.localY = localPosition[1];\r\n };\r\n SankeySeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n SankeySeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n function noValue(val) {\r\n return isNaN(val) || val == null;\r\n }\r\n if (dataType === 'edge') {\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var rawDataOpt = params.data;\r\n var edgeValue = params.value;\r\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\r\n return createTooltipMarkup('nameValue', {\r\n name: edgeName,\r\n value: edgeValue,\r\n noValue: noValue(edgeValue)\r\n });\r\n }\r\n else {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var value = node.getLayout().value;\r\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\r\n return createTooltipMarkup('nameValue', {\r\n name: name_1,\r\n value: value,\r\n noValue: noValue(value)\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n if (option.focusNodeAdjacency === true) {\r\n option.focusNodeAdjacency = 'allEdges';\r\n }\r\n };\r\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n if (params.value == null && dataType === 'node') {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var nodeValue = node.getLayout().value;\r\n params.value = nodeValue;\r\n }\r\n return params;\r\n };\r\n SankeySeriesModel.type = 'series.sankey';\r\n SankeySeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '5%',\r\n top: '5%',\r\n right: '20%',\r\n bottom: '5%',\r\n orient: 'horizontal',\r\n nodeWidth: 20,\r\n nodeGap: 8,\r\n draggable: true,\r\n focusNodeAdjacency: false,\r\n layoutIterations: 32,\r\n label: {\r\n show: true,\r\n position: 'right',\r\n fontSize: 12\r\n },\r\n levels: [],\r\n nodeAlign: 'justify',\r\n lineStyle: {\r\n color: '#314656',\r\n opacity: 0.2,\r\n curveness: 0.5\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 1000\r\n };\r\n return SankeySeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(SankeySeriesModel);\n\nvar SankeyPathShape = (function () {\r\n function SankeyPathShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.cpx2 = 0;\r\n this.cpy2 = 0;\r\n this.extent = 0;\r\n }\r\n return SankeyPathShape;\r\n}());\r\nvar SankeyPath = (function (_super) {\r\n __extends(SankeyPath, _super);\r\n function SankeyPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n SankeyPath.prototype.getDefaultShape = function () {\r\n return new SankeyPathShape();\r\n };\r\n SankeyPath.prototype.buildPath = function (ctx, shape) {\r\n var extent = shape.extent;\r\n ctx.moveTo(shape.x1, shape.y1);\r\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\r\n if (shape.orient === 'vertical') {\r\n ctx.lineTo(shape.x2 + extent, shape.y2);\r\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\r\n }\r\n else {\r\n ctx.lineTo(shape.x2, shape.y2 + extent);\r\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\r\n }\r\n ctx.closePath();\r\n };\r\n SankeyPath.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n SankeyPath.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n return SankeyPath;\r\n}(Path));\r\nvar SankeyView = (function (_super) {\r\n __extends(SankeyView, _super);\r\n function SankeyView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeyView.type;\r\n _this._focusAdjacencyDisabled = false;\r\n return _this;\r\n }\r\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\r\n var sankeyView = this;\r\n var graph = seriesModel.getGraph();\r\n var group = this.group;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var nodeData = seriesModel.getData();\r\n var edgeData = seriesModel.getData('edge');\r\n var orient = seriesModel.get('orient');\r\n this._model = seriesModel;\r\n group.removeAll();\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n graph.eachEdge(function (edge) {\r\n var curve = new SankeyPath();\r\n var ecData = getECData(curve);\r\n ecData.dataIndex = edge.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataType = 'edge';\r\n var edgeModel = edge.getModel();\r\n var lineStyleModel = edgeModel.getModel('lineStyle');\r\n var curvature = lineStyleModel.get('curveness');\r\n var n1Layout = edge.node1.getLayout();\r\n var node1Model = edge.node1.getModel();\r\n var dragX1 = node1Model.get('localX');\r\n var dragY1 = node1Model.get('localY');\r\n var n2Layout = edge.node2.getLayout();\r\n var node2Model = edge.node2.getModel();\r\n var dragX2 = node2Model.get('localX');\r\n var dragY2 = node2Model.get('localY');\r\n var edgeLayout = edge.getLayout();\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n curve.shape.extent = Math.max(1, edgeLayout.dy);\r\n curve.shape.orient = orient;\r\n if (orient === 'vertical') {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\r\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\r\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\r\n cpx1 = x1;\r\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\r\n cpx2 = x2;\r\n cpy2 = y1 * curvature + y2 * (1 - curvature);\r\n }\r\n else {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\r\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\r\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\r\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\r\n cpy1 = y1;\r\n cpx2 = x1 * curvature + x2 * (1 - curvature);\r\n cpy2 = y2;\r\n }\r\n curve.setShape({\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n });\r\n curve.useStyle(lineStyleModel.getItemStyle());\r\n switch (curve.style.fill) {\r\n case 'source':\r\n curve.style.fill = edge.node1.getVisual('color');\r\n curve.style.decal = edge.node1.getVisual('style').decal;\r\n break;\r\n case 'target':\r\n curve.style.fill = edge.node2.getVisual('color');\r\n curve.style.decal = edge.node2.getVisual('style').decal;\r\n break;\r\n case 'gradient':\r\n var sourceColor = edge.node1.getVisual('color');\r\n var targetColor = edge.node2.getVisual('color');\r\n if (typeof sourceColor === 'string' && typeof targetColor === 'string') {\r\n curve.style.fill = new LinearGradient(0, 0, 1, 0, [{\r\n color: sourceColor,\r\n offset: 0\r\n }, {\r\n color: targetColor,\r\n offset: 1\r\n }]);\r\n }\r\n }\r\n var emphasisModel = edgeModel.getModel('emphasis');\r\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { return model.getItemStyle(); });\r\n group.add(curve);\r\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n getECData(curve).dataType = 'edge';\r\n });\r\n graph.eachNode(function (node) {\r\n var layout = node.getLayout();\r\n var itemModel = node.getModel();\r\n var dragX = itemModel.get('localX');\r\n var dragY = itemModel.get('localY');\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var rect = new Rect({\r\n shape: {\r\n x: dragX != null ? dragX * width : layout.x,\r\n y: dragY != null ? dragY * height : layout.y,\r\n width: layout.dx,\r\n height: layout.dy\r\n },\r\n style: itemModel.getModel('itemStyle').getItemStyle()\r\n });\r\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: node.dataIndex,\r\n defaultText: node.id\r\n });\r\n rect.disableLabelAnimation = true;\r\n rect.setStyle('fill', node.getVisual('color'));\r\n rect.setStyle('decal', node.getVisual('style').decal);\r\n setStatesStylesFromModel(rect, itemModel);\r\n group.add(rect);\r\n nodeData.setItemGraphicEl(node.dataIndex, rect);\r\n getECData(rect).dataType = 'node';\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n });\r\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\r\n var itemModel = nodeData.getItemModel(dataIndex);\r\n if (itemModel.get('draggable')) {\r\n el.drift = function (dx, dy) {\r\n sankeyView._focusAdjacencyDisabled = true;\r\n this.shape.x += dx;\r\n this.shape.y += dy;\r\n this.dirty();\r\n api.dispatchAction({\r\n type: 'dragNode',\r\n seriesId: seriesModel.id,\r\n dataIndex: nodeData.getRawIndex(dataIndex),\r\n localX: this.shape.x / width,\r\n localY: this.shape.y / height\r\n });\r\n };\r\n el.ondragend = function () {\r\n sankeyView._focusAdjacencyDisabled = false;\r\n };\r\n el.draggable = true;\r\n el.cursor = 'move';\r\n }\r\n });\r\n if (!this._data && seriesModel.isAnimationEnabled()) {\r\n group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () {\r\n group.removeClipPath();\r\n }));\r\n }\r\n this._data = seriesModel.getData();\r\n };\r\n SankeyView.prototype.dispose = function () {\r\n };\r\n SankeyView.type = 'sankey';\r\n return SankeyView;\r\n}(ChartView));\r\nfunction createGridClipShape$1(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nChartView.registerClass(SankeyView);\n\nregisterAction({\r\n type: 'dragNode',\r\n event: 'dragnode',\r\n update: 'update'\r\n}, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'sankey',\r\n query: payload\r\n }, function (seriesModel) {\r\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\r\n });\r\n});\n\nfunction sankeyLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var nodeWidth = seriesModel.get('nodeWidth');\r\n var nodeGap = seriesModel.get('nodeGap');\r\n var layoutInfo = getViewRect$4(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n var edges = graph.edges;\r\n computeNodeValues(nodes);\r\n var filteredNodes = filter(nodes, function (node) {\r\n return node.getLayout().value === 0;\r\n });\r\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\r\n var orient = seriesModel.get('orient');\r\n var nodeAlign = seriesModel.get('nodeAlign');\r\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\r\n });\r\n}\r\nfunction getViewRect$4(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\r\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\r\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\r\n computeEdgeDepths(nodes, orient);\r\n}\r\nfunction computeNodeValues(nodes) {\r\n each(nodes, function (node) {\r\n var value1 = sum(node.outEdges, getEdgeValue);\r\n var value2 = sum(node.inEdges, getEdgeValue);\r\n var nodeRawValue = node.getValue() || 0;\r\n var value = Math.max(value1, value2, nodeRawValue);\r\n node.setLayout({ value: value }, true);\r\n });\r\n}\r\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\r\n var remainEdges = [];\r\n var indegreeArr = [];\r\n var zeroIndegrees = [];\r\n var nextTargetNode = [];\r\n var x = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n remainEdges[i] = 1;\r\n }\r\n for (var i = 0; i < nodes.length; i++) {\r\n indegreeArr[i] = nodes[i].inEdges.length;\r\n if (indegreeArr[i] === 0) {\r\n zeroIndegrees.push(nodes[i]);\r\n }\r\n }\r\n var maxNodeDepth = -1;\r\n while (zeroIndegrees.length) {\r\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\r\n var node = zeroIndegrees[idx];\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n var isItemDepth = item.depth != null && item.depth >= 0;\r\n if (isItemDepth && item.depth > maxNodeDepth) {\r\n maxNodeDepth = item.depth;\r\n }\r\n node.setLayout({ depth: isItemDepth ? item.depth : x }, true);\r\n orient === 'vertical'\r\n ? node.setLayout({ dy: nodeWidth }, true)\r\n : node.setLayout({ dx: nodeWidth }, true);\r\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\r\n var edge = node.outEdges[edgeIdx];\r\n var indexEdge = edges.indexOf(edge);\r\n remainEdges[indexEdge] = 0;\r\n var targetNode = edge.node2;\r\n var nodeIndex = nodes.indexOf(targetNode);\r\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\r\n nextTargetNode.push(targetNode);\r\n }\r\n }\r\n }\r\n ++x;\r\n zeroIndegrees = nextTargetNode;\r\n nextTargetNode = [];\r\n }\r\n for (var i = 0; i < remainEdges.length; i++) {\r\n if (remainEdges[i] === 1) {\r\n throw new Error('Sankey is a DAG, the original data has cycle!');\r\n }\r\n }\r\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\r\n if (nodeAlign && nodeAlign !== 'left') {\r\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\r\n }\r\n var kx = orient === 'vertical'\r\n ? (height - nodeWidth) / maxDepth\r\n : (width - nodeWidth) / maxDepth;\r\n scaleNodeBreadths(nodes, kx, orient);\r\n}\r\nfunction isNodeDepth(node) {\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n return item.depth != null && item.depth >= 0;\r\n}\r\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\r\n if (nodeAlign === 'right') {\r\n var nextSourceNode = [];\r\n var remainNodes = nodes;\r\n var nodeHeight = 0;\r\n while (remainNodes.length) {\r\n for (var i = 0; i < remainNodes.length; i++) {\r\n var node = remainNodes[i];\r\n node.setLayout({ skNodeHeight: nodeHeight }, true);\r\n for (var j = 0; j < node.inEdges.length; j++) {\r\n var edge = node.inEdges[j];\r\n if (nextSourceNode.indexOf(edge.node1) < 0) {\r\n nextSourceNode.push(edge.node1);\r\n }\r\n }\r\n }\r\n remainNodes = nextSourceNode;\r\n nextSourceNode = [];\r\n ++nodeHeight;\r\n }\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node)) {\r\n node.setLayout({ depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) }, true);\r\n }\r\n });\r\n }\r\n else if (nodeAlign === 'justify') {\r\n moveSinksRight(nodes, maxDepth);\r\n }\r\n}\r\nfunction moveSinksRight(nodes, maxDepth) {\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node) && !node.outEdges.length) {\r\n node.setLayout({ depth: maxDepth }, true);\r\n }\r\n });\r\n}\r\nfunction scaleNodeBreadths(nodes, kx, orient) {\r\n each(nodes, function (node) {\r\n var nodeDepth = node.getLayout().depth * kx;\r\n orient === 'vertical'\r\n ? node.setLayout({ y: nodeDepth }, true)\r\n : node.setLayout({ x: nodeDepth }, true);\r\n });\r\n}\r\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\r\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\r\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n for (var alpha = 1; iterations > 0; iterations--) {\r\n alpha *= 0.99;\r\n relaxRightToLeft(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n relaxLeftToRight(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n }\r\n}\r\nfunction prepareNodesByBreadth(nodes, orient) {\r\n var nodesByBreadth = [];\r\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\r\n var groupResult = groupData(nodes, function (node) {\r\n return node.getLayout()[keyAttr];\r\n });\r\n groupResult.keys.sort(function (a, b) {\r\n return a - b;\r\n });\r\n each(groupResult.keys, function (key) {\r\n nodesByBreadth.push(groupResult.buckets.get(key));\r\n });\r\n return nodesByBreadth;\r\n}\r\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\r\n var minKy = Infinity;\r\n each(nodesByBreadth, function (nodes) {\r\n var n = nodes.length;\r\n var sum = 0;\r\n each(nodes, function (node) {\r\n sum += node.getLayout().value;\r\n });\r\n var ky = orient === 'vertical'\r\n ? (width - (n - 1) * nodeGap) / sum\r\n : (height - (n - 1) * nodeGap) / sum;\r\n if (ky < minKy) {\r\n minKy = ky;\r\n }\r\n });\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node, i) {\r\n var nodeDy = node.getLayout().value * minKy;\r\n if (orient === 'vertical') {\r\n node.setLayout({ x: i }, true);\r\n node.setLayout({ dx: nodeDy }, true);\r\n }\r\n else {\r\n node.setLayout({ y: i }, true);\r\n node.setLayout({ dy: nodeDy }, true);\r\n }\r\n });\r\n });\r\n each(edges, function (edge) {\r\n var edgeDy = +edge.getValue() * minKy;\r\n edge.setLayout({ dy: edgeDy }, true);\r\n });\r\n}\r\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodesByBreadth, function (nodes) {\r\n nodes.sort(function (a, b) {\r\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\r\n });\r\n var nodeX;\r\n var node;\r\n var dy;\r\n var y0 = 0;\r\n var n = nodes.length;\r\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\r\n for (var i = 0; i < n; i++) {\r\n node = nodes[i];\r\n dy = y0 - node.getLayout()[keyAttr];\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] + dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\r\n }\r\n var viewWidth = orient === 'vertical' ? width : height;\r\n dy = y0 - nodeGap - viewWidth;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n y0 = nodeX;\r\n for (var i = n - 2; i >= 0; --i) {\r\n node = nodes[i];\r\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr];\r\n }\r\n }\r\n });\r\n}\r\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth.slice().reverse(), function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.outEdges.length) {\r\n var y = sum(node.outEdges, weightedTarget, orient)\r\n / sum(node.outEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.outEdges.length;\r\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\nfunction weightedTarget(edge, orient) {\r\n return center$1(edge.node2, orient) * edge.getValue();\r\n}\r\nfunction centerTarget(edge, orient) {\r\n return center$1(edge.node2, orient);\r\n}\r\nfunction weightedSource(edge, orient) {\r\n return center$1(edge.node1, orient) * edge.getValue();\r\n}\r\nfunction centerSource(edge, orient) {\r\n return center$1(edge.node1, orient);\r\n}\r\nfunction center$1(node, orient) {\r\n return orient === 'vertical'\r\n ? node.getLayout().x + node.getLayout().dx / 2\r\n : node.getLayout().y + node.getLayout().dy / 2;\r\n}\r\nfunction getEdgeValue(edge) {\r\n return edge.getValue();\r\n}\r\nfunction sum(array, cb, orient) {\r\n var sum = 0;\r\n var len = array.length;\r\n var i = -1;\r\n while (++i < len) {\r\n var value = +cb(array[i], orient);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n return sum;\r\n}\r\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.inEdges.length) {\r\n var y = sum(node.inEdges, weightedSource, orient)\r\n / sum(node.inEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.inEdges.length;\r\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\nfunction computeEdgeDepths(nodes, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodes, function (node) {\r\n node.outEdges.sort(function (a, b) {\r\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\r\n });\r\n node.inEdges.sort(function (a, b) {\r\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\r\n });\r\n });\r\n each(nodes, function (node) {\r\n var sy = 0;\r\n var ty = 0;\r\n each(node.outEdges, function (edge) {\r\n edge.setLayout({ sy: sy }, true);\r\n sy += edge.getLayout().dy;\r\n });\r\n each(node.inEdges, function (edge) {\r\n edge.setLayout({ ty: ty }, true);\r\n ty += edge.getLayout().dy;\r\n });\r\n });\r\n}\n\nfunction sankeyVisual(ecModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n if (nodes.length) {\r\n var minValue_1 = Infinity;\r\n var maxValue_1 = -Infinity;\r\n each(nodes, function (node) {\r\n var nodeValue = node.getLayout().value;\r\n if (nodeValue < minValue_1) {\r\n minValue_1 = nodeValue;\r\n }\r\n if (nodeValue > maxValue_1) {\r\n maxValue_1 = nodeValue;\r\n }\r\n });\r\n each(nodes, function (node) {\r\n var mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue_1, maxValue_1],\r\n visual: seriesModel.get('color')\r\n });\r\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n var customColor = node.getModel().get(['itemStyle', 'color']);\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', { fill: customColor });\r\n }\r\n else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', { fill: mapValueToColor });\r\n }\r\n });\r\n }\r\n });\r\n}\n\nregisterLayout(sankeyLayout);\r\nregisterVisual(sankeyVisual);\n\nvar WhiskerBoxCommonMixin = (function () {\r\n function WhiskerBoxCommonMixin() {\r\n }\r\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\r\n var ordinalMeta;\r\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\r\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\r\n var xAxisType = xAxisModel.get('type');\r\n var yAxisType = yAxisModel.get('type');\r\n var addOrdinal;\r\n if (xAxisType === 'category') {\r\n option.layout = 'horizontal';\r\n ordinalMeta = xAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else if (yAxisType === 'category') {\r\n option.layout = 'vertical';\r\n ordinalMeta = yAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else {\r\n option.layout = option.layout || 'horizontal';\r\n }\r\n var coordDims = ['x', 'y'];\r\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\r\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\r\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\r\n var axisModels = [xAxisModel, yAxisModel];\r\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\r\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\r\n var data = option.data;\r\n if (data && addOrdinal) {\r\n var newOptionData_1 = [];\r\n each(data, function (item, index) {\r\n var newItem;\r\n if (isArray(item)) {\r\n newItem = item.slice();\r\n item.unshift(index);\r\n }\r\n else if (isArray(item.value)) {\r\n newItem = item.value.slice();\r\n item.value.unshift(index);\r\n }\r\n else {\r\n newItem = item;\r\n }\r\n newOptionData_1.push(newItem);\r\n });\r\n option.data = newOptionData_1;\r\n }\r\n var defaultValueDimensions = this.defaultValueDimensions;\r\n var coordDimensions = [{\r\n name: baseAxisDim,\r\n type: getDimensionTypeByAxis(baseAxisType),\r\n ordinalMeta: ordinalMeta,\r\n otherDims: {\r\n tooltip: false,\r\n itemName: 0\r\n },\r\n dimsDef: ['base']\r\n }, {\r\n name: otherAxisDim,\r\n type: getDimensionTypeByAxis(otherAxisType),\r\n dimsDef: defaultValueDimensions.slice()\r\n }];\r\n return createListSimply(this, {\r\n coordDimensions: coordDimensions,\r\n dimensionsCount: defaultValueDimensions.length + 1,\r\n encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\r\n });\r\n };\r\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\r\n var dim = this._baseAxisDim;\r\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\r\n };\r\n return WhiskerBoxCommonMixin;\r\n}());\n\nvar BoxplotSeriesModel = (function (_super) {\r\n __extends(BoxplotSeriesModel, _super);\r\n function BoxplotSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'min', defaultTooltip: true },\r\n { name: 'Q1', defaultTooltip: true },\r\n { name: 'median', defaultTooltip: true },\r\n { name: 'Q3', defaultTooltip: true },\r\n { name: 'max', defaultTooltip: true }\r\n ];\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n BoxplotSeriesModel.type = 'series.boxplot';\r\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n BoxplotSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n boxWidth: [7, 50],\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2,\r\n shadowBlur: 5,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n },\r\n animationDuration: 800\r\n };\r\n return BoxplotSeriesModel;\r\n}(SeriesModel));\r\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\r\nSeriesModel.registerClass(BoxplotSeriesModel);\n\nvar BoxplotView = (function (_super) {\r\n __extends(BoxplotView, _super);\r\n function BoxplotView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotView.type;\r\n return _this;\r\n }\r\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var group = this.group;\r\n var oldData = this._data;\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (!symbolEl) {\r\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\r\n }\r\n else {\r\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n BoxplotView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var data = this._data;\r\n this._data = null;\r\n data && data.eachItemGraphicEl(function (el) {\r\n el && group.remove(el);\r\n });\r\n };\r\n BoxplotView.type = 'boxplot';\r\n return BoxplotView;\r\n}(ChartView));\r\nvar BoxPathShape = (function () {\r\n function BoxPathShape() {\r\n }\r\n return BoxPathShape;\r\n}());\r\nvar BoxPath = (function (_super) {\r\n __extends(BoxPath, _super);\r\n function BoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'boxplotBoxPath';\r\n return _this;\r\n }\r\n BoxPath.prototype.getDefaultShape = function () {\r\n return new BoxPathShape();\r\n };\r\n BoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n var i = 0;\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n for (; i < 4; i++) {\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n ctx.closePath();\r\n for (; i < ends.length; i++) {\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n };\r\n return BoxPath;\r\n}(Path));\r\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\r\n var ends = itemLayout.ends;\r\n var el = new BoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, constDim, itemLayout)\r\n : ends\r\n }\r\n });\r\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\r\n return el;\r\n}\r\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\r\n var seriesModel = data.hostModel;\r\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\r\n updateMethod(el, { shape: { points: itemLayout.ends } }, seriesModel, dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.z2 = 100;\r\n var itemModel = data.getItemModel(dataIndex);\r\n setStatesStylesFromModel(el, itemModel);\r\n enableHoverEmphasis(el, itemModel.get(['emphasis', 'focus']), itemModel.get(['emphasis', 'blurScope']));\r\n}\r\nfunction transInit(points, dim, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[dim] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\nChartView.registerClass(BoxplotView);\n\nfunction boxplotVisual(ecModel, api) {\r\n ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n });\r\n}\n\nvar each$7 = each;\r\nfunction boxplotLayout(ecModel) {\r\n var groupResult = groupSeriesByAxis(ecModel);\r\n each$7(groupResult, function (groupItem) {\r\n var seriesModels = groupItem.seriesModels;\r\n if (!seriesModels.length) {\r\n return;\r\n }\r\n calculateBase(groupItem);\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\r\n });\r\n });\r\n}\r\nfunction groupSeriesByAxis(ecModel) {\r\n var result = [];\r\n var axisList = [];\r\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var idx = indexOf(axisList, baseAxis);\r\n if (idx < 0) {\r\n idx = axisList.length;\r\n axisList[idx] = baseAxis;\r\n result[idx] = {\r\n axis: baseAxis,\r\n seriesModels: []\r\n };\r\n }\r\n result[idx].seriesModels.push(seriesModel);\r\n });\r\n return result;\r\n}\r\nfunction calculateBase(groupItem) {\r\n var extent;\r\n var baseAxis = groupItem.axis;\r\n var seriesModels = groupItem.seriesModels;\r\n var seriesCount = seriesModels.length;\r\n var boxWidthList = groupItem.boxWidthList = [];\r\n var boxOffsetList = groupItem.boxOffsetList = [];\r\n var boundList = [];\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else {\r\n var maxDataCount_1 = 0;\r\n each$7(seriesModels, function (seriesModel) {\r\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\r\n });\r\n extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / maxDataCount_1;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var boxWidthBound = seriesModel.get('boxWidth');\r\n if (!isArray(boxWidthBound)) {\r\n boxWidthBound = [boxWidthBound, boxWidthBound];\r\n }\r\n boundList.push([\r\n parsePercent$2(boxWidthBound[0], bandWidth) || 0,\r\n parsePercent$2(boxWidthBound[1], bandWidth) || 0\r\n ]);\r\n });\r\n var availableWidth = bandWidth * 0.8 - 2;\r\n var boxGap = availableWidth / seriesCount * 0.3;\r\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\r\n var base = boxWidth / 2 - availableWidth / 2;\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n boxOffsetList.push(base);\r\n base += boxGap + boxWidth;\r\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\r\n });\r\n}\r\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var halfWidth = boxWidth / 2;\r\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\r\n var vDimIdx = 1 - cDimIdx;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n if (cDim == null || vDims.length < 5) {\r\n return;\r\n }\r\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\r\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\r\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\r\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\r\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\r\n var ends = [];\r\n addBodyEnd(ends, end2, false);\r\n addBodyEnd(ends, end4, true);\r\n ends.push(end1, end2, end5, end4);\r\n layEndLine(ends, end1);\r\n layEndLine(ends, end5);\r\n layEndLine(ends, median);\r\n data.setItemLayout(dataIndex, {\r\n initBaseline: median[vDimIdx],\r\n ends: ends\r\n });\r\n }\r\n function getPoint(axisDimVal, dim, dataIndex) {\r\n var val = data.get(dim, dataIndex);\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n var point;\r\n if (isNaN(axisDimVal) || isNaN(val)) {\r\n point = [NaN, NaN];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(p);\r\n point[cDimIdx] += offset;\r\n }\r\n return point;\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] += halfWidth;\r\n point2[cDimIdx] -= halfWidth;\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function layEndLine(ends, endCenter) {\r\n var from = endCenter.slice();\r\n var to = endCenter.slice();\r\n from[cDimIdx] -= halfWidth;\r\n to[cDimIdx] += halfWidth;\r\n ends.push(from, to);\r\n }\r\n}\n\nfunction prepareBoxplotData(rawData, opt) {\r\n opt = opt || {};\r\n var boxData = [];\r\n var outliers = [];\r\n var boundIQR = opt.boundIQR;\r\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\r\n for (var i = 0; i < rawData.length; i++) {\r\n var ascList = asc(rawData[i].slice());\r\n var Q1 = quantile(ascList, 0.25);\r\n var Q2 = quantile(ascList, 0.5);\r\n var Q3 = quantile(ascList, 0.75);\r\n var min = ascList[0];\r\n var max = ascList[ascList.length - 1];\r\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\r\n var low = useExtreme\r\n ? min\r\n : Math.max(min, Q1 - bound);\r\n var high = useExtreme\r\n ? max\r\n : Math.min(max, Q3 + bound);\r\n var itemNameFormatter = opt.itemNameFormatter;\r\n var itemName = isFunction(itemNameFormatter)\r\n ? itemNameFormatter({ value: i })\r\n : isString(itemNameFormatter)\r\n ? itemNameFormatter.replace('{value}', i + '')\r\n : i + '';\r\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\r\n for (var j = 0; j < ascList.length; j++) {\r\n var dataItem = ascList[j];\r\n if (dataItem < low || dataItem > high) {\r\n var outlier = [itemName, dataItem];\r\n outliers.push(outlier);\r\n }\r\n }\r\n }\r\n return {\r\n boxData: boxData,\r\n outliers: outliers\r\n };\r\n}\n\nvar boxplotTransform = {\r\n type: 'echarts:boxplot',\r\n transform: function transform(params) {\r\n var upstream = params.upstream;\r\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\r\n }\r\n throwError(errMsg);\r\n }\r\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\r\n return [{\r\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\r\n data: result.boxData\r\n }, {\r\n data: result.outliers\r\n }];\r\n }\r\n};\n\nregisterVisual(boxplotVisual);\r\nregisterLayout(boxplotLayout);\r\nregisterTransform(boxplotTransform);\n\nvar CandlestickSeriesModel = (function (_super) {\r\n __extends(CandlestickSeriesModel, _super);\r\n function CandlestickSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'open', defaultTooltip: true },\r\n { name: 'close', defaultTooltip: true },\r\n { name: 'lowest', defaultTooltip: true },\r\n { name: 'highest', defaultTooltip: true }\r\n ];\r\n return _this;\r\n }\r\n CandlestickSeriesModel.prototype.getShadowDim = function () {\r\n return 'open';\r\n };\r\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n return itemLayout && selectors.rect(itemLayout.brushRect);\r\n };\r\n CandlestickSeriesModel.type = 'series.candlestick';\r\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n CandlestickSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n clip: true,\r\n itemStyle: {\r\n color: '#c23531',\r\n color0: '#314656',\r\n borderWidth: 1,\r\n borderColor: '#c23531',\r\n borderColor0: '#314656'\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2\r\n }\r\n },\r\n barMaxWidth: null,\r\n barMinWidth: null,\r\n barWidth: null,\r\n large: true,\r\n largeThreshold: 600,\r\n progressive: 3e3,\r\n progressiveThreshold: 1e4,\r\n progressiveChunkMode: 'mod',\r\n animationEasing: 'linear',\r\n animationDuration: 300\r\n };\r\n return CandlestickSeriesModel;\r\n}(SeriesModel));\r\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\r\nSeriesModel.registerClass(CandlestickSeriesModel);\n\nvar SKIP_PROPS = ['color', 'borderColor'];\r\nvar CandlestickView = (function (_super) {\r\n __extends(CandlestickView, _super);\r\n function CandlestickView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickView.type;\r\n return _this;\r\n }\r\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeClipPath();\r\n this._updateDrawMode(seriesModel);\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel)\r\n : this._renderNormal(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n this._isLargeDraw\r\n ? this._incrementalRenderLarge(params, seriesModel)\r\n : this._incrementalRenderNormal(params, seriesModel);\r\n };\r\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n CandlestickView.prototype._renderNormal = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var needsClip = seriesModel.get('clip', true);\r\n var coord = seriesModel.coordinateSystem;\r\n var clipArea = coord.getArea && coord.getArea();\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n return;\r\n }\r\n var el = createNormalBox$1(itemLayout, newIdx, true);\r\n initProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx);\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(el);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n if (!el) {\r\n el = createNormalBox$1(itemLayout);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: {\r\n points: itemLayout.ends\r\n }\r\n }, seriesModel, newIdx);\r\n }\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n CandlestickView.prototype._renderLarge = function (seriesModel) {\r\n this._clear();\r\n createLarge$1(seriesModel, this.group);\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\r\n var data = seriesModel.getData();\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n var el = createNormalBox$1(itemLayout);\r\n setBoxCommon(el, data, dataIndex, isSimpleBox);\r\n el.incremental = true;\r\n this.group.add(el);\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n createLarge$1(seriesModel, this.group, true);\r\n };\r\n CandlestickView.prototype.remove = function (ecModel) {\r\n this._clear();\r\n };\r\n CandlestickView.prototype._clear = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CandlestickView.type = 'candlestick';\r\n return CandlestickView;\r\n}(ChartView));\r\nChartView.registerClass(CandlestickView);\r\nvar NormalBoxPathShape = (function () {\r\n function NormalBoxPathShape() {\r\n }\r\n return NormalBoxPathShape;\r\n}());\r\nvar NormalBoxPath = (function (_super) {\r\n __extends(NormalBoxPath, _super);\r\n function NormalBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'normalCandlestickBox';\r\n return _this;\r\n }\r\n NormalBoxPath.prototype.getDefaultShape = function () {\r\n return new NormalBoxPathShape();\r\n };\r\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n if (this.__simpleBox) {\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[6][0], ends[6][1]);\r\n }\r\n else {\r\n ctx.moveTo(ends[0][0], ends[0][1]);\r\n ctx.lineTo(ends[1][0], ends[1][1]);\r\n ctx.lineTo(ends[2][0], ends[2][1]);\r\n ctx.lineTo(ends[3][0], ends[3][1]);\r\n ctx.closePath();\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[5][0], ends[5][1]);\r\n ctx.moveTo(ends[6][0], ends[6][1]);\r\n ctx.lineTo(ends[7][0], ends[7][1]);\r\n }\r\n };\r\n return NormalBoxPath;\r\n}(Path));\r\nfunction createNormalBox$1(itemLayout, dataIndex, isInit) {\r\n var ends = itemLayout.ends;\r\n return new NormalBoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit$1(ends, itemLayout)\r\n : ends\r\n },\r\n z2: 100\r\n });\r\n}\r\nfunction isNormalBoxClipped(clipArea, itemLayout) {\r\n var clipped = true;\r\n for (var i = 0; i < itemLayout.ends.length; i++) {\r\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\r\n clipped = false;\r\n break;\r\n }\r\n }\r\n return clipped;\r\n}\r\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.__simpleBox = isSimpleBox;\r\n setStatesStylesFromModel(el, itemModel);\r\n}\r\nfunction transInit$1(points, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[1] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\nvar LargeBoxPathShape = (function () {\r\n function LargeBoxPathShape() {\r\n }\r\n return LargeBoxPathShape;\r\n}());\r\nvar LargeBoxPath = (function (_super) {\r\n __extends(LargeBoxPath, _super);\r\n function LargeBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeCandlestickBox';\r\n return _this;\r\n }\r\n LargeBoxPath.prototype.getDefaultShape = function () {\r\n return new LargeBoxPathShape();\r\n };\r\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n for (var i = 0; i < points.length;) {\r\n if (this.__sign === points[i++]) {\r\n var x = points[i++];\r\n ctx.moveTo(x, points[i++]);\r\n ctx.lineTo(x, points[i++]);\r\n }\r\n else {\r\n i += 3;\r\n }\r\n }\r\n };\r\n return LargeBoxPath;\r\n}(Path));\r\nfunction createLarge$1(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var largePoints = data.getLayout('largePoints');\r\n var elP = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: 1\r\n });\r\n group.add(elP);\r\n var elN = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: -1\r\n });\r\n group.add(elN);\r\n setLargeStyle$1(1, elP, seriesModel);\r\n setLargeStyle$1(-1, elN, seriesModel);\r\n if (incremental) {\r\n elP.incremental = true;\r\n elN.incremental = true;\r\n }\r\n}\r\nfunction setLargeStyle$1(sign, el, seriesModel, data) {\r\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0'])\r\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\r\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n}\n\nfunction candlestickPreprocessor(option) {\r\n if (!option || !isArray(option.series)) {\r\n return;\r\n }\r\n each(option.series, function (seriesItem) {\r\n if (isObject(seriesItem) && seriesItem.type === 'k') {\r\n seriesItem.type = 'candlestick';\r\n }\r\n });\r\n}\n\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\r\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\r\nvar positiveColorQuery = ['itemStyle', 'color'];\r\nvar negativeColorQuery = ['itemStyle', 'color0'];\r\nvar candlestickVisual = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n function getColor(sign, model) {\r\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\r\n }\r\n function getBorderColor(sign, model) {\r\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\r\n }\r\n var data = seriesModel.getData();\r\n data.setVisual('legendSymbol', 'roundRect');\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var isLargeRender = seriesModel.pipelineContext.large;\r\n return !isLargeRender && {\r\n progress: function (params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var sign = data.getItemLayout(dataIndex).sign;\r\n var style = itemModel.getItemStyle();\r\n style.fill = getColor(sign, itemModel);\r\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n extend(existsStyle, style);\r\n }\r\n }\r\n };\r\n }\r\n};\n\nvar LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\nvar candlestickLayout = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var candleWidth = calculateCandleWidth(seriesModel, data);\r\n var cDimIdx = 0;\r\n var vDimIdx = 1;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n var openDim = vDims[0];\r\n var closeDim = vDims[1];\r\n var lowestDim = vDims[2];\r\n var highestDim = vDims[3];\r\n data.setLayout({\r\n candleWidth: candleWidth,\r\n isSimpleBox: candleWidth <= 1.3\r\n });\r\n if (cDim == null || vDims.length < 4) {\r\n return;\r\n }\r\n return {\r\n progress: seriesModel.pipelineContext.large\r\n ? largeProgress : normalProgress\r\n };\r\n function normalProgress(params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n var ocLow = Math.min(openVal, closeVal);\r\n var ocHigh = Math.max(openVal, closeVal);\r\n var ocLowPoint = getPoint(ocLow, axisDimVal);\r\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\r\n var lowestPoint = getPoint(lowestVal, axisDimVal);\r\n var highestPoint = getPoint(highestVal, axisDimVal);\r\n var ends = [];\r\n addBodyEnd(ends, ocHighPoint, 0);\r\n addBodyEnd(ends, ocLowPoint, 1);\r\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\r\n data.setItemLayout(dataIndex, {\r\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\r\n initBaseline: openVal > closeVal\r\n ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\r\n ends: ends,\r\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\r\n });\r\n }\r\n function getPoint(val, axisDimVal) {\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n return (isNaN(axisDimVal) || isNaN(val))\r\n ? [NaN, NaN]\r\n : coordSys.dataToPoint(p);\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false);\r\n point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true);\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\r\n var pmin = getPoint(lowestVal, axisDimVal);\r\n var pmax = getPoint(highestVal, axisDimVal);\r\n pmin[cDimIdx] -= candleWidth / 2;\r\n pmax[cDimIdx] -= candleWidth / 2;\r\n return {\r\n x: pmin[0],\r\n y: pmin[1],\r\n width: candleWidth ,\r\n height: pmax[1] - pmin[1] \r\n };\r\n }\r\n function subPixelOptimizePoint(point) {\r\n point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1);\r\n return point;\r\n }\r\n }\r\n function largeProgress(params, data) {\r\n var points = new LargeArr$1(params.count * 4);\r\n var offset = 0;\r\n var point;\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\r\n points[offset++] = NaN;\r\n offset += 3;\r\n continue;\r\n }\r\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\r\n tmpIn[cDimIdx] = axisDimVal;\r\n tmpIn[vDimIdx] = lowestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[0] : NaN;\r\n points[offset++] = point ? point[1] : NaN;\r\n tmpIn[vDimIdx] = highestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[1] : NaN;\r\n }\r\n data.setLayout('largePoints', points);\r\n }\r\n }\r\n};\r\nfunction getSign(data, dataIndex, openVal, closeVal, closeDim) {\r\n var sign;\r\n if (openVal > closeVal) {\r\n sign = -1;\r\n }\r\n else if (openVal < closeVal) {\r\n sign = 1;\r\n }\r\n else {\r\n sign = dataIndex > 0\r\n ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1)\r\n : 1;\r\n }\r\n return sign;\r\n}\r\nfunction calculateCandleWidth(seriesModel, data) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var extent;\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / data.count());\r\n var barMaxWidth = parsePercent$2(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\r\n var barMinWidth = parsePercent$2(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\r\n var barWidth = seriesModel.get('barWidth');\r\n return barWidth != null\r\n ? parsePercent$2(barWidth, bandWidth)\r\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\r\n}\n\nregisterPreprocessor(candlestickPreprocessor);\r\nregisterVisual(candlestickVisual);\r\nregisterLayout(candlestickLayout);\n\nvar EffectScatterSeriesModel = (function (_super) {\r\n __extends(EffectScatterSeriesModel, _super);\r\n function EffectScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n EffectScatterSeriesModel.type = 'series.effectScatter';\r\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\r\n EffectScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n effectType: 'ripple',\r\n progressive: 0,\r\n showEffectOn: 'render',\r\n rippleEffect: {\r\n period: 4,\r\n scale: 2.5,\r\n brushType: 'fill'\r\n },\r\n symbolSize: 10\r\n };\r\n return EffectScatterSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(EffectScatterSeriesModel);\n\nvar EFFECT_RIPPLE_NUMBER = 3;\r\nfunction normalizeSymbolSize$1(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n}\r\nfunction updateRipplePath(rippleGroup, effectCfg) {\r\n var color = effectCfg.rippleEffectColor || effectCfg.color;\r\n rippleGroup.eachChild(function (ripplePath) {\r\n ripplePath.attr({\r\n z: effectCfg.z,\r\n zlevel: effectCfg.zlevel,\r\n style: {\r\n stroke: effectCfg.brushType === 'stroke' ? color : null,\r\n fill: effectCfg.brushType === 'fill' ? color : null\r\n }\r\n });\r\n });\r\n}\r\nvar EffectSymbol = (function (_super) {\r\n __extends(EffectSymbol, _super);\r\n function EffectSymbol(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var symbol = new Symbol(data, idx);\r\n var rippleGroup = new Group();\r\n _this.add(symbol);\r\n _this.add(rippleGroup);\r\n _this.updateData(data, idx);\r\n return _this;\r\n }\r\n EffectSymbol.prototype.stopEffectAnimation = function () {\r\n this.childAt(1).removeAll();\r\n };\r\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\r\n var symbolType = effectCfg.symbolType;\r\n var color = effectCfg.color;\r\n var rippleGroup = this.childAt(1);\r\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\r\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n ripplePath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 99,\r\n silent: true,\r\n scaleX: 0.5,\r\n scaleY: 0.5\r\n });\r\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset;\r\n ripplePath.animate('', true)\r\n .when(effectCfg.period, {\r\n scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2]\r\n })\r\n .delay(delay)\r\n .start();\r\n ripplePath.animateStyle(true)\r\n .when(effectCfg.period, {\r\n opacity: 0\r\n })\r\n .delay(delay)\r\n .start();\r\n rippleGroup.add(ripplePath);\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\r\n var oldEffectCfg = this._effectCfg;\r\n var rippleGroup = this.childAt(1);\r\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\r\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\r\n var propName = DIFFICULT_PROPS[i];\r\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\r\n this.stopEffectAnimation();\r\n this.startEffectAnimation(effectCfg);\r\n return;\r\n }\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n EffectSymbol.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n EffectSymbol.prototype.updateData = function (data, idx) {\r\n var _this = this;\r\n var seriesModel = data.hostModel;\r\n this.childAt(0).updateData(data, idx);\r\n var rippleGroup = this.childAt(1);\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = data.getItemVisual(idx, 'symbol');\r\n var symbolSize = normalizeSymbolSize$1(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var color = symbolStyle && symbolStyle.fill;\r\n rippleGroup.setScale(symbolSize);\r\n rippleGroup.traverse(function (ripplePath) {\r\n ripplePath.setStyle('fill', color);\r\n });\r\n var symbolOffset = itemModel.getShallow('symbolOffset');\r\n if (symbolOffset) {\r\n rippleGroup.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n rippleGroup.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var effectCfg = {};\r\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\r\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\r\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\r\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\r\n effectCfg.effectOffset = idx / data.count();\r\n effectCfg.z = seriesModel.getShallow('z') || 0;\r\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\r\n effectCfg.symbolType = symbolType;\r\n effectCfg.color = color;\r\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\r\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\r\n if (effectCfg.showEffectOn === 'render') {\r\n this._effectCfg\r\n ? this.updateEffectAnimation(effectCfg)\r\n : this.startEffectAnimation(effectCfg);\r\n this._effectCfg = effectCfg;\r\n }\r\n else {\r\n this._effectCfg = null;\r\n this.stopEffectAnimation();\r\n this.onHoverStateChange = function (toState) {\r\n if (toState === 'emphasis') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.startEffectAnimation(effectCfg);\r\n }\r\n }\r\n else if (toState === 'normal') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.stopEffectAnimation();\r\n }\r\n }\r\n };\r\n }\r\n this._effectCfg = effectCfg;\r\n enableHoverEmphasis(this);\r\n };\r\n EffectSymbol.prototype.fadeOut = function (cb) {\r\n this.off('mouseover').off('mouseout');\r\n cb && cb();\r\n };\r\n return EffectSymbol;\r\n}(Group));\r\ninherits(EffectSymbol, Group);\n\nvar EffectScatterView = (function (_super) {\r\n __extends(EffectScatterView, _super);\r\n function EffectScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterView.type;\r\n return _this;\r\n }\r\n EffectScatterView.prototype.init = function () {\r\n this._symbolDraw = new SymbolDraw(EffectSymbol);\r\n };\r\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var effectSymbolDraw = this._symbolDraw;\r\n effectSymbolDraw.updateData(data);\r\n this.group.add(effectSymbolDraw.group);\r\n };\r\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._symbolDraw.updateLayout();\r\n };\r\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.getRoamTransform) {\r\n this.group.transform = clone$2(coordSys.getRoamTransform());\r\n this.group.decomposeTransform();\r\n }\r\n };\r\n EffectScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n };\r\n EffectScatterView.type = 'effectScatter';\r\n return EffectScatterView;\r\n}(ChartView));\r\nChartView.registerClass(EffectScatterView);\n\nregisterLayout(pointsLayout('effectScatter'));\n\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\r\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\r\nfunction compatEc2(seriesOpt) {\r\n var data = seriesOpt.data;\r\n if (data && data[0] && data[0][0] && data[0][0].coord) {\r\n if (__DEV__) {\r\n console.warn('Lines data configuration has been changed to'\r\n + ' { coords:[[1,2],[2,3]] }');\r\n }\r\n seriesOpt.data = map(data, function (itemOpt) {\r\n var coords = [\r\n itemOpt[0].coord, itemOpt[1].coord\r\n ];\r\n var target = {\r\n coords: coords\r\n };\r\n if (itemOpt[0].name) {\r\n target.fromName = itemOpt[0].name;\r\n }\r\n if (itemOpt[1].name) {\r\n target.toName = itemOpt[1].name;\r\n }\r\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\r\n });\r\n }\r\n}\r\nvar LinesSeriesModel = (function (_super) {\r\n __extends(LinesSeriesModel, _super);\r\n function LinesSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n LinesSeriesModel.prototype.init = function (option) {\r\n option.data = option.data || [];\r\n compatEc2(option);\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n _super.prototype.init.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.mergeOption = function (option) {\r\n compatEc2(option);\r\n if (option.data) {\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n }\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.appendData = function (params) {\r\n var result = this._processFlatCoordsArray(params.data);\r\n if (result.flatCoords) {\r\n if (!this._flatCoords) {\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n }\r\n else {\r\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\r\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\r\n }\r\n params.data = new Float32Array(result.count);\r\n }\r\n this.getRawData().appendData(params.data);\r\n };\r\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\r\n var itemModel = this.getData().getItemModel(idx);\r\n var coords = (itemModel.option instanceof Array)\r\n ? itemModel.option : itemModel.getShallow('coords');\r\n if (__DEV__) {\r\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\r\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\r\n }\r\n }\r\n return coords;\r\n };\r\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\r\n if (this._flatCoordsOffset) {\r\n return this._flatCoordsOffset[idx * 2 + 1];\r\n }\r\n else {\r\n return this._getCoordsFromItemModel(idx).length;\r\n }\r\n };\r\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\r\n if (this._flatCoordsOffset) {\r\n var offset = this._flatCoordsOffset[idx * 2];\r\n var len = this._flatCoordsOffset[idx * 2 + 1];\r\n for (var i = 0; i < len; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = this._flatCoords[offset + i * 2];\r\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\r\n }\r\n return len;\r\n }\r\n else {\r\n var coords = this._getCoordsFromItemModel(idx);\r\n for (var i = 0; i < coords.length; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = coords[i][0];\r\n out[i][1] = coords[i][1];\r\n }\r\n return coords.length;\r\n }\r\n };\r\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\r\n var startOffset = 0;\r\n if (this._flatCoords) {\r\n startOffset = this._flatCoords.length;\r\n }\r\n if (typeof data[0] === 'number') {\r\n var len = data.length;\r\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\r\n var coordsStorage = new Float64Arr(len);\r\n var coordsCursor = 0;\r\n var offsetCursor = 0;\r\n var dataCount = 0;\r\n for (var i = 0; i < len;) {\r\n dataCount++;\r\n var count = data[i++];\r\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\r\n coordsOffsetAndLenStorage[offsetCursor++] = count;\r\n for (var k = 0; k < count; k++) {\r\n var x = data[i++];\r\n var y = data[i++];\r\n coordsStorage[coordsCursor++] = x;\r\n coordsStorage[coordsCursor++] = y;\r\n if (i > len) {\r\n if (__DEV__) {\r\n throw new Error('Invalid data format.');\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\r\n flatCoords: coordsStorage,\r\n count: dataCount\r\n };\r\n }\r\n return {\r\n flatCoordsOffset: null,\r\n flatCoords: null,\r\n count: data.length\r\n };\r\n };\r\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n if (__DEV__) {\r\n var CoordSys = CoordinateSystemManager.get(option.coordinateSystem);\r\n if (!CoordSys) {\r\n throw new Error('Unkown coordinate system ' + option.coordinateSystem);\r\n }\r\n }\r\n var lineData = new List(['value'], this);\r\n lineData.hasItemOption = false;\r\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\r\n if (dataItem instanceof Array) {\r\n return NaN;\r\n }\r\n else {\r\n lineData.hasItemOption = true;\r\n var value = dataItem.value;\r\n if (value != null) {\r\n return value instanceof Array ? value[dimIndex] : value;\r\n }\r\n }\r\n });\r\n return lineData;\r\n };\r\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var itemModel = data.getItemModel(dataIndex);\r\n var name = itemModel.get('name');\r\n if (name) {\r\n return name;\r\n }\r\n var fromName = itemModel.get('fromName');\r\n var toName = itemModel.get('toName');\r\n var nameArr = [];\r\n fromName != null && nameArr.push(fromName);\r\n toName != null && nameArr.push(toName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > ')\r\n });\r\n };\r\n LinesSeriesModel.prototype.preventIncremental = function () {\r\n return !!this.get(['effect', 'show']);\r\n };\r\n LinesSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 1e4 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n LinesSeriesModel.type = 'series.lines';\r\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\r\n LinesSeriesModel.defaultOption = {\r\n coordinateSystem: 'geo',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n xAxisIndex: 0,\r\n yAxisIndex: 0,\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 10],\r\n geoIndex: 0,\r\n effect: {\r\n show: false,\r\n period: 4,\r\n constantSpeed: 0,\r\n symbol: 'circle',\r\n symbolSize: 3,\r\n loop: true,\r\n trailLength: 0.2\r\n },\r\n large: false,\r\n largeThreshold: 2000,\r\n polyline: false,\r\n clip: true,\r\n label: {\r\n show: false,\r\n position: 'end'\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n };\r\n return LinesSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(LinesSeriesModel);\n\nvar EffectLine = (function (_super) {\r\n __extends(EffectLine, _super);\r\n function EffectLine(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this.add(_this.createLine(lineData, idx, seriesScope));\r\n _this._updateEffectSymbol(lineData, idx);\r\n return _this;\r\n }\r\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Line$1(lineData, idx, seriesScope);\r\n };\r\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\r\n var itemModel = lineData.getItemModel(idx);\r\n var effectModel = itemModel.getModel('effect');\r\n var size = effectModel.get('symbolSize');\r\n var symbolType = effectModel.get('symbol');\r\n if (!isArray(size)) {\r\n size = [size, size];\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var color = effectModel.get('color') || (lineStyle && lineStyle.stroke);\r\n var symbol = this.childAt(1);\r\n if (this._symbolType !== symbolType) {\r\n this.remove(symbol);\r\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n this.add(symbol);\r\n }\r\n if (!symbol) {\r\n return;\r\n }\r\n symbol.setStyle('shadowColor', color);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n symbol.setColor(color);\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\r\n var symbol = this.childAt(1);\r\n if (!symbol) {\r\n return;\r\n }\r\n var self = this;\r\n var points = lineData.getItemLayout(idx);\r\n var period = effectModel.get('period') * 1000;\r\n var loop = effectModel.get('loop');\r\n var constantSpeed = effectModel.get('constantSpeed');\r\n var delayExpr = retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n });\r\n symbol.ignore = true;\r\n this._updateAnimationPoints(symbol, points);\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n if (period !== this._period || loop !== this._loop) {\r\n symbol.stopAnimation();\r\n if (period > 0) {\r\n var delayNum = void 0;\r\n if (typeof delayExpr === 'function') {\r\n delayNum = delayExpr(idx);\r\n }\r\n else {\r\n delayNum = delayExpr;\r\n }\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n symbol.__t = 0;\r\n var animator = symbol.animate('', loop)\r\n .when(period, {\r\n __t: 1\r\n })\r\n .delay(delayNum)\r\n .during(function () {\r\n self._updateSymbolPosition(symbol);\r\n });\r\n if (!loop) {\r\n animator.done(function () {\r\n self.remove(symbol);\r\n });\r\n }\r\n animator.start();\r\n }\r\n }\r\n this._period = period;\r\n this._loop = loop;\r\n };\r\n EffectLine.prototype._getLineLength = function (symbol) {\r\n return (dist(symbol.__p1, symbol.__cp1)\r\n + dist(symbol.__cp1, symbol.__p2));\r\n };\r\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [\r\n (points[0][0] + points[1][0]) / 2,\r\n (points[0][1] + points[1][1]) / 2\r\n ];\r\n };\r\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\r\n this.childAt(0).updateData(lineData, idx, seriesScope);\r\n this._updateEffectSymbol(lineData, idx);\r\n };\r\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\r\n var p1 = symbol.__p1;\r\n var p2 = symbol.__p2;\r\n var cp1 = symbol.__cp1;\r\n var t = symbol.__t;\r\n var pos = [symbol.x, symbol.y];\r\n var lastPos = pos.slice();\r\n var quadraticAt$1 = quadraticAt;\r\n var quadraticDerivativeAt$1 = quadraticDerivativeAt;\r\n pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t);\r\n var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t);\r\n var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t);\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = dist(lastPos, pos) * 1.05;\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n }\r\n else if (symbol.__lastT === 1) {\r\n symbol.scaleY = 2 * dist(p1, pos);\r\n }\r\n else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n };\r\n EffectLine.prototype.updateLayout = function (lineData, idx) {\r\n this.childAt(0).updateLayout(lineData, idx);\r\n var effectModel = lineData.getItemModel(idx).getModel('effect');\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n return EffectLine;\r\n}(Group));\n\nvar Polyline$1 = (function (_super) {\r\n __extends(Polyline$1, _super);\r\n function Polyline$1(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createPolyline(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) {\r\n var points = lineData.getItemLayout(idx);\r\n var line = new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n });\r\n this.add(line);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childAt(0);\r\n var target = {\r\n shape: {\r\n points: lineData.getItemLayout(idx)\r\n }\r\n };\r\n updateProps(line, target, seriesModel, idx);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var line = this.childAt(0);\r\n var itemModel = lineData.getItemModel(idx);\r\n var hoverLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n hoverLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n }\r\n line.useStyle(lineData.getItemVisual(idx, 'style'));\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n var lineEmphasisState = line.ensureState('emphasis');\r\n lineEmphasisState.style = hoverLineStyle;\r\n enableHoverEmphasis(this);\r\n };\r\n Polyline$1.prototype.updateLayout = function (lineData, idx) {\r\n var polyline = this.childAt(0);\r\n polyline.setShape('points', lineData.getItemLayout(idx));\r\n };\r\n return Polyline$1;\r\n}(Group));\n\nvar EffectPolyline = (function (_super) {\r\n __extends(EffectPolyline, _super);\r\n function EffectPolyline() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._lastFrame = 0;\r\n _this._lastFramePercent = 0;\r\n return _this;\r\n }\r\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Polyline$1(lineData, idx, seriesScope);\r\n };\r\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\r\n this._points = points;\r\n var accLenArr = [0];\r\n var len = 0;\r\n for (var i = 1; i < points.length; i++) {\r\n var p1 = points[i - 1];\r\n var p2 = points[i];\r\n len += dist(p1, p2);\r\n accLenArr.push(len);\r\n }\r\n if (len === 0) {\r\n this._length = 0;\r\n return;\r\n }\r\n for (var i = 0; i < accLenArr.length; i++) {\r\n accLenArr[i] /= len;\r\n }\r\n this._offsets = accLenArr;\r\n this._length = len;\r\n };\r\n EffectPolyline.prototype._getLineLength = function () {\r\n return this._length;\r\n };\r\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\r\n var t = symbol.__t;\r\n var points = this._points;\r\n var offsets = this._offsets;\r\n var len = points.length;\r\n if (!offsets) {\r\n return;\r\n }\r\n var lastFrame = this._lastFrame;\r\n var frame;\r\n if (t < this._lastFramePercent) {\r\n var start = Math.min(lastFrame + 1, len - 1);\r\n for (frame = start; frame >= 0; frame--) {\r\n if (offsets[frame] <= t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame, len - 2);\r\n }\r\n else {\r\n for (frame = lastFrame; frame < len; frame++) {\r\n if (offsets[frame] > t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame - 1, len - 2);\r\n }\r\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\r\n var p0 = points[frame];\r\n var p1 = points[frame + 1];\r\n symbol.x = p0[0] * (1 - p) + p * p1[0];\r\n symbol.y = p0[1] * (1 - p) + p * p1[1];\r\n var tx = p1[0] - p0[0];\r\n var ty = p1[1] - p0[1];\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n this._lastFrame = frame;\r\n this._lastFramePercent = t;\r\n symbol.ignore = false;\r\n };\r\n return EffectPolyline;\r\n}(EffectLine));\n\nvar LargeLinesPathShape = (function () {\r\n function LargeLinesPathShape() {\r\n this.polyline = false;\r\n this.curveness = 0;\r\n this.segs = [];\r\n }\r\n return LargeLinesPathShape;\r\n}());\r\nvar LargeLinesPath = (function (_super) {\r\n __extends(LargeLinesPath, _super);\r\n function LargeLinesPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeLinesPath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n LargeLinesPath.prototype.getDefaultShape = function () {\r\n return new LargeLinesPathShape();\r\n };\r\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n if (shape.polyline) {\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n ctx.moveTo(segs[i++], segs[i++]);\r\n for (var k = 1; k < count; k++) {\r\n ctx.lineTo(segs[i++], segs[i++]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n ctx.moveTo(x0, y0);\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n ctx.quadraticCurveTo(x2, y2, x1, y1);\r\n }\r\n else {\r\n ctx.lineTo(x1, y1);\r\n }\r\n }\r\n }\r\n };\r\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n var lineWidth = this.style.lineWidth;\r\n if (shape.polyline) {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n for (var k = 1; k < count; k++) {\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n else {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n else {\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeLinesPath;\r\n}(Path));\r\nvar LargeLineDraw = (function () {\r\n function LargeLineDraw() {\r\n this.group = new Group();\r\n }\r\n LargeLineDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeLineDraw.prototype.updateData = function (data) {\r\n this.group.removeAll();\r\n var lineEl = new LargeLinesPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data);\r\n this.group.add(lineEl);\r\n this._incremental = null;\r\n };\r\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 5e5) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\r\n var lineEl = new LargeLinesPath();\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data, !!this._incremental);\r\n if (!this._incremental) {\r\n lineEl.rectHover = true;\r\n lineEl.cursor = 'default';\r\n lineEl.__startIndex = taskParams.start;\r\n this.group.add(lineEl);\r\n }\r\n else {\r\n this._incremental.addDisplayable(lineEl, true);\r\n }\r\n };\r\n LargeLineDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\r\n var hostModel = data.hostModel;\r\n lineEl.setShape({\r\n polyline: hostModel.get('polyline'),\r\n curveness: hostModel.get(['lineStyle', 'curveness'])\r\n });\r\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\r\n lineEl.style.strokeNoScale = true;\r\n var style = data.getVisual('style');\r\n if (style && style.stroke) {\r\n lineEl.setStyle('stroke', style.stroke);\r\n }\r\n lineEl.setStyle('fill', null);\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(lineEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n lineEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex > 0) {\r\n ecData_1.dataIndex = dataIndex + lineEl.__startIndex;\r\n }\r\n });\r\n }\r\n };\r\n LargeLineDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeLineDraw;\r\n}());\n\nvar linesLayout = {\r\n seriesType: 'lines',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var isPolyline = seriesModel.get('polyline');\r\n var isLarge = seriesModel.pipelineContext.large;\r\n return {\r\n progress: function (params, lineData) {\r\n var lineCoords = [];\r\n if (isLarge) {\r\n var points = void 0;\r\n var segCount = params.end - params.start;\r\n if (isPolyline) {\r\n var totalCoordsCount = 0;\r\n for (var i = params.start; i < params.end; i++) {\r\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\r\n }\r\n points = new Float32Array(segCount + totalCoordsCount * 2);\r\n }\r\n else {\r\n points = new Float32Array(segCount * 4);\r\n }\r\n var offset = 0;\r\n var pt = [];\r\n for (var i = params.start; i < params.end; i++) {\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n if (isPolyline) {\r\n points[offset++] = len;\r\n }\r\n for (var k = 0; k < len; k++) {\r\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\r\n points[offset++] = pt[0];\r\n points[offset++] = pt[1];\r\n }\r\n }\r\n lineData.setLayout('linesPoints', points);\r\n }\r\n else {\r\n for (var i = params.start; i < params.end; i++) {\r\n var itemModel = lineData.getItemModel(i);\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n var pts = [];\r\n if (isPolyline) {\r\n for (var j = 0; j < len; j++) {\r\n pts.push(coordSys.dataToPoint(lineCoords[j]));\r\n }\r\n }\r\n else {\r\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\r\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\r\n var curveness = itemModel.get(['lineStyle', 'curveness']);\r\n if (+curveness) {\r\n pts[2] = [\r\n (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness,\r\n (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness\r\n ];\r\n }\r\n }\r\n lineData.setItemLayout(i, pts);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n};\n\nvar LinesView = (function (_super) {\r\n __extends(LinesView, _super);\r\n function LinesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesView.type;\r\n return _this;\r\n }\r\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n var zlevel = seriesModel.get('zlevel');\r\n var trailLength = seriesModel.get(['effect', 'trailLength']);\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg) {\r\n zr.painter.getLayer(zlevel).clear(true);\r\n }\r\n if (this._lastZlevel != null && !isSvg) {\r\n zr.configLayer(this._lastZlevel, {\r\n motionBlur: false\r\n });\r\n }\r\n if (this._showEffect(seriesModel) && trailLength) {\r\n if (__DEV__) {\r\n var notInIndividual_1 = false;\r\n ecModel.eachSeries(function (otherSeriesModel) {\r\n if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {\r\n notInIndividual_1 = true;\r\n }\r\n });\r\n notInIndividual_1 && console.warn('Lines with trail effect should have an individual zlevel');\r\n }\r\n if (!isSvg) {\r\n zr.configLayer(zlevel, {\r\n motionBlur: true,\r\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\r\n });\r\n }\r\n }\r\n lineDraw.updateData(data);\r\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n this._lastZlevel = zlevel;\r\n this._finished = true;\r\n };\r\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n lineDraw.incrementalPrepareUpdate(data);\r\n this._clearLayer(api);\r\n this._finished = false;\r\n };\r\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = linesLayout.reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._lineDraw.updateLayout();\r\n this._clearLayer(api);\r\n }\r\n };\r\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\r\n var lineDraw = this._lineDraw;\r\n var hasEffect = this._showEffect(seriesModel);\r\n var isPolyline = !!seriesModel.get('polyline');\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (__DEV__) {\r\n if (hasEffect && isLargeDraw) {\r\n console.warn('Large lines not support effect');\r\n }\r\n }\r\n if (!lineDraw\r\n || hasEffect !== this._hasEffet\r\n || isPolyline !== this._isPolyline\r\n || isLargeDraw !== this._isLargeDraw) {\r\n if (lineDraw) {\r\n lineDraw.remove();\r\n }\r\n lineDraw = this._lineDraw = isLargeDraw\r\n ? new LargeLineDraw()\r\n : new LineDraw(isPolyline\r\n ? (hasEffect ? EffectPolyline : Polyline$1)\r\n : (hasEffect ? EffectLine : Line$1));\r\n this._hasEffet = hasEffect;\r\n this._isPolyline = isPolyline;\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(lineDraw.group);\r\n return lineDraw;\r\n };\r\n LinesView.prototype._showEffect = function (seriesModel) {\r\n return !!seriesModel.get(['effect', 'show']);\r\n };\r\n LinesView.prototype._clearLayer = function (api) {\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg && this._lastZlevel != null) {\r\n zr.painter.getLayer(this._lastZlevel).clear(true);\r\n }\r\n };\r\n LinesView.prototype.remove = function (ecModel, api) {\r\n this._lineDraw && this._lineDraw.remove();\r\n this._lineDraw = null;\r\n this._clearLayer(api);\r\n };\r\n LinesView.type = 'lines';\r\n return LinesView;\r\n}(ChartView));\r\nChartView.registerClass(LinesView);\n\nfunction normalize$3(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\nvar linesVisual = {\r\n seriesType: 'lines',\r\n reset: function (seriesModel) {\r\n var symbolType = normalize$3(seriesModel.get('symbol'));\r\n var symbolSize = normalize$3(seriesModel.get('symbolSize'));\r\n var data = seriesModel.getData();\r\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n data.setVisual('toSymbol', symbolType && symbolType[1]);\r\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = normalize$3(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true));\r\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\r\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\r\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\r\n }\r\n return {\r\n dataEach: data.hasItemOption ? dataEach : null\r\n };\r\n }\r\n};\n\nregisterLayout(linesLayout);\r\nregisterVisual(linesVisual);\n\nvar HeatmapSeriesModel = (function (_super) {\r\n __extends(HeatmapSeriesModel, _super);\r\n function HeatmapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapSeriesModel.type;\r\n return _this;\r\n }\r\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n generateCoord: 'value'\r\n });\r\n };\r\n HeatmapSeriesModel.prototype.preventIncremental = function () {\r\n var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem'));\r\n if (coordSysCreator && coordSysCreator.dimensions) {\r\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\r\n }\r\n };\r\n HeatmapSeriesModel.type = 'series.heatmap';\r\n HeatmapSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n geoIndex: 0,\r\n blurSize: 30,\r\n pointSize: 20,\r\n maxOpacity: 1,\r\n minOpacity: 0,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return HeatmapSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(HeatmapSeriesModel);\n\nvar GRADIENT_LEVELS = 256;\r\nvar HeatmapLayer = (function () {\r\n function HeatmapLayer() {\r\n this.blurSize = 30;\r\n this.pointSize = 20;\r\n this.maxOpacity = 1;\r\n this.minOpacity = 0;\r\n this._gradientPixels = {\r\n inRange: null,\r\n outOfRange: null\r\n };\r\n var canvas = createCanvas();\r\n this.canvas = canvas;\r\n }\r\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\r\n var brush = this._getBrush();\r\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\r\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\r\n var r = this.pointSize + this.blurSize;\r\n var canvas = this.canvas;\r\n var ctx = canvas.getContext('2d');\r\n var len = data.length;\r\n canvas.width = width;\r\n canvas.height = height;\r\n for (var i = 0; i < len; ++i) {\r\n var p = data[i];\r\n var x = p[0];\r\n var y = p[1];\r\n var value = p[2];\r\n var alpha = normalize(value);\r\n ctx.globalAlpha = alpha;\r\n ctx.drawImage(brush, x - r, y - r);\r\n }\r\n if (!canvas.width || !canvas.height) {\r\n return canvas;\r\n }\r\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n var pixels = imageData.data;\r\n var offset = 0;\r\n var pixelLen = pixels.length;\r\n var minOpacity = this.minOpacity;\r\n var maxOpacity = this.maxOpacity;\r\n var diffOpacity = maxOpacity - minOpacity;\r\n while (offset < pixelLen) {\r\n var alpha = pixels[offset + 3] / 256;\r\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\r\n if (alpha > 0) {\r\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\r\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\r\n pixels[offset++] = gradient[gradientOffset];\r\n pixels[offset++] = gradient[gradientOffset + 1];\r\n pixels[offset++] = gradient[gradientOffset + 2];\r\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\r\n }\r\n else {\r\n offset += 4;\r\n }\r\n }\r\n ctx.putImageData(imageData, 0, 0);\r\n return canvas;\r\n };\r\n HeatmapLayer.prototype._getBrush = function () {\r\n var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas());\r\n var r = this.pointSize + this.blurSize;\r\n var d = r * 2;\r\n brushCanvas.width = d;\r\n brushCanvas.height = d;\r\n var ctx = brushCanvas.getContext('2d');\r\n ctx.clearRect(0, 0, d, d);\r\n ctx.shadowOffsetX = d;\r\n ctx.shadowBlur = this.blurSize;\r\n ctx.shadowColor = '#000';\r\n ctx.beginPath();\r\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n return brushCanvas;\r\n };\r\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\r\n var gradientPixels = this._gradientPixels;\r\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\r\n var color = [0, 0, 0, 0];\r\n var off = 0;\r\n for (var i = 0; i < 256; i++) {\r\n colorFunc[state](i / 255, true, color);\r\n pixelsSingleState[off++] = color[0];\r\n pixelsSingleState[off++] = color[1];\r\n pixelsSingleState[off++] = color[2];\r\n pixelsSingleState[off++] = color[3];\r\n }\r\n return pixelsSingleState;\r\n };\r\n return HeatmapLayer;\r\n}());\n\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n pieceList = map(pieceList, function (piece) {\r\n return {\r\n interval: [\r\n (piece.interval[0] - dataExtent[0]) / dataSpan,\r\n (piece.interval[1] - dataExtent[0]) / dataSpan\r\n ]\r\n };\r\n });\r\n var len = pieceList.length;\r\n var lastIndex = 0;\r\n return function (val) {\r\n var i;\r\n for (i = lastIndex; i < len; i++) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n if (i === len) {\r\n for (i = lastIndex - 1; i >= 0; i--) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return i >= 0 && i < len && selected[i];\r\n };\r\n}\r\nfunction getIsInContinuousRange(dataExtent, range) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n range = [\r\n (range[0] - dataExtent[0]) / dataSpan,\r\n (range[1] - dataExtent[0]) / dataSpan\r\n ];\r\n return function (val) {\r\n return val >= range[0] && val <= range[1];\r\n };\r\n}\r\nfunction isGeoCoordSys(coordSys) {\r\n var dimensions = coordSys.dimensions;\r\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\r\n}\r\nvar HeatmapView = (function (_super) {\r\n __extends(HeatmapView, _super);\r\n function HeatmapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapView.type;\r\n return _this;\r\n }\r\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\r\n var visualMapOfThisSeries;\r\n ecModel.eachComponent('visualMap', function (visualMap) {\r\n visualMap.eachTargetSeries(function (targetSeries) {\r\n if (targetSeries === seriesModel) {\r\n visualMapOfThisSeries = visualMap;\r\n }\r\n });\r\n });\r\n if (__DEV__) {\r\n if (!visualMapOfThisSeries) {\r\n throw new Error('Heatmap must use with visualMap');\r\n }\r\n }\r\n this.group.removeAll();\r\n this._incrementalDisplayable = null;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\r\n }\r\n else if (isGeoCoordSys(coordSys)) {\r\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\r\n }\r\n };\r\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var width;\r\n var height;\r\n var xAxisExtent;\r\n var yAxisExtent;\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n if (__DEV__) {\r\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\r\n throw new Error('Heatmap on cartesian must have two category axes');\r\n }\r\n if (!(xAxis.onBand && yAxis.onBand)) {\r\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\r\n }\r\n }\r\n width = xAxis.getBandWidth();\r\n height = yAxis.getBandWidth();\r\n xAxisExtent = xAxis.scale.getExtent();\r\n yAxisExtent = yAxis.scale.getExtent();\r\n }\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\r\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var labelStatesModels = getLabelStatesModels(seriesModel);\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n var dataDims = isCoordinateSystemType(coordSys, 'cartesian2d')\r\n ? [\r\n data.mapDimension('x'),\r\n data.mapDimension('y'),\r\n data.mapDimension('value')\r\n ]\r\n : [\r\n data.mapDimension('time'),\r\n data.mapDimension('value')\r\n ];\r\n for (var idx = start; idx < end; idx++) {\r\n var rect = void 0;\r\n var style = data.getItemVisual(idx, 'style');\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var dataDimX = data.get(dataDims[0], idx);\r\n var dataDimY = data.get(dataDims[1], idx);\r\n if (isNaN(data.get(dataDims[2], idx))\r\n || dataDimX < xAxisExtent[0]\r\n || dataDimX > xAxisExtent[1]\r\n || dataDimY < yAxisExtent[0]\r\n || dataDimY > yAxisExtent[1]) {\r\n continue;\r\n }\r\n var point = coordSys.dataToPoint([\r\n dataDimX,\r\n dataDimY\r\n ]);\r\n rect = new Rect({\r\n shape: {\r\n x: Math.floor(Math.round(point[0]) - width / 2),\r\n y: Math.floor(Math.round(point[1]) - height / 2),\r\n width: Math.ceil(width),\r\n height: Math.ceil(height)\r\n },\r\n style: style\r\n });\r\n }\r\n else {\r\n if (isNaN(data.get(dataDims[1], idx))) {\r\n continue;\r\n }\r\n rect = new Rect({\r\n z2: 1,\r\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\r\n style: style\r\n });\r\n }\r\n var itemModel = data.getItemModel(idx);\r\n if (data.hasItemOption) {\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var defaultText = '-';\r\n if (rawValue && rawValue[2] != null) {\r\n defaultText = rawValue[2] + '';\r\n }\r\n setLabelStyle(rect, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: defaultText\r\n });\r\n rect.ensureState('emphasis').style = emphasisStyle;\r\n rect.ensureState('blur').style = blurStyle;\r\n rect.ensureState('select').style = selectStyle;\r\n enableHoverEmphasis(rect, focus, blurScope);\r\n rect.incremental = incremental;\r\n if (incremental) {\r\n rect.states.emphasis.hoverLayer = true;\r\n }\r\n group.add(rect);\r\n data.setItemGraphicEl(idx, rect);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\r\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\r\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\r\n var data = seriesModel.getData();\r\n var hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());\r\n hmLayer.blurSize = seriesModel.get('blurSize');\r\n hmLayer.pointSize = seriesModel.get('pointSize');\r\n hmLayer.minOpacity = seriesModel.get('minOpacity');\r\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\r\n var rect = geo.getViewRect().clone();\r\n var roamTransform = geo.getRoamTransform();\r\n rect.applyTransform(roamTransform);\r\n var x = Math.max(rect.x, 0);\r\n var y = Math.max(rect.y, 0);\r\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\r\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var dims = [\r\n data.mapDimension('lng'),\r\n data.mapDimension('lat'),\r\n data.mapDimension('value')\r\n ];\r\n var points = data.mapArray(dims, function (lng, lat, value) {\r\n var pt = geo.dataToPoint([lng, lat]);\r\n pt[0] -= x;\r\n pt[1] -= y;\r\n pt.push(value);\r\n return pt;\r\n });\r\n var dataExtent = visualMapModel.getExtent();\r\n var isInRange = visualMapModel.type === 'visualMap.continuous'\r\n ? getIsInContinuousRange(dataExtent, visualMapModel.option.range)\r\n : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\r\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\r\n inRange: inRangeVisuals.color.getColorMapper(),\r\n outOfRange: outOfRangeVisuals.color.getColorMapper()\r\n }, isInRange);\r\n var img = new ZRImage({\r\n style: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y,\r\n image: hmLayer.canvas\r\n },\r\n silent: true\r\n });\r\n this.group.add(img);\r\n };\r\n HeatmapView.type = 'heatmap';\r\n return HeatmapView;\r\n}(ChartView));\r\nChartView.registerClass(HeatmapView);\n\nvar PictorialBarSeriesModel = (function (_super) {\r\n __extends(PictorialBarSeriesModel, _super);\r\n function PictorialBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.defaultSymbol = 'roundRect';\r\n return _this;\r\n }\r\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\r\n option.stack = null;\r\n return _super.prototype.getInitialData.apply(this, arguments);\r\n };\r\n PictorialBarSeriesModel.type = 'series.pictorialBar';\r\n PictorialBarSeriesModel.dependencies = ['grid'];\r\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n symbol: 'circle',\r\n symbolSize: null,\r\n symbolRotate: null,\r\n symbolPosition: null,\r\n symbolOffset: null,\r\n symbolMargin: null,\r\n symbolRepeat: false,\r\n symbolRepeatDirection: 'end',\r\n symbolClip: false,\r\n symbolBoundingData: null,\r\n symbolPatternSize: 400,\r\n barGap: '-100%',\r\n progressive: 0,\r\n emphasis: {\r\n scale: false\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n });\r\n return PictorialBarSeriesModel;\r\n}(BaseBarSeriesModel));\r\nSeriesModel.registerClass(PictorialBarSeriesModel);\n\nvar BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth'];\r\nvar LAYOUT_ATTRS = [\r\n { xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right'] },\r\n { xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom'] }\r\n];\r\nvar pathForLineWidth = new Circle();\r\nvar PictorialBarView = (function (_super) {\r\n __extends(PictorialBarView, _super);\r\n function PictorialBarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarView.type;\r\n return _this;\r\n }\r\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var coordSysRect = cartesian.master.getRect();\r\n var opt = {\r\n ecSize: { width: api.getWidth(), height: api.getHeight() },\r\n seriesModel: seriesModel,\r\n coordSys: cartesian,\r\n coordSysExtent: [\r\n [coordSysRect.x, coordSysRect.x + coordSysRect.width],\r\n [coordSysRect.y, coordSysRect.y + coordSysRect.height]\r\n ],\r\n isHorizontal: isHorizontal,\r\n valueDim: LAYOUT_ATTRS[+isHorizontal],\r\n categoryDim: LAYOUT_ATTRS[1 - (+isHorizontal)]\r\n };\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var itemModel = getItemModel(data, dataIndex);\r\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\r\n var bar = createBar(data, opt, symbolMeta);\r\n data.setItemGraphicEl(dataIndex, bar);\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var bar = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(bar);\r\n return;\r\n }\r\n var itemModel = getItemModel(data, newIndex);\r\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\r\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\r\n group.remove(bar);\r\n data.setItemGraphicEl(newIndex, null);\r\n bar = null;\r\n }\r\n if (bar) {\r\n updateBar(bar, opt, symbolMeta);\r\n }\r\n else {\r\n bar = createBar(data, opt, symbolMeta, true);\r\n }\r\n data.setItemGraphicEl(newIndex, bar);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .remove(function (dataIndex) {\r\n var bar = oldData.getItemGraphicEl(dataIndex);\r\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\r\n })\r\n .execute();\r\n this._data = data;\r\n return this.group;\r\n };\r\n PictorialBarView.prototype.remove = function (ecModel, api) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (ecModel.get('animation')) {\r\n if (data) {\r\n data.eachItemGraphicEl(function (bar) {\r\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\r\n });\r\n }\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n PictorialBarView.type = 'pictorialBar';\r\n return PictorialBarView;\r\n}(ChartView));\r\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var symbolRepeat = itemModel.get('symbolRepeat');\r\n var symbolClip = itemModel.get('symbolClip');\r\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\r\n var symbolRotate = itemModel.get('symbolRotate');\r\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\r\n var isAnimationEnabled = itemModel.isAnimationEnabled();\r\n var symbolMeta = {\r\n dataIndex: dataIndex,\r\n layout: layout,\r\n itemModel: itemModel,\r\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\r\n style: data.getItemVisual(dataIndex, 'style'),\r\n symbolClip: symbolClip,\r\n symbolRepeat: symbolRepeat,\r\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\r\n symbolPatternSize: symbolPatternSize,\r\n rotation: rotation,\r\n animationModel: isAnimationEnabled ? itemModel : null,\r\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\r\n z2: itemModel.getShallow('z', true) || 0\r\n };\r\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\r\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\r\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\r\n var symbolSize = symbolMeta.symbolSize;\r\n var symbolOffset = itemModel.get('symbolOffset');\r\n if (isArray(symbolOffset)) {\r\n symbolOffset = [\r\n parsePercent$2(symbolOffset[0], symbolSize[0]),\r\n parsePercent$2(symbolOffset[1], symbolSize[1])\r\n ];\r\n }\r\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\r\n return symbolMeta;\r\n}\r\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var symbolBoundingData = itemModel.get('symbolBoundingData');\r\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\r\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\r\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\r\n var boundingLength;\r\n if (isArray(symbolBoundingData)) {\r\n var symbolBoundingExtent = [\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\r\n ];\r\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\r\n boundingLength = symbolBoundingExtent[pxSignIdx];\r\n }\r\n else if (symbolBoundingData != null) {\r\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\r\n }\r\n else if (symbolRepeat) {\r\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\r\n }\r\n else {\r\n boundingLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.boundingLength = boundingLength;\r\n if (symbolRepeat) {\r\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\r\n}\r\nfunction convertToCoordOnAxis(axis, value) {\r\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\r\n}\r\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var categoryDim = opt.categoryDim;\r\n var categorySize = Math.abs(layout[categoryDim.wh]);\r\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\r\n var parsedSymbolSize;\r\n if (isArray(symbolSize)) {\r\n parsedSymbolSize = symbolSize.slice();\r\n }\r\n else {\r\n if (symbolSize == null) {\r\n parsedSymbolSize = ['100%', '100%'];\r\n }\r\n else {\r\n parsedSymbolSize = [symbolSize, symbolSize];\r\n }\r\n }\r\n parsedSymbolSize[categoryDim.index] = parsePercent$2(parsedSymbolSize[categoryDim.index], categorySize);\r\n parsedSymbolSize[valueDim.index] = parsePercent$2(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\r\n outputSymbolMeta.symbolSize = parsedSymbolSize;\r\n var symbolScale = outputSymbolMeta.symbolScale = [\r\n parsedSymbolSize[0] / symbolPatternSize,\r\n parsedSymbolSize[1] / symbolPatternSize\r\n ];\r\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\r\n}\r\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\r\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0;\r\n if (valueLineWidth) {\r\n pathForLineWidth.attr({\r\n scaleX: symbolScale[0],\r\n scaleY: symbolScale[1],\r\n rotation: rotation\r\n });\r\n pathForLineWidth.updateTransform();\r\n valueLineWidth /= pathForLineWidth.getLineScale();\r\n valueLineWidth *= symbolScale[opt.valueDim.index];\r\n }\r\n outputSymbolMeta.valueLineWidth = valueLineWidth;\r\n}\r\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\r\n var categoryDim = opt.categoryDim;\r\n var valueDim = opt.valueDim;\r\n var pxSign = outputSymbolMeta.pxSign;\r\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\r\n var pathLen = unitLength;\r\n if (symbolRepeat) {\r\n var absBoundingLength = Math.abs(boundingLength);\r\n var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + '';\r\n var hasEndGap = false;\r\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\r\n hasEndGap = true;\r\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\r\n }\r\n var symbolMarginNumeric = parsePercent$2(symbolMargin, symbolSize[valueDim.index]);\r\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\r\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n var repeatSpecified = isNumeric(symbolRepeat);\r\n var repeatTimes = repeatSpecified\r\n ? symbolRepeat\r\n : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\r\n var mDiff = absBoundingLength - repeatTimes * unitLength;\r\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\r\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\r\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\r\n repeatTimes = repeatCutLength\r\n ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin)\r\n : 0;\r\n }\r\n pathLen = repeatTimes * uLenWithMargin - endFix;\r\n outputSymbolMeta.repeatTimes = repeatTimes;\r\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\r\n }\r\n var sizeFix = pxSign * (pathLen / 2);\r\n var pathPosition = outputSymbolMeta.pathPosition = [];\r\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\r\n pathPosition[valueDim.index] = symbolPosition === 'start'\r\n ? sizeFix\r\n : symbolPosition === 'end'\r\n ? boundingLength - sizeFix\r\n : boundingLength / 2;\r\n if (symbolOffset) {\r\n pathPosition[0] += symbolOffset[0];\r\n pathPosition[1] += symbolOffset[1];\r\n }\r\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\r\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\r\n bundlePosition[valueDim.index] = layout[valueDim.xy];\r\n var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout);\r\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\r\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\r\n var clipShape = outputSymbolMeta.clipShape = {};\r\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\r\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\r\n clipShape[valueDim.xy] = 0;\r\n clipShape[valueDim.wh] = layout[valueDim.wh];\r\n}\r\nfunction createPath(symbolMeta) {\r\n var symbolPatternSize = symbolMeta.symbolPatternSize;\r\n var path = createSymbol(symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\r\n path.attr({\r\n culling: true\r\n });\r\n path.type !== 'image' && path.setStyle({\r\n strokeNoScale: true\r\n });\r\n return path;\r\n}\r\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var symbolSize = symbolMeta.symbolSize;\r\n var valueLineWidth = symbolMeta.valueLineWidth;\r\n var pathPosition = symbolMeta.pathPosition;\r\n var valueDim = opt.valueDim;\r\n var repeatTimes = symbolMeta.repeatTimes || 0;\r\n var index = 0;\r\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\r\n eachPath(bar, function (path) {\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n if (index < repeatTimes) {\r\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(path, null, { scaleX: 0, scaleY: 0 }, symbolMeta, isUpdate, function () {\r\n bundle.remove(path);\r\n });\r\n }\r\n index++;\r\n });\r\n for (; index < repeatTimes; index++) {\r\n var path = createPath(symbolMeta);\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n bundle.add(path);\r\n var target = makeTarget(index);\r\n updateAttr(path, {\r\n x: target.x,\r\n y: target.y,\r\n scaleX: 0,\r\n scaleY: 0\r\n }, {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n rotation: target.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n function makeTarget(index) {\r\n var position = pathPosition.slice();\r\n var pxSign = symbolMeta.pxSign;\r\n var i = index;\r\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\r\n i = repeatTimes - 1 - index;\r\n }\r\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n };\r\n }\r\n}\r\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var mainPath = bar.__pictorialMainPath;\r\n if (!mainPath) {\r\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\r\n bundle.add(mainPath);\r\n updateAttr(mainPath, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: 0,\r\n scaleY: 0,\r\n rotation: symbolMeta.rotation\r\n }, {\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1]\r\n }, symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(mainPath, null, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n}\r\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\r\n var rectShape = extend({}, symbolMeta.barRectShape);\r\n var barRect = bar.__pictorialBarRect;\r\n if (!barRect) {\r\n barRect = bar.__pictorialBarRect = new Rect({\r\n z2: 2,\r\n shape: rectShape,\r\n silent: true,\r\n style: {\r\n stroke: 'transparent',\r\n fill: 'transparent',\r\n lineWidth: 0\r\n }\r\n });\r\n bar.add(barRect);\r\n }\r\n else {\r\n updateAttr(barRect, null, { shape: rectShape }, symbolMeta, isUpdate);\r\n }\r\n}\r\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\r\n if (symbolMeta.symbolClip) {\r\n var clipPath = bar.__pictorialClipPath;\r\n var clipShape = extend({}, symbolMeta.clipShape);\r\n var valueDim = opt.valueDim;\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n if (clipPath) {\r\n updateProps(clipPath, { shape: clipShape }, animationModel, dataIndex);\r\n }\r\n else {\r\n clipShape[valueDim.wh] = 0;\r\n clipPath = new Rect({ shape: clipShape });\r\n bar.__pictorialBundle.setClipPath(clipPath);\r\n bar.__pictorialClipPath = clipPath;\r\n var target = {};\r\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\r\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { shape: target }, animationModel, dataIndex);\r\n }\r\n }\r\n}\r\nfunction getItemModel(data, dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\r\n itemModel.isAnimationEnabled = isAnimationEnabled;\r\n return itemModel;\r\n}\r\nfunction getAnimationDelayParams(path) {\r\n return {\r\n index: path.__pictorialAnimationIndex,\r\n count: path.__pictorialRepeatTimes\r\n };\r\n}\r\nfunction isAnimationEnabled() {\r\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\r\n}\r\nfunction createBar(data, opt, symbolMeta, isUpdate) {\r\n var bar = new Group();\r\n var bundle = new Group();\r\n bar.add(bundle);\r\n bar.__pictorialBundle = bundle;\r\n bundle.x = symbolMeta.bundlePosition[0];\r\n bundle.y = symbolMeta.bundlePosition[1];\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\r\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\r\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n return bar;\r\n}\r\nfunction updateBar(bar, opt, symbolMeta) {\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n var bundle = bar.__pictorialBundle;\r\n updateProps(bundle, {\r\n x: symbolMeta.bundlePosition[0],\r\n y: symbolMeta.bundlePosition[1]\r\n }, animationModel, dataIndex);\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, true);\r\n createOrUpdateClip(bar, opt, symbolMeta, true);\r\n}\r\nfunction removeBar(data, dataIndex, animationModel, bar) {\r\n var labelRect = bar.__pictorialBarRect;\r\n labelRect && (labelRect.removeTextContent());\r\n var pathes = [];\r\n eachPath(bar, function (path) {\r\n pathes.push(path);\r\n });\r\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath);\r\n bar.__pictorialClipPath && (animationModel = null);\r\n each(pathes, function (path) {\r\n removeElement(path, { scaleX: 0, scaleY: 0 }, animationModel, dataIndex, function () {\r\n bar.parent && bar.parent.remove(bar);\r\n });\r\n });\r\n data.setItemGraphicEl(dataIndex, null);\r\n}\r\nfunction getShapeStr(data, symbolMeta) {\r\n return [\r\n data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none',\r\n !!symbolMeta.symbolRepeat,\r\n !!symbolMeta.symbolClip\r\n ].join(':');\r\n}\r\nfunction eachPath(bar, cb, context) {\r\n each(bar.__pictorialBundle.children(), function (el) {\r\n el !== bar.__pictorialBarRect && cb.call(context, el);\r\n });\r\n}\r\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\r\n immediateAttrs && el.attr(immediateAttrs);\r\n if (symbolMeta.symbolClip && !isUpdate) {\r\n animationAttrs && el.attr(animationAttrs);\r\n }\r\n else {\r\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\r\n }\r\n}\r\nfunction updateCommon$1(bar, opt, symbolMeta) {\r\n var dataIndex = symbolMeta.dataIndex;\r\n var itemModel = symbolMeta.itemModel;\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n var focus = emphasisModel.get('focus');\r\n var blurScope = emphasisModel.get('blurScope');\r\n var hoverScale = emphasisModel.get('scale');\r\n eachPath(bar, function (path) {\r\n if (path instanceof ZRImage) {\r\n var pathStyle = path.style;\r\n path.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolMeta.style));\r\n }\r\n else {\r\n path.useStyle(symbolMeta.style);\r\n }\r\n var emphasisState = path.ensureState('emphasis');\r\n emphasisState.style = emphasisStyle;\r\n if (hoverScale) {\r\n emphasisState.scaleX = path.scaleX * 1.1;\r\n emphasisState.scaleY = path.scaleY * 1.1;\r\n }\r\n path.ensureState('blur').style = blurStyle;\r\n path.ensureState('select').style = selectStyle;\r\n cursorStyle && (path.cursor = cursorStyle);\r\n path.z2 = symbolMeta.z2;\r\n });\r\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\r\n var barRect = bar.__pictorialBarRect;\r\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\r\n labelFetcher: opt.seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\r\n inheritColor: symbolMeta.style.fill,\r\n defaultOpacity: symbolMeta.style.opacity,\r\n defaultOutsidePosition: barPositionOutside\r\n });\r\n enableHoverEmphasis(bar, focus, blurScope);\r\n}\r\nfunction toIntTimes(times) {\r\n var roundedTimes = Math.round(times);\r\n return Math.abs(times - roundedTimes) < 1e-4\r\n ? roundedTimes\r\n : Math.ceil(times);\r\n}\r\nChartView.registerClass(PictorialBarView);\n\nregisterLayout(curry(layout, 'pictorialBar'));\n\nvar SingleAxis = (function (_super) {\r\n __extends(SingleAxis, _super);\r\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n SingleAxis.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n SingleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.coordinateSystem.pointToData(point)[0];\r\n };\r\n return SingleAxis;\r\n}(Axis));\n\nvar Single = (function () {\r\n function Single(axisModel, ecModel, api) {\r\n this.type = 'single';\r\n this.dimension = 'single';\r\n this.dimensions = ['single'];\r\n this.axisPointerEnabled = true;\r\n this.model = axisModel;\r\n this._init(axisModel, ecModel, api);\r\n }\r\n Single.prototype._init = function (axisModel, ecModel, api) {\r\n var dim = this.dimension;\r\n var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axis.orient = axisModel.get('orient');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = this;\r\n this._axis = axis;\r\n };\r\n Single.prototype.update = function (ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === this) {\r\n var data_1 = seriesModel.getData();\r\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\r\n this._axis.scale.unionExtentFromData(data_1, dim);\r\n }, this);\r\n niceScaleExtent(this._axis.scale, this._axis.model);\r\n }\r\n }, this);\r\n };\r\n Single.prototype.resize = function (axisModel, api) {\r\n this._rect = getLayoutRect({\r\n left: axisModel.get('left'),\r\n top: axisModel.get('top'),\r\n right: axisModel.get('right'),\r\n bottom: axisModel.get('bottom'),\r\n width: axisModel.get('width'),\r\n height: axisModel.get('height')\r\n }, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._adjustAxis();\r\n };\r\n Single.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Single.prototype._adjustAxis = function () {\r\n var rect = this._rect;\r\n var axis = this._axis;\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\r\n var idx = axis.reverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\r\n };\r\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var extentSum = axisExtent[0] + axisExtent[1];\r\n var isHorizontal = axis.isHorizontal();\r\n axis.toGlobalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n };\r\n Single.prototype.getAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getBaseAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getAxes = function () {\r\n return [this._axis];\r\n };\r\n Single.prototype.getTooltipAxes = function () {\r\n return {\r\n baseAxes: [this.getAxis()],\r\n otherAxes: []\r\n };\r\n };\r\n Single.prototype.containPoint = function (point) {\r\n var rect = this.getRect();\r\n var axis = this.getAxis();\r\n var orient = axis.orient;\r\n if (orient === 'horizontal') {\r\n return axis.contain(axis.toLocalCoord(point[0]))\r\n && (point[1] >= rect.y && point[1] <= (rect.y + rect.height));\r\n }\r\n else {\r\n return axis.contain(axis.toLocalCoord(point[1]))\r\n && (point[0] >= rect.y && point[0] <= (rect.y + rect.height));\r\n }\r\n };\r\n Single.prototype.pointToData = function (point) {\r\n var axis = this.getAxis();\r\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\r\n };\r\n Single.prototype.dataToPoint = function (val) {\r\n var axis = this.getAxis();\r\n var rect = this.getRect();\r\n var pt = [];\r\n var idx = axis.orient === 'horizontal' ? 0 : 1;\r\n if (val instanceof Array) {\r\n val = val[0];\r\n }\r\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\r\n pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2);\r\n return pt;\r\n };\r\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Single;\r\n}());\r\nfunction getCoordSys$2(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var singleModel = finder.singleAxisModel;\r\n return singleModel && singleModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n}\n\nfunction create$3(ecModel, api) {\r\n var singles = [];\r\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\r\n var single = new Single(axisModel, ecModel, api);\r\n single.name = 'single_' + idx;\r\n single.resize(axisModel, api);\r\n axisModel.coordinateSystem = single;\r\n singles.push(single);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\r\n }\r\n });\r\n return singles;\r\n}\r\nCoordinateSystemManager.register('single', {\r\n create: create$3,\r\n dimensions: Single.prototype.dimensions\r\n});\n\nfunction layout$2(axisModel, opt) {\r\n opt = opt || {};\r\n var single = axisModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var axisPosition = axis.position;\r\n var orient = axis.orient;\r\n var rect = single.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var positionMap = {\r\n horizontal: { top: rectBound[2], bottom: rectBound[3] },\r\n vertical: { left: rectBound[0], right: rectBound[1] }\r\n };\r\n layout.position = [\r\n orient === 'vertical'\r\n ? positionMap.vertical[axisPosition]\r\n : rectBound[0],\r\n orient === 'horizontal'\r\n ? positionMap.horizontal[axisPosition]\r\n : rectBound[3]\r\n ];\r\n var r = { horizontal: 0, vertical: 1 };\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n var directionMap = { top: -1, bottom: 1, right: 1, left: -1 };\r\n layout.labelDirection = layout.tickDirection =\r\n layout.nameDirection = directionMap[axisPosition];\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n layout.z2 = 1;\r\n return layout;\r\n}\n\nvar axisBuilderAttrs$2 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs$1 = ['splitArea', 'splitLine'];\r\nvar SingleAxisView = (function (_super) {\r\n __extends(SingleAxisView, _super);\r\n function SingleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisView.type;\r\n _this.axisPointerClass = 'SingleAxisPointer';\r\n return _this;\r\n }\r\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n var layout = layout$2(axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, layout);\r\n each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder);\r\n group.add(this._axisGroup);\r\n group.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs$1, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders$1[name](this, this.group, this._axisGroup, axisModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n SingleAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n SingleAxisView.type = 'singleAxis';\r\n return SingleAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders$1 = {\r\n splitLine: function (axisView, group, axisGroup, axisModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var gridRect = axisModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var splitLines = [];\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n for (var i = 0; i < ticksCoords.length; ++i) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n silent: true\r\n }));\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle(['color']);\r\n for (var i = 0; i < splitLines.length; ++i) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n splitArea: function (axisView, group, axisGroup, axisModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\r\n }\r\n};\r\nComponentView.registerClass(SingleAxisView);\n\nvar SingleAxisModel = (function (_super) {\r\n __extends(SingleAxisModel, _super);\r\n function SingleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisModel.type;\r\n return _this;\r\n }\r\n SingleAxisModel.prototype.getCoordSysModel = function () {\r\n return this;\r\n };\r\n SingleAxisModel.type = 'singleAxis';\r\n SingleAxisModel.layoutMode = 'box';\r\n SingleAxisModel.defaultOption = {\r\n left: '5%',\r\n top: '5%',\r\n right: '5%',\r\n bottom: '5%',\r\n type: 'value',\r\n position: 'bottom',\r\n orient: 'horizontal',\r\n axisLine: {\r\n show: true,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n tooltip: {\r\n show: true\r\n },\r\n axisTick: {\r\n show: true,\r\n length: 6,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n interval: 'auto'\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n type: 'dashed',\r\n opacity: 0.2\r\n }\r\n }\r\n };\r\n return SingleAxisModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(SingleAxisModel);\r\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\r\naxisModelCreator('single', SingleAxisModel, SingleAxisModel.defaultOption);\n\nfunction findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n}\n\nvar inner$b = makeInner();\r\nfunction axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n}\r\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n}\r\nfunction buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n}\r\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n}\r\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n}\r\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n}\r\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n}\r\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$b(zr)[highDownKey] || {};\r\n var newHighlights = inner$b(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n}\r\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n}\r\nfunction makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n}\r\nfunction illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n}\n\nvar inner$c = makeInner();\r\nvar each$8 = each;\r\nfunction register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$c(zr).records || (inner$c(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$c(zr).records[key] || (inner$c(zr).records[key] = {});\r\n record.handler = handler;\r\n}\r\nfunction initGlobalListeners(zr, api) {\r\n if (inner$c(zr).initialized) {\r\n return;\r\n }\r\n inner$c(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$8(inner$c(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n}\r\nfunction dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n}\r\nfunction onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n}\r\nfunction doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n}\r\nfunction makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n}\r\nfunction unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$c(zr).records || {})[key];\r\n if (record) {\r\n inner$c(zr).records[key] = null;\r\n }\r\n}\n\nvar AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n}(ComponentView));\r\nComponentView.registerClass(AxisPointerView);\n\nvar inner$d = makeInner();\r\nvar clone$3 = clone;\r\nvar bind$1 = bind;\r\nvar BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$d(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$d(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$d(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$d(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$d(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n}());\r\nfunction updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$d(el).lastProp, props)) {\r\n inner$d(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n}\r\nfunction propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n}\r\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n}\r\nfunction getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n}\r\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n}\n\nfunction buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n}\r\nfunction buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n}\r\nfunction confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n}\r\nfunction getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n}\r\nfunction getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n}\r\nfunction buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n}\r\nfunction makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n}\r\nfunction makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n}\r\nfunction makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: true\r\n };\r\n}\n\nvar CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n}(BaseAxisPointer));\r\nfunction getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n}\r\nvar pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n};\r\nfunction getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n}\r\nAxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\nvar AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n}(ComponentModel));\n\nComponentModel.registerClass(AxisPointerModel);\r\nregisterPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n});\r\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n});\r\nregisterAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n}, axisTrigger);\n\nvar XY = ['x', 'y'];\r\nvar WH = ['width', 'height'];\r\nvar SingleAxisPointer = (function (_super) {\r\n __extends(SingleAxisPointer, _super);\r\n function SingleAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\r\n var pixelValue = coordSys.dataToPoint(value)[0];\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$2(axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$2(axisModel, { labelInside: false });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var position = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var dimIndex = getPointDimIndex(axis);\r\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: {\r\n verticalAlign: 'middle'\r\n }\r\n };\r\n };\r\n return SingleAxisPointer;\r\n}(BaseAxisPointer));\r\nvar pointerShapeBuilder$1 = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = axis.getBandWidth();\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\r\n };\r\n }\r\n};\r\nfunction getPointDimIndex(axis) {\r\n return axis.isHorizontal() ? 0 : 1;\r\n}\r\nfunction getGlobalExtent(coordSys, dimIndex) {\r\n var rect = coordSys.getRect();\r\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\r\n}\r\nAxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n\nextendComponentView({\r\n type: 'single'\r\n});\n\nvar DATA_NAME_INDEX = 2;\r\nvar ThemeRiverSeriesModel = (function (_super) {\r\n __extends(ThemeRiverSeriesModel, _super);\r\n function ThemeRiverSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n ThemeRiverSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\r\n var rawDataLength = data.length;\r\n var timeValueKeys = {};\r\n var groupResult = groupData(data, function (item) {\r\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\r\n timeValueKeys[item[0] + ''] = -1;\r\n }\r\n return item[2];\r\n });\r\n var layerData = [];\r\n groupResult.buckets.each(function (items, key) {\r\n layerData.push({\r\n name: key, dataList: items\r\n });\r\n });\r\n var layerNum = layerData.length;\r\n for (var k = 0; k < layerNum; ++k) {\r\n var name_1 = layerData[k].name;\r\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\r\n var timeValue = layerData[k].dataList[j][0] + '';\r\n timeValueKeys[timeValue] = k;\r\n }\r\n for (var timeValue in timeValueKeys) {\r\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\r\n timeValueKeys[timeValue] = k;\r\n data[rawDataLength] = [timeValue, 0, name_1];\r\n rawDataLength++;\r\n }\r\n }\r\n }\r\n return data;\r\n };\r\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n var axisType = singleAxisModel.get('type');\r\n var filterData = filter(option.data, function (dataItem) {\r\n return dataItem[2] !== undefined;\r\n });\r\n var data = this.fixData(filterData || []);\r\n var nameList = [];\r\n var nameMap = this.nameMap = createHashMap();\r\n var count = 0;\r\n for (var i = 0; i < data.length; ++i) {\r\n nameList.push(data[i][DATA_NAME_INDEX]);\r\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\r\n nameMap.set(data[i][DATA_NAME_INDEX], count);\r\n count++;\r\n }\r\n }\r\n var dimensionsInfo = createDimensions(data, {\r\n coordDimensions: ['single'],\r\n dimensionsDefine: [\r\n {\r\n name: 'time',\r\n type: getDimensionTypeByAxis(axisType)\r\n },\r\n {\r\n name: 'value',\r\n type: 'float'\r\n },\r\n {\r\n name: 'name',\r\n type: 'ordinal'\r\n }\r\n ],\r\n encodeDefine: {\r\n single: 0,\r\n value: 1,\r\n itemName: 2\r\n }\r\n });\r\n var list = new List(dimensionsInfo, this);\r\n list.initData(data);\r\n return list;\r\n };\r\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\r\n var data = this.getData();\r\n var lenCount = data.count();\r\n var indexArr = [];\r\n for (var i = 0; i < lenCount; ++i) {\r\n indexArr[i] = i;\r\n }\r\n var timeDim = data.mapDimension('single');\r\n var groupResult = groupData(indexArr, function (index) {\r\n return data.get('name', index);\r\n });\r\n var layerSeries = [];\r\n groupResult.buckets.each(function (items, key) {\r\n items.sort(function (index1, index2) {\r\n return data.get(timeDim, index1) - data.get(timeDim, index2);\r\n });\r\n layerSeries.push({\r\n name: key,\r\n indices: items\r\n });\r\n });\r\n return layerSeries;\r\n };\r\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\r\n if (!isArray(dim)) {\r\n dim = dim ? [dim] : [];\r\n }\r\n var data = this.getData();\r\n var layerSeries = this.getLayerSeries();\r\n var indices = [];\r\n var layerNum = layerSeries.length;\r\n var nestestValue;\r\n for (var i = 0; i < layerNum; ++i) {\r\n var minDist = Number.MAX_VALUE;\r\n var nearestIdx = -1;\r\n var pointNum = layerSeries[i].indices.length;\r\n for (var j = 0; j < pointNum; ++j) {\r\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\r\n var dist = Math.abs(theValue - value);\r\n if (dist <= minDist) {\r\n nestestValue = theValue;\r\n minDist = dist;\r\n nearestIdx = layerSeries[i].indices[j];\r\n }\r\n }\r\n indices.push(nearestIdx);\r\n }\r\n return { dataIndices: indices, nestestValue: nestestValue };\r\n };\r\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var name = data.getName(dataIndex);\r\n var value = data.get(data.mapDimension('value'), dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n ThemeRiverSeriesModel.type = 'series.themeRiver';\r\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\r\n ThemeRiverSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'singleAxis',\r\n boundaryGap: ['10%', '10%'],\r\n singleAxisIndex: 0,\r\n animationEasing: 'linear',\r\n label: {\r\n margin: 4,\r\n show: true,\r\n position: 'left',\r\n fontSize: 11\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return ThemeRiverSeriesModel;\r\n}(SeriesModel));\r\nSeriesModel.registerClass(ThemeRiverSeriesModel);\n\nvar ThemeRiverView = (function (_super) {\r\n __extends(ThemeRiverView, _super);\r\n function ThemeRiverView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverView.type;\r\n _this._layers = [];\r\n return _this;\r\n }\r\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var self = this;\r\n var group = this.group;\r\n var layersSeries = seriesModel.getLayerSeries();\r\n var layoutInfo = data.getLayout('layoutInfo');\r\n var rect = layoutInfo.rect;\r\n var boundaryGap = layoutInfo.boundaryGap;\r\n group.x = 0;\r\n group.y = rect.y + boundaryGap[0];\r\n function keyGetter(item) {\r\n return item.name;\r\n }\r\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\r\n var newLayersGroups = [];\r\n dataDiffer\r\n .add(bind(process, this, 'add'))\r\n .update(bind(process, this, 'update'))\r\n .remove(bind(process, this, 'remove'))\r\n .execute();\r\n function process(status, idx, oldIdx) {\r\n var oldLayersGroups = self._layers;\r\n if (status === 'remove') {\r\n group.remove(oldLayersGroups[idx]);\r\n return;\r\n }\r\n var points0 = [];\r\n var points1 = [];\r\n var style;\r\n var indices = layersSeries[idx].indices;\r\n var j = 0;\r\n for (; j < indices.length; j++) {\r\n var layout = data.getItemLayout(indices[j]);\r\n var x = layout.x;\r\n var y0 = layout.y0;\r\n var y = layout.y;\r\n points0.push(x, y0);\r\n points1.push(x, y0 + y);\r\n style = data.getItemVisual(indices[j], 'style');\r\n }\r\n var polygon;\r\n var textLayout = data.getItemLayout(indices[0]);\r\n var labelModel = seriesModel.getModel('label');\r\n var margin = labelModel.get('margin');\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n if (status === 'add') {\r\n var layerGroup = newLayersGroups[idx] = new Group();\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1,\r\n smooth: 0.4,\r\n stackedOnSmooth: 0.4,\r\n smoothConstraint: false\r\n },\r\n z2: 0\r\n });\r\n layerGroup.add(polygon);\r\n group.add(layerGroup);\r\n if (seriesModel.isAnimationEnabled()) {\r\n polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () {\r\n polygon.removeClipPath();\r\n }));\r\n }\r\n }\r\n else {\r\n var layerGroup = oldLayersGroups[oldIdx];\r\n polygon = layerGroup.childAt(0);\r\n group.add(layerGroup);\r\n newLayersGroups[idx] = layerGroup;\r\n updateProps(polygon, {\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1\r\n }\r\n }, seriesModel);\r\n }\r\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\r\n labelDataIndex: indices[j - 1],\r\n defaultText: data.getName(indices[j - 1]),\r\n inheritColor: style.fill\r\n }, {\r\n normal: {\r\n verticalAlign: 'middle'\r\n }\r\n });\r\n polygon.setTextConfig({\r\n position: null,\r\n local: true\r\n });\r\n var labelEl = polygon.getTextContent();\r\n if (labelEl) {\r\n labelEl.x = textLayout.x - margin;\r\n labelEl.y = textLayout.y0 + textLayout.y / 2;\r\n }\r\n polygon.useStyle(style);\r\n data.setItemGraphicEl(idx, polygon);\r\n setStatesStylesFromModel(polygon, seriesModel);\r\n enableHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n this._layersSeries = layersSeries;\r\n this._layers = newLayersGroups;\r\n };\r\n ThemeRiverView.type = 'themeRiver';\r\n return ThemeRiverView;\r\n}(ChartView));\r\nfunction createGridClipShape$2(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n x: rect.x - 50,\r\n width: rect.width + 100,\r\n height: rect.height + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\nChartView.registerClass(ThemeRiverView);\n\nfunction themeRiverLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var single = seriesModel.coordinateSystem;\r\n var layoutInfo = {};\r\n var rect = single.getRect();\r\n layoutInfo.rect = rect;\r\n var boundaryGap = seriesModel.get('boundaryGap');\r\n var axis = single.getAxis();\r\n layoutInfo.boundaryGap = boundaryGap;\r\n if (axis.orient === 'horizontal') {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.height);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.height);\r\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, height);\r\n }\r\n else {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.width);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.width);\r\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, width);\r\n }\r\n data.setLayout('layoutInfo', layoutInfo);\r\n });\r\n}\r\nfunction doThemeRiverLayout(data, seriesModel, height) {\r\n if (!data.count()) {\r\n return;\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n var layerSeries = seriesModel.getLayerSeries();\r\n var timeDim = data.mapDimension('single');\r\n var valueDim = data.mapDimension('value');\r\n var layerPoints = map(layerSeries, function (singleLayer) {\r\n return map(singleLayer.indices, function (idx) {\r\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\r\n pt[1] = data.get(valueDim, idx);\r\n return pt;\r\n });\r\n });\r\n var base = computeBaseline(layerPoints);\r\n var baseLine = base.y0;\r\n var ky = height / base.max;\r\n var n = layerSeries.length;\r\n var m = layerSeries[0].indices.length;\r\n var baseY0;\r\n for (var j = 0; j < m; ++j) {\r\n baseY0 = baseLine[j] * ky;\r\n data.setItemLayout(layerSeries[0].indices[j], {\r\n layerIndex: 0,\r\n x: layerPoints[0][j][0],\r\n y0: baseY0,\r\n y: layerPoints[0][j][1] * ky\r\n });\r\n for (var i = 1; i < n; ++i) {\r\n baseY0 += layerPoints[i - 1][j][1] * ky;\r\n data.setItemLayout(layerSeries[i].indices[j], {\r\n layerIndex: i,\r\n x: layerPoints[i][j][0],\r\n y0: baseY0,\r\n y: layerPoints[i][j][1] * ky\r\n });\r\n }\r\n }\r\n}\r\nfunction computeBaseline(data) {\r\n var layerNum = data.length;\r\n var pointNum = data[0].length;\r\n var sums = [];\r\n var y0 = [];\r\n var max = 0;\r\n for (var i = 0; i < pointNum; ++i) {\r\n var temp = 0;\r\n for (var j = 0; j < layerNum; ++j) {\r\n temp += data[j][i][1];\r\n }\r\n if (temp > max) {\r\n max = temp;\r\n }\r\n sums.push(temp);\r\n }\r\n for (var k = 0; k < pointNum; ++k) {\r\n y0[k] = (max - sums[k]) / 2;\r\n }\r\n max = 0;\r\n for (var l = 0; l < pointNum; ++l) {\r\n var sum = sums[l] + y0[l];\r\n if (sum > max) {\r\n max = sum;\r\n }\r\n }\r\n return {\r\n y0: y0,\r\n max: max\r\n };\r\n}\n\nregisterLayout(themeRiverLayout);\r\nregisterProcessor(dataFilter('themeRiver'));\n\nvar SunburstSeriesModel = (function (_super) {\r\n __extends(SunburstSeriesModel, _super);\r\n function SunburstSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstSeriesModel.type;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = { name: option.name, children: option.data };\r\n completeTreeValue$1(root);\r\n var levelModels = map(option.levels || [], function (levelDefine) {\r\n return new Model(levelDefine, this, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n levelModel && (model.parentModel = levelModel);\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n SunburstSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n SunburstSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n SunburstSeriesModel.type = 'series.sunburst';\r\n SunburstSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n stillShowZeroSum: true,\r\n nodeClick: 'rootToNode',\r\n renderLabelForZeroData: false,\r\n label: {\r\n rotate: 'radial',\r\n show: true,\r\n opacity: 1,\r\n align: 'center',\r\n position: 'inside',\r\n distance: 5,\r\n silent: true\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderColor: 'white',\r\n borderType: 'solid',\r\n shadowBlur: 0,\r\n shadowColor: 'rgba(0, 0, 0, 0.2)',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n emphasis: {\r\n focus: 'descendant'\r\n },\r\n blur: {\r\n itemStyle: {\r\n opacity: 0.2\r\n },\r\n label: {\r\n opacity: 0.1\r\n }\r\n },\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n data: [],\r\n levels: [],\r\n sort: 'desc'\r\n };\r\n return SunburstSeriesModel;\r\n}(SeriesModel));\r\nfunction completeTreeValue$1(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue$1(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\nSeriesModel.registerClass(SunburstSeriesModel);\n\nvar DEFAULT_SECTOR_Z = 2;\r\nvar DEFAULT_TEXT_Z = 4;\r\nvar SunburstPiece = (function (_super) {\r\n __extends(SunburstPiece, _super);\r\n function SunburstPiece(node, seriesModel, ecModel, api) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = DEFAULT_SECTOR_Z;\r\n _this.textConfig = {\r\n inside: true\r\n };\r\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\r\n var text = new ZRText({\r\n z2: DEFAULT_TEXT_Z,\r\n silent: node.getModel().get(['label', 'silent'])\r\n });\r\n _this.setTextContent(text);\r\n _this.updateData(true, node, seriesModel, ecModel, api);\r\n return _this;\r\n }\r\n SunburstPiece.prototype.updateData = function (firstCreate, node, seriesModel, ecModel, api) {\r\n this.node = node;\r\n node.piece = this;\r\n seriesModel = seriesModel || this._seriesModel;\r\n ecModel = ecModel || this._ecModel;\r\n var sector = this;\r\n getECData(sector).dataIndex = node.dataIndex;\r\n var itemModel = node.getModel();\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = node.getLayout();\r\n var sectorShape = extend({}, layout);\r\n sectorShape.label = null;\r\n var normalStyle = node.getVisual('style');\r\n normalStyle.lineJoin = 'bevel';\r\n var decal = node.getVisual('decal');\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape);\r\n extend(sectorShape, cornerRadius);\r\n each(SPECIAL_STATES, function (stateName) {\r\n var state = sector.ensureState(stateName);\r\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\r\n state.style = itemStyleModel.getItemStyle();\r\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\r\n if (cornerRadius) {\r\n state.shape = cornerRadius;\r\n }\r\n });\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n sector.shape.r = layout.r0;\r\n updateProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, node.dataIndex);\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel);\r\n }\r\n sector.useStyle(normalStyle);\r\n this._updateLabel(seriesModel);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._seriesModel = seriesModel || this._seriesModel;\r\n this._ecModel = ecModel || this._ecModel;\r\n var focus = emphasisModel.get('focus');\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n enableHoverEmphasis(this, focusDataIndices || focus, emphasisModel.get('blurScope'));\r\n };\r\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\r\n var _this = this;\r\n var itemModel = this.node.getModel();\r\n var normalLabelModel = itemModel.getModel('label');\r\n var layout = this.node.getLayout();\r\n var angle = layout.endAngle - layout.startAngle;\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var dx = Math.cos(midAngle);\r\n var dy = Math.sin(midAngle);\r\n var sector = this;\r\n var label = sector.getTextContent();\r\n var dataIndex = this.node.dataIndex;\r\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\r\n var isNormalShown = normalLabelModel.get('show')\r\n && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\r\n label.ignore = !isNormalShown;\r\n each(DISPLAY_STATES, function (stateName) {\r\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label')\r\n : itemModel.getModel([stateName, 'label']);\r\n var isNormal = stateName === 'normal';\r\n var state = isNormal ? label : label.ensureState(stateName);\r\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\r\n if (isNormal) {\r\n text = text || _this.node.name;\r\n }\r\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\r\n if (text) {\r\n state.style.text = text;\r\n }\r\n var isShown = labelStateModel.get('show');\r\n if (isShown != null && !isNormal) {\r\n state.ignore = !isShown;\r\n }\r\n var labelPosition = getLabelAttr(labelStateModel, 'position');\r\n var sectorState = isNormal ? sector : sector.states[stateName];\r\n var labelColor = sectorState.style.fill;\r\n sectorState.textConfig = {\r\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\r\n inside: labelPosition !== 'outside'\r\n };\r\n var r;\r\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\r\n var textAlign = getLabelAttr(labelStateModel, 'align');\r\n if (labelPosition === 'outside') {\r\n r = layout.r + labelPadding;\r\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\r\n }\r\n else {\r\n if (!textAlign || textAlign === 'center') {\r\n r = (layout.r + layout.r0) / 2;\r\n textAlign = 'center';\r\n }\r\n else if (textAlign === 'left') {\r\n r = layout.r0 + labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (textAlign === 'right') {\r\n r = layout.r - labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'left';\r\n }\r\n }\r\n }\r\n state.style.align = textAlign;\r\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\r\n state.x = r * dx + layout.cx;\r\n state.y = r * dy + layout.cy;\r\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\r\n var rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = -midAngle;\r\n if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = Math.PI / 2 - midAngle;\r\n if (rotate > Math.PI / 2) {\r\n rotate -= Math.PI;\r\n }\r\n else if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (typeof rotateType === 'number') {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n state.rotation = rotate;\r\n });\r\n function getLabelAttr(model, name) {\r\n var stateAttr = model.get(name);\r\n if (stateAttr == null) {\r\n return normalLabelModel.get(name);\r\n }\r\n return stateAttr;\r\n }\r\n label.dirtyStyle();\r\n };\r\n return SunburstPiece;\r\n}(Sector));\n\nvar ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\r\nregisterAction({ type: ROOT_TO_NODE_ACTION, update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n});\r\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\r\nregisterAction({ type: HIGHLIGHT_ACTION, update: 'none' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleHighlight);\r\n function handleHighlight(model) {\r\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\r\n if (targetInfo) {\r\n payload.dataIndex = targetInfo.node.dataIndex;\r\n }\r\n }\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlight', 'sunburstHighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'highlight'\r\n }));\r\n});\r\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\r\nregisterAction({ type: UNHIGHLIGHT_ACTION, update: 'updateView' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'sunburstUnhighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'downplay'\r\n }));\r\n});\n\nvar SunburstView = (function (_super) {\r\n __extends(SunburstView, _super);\r\n function SunburstView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstView.type;\r\n return _this;\r\n }\r\n SunburstView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var self = this;\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var data = seriesModel.getData();\r\n var virtualRoot = data.tree.root;\r\n var newRoot = seriesModel.getViewRoot();\r\n var group = this.group;\r\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\r\n var newChildren = [];\r\n newRoot.eachNode(function (node) {\r\n newChildren.push(node);\r\n });\r\n var oldChildren = this._oldChildren || [];\r\n dualTravel(newChildren, oldChildren);\r\n renderRollUp(virtualRoot, newRoot);\r\n this._initEvents();\r\n this._oldChildren = newChildren;\r\n function dualTravel(newChildren, oldChildren) {\r\n if (newChildren.length === 0 && oldChildren.length === 0) {\r\n return;\r\n }\r\n new DataDiffer(oldChildren, newChildren, getKey, getKey)\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIdx, oldIdx) {\r\n var newNode = newIdx == null ? null : newChildren[newIdx];\r\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\r\n doRenderNode(newNode, oldNode);\r\n }\r\n }\r\n function doRenderNode(newNode, oldNode) {\r\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\r\n newNode = null;\r\n }\r\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\r\n if (oldNode && oldNode.piece) {\r\n if (newNode) {\r\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\r\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\r\n }\r\n else {\r\n removeNode(oldNode);\r\n }\r\n }\r\n else if (newNode) {\r\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\r\n group.add(piece);\r\n data.setItemGraphicEl(newNode.dataIndex, piece);\r\n }\r\n }\r\n }\r\n function removeNode(node) {\r\n if (!node) {\r\n return;\r\n }\r\n if (node.piece) {\r\n group.remove(node.piece);\r\n node.piece = null;\r\n }\r\n }\r\n function renderRollUp(virtualRoot, viewRoot) {\r\n if (viewRoot.depth > 0) {\r\n if (self.virtualPiece) {\r\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\r\n }\r\n else {\r\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\r\n group.add(self.virtualPiece);\r\n }\r\n viewRoot.piece.off('click');\r\n self.virtualPiece.on('click', function (e) {\r\n self._rootToNode(viewRoot.parentNode);\r\n });\r\n }\r\n else if (self.virtualPiece) {\r\n group.remove(self.virtualPiece);\r\n self.virtualPiece = null;\r\n }\r\n }\r\n };\r\n SunburstView.prototype._initEvents = function () {\r\n var _this = this;\r\n this.group.off('click');\r\n this.group.on('click', function (e) {\r\n var targetFound = false;\r\n var viewRoot = _this.seriesModel.getViewRoot();\r\n viewRoot.eachNode(function (node) {\r\n if (!targetFound\r\n && node.piece && node.piece === e.target) {\r\n var nodeClick = node.getModel().get('nodeClick');\r\n if (nodeClick === 'rootToNode') {\r\n _this._rootToNode(node);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.getModel();\r\n var link = itemModel.get('link');\r\n if (link) {\r\n var linkTarget = itemModel.get('target', true)\r\n || '_blank';\r\n windowOpen(link, linkTarget);\r\n }\r\n }\r\n targetFound = true;\r\n }\r\n });\r\n });\r\n };\r\n SunburstView.prototype._rootToNode = function (node) {\r\n if (node !== this.seriesModel.getViewRoot()) {\r\n this.api.dispatchAction({\r\n type: ROOT_TO_NODE_ACTION,\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: node\r\n });\r\n }\r\n };\r\n SunburstView.prototype.containPoint = function (point, seriesModel) {\r\n var treeRoot = seriesModel.getData();\r\n var itemLayout = treeRoot.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n SunburstView.type = 'sunburst';\r\n return SunburstView;\r\n}(ChartView));\r\nChartView.registerClass(SunburstView);\n\nvar RADIAN$2 = Math.PI / 180;\r\nfunction sunburstLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width);\r\n var cy = parsePercent$2(center[1], height);\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$2;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$2;\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var treeRoot = seriesModel.getViewRoot();\r\n var rootDepth = treeRoot.depth;\r\n var sort = seriesModel.get('sort');\r\n if (sort != null) {\r\n initChildren$1(treeRoot, sort);\r\n }\r\n var validDataCount = 0;\r\n each(treeRoot.children, function (child) {\r\n !isNaN(child.getValue()) && validDataCount++;\r\n });\r\n var sum = treeRoot.getValue();\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var renderRollupNode = treeRoot.depth > 0;\r\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\r\n var rPerLevel = (r - r0) / (levels || 1);\r\n var clockwise = seriesModel.get('clockwise');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var dir = clockwise ? 1 : -1;\r\n var renderNode = function (node, startAngle) {\r\n if (!node) {\r\n return;\r\n }\r\n var endAngle = startAngle;\r\n if (node !== virtualRoot) {\r\n var value = node.getValue();\r\n var angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n }\r\n endAngle = startAngle + dir * angle;\r\n var depth = node.depth - rootDepth\r\n - (renderRollupNode ? -1 : 1);\r\n var rStart = r0 + rPerLevel * depth;\r\n var rEnd = r0 + rPerLevel * (depth + 1);\r\n var itemModel = node.getModel();\r\n if (itemModel.get('r0') != null) {\r\n rStart = parsePercent$2(itemModel.get('r0'), size / 2);\r\n }\r\n if (itemModel.get('r') != null) {\r\n rEnd = parsePercent$2(itemModel.get('r'), size / 2);\r\n }\r\n node.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n if (node.children && node.children.length) {\r\n var siblingAngle_1 = 0;\r\n each(node.children, function (node) {\r\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\r\n });\r\n }\r\n return endAngle - startAngle;\r\n };\r\n if (renderRollupNode) {\r\n var rStart = r0;\r\n var rEnd = r0 + rPerLevel;\r\n var angle = Math.PI * 2;\r\n virtualRoot.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: startAngle + angle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n renderNode(treeRoot, startAngle);\r\n });\r\n}\r\nfunction initChildren$1(node, sortOrder) {\r\n var children = node.children || [];\r\n node.children = sort$2(children, sortOrder);\r\n if (children.length) {\r\n each(node.children, function (child) {\r\n initChildren$1(child, sortOrder);\r\n });\r\n }\r\n}\r\nfunction sort$2(children, sortOrder) {\r\n if (typeof sortOrder === 'function') {\r\n var sortTargets = map(children, function (child, idx) {\r\n var value = child.getValue();\r\n return {\r\n params: {\r\n depth: child.depth,\r\n height: child.height,\r\n dataIndex: child.dataIndex,\r\n getValue: function () { return value; }\r\n },\r\n index: idx\r\n };\r\n });\r\n sortTargets.sort(function (a, b) {\r\n return sortOrder(a.params, b.params);\r\n });\r\n return map(sortTargets, function (target) {\r\n return children[target.index];\r\n });\r\n }\r\n else {\r\n var isAsc_1 = sortOrder === 'asc';\r\n return children.sort(function (a, b) {\r\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\r\n return diff === 0\r\n ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1)\r\n : diff;\r\n });\r\n }\r\n}\n\nfunction sunburstVisual(ecModel) {\r\n var paletteScope = {};\r\n function pickColor(node, seriesModel, treeHeight) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var color = seriesModel.getColorFromPalette((current.name || current.dataIndex + ''), paletteScope);\r\n if (node.depth > 1 && typeof color === 'string') {\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n return color;\r\n }\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\n\nregisterLayout(curry(sunburstLayout, 'sunburst'));\r\nregisterProcessor(curry(dataFilter, 'sunburst'));\r\nregisterVisual(sunburstVisual);\n\nfunction dataToCoordSize(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['x', 'y'], function (dim, dimIdx) {\r\n var axis = this.getAxis(dim);\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }, this);\r\n}\r\nfunction cartesianPrepareCustom(coordSys) {\r\n var rect = coordSys.master.getRect();\r\n return {\r\n coordSys: {\r\n type: 'cartesian2d',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$1(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map([0, 1], function (dimIdx) {\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var p1 = [];\r\n var p2 = [];\r\n p1[dimIdx] = val - halfSize;\r\n p2[dimIdx] = val + halfSize;\r\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\r\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\r\n }, this);\r\n}\r\nfunction geoPrepareCustom(coordSys) {\r\n var rect = coordSys.getBoundingRect();\r\n return {\r\n coordSys: {\r\n type: 'geo',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n zoom: coordSys.getZoom()\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize$1, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$2(dataSize, dataItem) {\r\n var axis = this.getAxis();\r\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\r\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n}\r\nfunction singlePrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n return {\r\n coordSys: {\r\n type: 'singleAxis',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (val) {\r\n return coordSys.dataToPoint(val);\r\n },\r\n size: bind(dataToCoordSize$2, coordSys)\r\n }\r\n };\r\n}\n\nfunction dataToCoordSize$3(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['Radius', 'Angle'], function (dim, dimIdx) {\r\n var getterName = 'get' + dim + 'Axis';\r\n var axis = this[getterName]();\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var result = axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n if (dim === 'Angle') {\r\n result = result * Math.PI / 180;\r\n }\r\n return result;\r\n }, this);\r\n}\r\nfunction polarPrepareCustom(coordSys) {\r\n var radiusAxis = coordSys.getRadiusAxis();\r\n var angleAxis = coordSys.getAngleAxis();\r\n var radius = radiusAxis.getExtent();\r\n radius[0] > radius[1] && radius.reverse();\r\n return {\r\n coordSys: {\r\n type: 'polar',\r\n cx: coordSys.cx,\r\n cy: coordSys.cy,\r\n r: radius[1],\r\n r0: radius[0]\r\n },\r\n api: {\r\n coord: function (data) {\r\n var radius = radiusAxis.dataToRadius(data[0]);\r\n var angle = angleAxis.dataToAngle(data[1]);\r\n var coord = coordSys.coordToPoint([radius, angle]);\r\n coord.push(radius, angle * Math.PI / 180);\r\n return coord;\r\n },\r\n size: bind(dataToCoordSize$3, coordSys)\r\n }\r\n };\r\n}\n\nfunction calendarPrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n var rangeInfo = coordSys.getRangeInfo();\r\n return {\r\n coordSys: {\r\n type: 'calendar',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n cellWidth: coordSys.getCellWidth(),\r\n cellHeight: coordSys.getCellHeight(),\r\n rangeInfo: {\r\n start: rangeInfo.start,\r\n end: rangeInfo.end,\r\n weeks: rangeInfo.weeks,\r\n dayCount: rangeInfo.allDay\r\n }\r\n },\r\n api: {\r\n coord: function (data, clamp) {\r\n return coordSys.dataToPoint(data, clamp);\r\n }\r\n }\r\n };\r\n}\n\nvar deprecatedLogs = {};\r\nfunction isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n}\r\nfunction convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n}\r\nfunction convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n}\r\nfunction convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\r\n var out = itemStl;\r\n out.textPosition = out.textPosition || txCfg.position || 'inside';\r\n txCfg.offset != null && (out.textOffset = txCfg.offset);\r\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\r\n txCfg.distance != null && (out.textDistance = txCfg.distance);\r\n var isInside = out.textPosition.indexOf('inside') >= 0;\r\n var hostFill = itemStl.fill || '#000';\r\n convertToEC4RichItem(out, txStl);\r\n var textFillNotSet = out.textFill == null;\r\n if (isInside) {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.insideFill || '#fff';\r\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\r\n !out.textStroke && (out.textStroke = hostFill);\r\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\r\n }\r\n }\r\n else {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.outsideFill || hostFill;\r\n }\r\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\r\n }\r\n out.text = txStl.text;\r\n out.rich = txStl.rich;\r\n each(txStl.rich, function (richItem) {\r\n convertToEC4RichItem(richItem, richItem);\r\n });\r\n return out;\r\n}\r\nfunction convertToEC4RichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\r\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\r\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\r\n hasOwn(richItem, 'font') && (out.font = richItem.font);\r\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\r\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\r\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\r\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\r\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\r\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\r\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\r\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\r\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\r\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\r\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\r\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\r\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\r\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\r\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\r\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\r\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\r\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\r\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\r\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\r\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\r\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\r\n}\r\nfunction warnDeprecated(deprecated, insteadApproach) {\r\n if (__DEV__) {\r\n var key = deprecated + '^_^' + insteadApproach;\r\n if (!deprecatedLogs[key]) {\r\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\r\n deprecatedLogs[key] = true;\r\n }\r\n }\r\n}\n\nvar inner$e = makeInner();\r\nvar TRANSFORM_PROPS = {\r\n x: 1,\r\n y: 1,\r\n scaleX: 1,\r\n scaleY: 1,\r\n originX: 1,\r\n originY: 1,\r\n rotation: 1\r\n};\r\nvar transformPropNamesStr = keys(TRANSFORM_PROPS).join(', ');\r\nvar STYLE_VISUAL_TYPE = {\r\n color: 'fill',\r\n borderColor: 'stroke'\r\n};\r\nvar NON_STYLE_VISUAL_PROPS = {\r\n symbol: 1,\r\n symbolSize: 1,\r\n symbolKeepAspect: 1,\r\n legendSymbol: 1,\r\n visualMeta: 1,\r\n liftZ: 1,\r\n decal: 1\r\n};\r\nvar EMPHASIS = 'emphasis';\r\nvar NORMAL = 'normal';\r\nvar BLUR = 'blur';\r\nvar SELECT = 'select';\r\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\r\nvar PATH_ITEM_STYLE = {\r\n normal: ['itemStyle'],\r\n emphasis: [EMPHASIS, 'itemStyle'],\r\n blur: [BLUR, 'itemStyle'],\r\n select: [SELECT, 'itemStyle']\r\n};\r\nvar PATH_LABEL = {\r\n normal: ['label'],\r\n emphasis: [EMPHASIS, 'label'],\r\n blur: [BLUR, 'label'],\r\n select: [SELECT, 'label']\r\n};\r\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\r\nvar attachedTxInfoTmp = {\r\n normal: {},\r\n emphasis: {},\r\n blur: {},\r\n select: {}\r\n};\r\nvar LEGACY_TRANSFORM_PROPS = {\r\n position: ['x', 'y'],\r\n scale: ['scaleX', 'scaleY'],\r\n origin: ['originX', 'originY']\r\n};\r\nvar tmpTransformable = new Transformable();\r\nvar prepareCustoms = {\r\n cartesian2d: cartesianPrepareCustom,\r\n geo: geoPrepareCustom,\r\n singleAxis: singlePrepareCustom,\r\n polar: polarPrepareCustom,\r\n calendar: calendarPrepareCustom\r\n};\r\nvar CustomSeriesModel = (function (_super) {\r\n __extends(CustomSeriesModel, _super);\r\n function CustomSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesModel.type;\r\n return _this;\r\n }\r\n CustomSeriesModel.prototype.optionUpdated = function () {\r\n this.currentZLevel = this.get('zlevel', true);\r\n this.currentZ = this.get('z', true);\r\n };\r\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this);\r\n };\r\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n el && (params.info = inner$e(el).info);\r\n return params;\r\n };\r\n CustomSeriesModel.type = 'series.custom';\r\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n CustomSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n clip: false\r\n };\r\n return CustomSeriesModel;\r\n}(SeriesModel));\r\nComponentModel.registerClass(CustomSeriesModel);\r\nvar CustomSeriesView = (function (_super) {\r\n __extends(CustomSeriesView, _super);\r\n function CustomSeriesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesView.type;\r\n return _this;\r\n }\r\n CustomSeriesView.prototype.render = function (customSeries, ecModel, api, payload) {\r\n var oldData = this._data;\r\n var data = customSeries.getData();\r\n var group = this.group;\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n var transOpt = customSeries.__transientTransitionOpt;\r\n if (transOpt && (transOpt.from == null || transOpt.to == null)) {\r\n oldData && oldData.each(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n });\r\n data.each(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n });\r\n }\r\n else {\r\n var morphPreparation_1 = new MorphPreparation(customSeries, transOpt);\r\n var diffMode = transOpt ? 'multiple' : 'oneToOne';\r\n (new DataDiffer(oldData ? oldData.getIndices() : [], data.getIndices(), createGetKey(oldData, diffMode, transOpt && transOpt.from), createGetKey(data, diffMode, transOpt && transOpt.to), null, diffMode))\r\n .add(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n })\r\n .remove(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n morphPreparation_1.reset('oneToOne');\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n if (morphPreparation_1.hasFrom()) {\r\n removeElementDirectly(oldEl, group);\r\n oldEl = null;\r\n }\r\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateManyToOne(function (newIdx, oldIndices) {\r\n morphPreparation_1.reset('manyToOne');\r\n for (var i = 0; i < oldIndices.length; i++) {\r\n var oldEl = oldData.getItemGraphicEl(oldIndices[i]);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n }\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateOneToMany(function (newIndices, oldIdx) {\r\n morphPreparation_1.reset('oneToMany');\r\n var newLen = newIndices.length;\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n for (var i = 0; i < newLen; i++) {\r\n createOrUpdateItem(api, null, newIndices[i], renderItem(newIndices[i], payload), customSeries, group, data, morphPreparation_1);\r\n }\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .execute();\r\n }\r\n var clipPath = customSeries.get('clip', true)\r\n ? createClipPath(customSeries.coordinateSystem, false, customSeries)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n this._data = data;\r\n };\r\n CustomSeriesView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CustomSeriesView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\r\n var data = customSeries.getData();\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n function setIncrementalAndHoverLayer(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = params.start; idx < params.end; idx++) {\r\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data, null);\r\n el.traverse(setIncrementalAndHoverLayer);\r\n }\r\n };\r\n CustomSeriesView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\r\n var elementName = query.element;\r\n if (elementName == null || targetEl.name === elementName) {\r\n return true;\r\n }\r\n while ((targetEl = (targetEl.__hostTarget || targetEl.parent)) && targetEl !== this.group) {\r\n if (targetEl.name === elementName) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n CustomSeriesView.type = 'custom';\r\n return CustomSeriesView;\r\n}(ChartView));\r\nChartView.registerClass(CustomSeriesView);\r\nfunction createGetKey(data, diffMode, dimension) {\r\n if (!data) {\r\n return;\r\n }\r\n if (diffMode === 'oneToOne') {\r\n return function (rawIdx, dataIndex) {\r\n return data.getId(dataIndex);\r\n };\r\n }\r\n var diffByDimName = data.getDimension(dimension);\r\n var dimInfo = data.getDimensionInfo(diffByDimName);\r\n if (!dimInfo) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = dimension + \" is not a valid dimension.\";\r\n }\r\n throwError(errMsg);\r\n }\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n return function (rawIdx, dataIndex) {\r\n var key = data.get(diffByDimName, dataIndex);\r\n if (ordinalMeta) {\r\n key = ordinalMeta.categories[key];\r\n }\r\n return (key == null || eqNaN(key))\r\n ? rawIdx + ''\r\n : '_ec_' + key;\r\n };\r\n}\r\nfunction createEl(elOption) {\r\n var graphicType = elOption.type;\r\n var el;\r\n if (graphicType === 'path') {\r\n var shape = elOption.shape;\r\n var pathRect = (shape.width != null && shape.height != null)\r\n ? {\r\n x: shape.x || 0,\r\n y: shape.y || 0,\r\n width: shape.width,\r\n height: shape.height\r\n }\r\n : null;\r\n var pathData = getPathData(shape);\r\n el = makePath(pathData, null, pathRect, shape.layout || 'center');\r\n inner$e(el).customPathData = pathData;\r\n }\r\n else if (graphicType === 'image') {\r\n el = new ZRImage({});\r\n inner$e(el).customImagePath = elOption.style.image;\r\n }\r\n else if (graphicType === 'text') {\r\n el = new ZRText({});\r\n }\r\n else if (graphicType === 'group') {\r\n el = new Group();\r\n }\r\n else if (graphicType === 'compoundPath') {\r\n throw new Error('\"compoundPath\" is not supported yet.');\r\n }\r\n else {\r\n var Clz = getShapeClass(graphicType);\r\n if (!Clz) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\r\n }\r\n throwError(errMsg);\r\n }\r\n el = new Clz();\r\n }\r\n inner$e(el).customGraphicType = graphicType;\r\n el.name = elOption.name;\r\n el.z2EmphasisLift = 1;\r\n el.z2SelectLift = 1;\r\n return el;\r\n}\r\nfunction updateElNormal(api, el, isMorphTo, dataIndex, elOption, styleOpt, attachedTxInfo, seriesModel, isInit, isTextContent) {\r\n var transFromProps = {};\r\n var allPropsFinal = {};\r\n var elDisplayable = el.isGroup ? null : el;\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('shape', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('shape', elOption, allPropsFinal);\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('extra', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('extra', elOption, allPropsFinal);\r\n !isMorphTo && prepareTransformTransitionFrom(el, null, elOption, transFromProps, isInit);\r\n prepareTransformAllPropsFinal(elOption, allPropsFinal);\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\r\n if (txCfgOpt) {\r\n el.setTextConfig(txCfgOpt);\r\n }\r\n if (el.type === 'text' && styleOpt) {\r\n var textOptionStyle = styleOpt;\r\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\r\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\r\n }\r\n if (styleOpt) {\r\n var decalPattern = void 0;\r\n var decalObj = isPath$1(el) ? styleOpt.decal : null;\r\n if (api && decalObj) {\r\n decalObj.dirty = true;\r\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\r\n }\r\n styleOpt.__decalPattern = decalPattern;\r\n }\r\n !isMorphTo && prepareStyleTransitionFrom(el, null, elOption, styleOpt, transFromProps, isInit);\r\n if (elDisplayable) {\r\n hasOwn(elOption, 'invisible') && (elDisplayable.invisible = elOption.invisible);\r\n }\r\n if (!isMorphTo) {\r\n applyPropsFinal(el, allPropsFinal, styleOpt);\r\n applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit);\r\n }\r\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\r\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\r\n if (!isTextContent) {\r\n hasOwn(elOption, 'info') && (inner$e(el).info = elOption.info);\r\n }\r\n styleOpt ? el.dirty() : el.markRedraw();\r\n return isMorphTo ? allPropsFinal : null;\r\n}\r\nfunction applyPropsFinal(el, allPropsFinal, styleOpt) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n if (elDisplayable && styleOpt) {\r\n var decalPattern = styleOpt.__decalPattern;\r\n var originalDecalObj = void 0;\r\n if (decalPattern) {\r\n originalDecalObj = styleOpt.decal;\r\n styleOpt.decal = decalPattern;\r\n }\r\n elDisplayable.useStyle(styleOpt);\r\n if (decalPattern) {\r\n styleOpt.decal = originalDecalObj;\r\n }\r\n var animators = elDisplayable.animators;\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (animator.targetName === 'style') {\r\n animator.changeTarget(elDisplayable.style);\r\n }\r\n }\r\n }\r\n allPropsFinal && el.attr(allPropsFinal);\r\n}\r\nfunction applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit) {\r\n if (transFromProps) {\r\n var userDuring = elOption.during;\r\n inner$e(el).userDuring = userDuring;\r\n var cfgDuringCall = userDuring ? bind(duringCall, { el: el, userDuring: userDuring }) : null;\r\n var cfg = {\r\n dataIndex: dataIndex,\r\n isFrom: true,\r\n during: cfgDuringCall\r\n };\r\n isInit\r\n ? initProps(el, transFromProps, seriesModel, cfg)\r\n : updateProps(el, transFromProps, seriesModel, cfg);\r\n }\r\n}\r\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, el, morphFromEl, elOption, transFromProps, isInit) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var elPropsInAttr = el[mainAttr];\r\n var transFromPropsInAttr;\r\n var enterFrom = attrOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromPropsInAttr[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit\r\n && elPropsInAttr\r\n && !(morphFromEl != null && mainAttr === 'shape')) {\r\n if (attrOpt.transition) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var transitionKeys = normalizeToArray(attrOpt.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer(key, attrOpt[key], elVal);\r\n }\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n else if (indexOf(elOption.transition, mainAttr) >= 0) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var elPropsInAttrKeys = keys(elPropsInAttr);\r\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\r\n var key = elPropsInAttrKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = attrOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToPropsInAttr = leaveToProps[mainAttr] || (leaveToProps[mainAttr] = {});\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToPropsInAttr[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var allPropsInAttr = allProps[mainAttr] = {};\r\n var keysInAttr = keys(attrOpt);\r\n for (var i = 0; i < keysInAttr.length; i++) {\r\n var key = keysInAttr[i];\r\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\r\n }\r\n}\r\nfunction prepareTransformTransitionFrom(el, morphFromEl, elOption, transFromProps, isInit) {\r\n var enterFrom = elOption.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.enterFrom');\r\n }\r\n transFromProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit) {\r\n if (morphFromEl) {\r\n var fromTransformable = calcOldElLocalTransformBasedOnNewElParent(morphFromEl, el);\r\n setTransformPropToTransitionFrom(transFromProps, 'x', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'rotation', fromTransformable);\r\n }\r\n else if (elOption.transition) {\r\n var transitionKeys = normalizeToArray(elOption.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n if (key === 'style' || key === 'shape' || key === 'extra') {\r\n continue;\r\n }\r\n var elVal = el[key];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.transition');\r\n checkNonStyleTansitionRefer(key, elOption[key], elVal);\r\n }\r\n transFromProps[key] = elVal;\r\n }\r\n }\r\n else {\r\n setTransformPropToTransitionFrom(transFromProps, 'x', el);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', el);\r\n }\r\n }\r\n var leaveTo = elOption.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.leaveTo');\r\n }\r\n leaveToProps[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction prepareTransformAllPropsFinal(elOption, allProps) {\r\n setLagecyTransformProp(elOption, allProps, 'position');\r\n setLagecyTransformProp(elOption, allProps, 'scale');\r\n setLagecyTransformProp(elOption, allProps, 'origin');\r\n setTransformProp(elOption, allProps, 'x');\r\n setTransformProp(elOption, allProps, 'y');\r\n setTransformProp(elOption, allProps, 'scaleX');\r\n setTransformProp(elOption, allProps, 'scaleY');\r\n setTransformProp(elOption, allProps, 'originX');\r\n setTransformProp(elOption, allProps, 'originY');\r\n setTransformProp(elOption, allProps, 'rotation');\r\n}\r\nfunction prepareStyleTransitionFrom(el, morphFromEl, elOption, styleOpt, transFromProps, isInit) {\r\n if (!styleOpt) {\r\n return;\r\n }\r\n var fromEl = morphFromEl || el;\r\n var fromElStyle = fromEl.style;\r\n var transFromStyleProps;\r\n var enterFrom = styleOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromStyleProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit && fromElStyle) {\r\n if (styleOpt.transition) {\r\n var transitionKeys = normalizeToArray(styleOpt.transition);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n else if (el.getAnimationStyleProps\r\n && indexOf(elOption.transition, 'style') >= 0) {\r\n var animationProps = el.getAnimationStyleProps();\r\n var animationStyleProps = animationProps ? animationProps.style : null;\r\n if (animationStyleProps) {\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n var styleKeys = keys(styleOpt);\r\n for (var i = 0; i < styleKeys.length; i++) {\r\n var key = styleKeys[i];\r\n if (animationStyleProps[key]) {\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = styleOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToKeys = keys(leaveTo);\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToStyleProps = leaveToProps.style || (leaveToProps.style = {});\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToStyleProps[key] = leaveTo[key];\r\n }\r\n }\r\n}\r\nfunction calcOldElLocalTransformBasedOnNewElParent(oldEl, newEl) {\r\n if (!oldEl || oldEl === newEl || oldEl.parent === newEl.parent) {\r\n return oldEl;\r\n }\r\n var tmpM = tmpTransformable.transform\r\n || (tmpTransformable.transform = identity([]));\r\n var oldGlobalTransform = oldEl.getComputedTransform();\r\n oldGlobalTransform\r\n ? copy$1(tmpM, oldGlobalTransform)\r\n : identity(tmpM);\r\n var newParent = newEl.parent;\r\n if (newParent) {\r\n newParent.getComputedTransform();\r\n }\r\n tmpTransformable.originX = oldEl.originX;\r\n tmpTransformable.originY = oldEl.originY;\r\n tmpTransformable.parent = newParent;\r\n tmpTransformable.decomposeTransform();\r\n return tmpTransformable;\r\n}\r\nvar checkNonStyleTansitionRefer;\r\nif (__DEV__) {\r\n checkNonStyleTansitionRefer = function (propName, optVal, elVal) {\r\n if (!isArrayLike(optVal)) {\r\n assert(optVal != null && isFinite(optVal), 'Prop `' + propName + '` must refer to a finite number or ArrayLike for transition.');\r\n }\r\n else {\r\n assert(optVal !== elVal, 'Prop `' + propName + '` must use different Array object each time for transition.');\r\n }\r\n };\r\n}\r\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\r\n return !isArrayLike(optVal)\r\n ? (optVal != null && isFinite(optVal))\r\n : optVal !== elVal;\r\n}\r\nvar checkTransformPropRefer;\r\nif (__DEV__) {\r\n checkTransformPropRefer = function (key, usedIn) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Prop `' + key + '` is not a permitted in `' + usedIn + '`. '\r\n + 'Only `' + keys(TRANSFORM_PROPS).join('`, `') + '` are permitted.');\r\n };\r\n}\r\nfunction getOrCreateLeaveToPropsFromEl(el) {\r\n var innerEl = inner$e(el);\r\n return innerEl.leaveToProps || (innerEl.leaveToProps = {});\r\n}\r\nvar tmpDuringScope = {};\r\nvar customDuringAPI = {\r\n setTransform: function (key, val) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\r\n }\r\n tmpDuringScope.el[key] = val;\r\n return this;\r\n },\r\n getTransform: function (key) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\r\n }\r\n return tmpDuringScope.el[key];\r\n },\r\n setShape: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape\r\n || (tmpDuringScope.el.shape = {});\r\n shape[key] = val;\r\n tmpDuringScope.isShapeDirty = true;\r\n return this;\r\n },\r\n getShape: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape;\r\n if (shape) {\r\n return shape[key];\r\n }\r\n },\r\n setStyle: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n if (__DEV__) {\r\n if (eqNaN(val)) {\r\n warn('style.' + key + ' must not be assigned with NaN.');\r\n }\r\n }\r\n style[key] = val;\r\n tmpDuringScope.isStyleDirty = true;\r\n }\r\n return this;\r\n },\r\n getStyle: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n return style[key];\r\n }\r\n },\r\n setExtra: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra\r\n || (tmpDuringScope.el.extra = {});\r\n extra[key] = val;\r\n return this;\r\n },\r\n getExtra: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra;\r\n if (extra) {\r\n return extra[key];\r\n }\r\n }\r\n};\r\nfunction assertNotReserved(key) {\r\n if (__DEV__) {\r\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\r\n throw new Error('key must not be \"' + key + '\"');\r\n }\r\n }\r\n}\r\nfunction duringCall() {\r\n var scope = this;\r\n var el = scope.el;\r\n if (!el) {\r\n return;\r\n }\r\n var newstUserDuring = inner$e(el).userDuring;\r\n var scopeUserDuring = scope.userDuring;\r\n if (newstUserDuring !== scopeUserDuring) {\r\n scope.el = scope.userDuring = null;\r\n return;\r\n }\r\n tmpDuringScope.el = el;\r\n tmpDuringScope.isShapeDirty = false;\r\n tmpDuringScope.isStyleDirty = false;\r\n scopeUserDuring(customDuringAPI);\r\n if (tmpDuringScope.isShapeDirty && el.dirtyShape) {\r\n el.dirtyShape();\r\n }\r\n if (tmpDuringScope.isStyleDirty && el.dirtyStyle) {\r\n el.dirtyStyle();\r\n }\r\n}\r\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo, isRoot, isTextContent) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\r\n if (elDisplayable) {\r\n var stateObj = elDisplayable.ensureState(state);\r\n if (styleOpt === false) {\r\n var existingEmphasisState = elDisplayable.getState(state);\r\n if (existingEmphasisState) {\r\n existingEmphasisState.style = null;\r\n }\r\n }\r\n else {\r\n stateObj.style = styleOpt || null;\r\n }\r\n if (txCfgOpt) {\r\n stateObj.textConfig = txCfgOpt;\r\n }\r\n setDefaultStateProxy(elDisplayable);\r\n }\r\n}\r\nfunction updateZ$1(el, elOption, seriesModel, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n var elDisplayable = el;\r\n var currentZ = seriesModel.currentZ;\r\n var currentZLevel = seriesModel.currentZLevel;\r\n elDisplayable.z = currentZ;\r\n elDisplayable.zlevel = currentZLevel;\r\n var optZ2 = elOption.z2;\r\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\r\n for (var i = 0; i < STATES.length; i++) {\r\n updateZForEachState(elDisplayable, elOption, STATES[i]);\r\n }\r\n}\r\nfunction updateZForEachState(elDisplayable, elOption, state) {\r\n var isNormal = state === NORMAL;\r\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\r\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\r\n var stateObj;\r\n if (optZ2 != null) {\r\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\r\n stateObj.z2 = optZ2 || 0;\r\n }\r\n}\r\nfunction setLagecyTransformProp(elOption, targetProps, legacyName, fromTransformable) {\r\n var legacyArr = elOption[legacyName];\r\n var xyName = LEGACY_TRANSFORM_PROPS[legacyName];\r\n if (legacyArr) {\r\n if (fromTransformable) {\r\n targetProps[xyName[0]] = fromTransformable[xyName[0]];\r\n targetProps[xyName[1]] = fromTransformable[xyName[1]];\r\n }\r\n else {\r\n targetProps[xyName[0]] = legacyArr[0];\r\n targetProps[xyName[1]] = legacyArr[1];\r\n }\r\n }\r\n}\r\nfunction setTransformProp(elOption, allProps, name, fromTransformable) {\r\n if (elOption[name] != null) {\r\n allProps[name] = fromTransformable ? fromTransformable[name] : elOption[name];\r\n }\r\n}\r\nfunction setTransformPropToTransitionFrom(transitionFrom, name, fromTransformable) {\r\n if (fromTransformable) {\r\n transitionFrom[name] = fromTransformable[name];\r\n }\r\n}\r\nfunction makeRenderItem(customSeries, data, ecModel, api) {\r\n var renderItem = customSeries.get('renderItem');\r\n var coordSys = customSeries.coordinateSystem;\r\n var prepareResult = {};\r\n if (coordSys) {\r\n if (__DEV__) {\r\n assert(renderItem, 'series.render is required.');\r\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\r\n }\r\n prepareResult = coordSys.prepareCustoms\r\n ? coordSys.prepareCustoms(coordSys)\r\n : prepareCustoms[coordSys.type](coordSys);\r\n }\r\n var userAPI = defaults({\r\n getWidth: api.getWidth,\r\n getHeight: api.getHeight,\r\n getZr: api.getZr,\r\n getDevicePixelRatio: api.getDevicePixelRatio,\r\n value: value,\r\n style: style,\r\n ordinalRawValue: ordinalRawValue,\r\n styleEmphasis: styleEmphasis,\r\n visual: visual,\r\n barLayout: barLayout,\r\n currentSeriesIndices: currentSeriesIndices,\r\n font: font\r\n }, prepareResult.api || {});\r\n var userParams = {\r\n context: {},\r\n seriesId: customSeries.id,\r\n seriesName: customSeries.name,\r\n seriesIndex: customSeries.seriesIndex,\r\n coordSys: prepareResult.coordSys,\r\n dataInsideLength: data.count(),\r\n encode: wrapEncodeDef(customSeries.getData())\r\n };\r\n var currDataIndexInside;\r\n var currItemModel;\r\n var currItemStyleModels = {};\r\n var currLabelModels = {};\r\n var seriesItemStyleModels = {};\r\n var seriesLabelModels = {};\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n seriesItemStyleModels[stateName] = customSeries\r\n .getModel(PATH_ITEM_STYLE[stateName]);\r\n seriesLabelModels[stateName] = customSeries\r\n .getModel(PATH_LABEL[stateName]);\r\n }\r\n function getItemModel(dataIndexInside) {\r\n return dataIndexInside === currDataIndexInside\r\n ? (currItemModel || (currItemModel = data.getItemModel(dataIndexInside)))\r\n : data.getItemModel(dataIndexInside);\r\n }\r\n function getItemStyleModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesItemStyleModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\r\n }\r\n function getLabelModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesLabelModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\r\n }\r\n return function (dataIndexInside, payload) {\r\n currDataIndexInside = dataIndexInside;\r\n currItemModel = null;\r\n currItemStyleModels = {};\r\n currLabelModels = {};\r\n return renderItem && renderItem(defaults({\r\n dataIndexInside: dataIndexInside,\r\n dataIndex: data.getRawIndex(dataIndexInside),\r\n actionType: payload ? payload.type : null\r\n }, userParams), userAPI);\r\n };\r\n function value(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n return data.get(data.getDimension(dim || 0), dataIndexInside);\r\n }\r\n function ordinalRawValue(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var dimInfo = data.getDimensionInfo(dim || 0);\r\n if (!dimInfo) {\r\n return;\r\n }\r\n var val = data.get(dimInfo.name, dataIndexInside);\r\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.categories[val]\r\n : val;\r\n }\r\n function style(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.style', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var style = data.getItemVisual(dataIndexInside, 'style');\r\n var visualColor = style && style.fill;\r\n var opacity = style && style.opacity;\r\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\r\n visualColor != null && (itemStyle.fill = visualColor);\r\n opacity != null && (itemStyle.opacity = opacity);\r\n var opt = { inheritColor: isString(visualColor) ? visualColor : '#000' };\r\n var labelModel = getLabelModel(dataIndexInside, NORMAL);\r\n var textStyle = createTextStyle(labelModel, null, opt, false, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, opt, false);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function styleEmphasis(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\r\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\r\n var textStyle = createTextStyle(labelModel, null, null, true, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, null, true);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function applyUserPropsAfter(itemStyle, extra) {\r\n for (var key in extra) {\r\n if (hasOwn(extra, key)) {\r\n itemStyle[key] = extra[key];\r\n }\r\n }\r\n }\r\n function preFetchFromExtra(extra, itemStyle) {\r\n if (extra) {\r\n extra.textFill && (itemStyle.textFill = extra.textFill);\r\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\r\n }\r\n }\r\n function visual(visualType, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\r\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\r\n return style_1\r\n ? style_1[STYLE_VISUAL_TYPE[visualType]]\r\n : null;\r\n }\r\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\r\n return data.getItemVisual(dataIndexInside, visualType);\r\n }\r\n }\r\n function barLayout(opt) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var baseAxis = coordSys.getBaseAxis();\r\n return getLayoutOnAxis(defaults({ axis: baseAxis }, opt));\r\n }\r\n }\r\n function currentSeriesIndices() {\r\n return ecModel.getCurrentSeriesIndices();\r\n }\r\n function font(opt) {\r\n return getFont(opt, ecModel);\r\n }\r\n}\r\nfunction wrapEncodeDef(data) {\r\n var encodeDef = {};\r\n each(data.dimensions, function (dimName, dataDimIndex) {\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isExtraCoord) {\r\n var coordDim = dimInfo.coordDim;\r\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\r\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\r\n }\r\n });\r\n return encodeDef;\r\n}\r\nfunction createOrUpdateItem(api, el, dataIndex, elOption, seriesModel, group, data, morphPreparation) {\r\n if (!elOption) {\r\n removeElementDirectly(el, group);\r\n return;\r\n }\r\n el = doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, true, morphPreparation);\r\n el && data.setItemGraphicEl(dataIndex, el);\r\n enableHoverEmphasis(el, elOption.focus, elOption.blurScope);\r\n return el;\r\n}\r\nfunction doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, isRoot, morphPreparation) {\r\n if (__DEV__) {\r\n assert(elOption, 'should not have an null/undefined element setting');\r\n }\r\n var toBeReplacedIdx = -1;\r\n if (el && (doesElNeedRecreate(el, elOption))) {\r\n toBeReplacedIdx = group.childrenRef().indexOf(el);\r\n el = null;\r\n }\r\n var elIsNewCreated = !el;\r\n if (!el) {\r\n el = createEl(elOption);\r\n }\r\n else {\r\n el.clearStates();\r\n }\r\n var canMorph = inner$e(el).canMorph = elOption.morph && isPath$1(el);\r\n var thisElIsMorphTo = canMorph && morphPreparation && morphPreparation.hasFrom();\r\n var isInit = elIsNewCreated && !thisElIsMorphTo;\r\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt =\r\n attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt =\r\n attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt =\r\n attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\r\n attachedTxInfoTmp.isLegacy = false;\r\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\r\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\r\n var pendingAllPropsFinal = updateElNormal(api, el, thisElIsMorphTo, dataIndex, elOption, elOption.style, attachedTxInfoTmp, seriesModel, isInit, false);\r\n if (thisElIsMorphTo) {\r\n morphPreparation.addTo(el, elOption, dataIndex, pendingAllPropsFinal);\r\n }\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var otherStateOpt = retrieveStateOption(elOption, stateName);\r\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\r\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\r\n }\r\n }\r\n updateZ$1(el, elOption, seriesModel);\r\n if (elOption.type === 'group') {\r\n mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation);\r\n }\r\n if (toBeReplacedIdx >= 0) {\r\n group.replaceAt(el, toBeReplacedIdx);\r\n }\r\n else {\r\n group.add(el);\r\n }\r\n return el;\r\n}\r\nfunction doesElNeedRecreate(el, elOption) {\r\n var elInner = inner$e(el);\r\n var elOptionType = elOption.type;\r\n var elOptionShape = elOption.shape;\r\n var elOptionStyle = elOption.style;\r\n return ((elOptionType != null\r\n && elOptionType !== elInner.customGraphicType)\r\n || (elOptionType === 'path'\r\n && hasOwnPathData(elOptionShape)\r\n && getPathData(elOptionShape) !== elInner.customPathData)\r\n || (elOptionType === 'image'\r\n && hasOwn(elOptionStyle, 'image')\r\n && elOptionStyle.image !== elInner.customImagePath));\r\n}\r\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\r\n var clipPathOpt = elOption.clipPath;\r\n if (clipPathOpt === false) {\r\n if (el && el.getClipPath()) {\r\n el.removeClipPath();\r\n }\r\n }\r\n else if (clipPathOpt) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {\r\n clipPath = null;\r\n }\r\n if (!clipPath) {\r\n clipPath = createEl(clipPathOpt);\r\n if (__DEV__) {\r\n assert(clipPath instanceof Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\r\n }\r\n el.setClipPath(clipPath);\r\n }\r\n updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);\r\n }\r\n}\r\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n processTxInfo(elOption, null, attachedTxInfo);\r\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\r\n var txConOptNormal = attachedTxInfo.normal.conOpt;\r\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\r\n var txConOptBlur = attachedTxInfo.blur.conOpt;\r\n var txConOptSelect = attachedTxInfo.select.conOpt;\r\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\r\n var textContent = el.getTextContent();\r\n if (txConOptNormal === false) {\r\n textContent && el.removeTextContent();\r\n }\r\n else {\r\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { type: 'text' };\r\n if (!textContent) {\r\n textContent = createEl(txConOptNormal);\r\n el.setTextContent(textContent);\r\n }\r\n else {\r\n textContent.clearStates();\r\n }\r\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\r\n updateElNormal(null, textContent, null, dataIndex, txConOptNormal, txConStlOptNormal, null, seriesModel, isInit, true);\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\r\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\r\n }\r\n }\r\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\r\n }\r\n }\r\n}\r\nfunction processTxInfo(elOption, state, attachedTxInfo) {\r\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\r\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\r\n var elType = elOption.type;\r\n var txCfg = stateOpt ? stateOpt.textConfig : null;\r\n var txConOptNormal = elOption.textContent;\r\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\r\n if (styleOpt && (attachedTxInfo.isLegacy\r\n || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\r\n attachedTxInfo.isLegacy = true;\r\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\r\n if (!txCfg && convertResult.textConfig) {\r\n txCfg = convertResult.textConfig;\r\n }\r\n if (!txConOpt && convertResult.textContent) {\r\n txConOpt = convertResult.textContent;\r\n }\r\n }\r\n if (!state && txConOpt) {\r\n var txConOptNormal_1 = txConOpt;\r\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\r\n if (__DEV__) {\r\n txConOptNormal_1.type !== 'text' && assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\r\n }\r\n }\r\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\r\n info.cfg = txCfg;\r\n info.conOpt = txConOpt;\r\n}\r\nfunction retrieveStateOption(elOption, state) {\r\n return !state ? elOption : elOption ? elOption[state] : null;\r\n}\r\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\r\n var style = stateOption && stateOption.style;\r\n if (style == null && state === EMPHASIS && stateOptionNormal) {\r\n style = stateOptionNormal.styleEmphasis;\r\n }\r\n return style;\r\n}\r\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation) {\r\n var newChildren = elOption.children;\r\n var newLen = newChildren ? newChildren.length : 0;\r\n var mergeChildren = elOption.$mergeChildren;\r\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\r\n var notMerge = mergeChildren === false;\r\n if (!newLen && !byName && !notMerge) {\r\n return;\r\n }\r\n if (byName) {\r\n diffGroupChildren({\r\n api: api,\r\n oldChildren: el.children() || [],\r\n newChildren: newChildren || [],\r\n dataIndex: dataIndex,\r\n seriesModel: seriesModel,\r\n group: el,\r\n morphPreparation: morphPreparation\r\n });\r\n return;\r\n }\r\n notMerge && el.removeAll();\r\n var index = 0;\r\n for (; index < newLen; index++) {\r\n newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el, false, morphPreparation);\r\n }\r\n for (var i = el.childCount() - 1; i >= index; i--) {\r\n doRemoveEl(el.childAt(i), seriesModel, el);\r\n }\r\n}\r\nfunction diffGroupChildren(context) {\r\n (new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context))\r\n .add(processAddUpdate)\r\n .update(processAddUpdate)\r\n .remove(processRemove)\r\n .execute();\r\n}\r\nfunction getKey(item, idx) {\r\n var name = item && item.name;\r\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\r\n}\r\nfunction processAddUpdate(newIndex, oldIndex) {\r\n var context = this.context;\r\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\r\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\r\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group, false, context.morphPreparation);\r\n}\r\nfunction processRemove(oldIndex) {\r\n var context = this.context;\r\n var child = context.oldChildren[oldIndex];\r\n doRemoveEl(child, context.seriesModel, context.group);\r\n}\r\nfunction doRemoveEl(el, seriesModel, group) {\r\n if (el) {\r\n var leaveToProps = inner$e(el).leaveToProps;\r\n leaveToProps\r\n ? updateProps(el, leaveToProps, seriesModel, {\r\n cb: function () {\r\n group.remove(el);\r\n }\r\n })\r\n : group.remove(el);\r\n }\r\n}\r\nfunction getPathData(shape) {\r\n return shape && (shape.pathData || shape.d);\r\n}\r\nfunction hasOwnPathData(shape) {\r\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\r\n}\r\nfunction isPath$1(el) {\r\n return el && el instanceof Path;\r\n}\r\nfunction removeElementDirectly(el, group) {\r\n el && group.remove(el);\r\n}\r\nvar MorphPreparation = (function () {\r\n function MorphPreparation(seriesModel, transOpt) {\r\n this._fromList = [];\r\n this._toList = [];\r\n this._toElOptionList = [];\r\n this._allPropsFinalList = [];\r\n this._toDataIndices = [];\r\n this._morphConfigList = [];\r\n this._seriesModel = seriesModel;\r\n this._transOpt = transOpt;\r\n }\r\n MorphPreparation.prototype.hasFrom = function () {\r\n return !!this._fromList.length;\r\n };\r\n MorphPreparation.prototype.findAndAddFrom = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n if (inner$e(el).canMorph) {\r\n this._fromList.push(el);\r\n }\r\n if (el.isGroup) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n this.findAndAddFrom(children[i]);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype.addTo = function (path, elOption, dataIndex, allPropsFinal) {\r\n if (path) {\r\n this._toList.push(path);\r\n this._toElOptionList.push(elOption);\r\n this._toDataIndices.push(dataIndex);\r\n this._allPropsFinalList.push(allPropsFinal);\r\n }\r\n };\r\n MorphPreparation.prototype.applyMorphing = function () {\r\n var type = this._type;\r\n var fromList = this._fromList;\r\n var toList = this._toList;\r\n var toListLen = toList.length;\r\n var fromListLen = fromList.length;\r\n if (!fromListLen || !toListLen) {\r\n return;\r\n }\r\n if (type === 'oneToOne') {\r\n for (var toIdx = 0; toIdx < toListLen; toIdx++) {\r\n this._oneToOneForSingleTo(toIdx, toIdx);\r\n }\r\n }\r\n else if (type === 'manyToOne') {\r\n var fromSingleSegLen = Math.max(1, Math.floor(fromListLen / toListLen));\r\n for (var toIdx = 0, fromIdxStart = 0; toIdx < toListLen; toIdx++, fromIdxStart += fromSingleSegLen) {\r\n var fromCount = toIdx + 1 >= toListLen\r\n ? fromListLen - fromIdxStart\r\n : fromSingleSegLen;\r\n this._manyToOneForSingleTo(toIdx, fromIdxStart >= fromListLen ? null : fromIdxStart, fromCount);\r\n }\r\n }\r\n else if (type === 'oneToMany') {\r\n var toSingleSegLen = Math.max(1, Math.floor(toListLen / fromListLen));\r\n for (var toIdxStart = 0, fromIdx = 0; toIdxStart < toListLen; toIdxStart += toSingleSegLen, fromIdx++) {\r\n var toCount = toIdxStart + toSingleSegLen >= toListLen\r\n ? toListLen - toIdxStart\r\n : toSingleSegLen;\r\n this._oneToManyForSingleFrom(toIdxStart, toCount, fromIdx >= fromListLen ? null : fromIdx);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype._oneToOneForSingleTo = function (toIdx, fromIdx) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var toDataIndex = this._toDataIndices[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n var from = this._fromList[fromIdx];\r\n var elAnimationConfig = this._getOrCreateMorphConfig(toDataIndex);\r\n var morphDuration = elAnimationConfig.duration;\r\n if (from && isCombiningPath(from)) {\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphDuration) {\r\n var combineResult = combine([from], to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n }\r\n else {\r\n var morphFrom = (morphDuration\r\n && from\r\n && (from !== to || isInAnyMorphing(from))) ? from : null;\r\n var transFromProps = {};\r\n prepareShapeOrExtraTransitionFrom('shape', to, morphFrom, toElOption, transFromProps, false);\r\n prepareShapeOrExtraTransitionFrom('extra', to, morphFrom, toElOption, transFromProps, false);\r\n prepareTransformTransitionFrom(to, morphFrom, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(to, morphFrom, toElOption, toElOption.style, transFromProps, false);\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphFrom) {\r\n morphPath(morphFrom, to, elAnimationConfig);\r\n }\r\n applyTransitionFrom(to, toDataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._manyToOneForSingleTo = function (toIdx, fromIdxStart, fromCount) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdx]);\r\n if (elAnimationConfig.duration && fromIdxStart != null) {\r\n var combineFromList = [];\r\n for (var fromIdx = fromIdxStart; fromIdx < fromCount; fromIdx++) {\r\n combineFromList.push(this._fromList[fromIdx]);\r\n }\r\n var combineResult = combine(combineFromList, to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n };\r\n MorphPreparation.prototype._oneToManyForSingleFrom = function (toIdxStart, toCount, fromIdx) {\r\n var from = fromIdx == null ? null : this._fromList[fromIdx];\r\n var toList = this._toList;\r\n var separateToList = [];\r\n for (var toIdx = toIdxStart; toIdx < toCount; toIdx++) {\r\n var to = toList[toIdx];\r\n applyPropsFinal(to, this._allPropsFinalList[toIdx], this._toElOptionList[toIdx].style);\r\n separateToList.push(to);\r\n }\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdxStart]);\r\n if (elAnimationConfig.duration && from) {\r\n var separateResult = separate(from, separateToList, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(separateResult, toIdxStart, toCount);\r\n }\r\n };\r\n MorphPreparation.prototype._processResultIndividuals = function (combineSeparateResult, toIdxStart, toCount) {\r\n var isSeparate = toCount != null;\r\n for (var i = 0; i < combineSeparateResult.count; i++) {\r\n var fromIndividual = combineSeparateResult.fromIndividuals[i];\r\n var toIndividual = combineSeparateResult.toIndividuals[i];\r\n var toIdx = toIdxStart + (isSeparate ? i : 0);\r\n var toElOption = this._toElOptionList[toIdx];\r\n var dataIndex = this._toDataIndices[toIdx];\r\n var transFromProps = {};\r\n prepareTransformTransitionFrom(toIndividual, fromIndividual, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(toIndividual, fromIndividual, toElOption, toElOption.style, transFromProps, false);\r\n applyTransitionFrom(toIndividual, dataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._getOrCreateMorphConfig = function (dataIndex) {\r\n var morphConfigList = this._morphConfigList;\r\n var config = morphConfigList[dataIndex];\r\n if (config) {\r\n return config;\r\n }\r\n var duration;\r\n var easing;\r\n var delay;\r\n var seriesModel = this._seriesModel;\r\n var transOpt = this._transOpt;\r\n if (seriesModel.isAnimationEnabled()) {\r\n var animationPayload = void 0;\r\n if (seriesModel && seriesModel.ecModel) {\r\n var updatePayload = seriesModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n easing = animationPayload.easing || 'cubicOut';\r\n delay = animationPayload.delay || 0;\r\n }\r\n else {\r\n easing = seriesModel.get('animationEasingUpdate');\r\n var delayOption = seriesModel.get('animationDelayUpdate');\r\n delay = isFunction(delayOption) ? delayOption(dataIndex) : delayOption;\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n duration = isFunction(durationOption) ? durationOption(dataIndex) : durationOption;\r\n }\r\n }\r\n config = {\r\n duration: duration || 0,\r\n delay: delay,\r\n easing: easing,\r\n dividingMethod: transOpt ? transOpt.dividingMethod : null\r\n };\r\n morphConfigList[dataIndex] = config;\r\n return config;\r\n };\r\n MorphPreparation.prototype.reset = function (type) {\r\n this._type = type;\r\n this._fromList.length =\r\n this._toList.length =\r\n this._toElOptionList.length =\r\n this._allPropsFinalList.length =\r\n this._toDataIndices.length = 0;\r\n };\r\n return MorphPreparation;\r\n}());\r\nfunction copyPropsWhenDivided(srcPath, tarPath, willClone) {\r\n tarPath.style = willClone\r\n ? clone(srcPath.style)\r\n : srcPath.style;\r\n tarPath.zlevel = srcPath.zlevel;\r\n tarPath.z = srcPath.z;\r\n tarPath.z2 = srcPath.z2;\r\n}\n\nfunction getSeriesStackId$1(seriesModel) {\r\n return seriesModel.get('stack')\r\n || '__ec_stack_' + seriesModel.seriesIndex;\r\n}\r\nfunction getAxisKey$1(polar, axis) {\r\n return axis.dim + polar.model.componentIndex;\r\n}\r\nfunction barLayoutPolar(seriesType, ecModel, api) {\r\n var lastStackCoords = {};\r\n var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\r\n return !ecModel.isSeriesFiltered(seriesModel)\r\n && seriesModel.coordinateSystem\r\n && seriesModel.coordinateSystem.type === 'polar';\r\n }));\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (seriesModel.coordinateSystem.type !== 'polar') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = polar.getOtherAxis(baseAxis);\r\n var cx = seriesModel.coordinateSystem.cx;\r\n var cy = seriesModel.coordinateSystem.cy;\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var clampLayout = baseAxis.dim !== 'radius'\r\n || !seriesModel.get('roundCap', true);\r\n var valueAxisStart = valueAxis.dataToCoord(0);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var r0 = void 0;\r\n var r = void 0;\r\n var startAngle = void 0;\r\n var endAngle = void 0;\r\n if (valueAxis.dim === 'radius') {\r\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\r\n var angle = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(radiusSpan) < barMinHeight) {\r\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n r0 = baseCoord;\r\n r = baseCoord + radiusSpan;\r\n startAngle = angle - columnOffset;\r\n endAngle = startAngle - columnWidth;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\r\n }\r\n else {\r\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\r\n var radius = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(angleSpan) < barMinAngle) {\r\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\r\n }\r\n r0 = radius + columnOffset;\r\n r = r0 + columnWidth;\r\n startAngle = baseCoord;\r\n endAngle = baseCoord + angleSpan;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\r\n }\r\n data.setItemLayout(idx, {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: -startAngle * Math.PI / 180,\r\n endAngle: -endAngle * Math.PI / 180\r\n });\r\n }\r\n });\r\n}\r\nfunction calRadialBar(barSeries) {\r\n var columnsMap = {};\r\n each(barSeries, function (seriesModel, idx) {\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: '20%',\r\n gap: '30%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n if (barWidth && !stacks[stackId].width) {\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n stacks[stackId].width = barWidth;\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGap = parsePercent$2(columnsOnAxis.categoryGap, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column, stack) {\r\n var maxWidth = column.maxWidth;\r\n if (maxWidth && maxWidth < autoWidth) {\r\n maxWidth = Math.min(maxWidth, remainedWidth);\r\n if (column.width) {\r\n maxWidth = Math.min(maxWidth, column.width);\r\n }\r\n remainedWidth -= maxWidth;\r\n column.width = maxWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n}\n\nvar PolarModel = (function (_super) {\r\n __extends(PolarModel, _super);\r\n function PolarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PolarModel.type;\r\n return _this;\r\n }\r\n PolarModel.prototype.findAxisModel = function (axisType) {\r\n var foundAxisModel;\r\n var ecModel = this.ecModel;\r\n ecModel.eachComponent(axisType, function (axisModel) {\r\n if (axisModel.getCoordSysModel() === this) {\r\n foundAxisModel = axisModel;\r\n }\r\n }, this);\r\n return foundAxisModel;\r\n };\r\n PolarModel.type = 'polar';\r\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\r\n PolarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '80%'\r\n };\r\n return PolarModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(PolarModel);\n\nvar PolarAxisModel = (function (_super) {\r\n __extends(PolarAxisModel, _super);\r\n function PolarAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n };\r\n PolarAxisModel.type = 'polarAxis';\r\n return PolarAxisModel;\r\n}(ComponentModel));\r\nmixin(PolarAxisModel, AxisModelCommonMixin);\r\nvar AngleAxisModel = (function (_super) {\r\n __extends(AngleAxisModel, _super);\r\n function AngleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisModel.type;\r\n return _this;\r\n }\r\n AngleAxisModel.type = 'angleAxis';\r\n return AngleAxisModel;\r\n}(PolarAxisModel));\r\nvar RadiusAxisModel = (function (_super) {\r\n __extends(RadiusAxisModel, _super);\r\n function RadiusAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisModel.type;\r\n return _this;\r\n }\r\n RadiusAxisModel.type = 'radiusAxis';\r\n return RadiusAxisModel;\r\n}(PolarAxisModel));\r\nvar angleAxisExtraOption = {\r\n startAngle: 90,\r\n clockwise: true,\r\n splitNumber: 12,\r\n axisLabel: {\r\n rotate: 0\r\n }\r\n};\r\nvar radiusAxisExtraOption = {\r\n splitNumber: 5\r\n};\r\naxisModelCreator('angle', AngleAxisModel, angleAxisExtraOption);\r\naxisModelCreator('radius', RadiusAxisModel, radiusAxisExtraOption);\n\nvar RadiusAxis = (function (_super) {\r\n __extends(RadiusAxis, _super);\r\n function RadiusAxis(scale, radiusExtent) {\r\n return _super.call(this, 'radius', scale, radiusExtent) || this;\r\n }\r\n RadiusAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n return RadiusAxis;\r\n}(Axis));\r\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\r\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\n\nvar inner$f = makeInner();\r\nvar AngleAxis = (function (_super) {\r\n __extends(AngleAxis, _super);\r\n function AngleAxis(scale, angleExtent) {\r\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\r\n }\r\n AngleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n AngleAxis.prototype.calculateCategoryInterval = function () {\r\n var axis = this;\r\n var labelModel = axis.getLabelModel();\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitH = Math.abs(unitSpan);\r\n var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\r\n var maxH = Math.max(rect.height, 7);\r\n var dh = maxH / unitH;\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(dh));\r\n var cache = inner$f(axis.model);\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n }\r\n return interval;\r\n };\r\n return AngleAxis;\r\n}(Axis));\r\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\r\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\n\nvar Polar = (function () {\r\n function Polar(name) {\r\n this.dimensions = ['radius', 'angle'];\r\n this.type = 'polar';\r\n this.cx = 0;\r\n this.cy = 0;\r\n this._radiusAxis = new RadiusAxis();\r\n this._angleAxis = new AngleAxis();\r\n this.axisPointerEnabled = true;\r\n this.name = name || '';\r\n this._radiusAxis.polar = this._angleAxis.polar = this;\r\n }\r\n Polar.prototype.containPoint = function (point) {\r\n var coord = this.pointToCoord(point);\r\n return this._radiusAxis.contain(coord[0])\r\n && this._angleAxis.contain(coord[1]);\r\n };\r\n Polar.prototype.containData = function (data) {\r\n return this._radiusAxis.containData(data[0])\r\n && this._angleAxis.containData(data[1]);\r\n };\r\n Polar.prototype.getAxis = function (dim) {\r\n var key = ('_' + dim + 'Axis');\r\n return this[key];\r\n };\r\n Polar.prototype.getAxes = function () {\r\n return [this._radiusAxis, this._angleAxis];\r\n };\r\n Polar.prototype.getAxesByScale = function (scaleType) {\r\n var axes = [];\r\n var angleAxis = this._angleAxis;\r\n var radiusAxis = this._radiusAxis;\r\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\r\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\r\n return axes;\r\n };\r\n Polar.prototype.getAngleAxis = function () {\r\n return this._angleAxis;\r\n };\r\n Polar.prototype.getRadiusAxis = function () {\r\n return this._radiusAxis;\r\n };\r\n Polar.prototype.getOtherAxis = function (axis) {\r\n var angleAxis = this._angleAxis;\r\n return axis === angleAxis ? this._radiusAxis : angleAxis;\r\n };\r\n Polar.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAngleAxis();\r\n };\r\n Polar.prototype.getTooltipAxes = function (dim) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? this.getAxis(dim) : this.getBaseAxis();\r\n return {\r\n baseAxes: [baseAxis],\r\n otherAxes: [this.getOtherAxis(baseAxis)]\r\n };\r\n };\r\n Polar.prototype.dataToPoint = function (data, clamp) {\r\n return this.coordToPoint([\r\n this._radiusAxis.dataToRadius(data[0], clamp),\r\n this._angleAxis.dataToAngle(data[1], clamp)\r\n ]);\r\n };\r\n Polar.prototype.pointToData = function (point, clamp) {\r\n var coord = this.pointToCoord(point);\r\n return [\r\n this._radiusAxis.radiusToData(coord[0], clamp),\r\n this._angleAxis.angleToData(coord[1], clamp)\r\n ];\r\n };\r\n Polar.prototype.pointToCoord = function (point) {\r\n var dx = point[0] - this.cx;\r\n var dy = point[1] - this.cy;\r\n var angleAxis = this.getAngleAxis();\r\n var extent = angleAxis.getExtent();\r\n var minAngle = Math.min(extent[0], extent[1]);\r\n var maxAngle = Math.max(extent[0], extent[1]);\r\n angleAxis.inverse\r\n ? (minAngle = maxAngle - 360)\r\n : (maxAngle = minAngle + 360);\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx) / Math.PI * 180;\r\n var dir = radian < minAngle ? 1 : -1;\r\n while (radian < minAngle || radian > maxAngle) {\r\n radian += dir * 360;\r\n }\r\n return [radius, radian];\r\n };\r\n Polar.prototype.coordToPoint = function (coord) {\r\n var radius = coord[0];\r\n var radian = coord[1] / 180 * Math.PI;\r\n var x = Math.cos(radian) * radius + this.cx;\r\n var y = -Math.sin(radian) * radius + this.cy;\r\n return [x, y];\r\n };\r\n Polar.prototype.getArea = function () {\r\n var angleAxis = this.getAngleAxis();\r\n var radiusAxis = this.getRadiusAxis();\r\n var radiusExtent = radiusAxis.getExtent().slice();\r\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\r\n var angleExtent = angleAxis.getExtent();\r\n var RADIAN = Math.PI / 180;\r\n return {\r\n cx: this.cx,\r\n cy: this.cy,\r\n r0: radiusExtent[0],\r\n r: radiusExtent[1],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse,\r\n contain: function (x, y) {\r\n var dx = x - this.cx;\r\n var dy = y - this.cy;\r\n var d2 = dx * dx + dy * dy;\r\n var r = this.r;\r\n var r0 = this.r0;\r\n return d2 <= r * r && d2 >= r0 * r0;\r\n }\r\n };\r\n };\r\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Polar;\r\n}());\r\nfunction getCoordSys$3(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var polarModel = finder.polarModel;\r\n return polarModel && polarModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n}\n\nfunction resizePolar(polar, polarModel, api) {\r\n var center = polarModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n polar.cx = parsePercent$2(center[0], width);\r\n polar.cy = parsePercent$2(center[1], height);\r\n var radiusAxis = polar.getRadiusAxis();\r\n var size = Math.min(width, height) / 2;\r\n var radius = polarModel.get('radius');\r\n if (radius == null) {\r\n radius = [0, '100%'];\r\n }\r\n else if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n var parsedRadius = [\r\n parsePercent$2(radius[0], size),\r\n parsePercent$2(radius[1], size)\r\n ];\r\n radiusAxis.inverse\r\n ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0])\r\n : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\r\n}\r\nfunction updatePolarScale(ecModel, api) {\r\n var polar = this;\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxis = polar.getRadiusAxis();\r\n angleAxis.scale.setExtent(Infinity, -Infinity);\r\n radiusAxis.scale.setExtent(Infinity, -Infinity);\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === polar) {\r\n var data_1 = seriesModel.getData();\r\n each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\r\n radiusAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\r\n angleAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n }\r\n });\r\n niceScaleExtent(angleAxis.scale, angleAxis.model);\r\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\r\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\r\n var extent = angleAxis.getExtent();\r\n var diff = 360 / angleAxis.scale.count();\r\n angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);\r\n angleAxis.setExtent(extent[0], extent[1]);\r\n }\r\n}\r\nfunction isAngleAxisModel(axisModel) {\r\n return axisModel.mainType === 'angleAxis';\r\n}\r\nfunction setAxis(axis, axisModel) {\r\n axis.type = axisModel.get('type');\r\n axis.scale = createScaleByModel(axisModel);\r\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\r\n axis.inverse = axisModel.get('inverse');\r\n if (isAngleAxisModel(axisModel)) {\r\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\r\n var startAngle = axisModel.get('startAngle');\r\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\r\n }\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n}\r\nvar polarCreator = {\r\n dimensions: Polar.prototype.dimensions,\r\n create: function (ecModel, api) {\r\n var polarList = [];\r\n ecModel.eachComponent('polar', function (polarModel, idx) {\r\n var polar = new Polar(idx + '');\r\n polar.update = updatePolarScale;\r\n var radiusAxis = polar.getRadiusAxis();\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n setAxis(radiusAxis, radiusAxisModel);\r\n setAxis(angleAxis, angleAxisModel);\r\n resizePolar(polar, polarModel, api);\r\n polarList.push(polar);\r\n polarModel.coordinateSystem = polar;\r\n polar.model = polarModel;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'polar') {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!polarModel) {\r\n throw new Error('Polar \"' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\r\n }\r\n }\r\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\r\n }\r\n });\r\n return polarList;\r\n }\r\n};\r\nCoordinateSystemManager.register('polar', polarCreator);\n\nvar elementList$1 = [\r\n 'axisLine',\r\n 'axisLabel',\r\n 'axisTick',\r\n 'minorTick',\r\n 'splitLine',\r\n 'minorSplitLine',\r\n 'splitArea'\r\n];\r\nfunction getAxisLineShape(polar, rExtent, angle) {\r\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\r\n var start = polar.coordToPoint([rExtent[0], angle]);\r\n var end = polar.coordToPoint([rExtent[1], angle]);\r\n return {\r\n x1: start[0],\r\n y1: start[1],\r\n x2: end[0],\r\n y2: end[1]\r\n };\r\n}\r\nfunction getRadiusIdx(polar) {\r\n var radiusAxis = polar.getRadiusAxis();\r\n return radiusAxis.inverse ? 0 : 1;\r\n}\r\nfunction fixAngleOverlap(list) {\r\n var firstItem = list[0];\r\n var lastItem = list[list.length - 1];\r\n if (firstItem\r\n && lastItem\r\n && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\r\n list.pop();\r\n }\r\n}\r\nvar AngleAxisView = (function (_super) {\r\n __extends(AngleAxisView, _super);\r\n function AngleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!angleAxisModel.get('show')) {\r\n return;\r\n }\r\n var angleAxis = angleAxisModel.axis;\r\n var polar = angleAxis.polar;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var ticksAngles = angleAxis.getTicksCoords();\r\n var minorTickAngles = angleAxis.getMinorTicksCoords();\r\n var labels = map(angleAxis.getViewLabels(), function (labelItem) {\r\n labelItem = clone(labelItem);\r\n labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);\r\n return labelItem;\r\n });\r\n fixAngleOverlap(labels);\r\n fixAngleOverlap(ticksAngles);\r\n each(elementList$1, function (name) {\r\n if (angleAxisModel.get([name, 'show'])\r\n && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\r\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\r\n }\r\n }, this);\r\n };\r\n AngleAxisView.type = 'angleAxis';\r\n return AngleAxisView;\r\n}(AxisView));\r\nvar angelAxisElementsBuilders = {\r\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\r\n var rId = getRadiusIdx(polar);\r\n var r0Id = rId ? 0 : 1;\r\n var shape;\r\n if (radiusExtent[r0Id] === 0) {\r\n shape = new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n else {\r\n shape = new Ring({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n r0: radiusExtent[r0Id]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n shape.style.fill = null;\r\n group.add(shape);\r\n },\r\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = map(ticksAngles, function (tickAngleItem) {\r\n return new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\r\n });\r\n });\r\n group.add(mergePath$1(lines, {\r\n style: defaults(tickModel.getModel('lineStyle').getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n })\r\n }));\r\n },\r\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var minorTickModel = angleAxisModel.getModel('minorTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }))\r\n }));\r\n },\r\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\r\n var rawCategoryData = angleAxisModel.getCategories(true);\r\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\r\n var labelMargin = commonLabelModel.get('margin');\r\n var triggerEvent = angleAxisModel.get('triggerEvent');\r\n each(labels, function (labelItem, idx) {\r\n var labelModel = commonLabelModel;\r\n var tickValue = labelItem.tickValue;\r\n var r = radiusExtent[getRadiusIdx(polar)];\r\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3\r\n ? 'center' : (p[0] > cx ? 'left' : 'right');\r\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3\r\n ? 'middle' : (p[1] > cy ? 'top' : 'bottom');\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\r\n }\r\n }\r\n var textEl = new ZRText({\r\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\r\n style: createTextStyle(labelModel, {\r\n x: p[0],\r\n y: p[1],\r\n fill: labelModel.getTextColor()\r\n || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\r\n text: labelItem.formattedLabel,\r\n align: labelTextAlign,\r\n verticalAlign: labelTextVerticalAlign\r\n })\r\n });\r\n group.add(textEl);\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = labelItem.rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n }, this);\r\n },\r\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var splitLineModel = angleAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksAngles.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: lineStyleModel.getLineStyle(),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n },\r\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!ticksAngles.length) {\r\n return;\r\n }\r\n var splitAreaModel = angleAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var RADIAN = Math.PI / 180;\r\n var prevAngle = -ticksAngles[0].coord * RADIAN;\r\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\r\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\r\n var clockwise = angleAxisModel.get('clockwise');\r\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\r\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: r0,\r\n r: r1,\r\n startAngle: prevAngle,\r\n endAngle: -coord * RADIAN,\r\n clockwise: clockwise\r\n },\r\n silent: true\r\n }));\r\n prevAngle = -coord * RADIAN;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\nComponentView.registerClass(AngleAxisView);\n\nvar axisBuilderAttrs$3 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n];\r\nvar selfBuilderAttrs$2 = [\r\n 'splitLine', 'splitArea', 'minorSplitLine'\r\n];\r\nvar RadiusAxisView = (function (_super) {\r\n __extends(RadiusAxisView, _super);\r\n function RadiusAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!radiusAxisModel.get('show')) {\r\n return;\r\n }\r\n var oldAxisGroup = this._axisGroup;\r\n var newAxisGroup = this._axisGroup = new Group();\r\n this.group.add(newAxisGroup);\r\n var radiusAxis = radiusAxisModel.axis;\r\n var polar = radiusAxis.polar;\r\n var angleAxis = polar.getAngleAxis();\r\n var ticksCoords = radiusAxis.getTicksCoords();\r\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\r\n var axisAngle = angleAxis.getExtent()[0];\r\n var radiusExtent = radiusAxis.getExtent();\r\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\r\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\r\n each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder);\r\n newAxisGroup.add(axisBuilder.getGroup());\r\n groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\r\n each(selfBuilderAttrs$2, function (name) {\r\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\r\n axisElementBuilders$2[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\r\n }\r\n }, this);\r\n };\r\n RadiusAxisView.type = 'radiusAxis';\r\n return RadiusAxisView;\r\n}(AxisView));\r\nvar axisElementBuilders$2 = {\r\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n var splitLineModel = radiusAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: ticksCoords[i].coord\r\n }\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length],\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n lines.push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: minorTicksCoords[i][k].coord\r\n }\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults({\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n },\r\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var prevRadius = ticksCoords[0].coord;\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: prevRadius,\r\n r: ticksCoords[i].coord,\r\n startAngle: 0,\r\n endAngle: Math.PI * 2\r\n },\r\n silent: true\r\n }));\r\n prevRadius = ticksCoords[i].coord;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\r\n return {\r\n position: [polar.cx, polar.cy],\r\n rotation: axisAngle / 180 * Math.PI,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1,\r\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\r\n z2: 1\r\n };\r\n}\r\nAxisView.registerClass(RadiusAxisView);\n\nvar PolarAxisPointer = (function (_super) {\r\n __extends(PolarAxisPointer, _super);\r\n function PolarAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n if (axis.dim === 'angle') {\r\n this.animationThreshold = Math.PI / 18;\r\n }\r\n var polar = axis.polar;\r\n var otherAxis = polar.getOtherAxis(axis);\r\n var otherExtent = otherAxis.getExtent();\r\n var coordValue = axis.dataToCoord(value);\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, polar, coordValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var labelMargin = axisPointerModel.get(['label', 'margin']);\r\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\r\n };\r\n return PolarAxisPointer;\r\n}(BaseAxisPointer));\r\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\r\n var axis = axisModel.axis;\r\n var coord = axis.dataToCoord(value);\r\n var axisAngle = polar.getAngleAxis().getExtent()[0];\r\n axisAngle = axisAngle / 180 * Math.PI;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var position;\r\n var align;\r\n var verticalAlign;\r\n if (axis.dim === 'radius') {\r\n var transform = create$1();\r\n rotate(transform, transform, axisAngle);\r\n translate(transform, transform, [polar.cx, polar.cy]);\r\n position = applyTransform$1([coord, -labelMargin], transform);\r\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\r\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\r\n align = labelLayout.textAlign;\r\n verticalAlign = labelLayout.textVerticalAlign;\r\n }\r\n else {\r\n var r = radiusExtent[1];\r\n position = polar.coordToPoint([r + labelMargin, coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n align = Math.abs(position[0] - cx) / r < 0.3\r\n ? 'center' : (position[0] > cx ? 'left' : 'right');\r\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3\r\n ? 'middle' : (position[1] > cy ? 'top' : 'bottom');\r\n }\r\n return {\r\n position: position,\r\n align: align,\r\n verticalAlign: verticalAlign\r\n };\r\n}\r\nvar pointerShapeBuilder$2 = {\r\n line: function (axis, polar, coordValue, otherExtent) {\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Line',\r\n shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\r\n }\r\n : {\r\n type: 'Circle',\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: coordValue\r\n }\r\n };\r\n },\r\n shadow: function (axis, polar, coordValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var radian = Math.PI / 180;\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\r\n }\r\n : {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\r\n };\r\n }\r\n};\r\nAxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n\nregisterLayout(curry(barLayoutPolar, 'bar'));\r\nextendComponentView({\r\n type: 'polar'\r\n});\n\nvar GeoView = (function (_super) {\r\n __extends(GeoView, _super);\r\n function GeoView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoView.type;\r\n return _this;\r\n }\r\n GeoView.prototype.init = function (ecModel, api) {\r\n var mapDraw = new MapDraw(api);\r\n this._mapDraw = mapDraw;\r\n this.group.add(mapDraw.group);\r\n this._api = api;\r\n };\r\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\r\n var mapDraw = this._mapDraw;\r\n if (geoModel.get('show')) {\r\n mapDraw.draw(geoModel, ecModel, api, this, payload);\r\n }\r\n else {\r\n this._mapDraw.group.removeAll();\r\n }\r\n mapDraw.group.on('click', this._handleRegionClick, this);\r\n mapDraw.group.silent = geoModel.get('silent');\r\n this._model = geoModel;\r\n this.updateSelectStatus(geoModel, ecModel, api);\r\n };\r\n GeoView.prototype._handleRegionClick = function (e) {\r\n var current = e.target;\r\n var eventData;\r\n while (current && (eventData = getECData(current).eventData) == null) {\r\n current = current.__hostTarget || current.parent;\r\n }\r\n if (eventData) {\r\n this._api.dispatchAction({\r\n type: 'geoToggleSelect',\r\n geoId: this._model.id,\r\n name: eventData.name\r\n });\r\n }\r\n };\r\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\r\n var _this = this;\r\n this._mapDraw.group.traverse(function (node) {\r\n var eventData = getECData(node).eventData;\r\n if (eventData) {\r\n _this._model.isSelected(eventData.name)\r\n ? api.enterSelect(node) : api.leaveSelect(node);\r\n return true;\r\n }\r\n });\r\n };\r\n GeoView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n };\r\n GeoView.type = 'geo';\r\n return GeoView;\r\n}(ComponentView));\r\nComponentView.registerClass(GeoView);\n\nvar GeoModel = (function (_super) {\r\n __extends(GeoModel, _super);\r\n function GeoModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoModel.type;\r\n return _this;\r\n }\r\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n defaultEmphasis(option, 'label', ['show']);\r\n };\r\n GeoModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n var self = this;\r\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap);\r\n var selectedMap = {};\r\n this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) {\r\n var regionName = regionOpt.name;\r\n if (regionName) {\r\n optionModelMap.set(regionName, new Model(regionOpt, self));\r\n if (regionOpt.selected) {\r\n selectedMap[regionName] = true;\r\n }\r\n }\r\n return optionModelMap;\r\n }, createHashMap());\r\n if (!option.selectedMap) {\r\n option.selectedMap = selectedMap;\r\n }\r\n };\r\n GeoModel.prototype.getRegionModel = function (name) {\r\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\r\n };\r\n GeoModel.prototype.getFormattedLabel = function (name, status) {\r\n var regionModel = this.getRegionModel(name);\r\n var formatter = status === 'normal'\r\n ? regionModel.get(['label', 'formatter'])\r\n : regionModel.get(['emphasis', 'label', 'formatter']);\r\n var params = {\r\n name: name\r\n };\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n return formatter.replace('{a}', name != null ? name : '');\r\n }\r\n };\r\n GeoModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GeoModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GeoModel.prototype.select = function (name) {\r\n var option = this.option;\r\n var selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n if (selectedMode !== 'multiple') {\r\n option.selectedMap = null;\r\n }\r\n var selectedMap = option.selectedMap || (option.selectedMap = {});\r\n selectedMap[name] = true;\r\n };\r\n GeoModel.prototype.unSelect = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n if (selectedMap) {\r\n selectedMap[name] = false;\r\n }\r\n };\r\n GeoModel.prototype.toggleSelected = function (name) {\r\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\r\n };\r\n GeoModel.prototype.isSelected = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n return !!(selectedMap && selectedMap[name]);\r\n };\r\n GeoModel.prototype._initSelectedMapFromData = function () {\r\n };\r\n GeoModel.type = 'geo';\r\n GeoModel.layoutMode = 'box';\r\n GeoModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n show: true,\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: null,\r\n silent: false,\r\n map: '',\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n color: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n regions: []\r\n };\r\n return GeoModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(GeoModel);\n\nfunction makeAction(method, actionInfo) {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n var selected = {};\r\n ecModel.eachComponent({ mainType: 'geo', query: payload }, function (geoModel) {\r\n geoModel[method](payload.name);\r\n var geo = geoModel.coordinateSystem;\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n });\r\n });\r\n return {\r\n selected: selected,\r\n name: payload.name\r\n };\r\n });\r\n}\r\nmakeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n});\r\nmakeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n});\r\nmakeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n});\n\nvar PROXIMATE_ONE_DAY = 86400000;\r\nvar Calendar = (function () {\r\n function Calendar(calendarModel, ecModel, api) {\r\n this.type = 'calendar';\r\n this.dimensions = Calendar.dimensions;\r\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\r\n this._model = calendarModel;\r\n }\r\n Calendar.getDimensionsInfo = function () {\r\n return [{\r\n name: 'time', type: 'time'\r\n }, 'value'];\r\n };\r\n Calendar.prototype.getRangeInfo = function () {\r\n return this._rangeInfo;\r\n };\r\n Calendar.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Calendar.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Calendar.prototype.getCellWidth = function () {\r\n return this._sw;\r\n };\r\n Calendar.prototype.getCellHeight = function () {\r\n return this._sh;\r\n };\r\n Calendar.prototype.getOrient = function () {\r\n return this._orient;\r\n };\r\n Calendar.prototype.getFirstDayOfWeek = function () {\r\n return this._firstDayOfWeek;\r\n };\r\n Calendar.prototype.getDateInfo = function (date) {\r\n date = parseDate(date);\r\n var y = date.getFullYear();\r\n var m = date.getMonth() + 1;\r\n var mStr = m < 10 ? '0' + m : '' + m;\r\n var d = date.getDate();\r\n var dStr = d < 10 ? '0' + d : '' + d;\r\n var day = date.getDay();\r\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\r\n return {\r\n y: y + '',\r\n m: mStr,\r\n d: dStr,\r\n day: day,\r\n time: date.getTime(),\r\n formatedDate: y + '-' + mStr + '-' + dStr,\r\n date: date\r\n };\r\n };\r\n Calendar.prototype.getNextNDay = function (date, n) {\r\n n = n || 0;\r\n if (n === 0) {\r\n return this.getDateInfo(date);\r\n }\r\n date = new Date(this.getDateInfo(date).time);\r\n date.setDate(date.getDate() + n);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.prototype.update = function (ecModel, api) {\r\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\r\n this._orient = this._model.get('orient');\r\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\r\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\r\n var weeks = this._rangeInfo.weeks || 1;\r\n var whNames = ['width', 'height'];\r\n var cellSize = this._model.getCellSize().slice();\r\n var layoutParams = this._model.getBoxLayoutParams();\r\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\r\n each([0, 1], function (idx) {\r\n if (cellSizeSpecified(cellSize, idx)) {\r\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\r\n }\r\n });\r\n var whGlobal = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);\r\n each([0, 1], function (idx) {\r\n if (!cellSizeSpecified(cellSize, idx)) {\r\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\r\n }\r\n });\r\n function cellSizeSpecified(cellSize, idx) {\r\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\r\n }\r\n this._sw = cellSize[0];\r\n this._sh = cellSize[1];\r\n };\r\n Calendar.prototype.dataToPoint = function (data, clamp) {\r\n isArray(data) && (data = data[0]);\r\n clamp == null && (clamp = true);\r\n var dayInfo = this.getDateInfo(data);\r\n var range = this._rangeInfo;\r\n var date = dayInfo.formatedDate;\r\n if (clamp && !(dayInfo.time >= range.start.time\r\n && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\r\n return [NaN, NaN];\r\n }\r\n var week = dayInfo.day;\r\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\r\n if (this._orient === 'vertical') {\r\n return [\r\n this._rect.x + week * this._sw + this._sw / 2,\r\n this._rect.y + nthWeek * this._sh + this._sh / 2\r\n ];\r\n }\r\n return [\r\n this._rect.x + nthWeek * this._sw + this._sw / 2,\r\n this._rect.y + week * this._sh + this._sh / 2\r\n ];\r\n };\r\n Calendar.prototype.pointToData = function (point) {\r\n var date = this.pointToDate(point);\r\n return date && date.time;\r\n };\r\n Calendar.prototype.dataToRect = function (data, clamp) {\r\n var point = this.dataToPoint(data, clamp);\r\n return {\r\n contentShape: {\r\n x: point[0] - (this._sw - this._lineWidth) / 2,\r\n y: point[1] - (this._sh - this._lineWidth) / 2,\r\n width: this._sw - this._lineWidth,\r\n height: this._sh - this._lineWidth\r\n },\r\n center: point,\r\n tl: [\r\n point[0] - this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n tr: [\r\n point[0] + this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n br: [\r\n point[0] + this._sw / 2,\r\n point[1] + this._sh / 2\r\n ],\r\n bl: [\r\n point[0] - this._sw / 2,\r\n point[1] + this._sh / 2\r\n ]\r\n };\r\n };\r\n Calendar.prototype.pointToDate = function (point) {\r\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\r\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\r\n var range = this._rangeInfo.range;\r\n if (this._orient === 'vertical') {\r\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\r\n }\r\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\r\n };\r\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n Calendar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Calendar.prototype._initRangeOption = function () {\r\n var range = this._model.get('range');\r\n var normalizedRange;\r\n if (isArray(range) && range.length === 1) {\r\n range = range[0];\r\n }\r\n if (!isArray(range)) {\r\n var rangeStr = range.toString();\r\n if (/^\\d{4}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n var start = this.getDateInfo(rangeStr);\r\n var firstDay = start.date;\r\n firstDay.setMonth(firstDay.getMonth() + 1);\r\n var end = this.getNextNDay(firstDay, -1);\r\n normalizedRange = [start.formatedDate, end.formatedDate];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr, rangeStr];\r\n }\r\n }\r\n else {\r\n normalizedRange = range;\r\n }\r\n if (!normalizedRange) {\r\n if (__DEV__) {\r\n logError('Invalid date range.');\r\n }\r\n return range;\r\n }\r\n var tmp = this._getRangeInfo(normalizedRange);\r\n if (tmp.start.time > tmp.end.time) {\r\n normalizedRange.reverse();\r\n }\r\n return normalizedRange;\r\n };\r\n Calendar.prototype._getRangeInfo = function (range) {\r\n var parsedRange = [\r\n this.getDateInfo(range[0]),\r\n this.getDateInfo(range[1])\r\n ];\r\n var reversed;\r\n if (parsedRange[0].time > parsedRange[1].time) {\r\n reversed = true;\r\n parsedRange.reverse();\r\n }\r\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY)\r\n - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\r\n var date = new Date(parsedRange[0].time);\r\n var startDateNum = date.getDate();\r\n var endDateNum = parsedRange[1].date.getDate();\r\n date.setDate(startDateNum + allDay - 1);\r\n var dateNum = date.getDate();\r\n if (dateNum !== endDateNum) {\r\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\r\n while ((dateNum = date.getDate()) !== endDateNum\r\n && (date.getTime() - parsedRange[1].time) * sign > 0) {\r\n allDay -= sign;\r\n date.setDate(dateNum - sign);\r\n }\r\n }\r\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\r\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\r\n reversed && parsedRange.reverse();\r\n return {\r\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\r\n start: parsedRange[0],\r\n end: parsedRange[1],\r\n allDay: allDay,\r\n weeks: weeks,\r\n nthWeek: nthWeek,\r\n fweek: parsedRange[0].day,\r\n lweek: parsedRange[1].day\r\n };\r\n };\r\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\r\n var rangeInfo = this._getRangeInfo(range);\r\n if (nthWeek > rangeInfo.weeks\r\n || (nthWeek === 0 && day < rangeInfo.fweek)\r\n || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)) {\r\n return null;\r\n }\r\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\r\n var date = new Date(rangeInfo.start.time);\r\n date.setDate(+rangeInfo.start.d + nthDay);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.create = function (ecModel, api) {\r\n var calendarList = [];\r\n ecModel.eachComponent('calendar', function (calendarModel) {\r\n var calendar = new Calendar(calendarModel, ecModel, api);\r\n calendarList.push(calendar);\r\n calendarModel.coordinateSystem = calendar;\r\n });\r\n ecModel.eachSeries(function (calendarSeries) {\r\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\r\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\r\n }\r\n });\r\n return calendarList;\r\n };\r\n Calendar.dimensions = ['time', 'value'];\r\n return Calendar;\r\n}());\r\nfunction getCoordSys$4(finder) {\r\n var calendarModel = finder.calendarModel;\r\n var seriesModel = finder.seriesModel;\r\n var coordSys = calendarModel\r\n ? calendarModel.coordinateSystem\r\n : seriesModel\r\n ? seriesModel.coordinateSystem\r\n : null;\r\n return coordSys;\r\n}\r\nCoordinateSystemManager.register('calendar', Calendar);\n\nvar CalendarModel = (function (_super) {\r\n __extends(CalendarModel, _super);\r\n function CalendarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarModel.type;\r\n return _this;\r\n }\r\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\r\n };\r\n CalendarModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(this.option, option);\r\n };\r\n CalendarModel.prototype.getCellSize = function () {\r\n return this.option.cellSize;\r\n };\r\n CalendarModel.type = 'calendar';\r\n CalendarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n left: 80,\r\n top: 60,\r\n cellSize: 20,\r\n orient: 'horizontal',\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: '#000',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n },\r\n dayLabel: {\r\n show: true,\r\n firstDay: 0,\r\n position: 'start',\r\n margin: '50%',\r\n nameMap: 'en',\r\n color: '#000'\r\n },\r\n monthLabel: {\r\n show: true,\r\n position: 'start',\r\n margin: 5,\r\n align: 'center',\r\n nameMap: 'en',\r\n formatter: null,\r\n color: '#000'\r\n },\r\n yearLabel: {\r\n show: true,\r\n position: null,\r\n margin: 30,\r\n formatter: null,\r\n color: '#ccc',\r\n fontFamily: 'sans-serif',\r\n fontWeight: 'bolder',\r\n fontSize: 20\r\n }\r\n };\r\n return CalendarModel;\r\n}(ComponentModel));\r\nfunction mergeAndNormalizeLayoutParams(target, raw) {\r\n var cellSize = target.cellSize;\r\n var cellSizeArr;\r\n if (!isArray(cellSize)) {\r\n cellSizeArr = target.cellSize = [cellSize, cellSize];\r\n }\r\n else {\r\n cellSizeArr = cellSize;\r\n }\r\n if (cellSizeArr.length === 1) {\r\n cellSizeArr[1] = cellSizeArr[0];\r\n }\r\n var ignoreSize = map([0, 1], function (hvIdx) {\r\n if (sizeCalculable(raw, hvIdx)) {\r\n cellSizeArr[hvIdx] = 'auto';\r\n }\r\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\r\n });\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: ignoreSize\r\n });\r\n}\r\nComponentModel.registerClass(CalendarModel);\n\nvar MONTH_TEXT = {\r\n EN: [\r\n 'Jan', 'Feb', 'Mar',\r\n 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep',\r\n 'Oct', 'Nov', 'Dec'\r\n ],\r\n CN: [\r\n '一月', '二月', '三月',\r\n '四月', '五月', '六月',\r\n '七月', '八月', '九月',\r\n '十月', '十一月', '十二月'\r\n ]\r\n};\r\nvar WEEK_TEXT = {\r\n EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n CN: ['日', '一', '二', '三', '四', '五', '六']\r\n};\r\nvar CalendarView = (function (_super) {\r\n __extends(CalendarView, _super);\r\n function CalendarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarView.type;\r\n return _this;\r\n }\r\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n var coordSys = calendarModel.coordinateSystem;\r\n var rangeData = coordSys.getRangeInfo();\r\n var orient = coordSys.getOrient();\r\n this._renderDayRect(calendarModel, rangeData, group);\r\n this._renderLines(calendarModel, rangeData, orient, group);\r\n this._renderYearText(calendarModel, rangeData, orient, group);\r\n this._renderMonthText(calendarModel, orient, group);\r\n this._renderWeekText(calendarModel, rangeData, orient, group);\r\n };\r\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\r\n var sw = coordSys.getCellWidth();\r\n var sh = coordSys.getCellHeight();\r\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\r\n var point = coordSys.dataToRect([i], false).tl;\r\n var rect = new Rect({\r\n shape: {\r\n x: point[0],\r\n y: point[1],\r\n width: sw,\r\n height: sh\r\n },\r\n cursor: 'default',\r\n style: itemRectStyleModel\r\n });\r\n group.add(rect);\r\n }\r\n };\r\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\r\n var self = this;\r\n var coordSys = calendarModel.coordinateSystem;\r\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\r\n var show = calendarModel.get(['splitLine', 'show']);\r\n var lineWidth = lineStyleModel.lineWidth;\r\n this._tlpoints = [];\r\n this._blpoints = [];\r\n this._firstDayOfMonth = [];\r\n this._firstDayPoints = [];\r\n var firstDay = rangeData.start;\r\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\r\n addPoints(firstDay.formatedDate);\r\n if (i === 0) {\r\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\r\n }\r\n var date = firstDay.date;\r\n date.setMonth(date.getMonth() + 1);\r\n firstDay = coordSys.getDateInfo(date);\r\n }\r\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\r\n function addPoints(date) {\r\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\r\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\r\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\r\n self._tlpoints.push(points[0]);\r\n self._blpoints.push(points[points.length - 1]);\r\n show && self._drawSplitline(points, lineStyleModel, group);\r\n }\r\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\r\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\r\n };\r\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\r\n var rs = [points[0].slice(), points[points.length - 1].slice()];\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\r\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\r\n return rs;\r\n };\r\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\r\n var poyline = new Polyline({\r\n z2: 20,\r\n shape: {\r\n points: points\r\n },\r\n style: lineStyle\r\n });\r\n group.add(poyline);\r\n };\r\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var parsedDate = coordSys.getDateInfo(date);\r\n var points = [];\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\r\n var point = coordSys.dataToRect([tmpD.time], false);\r\n points[2 * tmpD.day] = point.tl;\r\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\r\n }\r\n return points;\r\n };\r\n CalendarView.prototype._formatterLabel = function (formatter, params) {\r\n if (typeof formatter === 'string' && formatter) {\r\n return formatTplSimple(formatter, params);\r\n }\r\n if (typeof formatter === 'function') {\r\n return formatter(params);\r\n }\r\n return params.nameMap;\r\n };\r\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\r\n var x = point[0];\r\n var y = point[1];\r\n var aligns = ['center', 'bottom'];\r\n if (position === 'bottom') {\r\n y += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else if (position === 'left') {\r\n x -= margin;\r\n }\r\n else if (position === 'right') {\r\n x += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else {\r\n y -= margin;\r\n }\r\n var rotate = 0;\r\n if (position === 'left' || position === 'right') {\r\n rotate = Math.PI / 2;\r\n }\r\n return {\r\n rotation: rotate,\r\n x: x,\r\n y: y,\r\n style: {\r\n align: aligns[0],\r\n verticalAlign: aligns[1]\r\n }\r\n };\r\n };\r\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\r\n var yearLabel = calendarModel.getModel('yearLabel');\r\n if (!yearLabel.get('show')) {\r\n return;\r\n }\r\n var margin = yearLabel.get('margin');\r\n var pos = yearLabel.get('position');\r\n if (!pos) {\r\n pos = orient !== 'horizontal' ? 'top' : 'left';\r\n }\r\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\r\n var xc = (points[0][0] + points[1][0]) / 2;\r\n var yc = (points[0][1] + points[1][1]) / 2;\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n var posPoints = {\r\n top: [xc, points[idx][1]],\r\n bottom: [xc, points[1 - idx][1]],\r\n left: [points[1 - idx][0], yc],\r\n right: [points[idx][0], yc]\r\n };\r\n var name = rangeData.start.y;\r\n if (+rangeData.end.y > +rangeData.start.y) {\r\n name = name + '-' + rangeData.end.y;\r\n }\r\n var formatter = yearLabel.get('formatter');\r\n var params = {\r\n start: rangeData.start.y,\r\n end: rangeData.end.y,\r\n nameMap: name\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var yearText = new ZRText({\r\n z2: 30,\r\n style: createTextStyle(yearLabel, {\r\n text: content\r\n })\r\n });\r\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\r\n group.add(yearText);\r\n };\r\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\r\n var align = 'left';\r\n var vAlign = 'top';\r\n var x = point[0];\r\n var y = point[1];\r\n if (orient === 'horizontal') {\r\n y = y + margin;\r\n if (isCenter) {\r\n align = 'center';\r\n }\r\n if (position === 'start') {\r\n vAlign = 'bottom';\r\n }\r\n }\r\n else {\r\n x = x + margin;\r\n if (isCenter) {\r\n vAlign = 'middle';\r\n }\r\n if (position === 'start') {\r\n align = 'right';\r\n }\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderMonthText = function (calendarModel, orient, group) {\r\n var monthLabel = calendarModel.getModel('monthLabel');\r\n if (!monthLabel.get('show')) {\r\n return;\r\n }\r\n var nameMap = monthLabel.get('nameMap');\r\n var margin = monthLabel.get('margin');\r\n var pos = monthLabel.get('position');\r\n var align = monthLabel.get('align');\r\n var termPoints = [this._tlpoints, this._blpoints];\r\n if (isString(nameMap)) {\r\n nameMap = MONTH_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var idx = pos === 'start' ? 0 : 1;\r\n var axis = orient === 'horizontal' ? 0 : 1;\r\n margin = pos === 'start' ? -margin : margin;\r\n var isCenter = (align === 'center');\r\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\r\n var tmp = termPoints[idx][i].slice();\r\n var firstDay = this._firstDayOfMonth[i];\r\n if (isCenter) {\r\n var firstDayPoints = this._firstDayPoints[i];\r\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\r\n }\r\n var formatter = monthLabel.get('formatter');\r\n var name_1 = nameMap[+firstDay.m - 1];\r\n var params = {\r\n yyyy: firstDay.y,\r\n yy: (firstDay.y + '').slice(2),\r\n MM: firstDay.m,\r\n M: +firstDay.m,\r\n nameMap: name_1\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var monthText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(monthLabel, { text: content }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\r\n });\r\n group.add(monthText);\r\n }\r\n };\r\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\r\n var align = 'center';\r\n var vAlign = 'middle';\r\n var x = point[0];\r\n var y = point[1];\r\n var isStart = position === 'start';\r\n if (orient === 'horizontal') {\r\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\r\n align = isStart ? 'right' : 'left';\r\n }\r\n else {\r\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\r\n vAlign = isStart ? 'bottom' : 'top';\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderWeekText = function (calendarModel, rangeData, orient, group) {\r\n var dayLabel = calendarModel.getModel('dayLabel');\r\n if (!dayLabel.get('show')) {\r\n return;\r\n }\r\n var coordSys = calendarModel.coordinateSystem;\r\n var pos = dayLabel.get('position');\r\n var nameMap = dayLabel.get('nameMap');\r\n var margin = dayLabel.get('margin');\r\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\r\n if (isString(nameMap)) {\r\n nameMap = WEEK_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var start = coordSys.getNextNDay(rangeData.end.time, (7 - rangeData.lweek)).time;\r\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\r\n margin = parsePercent$2(margin, cellSize[orient === 'horizontal' ? 0 : 1]);\r\n if (pos === 'start') {\r\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\r\n margin = -margin;\r\n }\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(start, i);\r\n var point = coordSys.dataToRect([tmpD.time], false).center;\r\n var day = i;\r\n day = Math.abs((i + firstDayOfWeek) % 7);\r\n var weekText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(dayLabel, { text: nameMap[day] }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\r\n });\r\n group.add(weekText);\r\n }\r\n };\r\n CalendarView.type = 'calendar';\r\n return CalendarView;\r\n}(ComponentView));\r\nComponentView.registerClass(CalendarView);\n\nvar inner$g = makeInner();\r\nvar _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n};\r\nregisterPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n});\r\nvar GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(GraphicComponentModel);\r\nvar GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$g(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$g(el);\r\n var parentElInner = inner$g(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$g(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n}(ComponentView));\r\nComponentView.registerClass(GraphicComponentView);\r\nfunction createEl$1(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$g(el).__ecGraphicId = id;\r\n}\r\nfunction removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$g(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n}\r\nfunction getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n}\r\nfunction isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n}\r\nfunction setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n}\r\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n}\r\nfunction setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n}\r\nfunction setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n}\n\nvar ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n}());\r\nvar features = {};\r\nfunction registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n}\r\nfunction getFeature(name) {\r\n return features[name];\r\n}\n\nvar ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(ToolboxModel);\n\nfunction layout$3(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n}\r\nfunction makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n}\n\nvar ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$3(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n}(ComponentView));\r\nComponentView.registerClass(ToolboxView);\r\nfunction isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n}\n\nvar SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n}(ToolboxFeature));\r\nSaveAsImage.prototype.unusable = !env.canvasSupported;\r\nregisterFeature('saveAsImage', SaveAsImage);\n\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\nvar radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n];\r\nvar MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n}(ToolboxFeature));\r\nvar seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n};\r\nregisterAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n});\r\nregisterFeature('magicType', MagicType);\n\nvar BLOCK_SPLITER = new Array(60).join('-');\r\nvar ITEM_SPLITER = '\\t';\r\nfunction groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n}\r\nfunction assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\nfunction assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\nfunction getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n}\r\nfunction trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n}\r\nfunction isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n}\r\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\nfunction parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n}\r\nfunction parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n}\r\nfunction parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n}\r\nvar DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n}(ToolboxFeature));\r\nfunction tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n}\r\nregisterFeature('dataView', DataView);\r\nregisterAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n});\n\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\nvar INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n];\r\nvar BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n}());\r\nfunction formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n}\r\nfunction parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n}\r\nvar targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n};\r\nvar targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n];\r\nvar panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n};\r\nvar coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n};\r\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n}\r\nvar diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n};\r\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n}\r\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n}\r\nfunction getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n}\n\nvar each$9 = each;\r\nvar inner$h = makeInner();\r\nfunction push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$9(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n}\r\nfunction pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$9(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n}\r\nfunction clear$1(ecModel) {\r\n inner$h(ecModel).snapshots = null;\r\n}\r\nfunction count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n}\r\nfunction getStoreSnapshots(ecModel) {\r\n var store = inner$h(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n}\n\nComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n});\n\nvar DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n];\r\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\nfunction isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n}\r\nfunction getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n}\r\nfunction findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n}\r\nfunction collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n}\n\nvar DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n}());\r\nvar DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n}(ComponentModel));\r\nfunction retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n}\n\nvar DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n}(ComponentView));\r\nComponentView.registerClass(DataZoomView);\n\nvar SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(SelectDataZoomModel);\n\nvar SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n}(DataZoomView));\r\nComponentView.registerClass(SelectDataZoomView);\n\nvar each$a = each;\r\nvar asc$1 = asc;\r\nvar AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$a(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$a(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$a(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$a(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$a(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n}());\r\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$a(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n}\n\nregisterProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n});\n\nregisterAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n});\n\nvar each$b = each;\r\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\nvar DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers$1[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$b(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n}(ToolboxFeature));\r\nvar handlers$1 = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n};\r\nfunction makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n}\r\nfunction updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n}\r\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n}\r\nregisterFeature('dataZoom', DataZoomFeature);\r\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$b(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$b(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n});\n\nvar RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n}(ToolboxFeature));\r\nregisterFeature('restore', RestoreOption);\r\nregisterAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n});\n\nvar TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TooltipModel);\n\nfunction shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n}\n\nvar vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\nvar gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\nfunction mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n}\r\nfunction assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n}\r\nfunction assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n}\r\nfunction assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n}\r\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n}\r\nfunction makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\r\nvar TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n}());\n\nvar TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n}());\r\nfunction mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n}\r\nfunction calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n}\r\nfunction makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\n\nvar bind$2 = bind;\r\nvar each$c = each;\r\nvar parsePercent$3 = parsePercent$2;\r\nvar proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n});\r\nvar TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$c(dataByCoordSys, function (itemCoordSys) {\r\n each$c(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$c(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$c(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$c(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n}(ComponentView));\r\nfunction buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n}\r\nfunction makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n}\r\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n}\r\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n}\r\nfunction calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n}\r\nfunction isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n}\r\nComponentView.registerClass(TooltipView);\n\nregisterAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n}, function () { });\r\nregisterAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n}, function () { });\n\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\r\nfunction brushPreprocessor(option, isNew) {\r\n var brushComponents = normalizeToArray(option ? option.brush : []);\r\n if (!brushComponents.length) {\r\n return;\r\n }\r\n var brushComponentSpecifiedBtns = [];\r\n each(brushComponents, function (brushOpt) {\r\n var tbs = brushOpt.hasOwnProperty('toolbox')\r\n ? brushOpt.toolbox : [];\r\n if (tbs instanceof Array) {\r\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\r\n }\r\n });\r\n var toolbox = option && option.toolbox;\r\n if (isArray(toolbox)) {\r\n toolbox = toolbox[0];\r\n }\r\n if (!toolbox) {\r\n toolbox = { feature: {} };\r\n option.toolbox = [toolbox];\r\n }\r\n var toolboxFeature = (toolbox.feature || (toolbox.feature = {}));\r\n var toolboxBrush = (toolboxFeature.brush || (toolboxFeature.brush = {}));\r\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\r\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\r\n removeDuplicate(brushTypes);\r\n if (isNew && !brushTypes.length) {\r\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\r\n }\r\n}\r\nfunction removeDuplicate(arr) {\r\n var map = {};\r\n each(arr, function (val) {\r\n map[val] = 1;\r\n });\r\n arr.length = 0;\r\n each(map, function (flag, val) {\r\n arr.push(val);\r\n });\r\n}\n\nvar each$d = each;\r\nfunction hasKeys(obj) {\r\n if (obj) {\r\n for (var name_1 in obj) {\r\n if (obj.hasOwnProperty(name_1)) {\r\n return true;\r\n }\r\n }\r\n }\r\n}\r\nfunction createVisualMappings(option, stateList, supplementVisualOption) {\r\n var visualMappings = {};\r\n each$d(stateList, function (state) {\r\n var mappings = visualMappings[state] = createMappings();\r\n each$d(option[state], function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var mappingOption = {\r\n type: visualType,\r\n visual: visualData\r\n };\r\n supplementVisualOption && supplementVisualOption(mappingOption, state);\r\n mappings[visualType] = new VisualMapping(mappingOption);\r\n if (visualType === 'opacity') {\r\n mappingOption = clone(mappingOption);\r\n mappingOption.type = 'colorAlpha';\r\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\r\n }\r\n });\r\n });\r\n return visualMappings;\r\n function createMappings() {\r\n var Creater = function () { };\r\n Creater.prototype.__hidden = Creater.prototype;\r\n var obj = new Creater();\r\n return obj;\r\n }\r\n}\r\nfunction replaceVisualOption(thisOption, newOption, keys) {\r\n var has;\r\n each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n has = true;\r\n }\r\n });\r\n has && each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n thisOption[key] = clone(newOption[key]);\r\n }\r\n else {\r\n delete thisOption[key];\r\n }\r\n });\r\n}\r\nfunction applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n var dataIndex;\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n if (dimension == null) {\r\n data.each(eachItem);\r\n }\r\n else {\r\n data.each([dimension], eachItem);\r\n }\r\n function eachItem(valueOrIndex, index) {\r\n dataIndex = dimension == null\r\n ? valueOrIndex\r\n : index;\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n return;\r\n }\r\n var valueState = getValueState.call(scope, valueOrIndex);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\r\n }\r\n }\r\n}\r\nfunction incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n return {\r\n progress: function progress(params, data) {\r\n var dimName;\r\n if (dim != null) {\r\n dimName = data.getDimension(dim);\r\n }\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n continue;\r\n }\r\n var value = dim != null\r\n ? data.get(dimName, dataIndex)\r\n : dataIndex;\r\n var valueState = getValueState(value);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n };\r\n}\n\nfunction makeBrushCommonSelectorForSeries(area) {\r\n var brushType = area.brushType;\r\n var selectors = {\r\n point: function (itemLayout) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect: function (itemLayout) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n}\r\nvar selector = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout\r\n && area.boundingRect.contain(itemLayout[0], itemLayout[1])\r\n && contain$2(area.range, itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n var points = area.range;\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n var x = itemLayout.x;\r\n var y = itemLayout.y;\r\n var width = itemLayout.width;\r\n var height = itemLayout.height;\r\n var p = points[0];\r\n if (contain$2(points, x, y)\r\n || contain$2(points, x + width, y)\r\n || contain$2(points, x, y + height)\r\n || contain$2(points, x + width, y + height)\r\n || BoundingRect.create(itemLayout).contain(p[0], p[1])\r\n || linePolygonIntersect(x, y, x + width, y, points)\r\n || linePolygonIntersect(x, y, x, y + height, points)\r\n || linePolygonIntersect(x + width, y, x + width, y + height, points)\r\n || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\r\n return true;\r\n }\r\n }\r\n }\r\n};\r\nfunction getLineSelectors(xyIndex) {\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var layoutRange = [\r\n itemLayout[xy[xyIndex]],\r\n itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]\r\n ];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range)\r\n || inLineRange(layoutRange[1], range)\r\n || inLineRange(range[0], layoutRange)\r\n || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n}\r\nfunction inLineRange(p, range) {\r\n return range[0] <= p && p <= range[1];\r\n}\n\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\r\nvar DISPATCH_METHOD = '__ecBrushSelect';\r\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\r\nvar PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH;\r\nfunction layoutCovers(ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\r\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\r\n });\r\n}\r\nregisterVisual(PRIORITY_BRUSH, function (ecModel, api, payload) {\r\n var brushSelected = [];\r\n var throttleType;\r\n var throttleDelay;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { brushType: false });\r\n });\r\n layoutCovers(ecModel);\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel, brushIndex) {\r\n var thisBrushSelected = {\r\n brushId: brushModel.id,\r\n brushIndex: brushIndex,\r\n brushName: brushModel.name,\r\n areas: clone(brushModel.areas),\r\n selected: []\r\n };\r\n brushSelected.push(thisBrushSelected);\r\n var brushOption = brushModel.option;\r\n var brushLink = brushOption.brushLink;\r\n var linkedSeriesMap = [];\r\n var selectedDataIndexForLink = [];\r\n var rangeInfoBySeries = [];\r\n var hasBrushExists = false;\r\n if (!brushIndex) {\r\n throttleType = brushOption.throttleType;\r\n throttleDelay = brushOption.throttleDelay;\r\n }\r\n var areas = map(brushModel.areas, function (area) {\r\n var builder = boundingRectBuilders[area.brushType];\r\n var selectableArea = defaults({ boundingRect: builder ? builder(area) : void 0 }, area);\r\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\r\n return selectableArea;\r\n });\r\n var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\r\n mappingOption.mappingMethod = 'fixed';\r\n });\r\n isArray(brushLink) && each(brushLink, function (seriesIndex) {\r\n linkedSeriesMap[seriesIndex] = 1;\r\n });\r\n function linkOthers(seriesIndex) {\r\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\r\n }\r\n function brushed(rangeInfoList) {\r\n return !!rangeInfoList.length;\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\r\n seriesModel.subType === 'parallel'\r\n ? stepAParallel(seriesModel, seriesIndex)\r\n : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\r\n });\r\n function stepAParallel(seriesModel, seriesIndex) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\r\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\r\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\r\n });\r\n }\r\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\r\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\r\n return;\r\n }\r\n each(areas, function (area) {\r\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\r\n rangeInfoList.push(area);\r\n }\r\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\r\n });\r\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\r\n var data_1 = seriesModel.getData();\r\n data_1.each(function (dataIndex) {\r\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\r\n selectedDataIndexForLink[dataIndex] = 1;\r\n }\r\n });\r\n }\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var seriesBrushSelected = {\r\n seriesId: seriesModel.id,\r\n seriesIndex: seriesIndex,\r\n seriesName: seriesModel.name,\r\n dataIndex: []\r\n };\r\n thisBrushSelected.selected.push(seriesBrushSelected);\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\r\n var data = seriesModel.getData();\r\n var getValueState = linkOthers(seriesIndex)\r\n ? function (dataIndex) {\r\n return selectedDataIndexForLink[dataIndex]\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n }\r\n : function (dataIndex) {\r\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex)\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n };\r\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList))\r\n && applyVisual(STATE_LIST, visualMappings, data, getValueState);\r\n });\r\n });\r\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\r\n});\r\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\r\n if (!payload) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n if (zr[DISPATCH_FLAG]) {\r\n return;\r\n }\r\n if (!zr[DISPATCH_METHOD]) {\r\n zr[DISPATCH_METHOD] = doDispatch;\r\n }\r\n var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\r\n fn(api, brushSelected);\r\n}\r\nfunction doDispatch(api, brushSelected) {\r\n if (!api.isDisposed()) {\r\n var zr = api.getZr();\r\n zr[DISPATCH_FLAG] = true;\r\n api.dispatchAction({\r\n type: 'brushSelect',\r\n batch: brushSelected\r\n });\r\n zr[DISPATCH_FLAG] = false;\r\n }\r\n}\r\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\r\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\r\n var area = rangeInfoList[i];\r\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\r\n return true;\r\n }\r\n }\r\n}\r\nfunction brushModelNotControll(brushModel, seriesIndex) {\r\n var seriesIndices = brushModel.option.seriesIndex;\r\n return seriesIndices != null\r\n && seriesIndices !== 'all'\r\n && (isArray(seriesIndices)\r\n ? indexOf(seriesIndices, seriesIndex) < 0\r\n : seriesIndex !== seriesIndices);\r\n}\r\nvar boundingRectBuilders = {\r\n rect: function (area) {\r\n return getBoundingRectFromMinMax(area.range);\r\n },\r\n polygon: function (area) {\r\n var minMax;\r\n var range = area.range;\r\n for (var i = 0, len = range.length; i < len; i++) {\r\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var rg = range[i];\r\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\r\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\r\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\r\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\r\n }\r\n return minMax && getBoundingRectFromMinMax(minMax);\r\n }\r\n};\r\nfunction getBoundingRectFromMinMax(minMax) {\r\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\r\n}\n\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\r\nvar BrushModel = (function (_super) {\r\n __extends(BrushModel, _super);\r\n function BrushModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushModel.type;\r\n _this.areas = [];\r\n _this.brushOption = {};\r\n return _this;\r\n }\r\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\r\n var inBrush = thisOption.inBrush = thisOption.inBrush || {};\r\n thisOption.outOfBrush = thisOption.outOfBrush || { color: DEFAULT_OUT_OF_BRUSH_COLOR };\r\n if (!inBrush.hasOwnProperty('liftZ')) {\r\n inBrush.liftZ = 5;\r\n }\r\n };\r\n BrushModel.prototype.setAreas = function (areas) {\r\n if (__DEV__) {\r\n assert(isArray(areas));\r\n each(areas, function (area) {\r\n assert(area.brushType, 'Illegal areas');\r\n });\r\n }\r\n if (!areas) {\r\n return;\r\n }\r\n this.areas = map(areas, function (area) {\r\n return generateBrushOption(this.option, area);\r\n }, this);\r\n };\r\n BrushModel.prototype.setBrushOption = function (brushOption) {\r\n this.brushOption = generateBrushOption(this.option, brushOption);\r\n this.brushType = this.brushOption.brushType;\r\n };\r\n BrushModel.type = 'brush';\r\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\r\n BrushModel.defaultOption = {\r\n seriesIndex: 'all',\r\n brushType: 'rect',\r\n brushMode: 'single',\r\n transformable: true,\r\n brushStyle: {\r\n borderWidth: 1,\r\n color: 'rgba(210,219,238,0.3)',\r\n borderColor: '#D2DBEE'\r\n },\r\n throttleType: 'fixRate',\r\n throttleDelay: 0,\r\n removeOnClick: true,\r\n z: 10000\r\n };\r\n return BrushModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(BrushModel);\r\nfunction generateBrushOption(option, brushOption) {\r\n return merge({\r\n brushType: option.brushType,\r\n brushMode: option.brushMode,\r\n transformable: option.transformable,\r\n brushStyle: new Model(option.brushStyle).getItemStyle(),\r\n removeOnClick: option.removeOnClick,\r\n z: option.z\r\n }, brushOption, true);\r\n}\n\nvar BrushView = (function (_super) {\r\n __extends(BrushView, _super);\r\n function BrushView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushView.type;\r\n return _this;\r\n }\r\n BrushView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n this.model;\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this))\r\n .mount();\r\n };\r\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\r\n this.model = brushModel;\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\r\n layoutCovers(ecModel);\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\r\n this.updateTransform(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\r\n (!payload || payload.$from !== brushModel.id) && this._brushController\r\n .setPanels(brushModel.brushTargetManager.makePanelOpts(api))\r\n .enableBrush(brushModel.brushOption)\r\n .updateCovers(brushModel.areas.slice());\r\n };\r\n BrushView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n BrushView.prototype._onBrush = function (eventParam) {\r\n var modelId = this.model.id;\r\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\r\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\r\n type: 'brush',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n eventParam.isEnd && this.api.dispatchAction({\r\n type: 'brushEnd',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n };\r\n BrushView.type = 'brush';\r\n return BrushView;\r\n}(ComponentView));\r\nComponentView.registerClass(BrushView);\n\nregisterAction({ type: 'brush', event: 'brush', update: 'updateVisual' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush', query: payload }, function (brushModel) {\r\n brushModel.setAreas(payload.areas);\r\n });\r\n});\r\nregisterAction({ type: 'brushSelect', event: 'brushSelected', update: 'none' }, function () { });\r\nregisterAction({ type: 'brushEnd', event: 'brushEnd', update: 'none' }, function () { });\n\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\r\nvar BrushFeature = (function (_super) {\r\n __extends(BrushFeature, _super);\r\n function BrushFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\r\n var brushType;\r\n var brushMode;\r\n var isBrushed;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n brushType = brushModel.brushType;\r\n brushMode = brushModel.brushOption.brushMode || 'single';\r\n isBrushed = isBrushed || !!brushModel.areas.length;\r\n });\r\n this._brushType = brushType;\r\n this._brushMode = brushMode;\r\n each(featureModel.get('type', true), function (type) {\r\n featureModel.setIconStatus(type, (type === 'keep'\r\n ? brushMode === 'multiple'\r\n : type === 'clear'\r\n ? isBrushed\r\n : type === brushType) ? 'emphasis' : 'normal');\r\n });\r\n };\r\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\r\n this.render(featureModel, ecModel, api);\r\n };\r\n BrushFeature.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon', true);\r\n var icons = {};\r\n each(model.get('type', true), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\r\n var brushType = this._brushType;\r\n var brushMode = this._brushMode;\r\n if (type === 'clear') {\r\n api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n intervals: []\r\n });\r\n api.dispatchAction({\r\n type: 'brush',\r\n command: 'clear',\r\n areas: []\r\n });\r\n }\r\n else {\r\n api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'brush',\r\n brushOption: {\r\n brushType: type === 'keep'\r\n ? brushType\r\n : (brushType === type ? false : type),\r\n brushMode: type === 'keep'\r\n ? (brushMode === 'multiple' ? 'single' : 'multiple')\r\n : brushMode\r\n }\r\n });\r\n }\r\n };\r\n BrushFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: ICON_TYPES.slice(),\r\n icon: {\r\n rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\r\n polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\r\n lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\r\n lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\r\n keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\r\n clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'brush', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return BrushFeature;\r\n}(ToolboxFeature));\r\nregisterFeature('brush', BrushFeature);\n\nregisterPreprocessor(brushPreprocessor);\n\nvar TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TitleModel);\r\nvar TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n}(ComponentView));\r\nComponentView.registerClass(TitleView);\n\nfunction timelinePreprocessor(option) {\r\n var timelineOpt = option && option.timeline;\r\n if (!isArray(timelineOpt)) {\r\n timelineOpt = timelineOpt ? [timelineOpt] : [];\r\n }\r\n each(timelineOpt, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n compatibleEC2(opt);\r\n });\r\n}\r\nfunction compatibleEC2(opt) {\r\n var type = opt.type;\r\n var ec2Types = { 'number': 'value', 'time': 'time' };\r\n if (ec2Types[type]) {\r\n opt.axisType = ec2Types[type];\r\n delete opt.type;\r\n }\r\n transferItem(opt);\r\n if (has(opt, 'controlPosition')) {\r\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\r\n if (!has(controlStyle, 'position')) {\r\n controlStyle.position = opt.controlPosition;\r\n }\r\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\r\n controlStyle.show = false;\r\n delete controlStyle.position;\r\n }\r\n delete opt.controlPosition;\r\n }\r\n each(opt.data || [], function (dataItem) {\r\n if (isObject(dataItem) && !isArray(dataItem)) {\r\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\r\n dataItem.value = dataItem.name;\r\n }\r\n transferItem(dataItem);\r\n }\r\n });\r\n}\r\nfunction transferItem(opt) {\r\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\r\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\r\n var label = opt.label || (opt.label || {});\r\n var labelNormal = label.normal || (label.normal = {});\r\n var excludeLabelAttr = { normal: 1, emphasis: 1 };\r\n each(label, function (value, name) {\r\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\r\n labelNormal[name] = value;\r\n }\r\n });\r\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\r\n label.emphasis = itemStyleEmphasis.label;\r\n delete itemStyleEmphasis.label;\r\n }\r\n}\r\nfunction has(obj, attr) {\r\n return obj.hasOwnProperty(attr);\r\n}\n\nComponentModel.registerSubTypeDefaulter('timeline', function () {\r\n return 'slider';\r\n});\n\nregisterAction({ type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.currentIndex != null) {\r\n timelineModel.setCurrentIndex(payload.currentIndex);\r\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {\r\n timelineModel.setPlayState(false);\r\n }\r\n }\r\n ecModel.resetOption('timeline', { replaceMerge: timelineModel.get('replaceMerge', true) });\r\n return defaults({\r\n currentIndex: timelineModel.option.currentIndex\r\n }, payload);\r\n});\r\nregisterAction({ type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.playState != null) {\r\n timelineModel.setPlayState(payload.playState);\r\n }\r\n});\n\nvar TimelineModel = (function (_super) {\r\n __extends(TimelineModel, _super);\r\n function TimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineModel.type;\r\n _this.layoutMode = 'box';\r\n return _this;\r\n }\r\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n var count = this._data.count();\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n }\r\n else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n this.option.currentIndex = currentIndex;\r\n };\r\n TimelineModel.prototype.getCurrentIndex = function () {\r\n return this.option.currentIndex;\r\n };\r\n TimelineModel.prototype.isIndexMax = function () {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n };\r\n TimelineModel.prototype.setPlayState = function (state) {\r\n this.option.autoPlay = !!state;\r\n };\r\n TimelineModel.prototype.getPlayState = function () {\r\n return !!this.option.autoPlay;\r\n };\r\n TimelineModel.prototype._initData = function () {\r\n var thisOption = this.option;\r\n var dataArr = thisOption.data || [];\r\n var axisType = thisOption.axisType;\r\n var names = this._names = [];\r\n var processedDataArr;\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n var value = convertOptionIdName(getDataItemValue(item), '');\r\n var newItem;\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n newItem.value = index;\r\n }\r\n else {\r\n newItem = index;\r\n }\r\n processedDataArr.push(newItem);\r\n names.push(value);\r\n });\r\n }\r\n else {\r\n processedDataArr = dataArr;\r\n }\r\n var dimType = ({\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n })[axisType] || 'number';\r\n var data = this._data = new List([{\r\n name: 'value', type: dimType\r\n }], this);\r\n data.initData(processedDataArr, names);\r\n };\r\n TimelineModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n TimelineModel.prototype.getCategories = function () {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n };\r\n TimelineModel.type = 'timeline';\r\n TimelineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n axisType: 'time',\r\n realtime: true,\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n controlPosition: 'left',\r\n autoPlay: false,\r\n rewind: false,\r\n loop: true,\r\n playInterval: 2000,\r\n currentIndex: 0,\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n data: []\r\n };\r\n return TimelineModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(TimelineModel);\n\nvar SliderTimelineModel = (function (_super) {\r\n __extends(SliderTimelineModel, _super);\r\n function SliderTimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineModel.type;\r\n return _this;\r\n }\r\n SliderTimelineModel.type = 'timeline.slider';\r\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n orient: 'horizontal',\r\n inverse: false,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n symbol: 'circle',\r\n symbolSize: 12,\r\n lineStyle: {\r\n show: true,\r\n width: 2,\r\n color: '#DAE1F5'\r\n },\r\n label: {\r\n position: 'auto',\r\n show: true,\r\n interval: 'auto',\r\n rotate: 0,\r\n color: '#A4B1D7'\r\n },\r\n itemStyle: {\r\n color: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n checkpointStyle: {\r\n symbol: 'circle',\r\n symbolSize: 15,\r\n color: '#316bf3',\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0, 0, 0, 0.3)',\r\n animation: true,\r\n animationDuration: 300,\r\n animationEasing: 'quinticInOut'\r\n },\r\n controlStyle: {\r\n show: true,\r\n showPlayBtn: true,\r\n showPrevBtn: true,\r\n showNextBtn: true,\r\n itemSize: 24,\r\n itemGap: 12,\r\n position: 'left',\r\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\r\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\r\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\r\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\r\n prevBtnSize: 18,\r\n nextBtnSize: 18,\r\n color: '#A4B1D7',\r\n borderColor: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: '#6f778d'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n controlStyle: {\r\n color: '#316BF3',\r\n borderColor: '#316BF3',\r\n borderWidth: 2\r\n }\r\n },\r\n progress: {\r\n lineStyle: {\r\n color: '#316BF3'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n label: {\r\n color: '#6f778d'\r\n }\r\n },\r\n data: []\r\n });\r\n return SliderTimelineModel;\r\n}(TimelineModel));\r\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\r\nComponentModel.registerClass(SliderTimelineModel);\n\nvar TimelineView = (function (_super) {\r\n __extends(TimelineView, _super);\r\n function TimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineView.type;\r\n return _this;\r\n }\r\n TimelineView.type = 'timeline';\r\n return TimelineView;\r\n}(ComponentView));\n\nvar TimelineAxis = (function (_super) {\r\n __extends(TimelineAxis, _super);\r\n function TimelineAxis(dim, scale, coordExtent, axisType) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n return _this;\r\n }\r\n TimelineAxis.prototype.getLabelModel = function () {\r\n return this.model.getModel('label');\r\n };\r\n TimelineAxis.prototype.isHorizontal = function () {\r\n return this.model.get('orient') === 'horizontal';\r\n };\r\n return TimelineAxis;\r\n}(Axis));\n\nvar PI$9 = Math.PI;\r\nvar labelDataIndexStore = makeInner();\r\nvar SliderTimelineView = (function (_super) {\r\n __extends(SliderTimelineView, _super);\r\n function SliderTimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineView.type;\r\n return _this;\r\n }\r\n SliderTimelineView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n };\r\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\r\n this.model = timelineModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n this.group.removeAll();\r\n if (timelineModel.get('show', true)) {\r\n var layoutInfo_1 = this._layout(timelineModel, api);\r\n var mainGroup_1 = this._createGroup('_mainGroup');\r\n var labelGroup = this._createGroup('_labelGroup');\r\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\r\n timelineModel.formatTooltip = function (dataIndex) {\r\n var name = axis_1.scale.getLabel({ value: dataIndex });\r\n return createTooltipMarkup('nameValue', { noName: true, value: name });\r\n };\r\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\r\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\r\n }, this);\r\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\r\n this._position(layoutInfo_1, timelineModel);\r\n }\r\n this._doPlayStop();\r\n this._updateTicksStatus();\r\n };\r\n SliderTimelineView.prototype.remove = function () {\r\n this._clearTimer();\r\n this.group.removeAll();\r\n };\r\n SliderTimelineView.prototype.dispose = function () {\r\n this._clearTimer();\r\n };\r\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\r\n var labelPosOpt = timelineModel.get(['label', 'position']);\r\n var orient = timelineModel.get('orient');\r\n var viewRect = getViewRect$5(timelineModel, api);\r\n var parsedLabelPos;\r\n if (labelPosOpt == null || labelPosOpt === 'auto') {\r\n parsedLabelPos = orient === 'horizontal'\r\n ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')\r\n : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');\r\n }\r\n else if (isString(labelPosOpt)) {\r\n parsedLabelPos = {\r\n horizontal: { top: '-', bottom: '+' },\r\n vertical: { left: '-', right: '+' }\r\n }[orient][labelPosOpt];\r\n }\r\n else {\r\n parsedLabelPos = labelPosOpt;\r\n }\r\n var labelAlignMap = {\r\n horizontal: 'center',\r\n vertical: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'left' : 'right'\r\n };\r\n var labelBaselineMap = {\r\n horizontal: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'top' : 'bottom',\r\n vertical: 'middle'\r\n };\r\n var rotationMap = {\r\n horizontal: 0,\r\n vertical: PI$9 / 2\r\n };\r\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\r\n var controlModel = timelineModel.getModel('controlStyle');\r\n var showControl = controlModel.get('show', true);\r\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\r\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\r\n var sizePlusGap = controlSize + controlGap;\r\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\r\n labelRotation = labelRotation * PI$9 / 180;\r\n var playPosition;\r\n var prevBtnPosition;\r\n var nextBtnPosition;\r\n var controlPosition = controlModel.get('position', true);\r\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\r\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\r\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\r\n var xLeft = 0;\r\n var xRight = mainLength;\r\n if (controlPosition === 'left' || controlPosition === 'bottom') {\r\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n else {\r\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n var axisExtent = [xLeft, xRight];\r\n if (timelineModel.get('inverse')) {\r\n axisExtent.reverse();\r\n }\r\n return {\r\n viewRect: viewRect,\r\n mainLength: mainLength,\r\n orient: orient,\r\n rotation: rotationMap[orient],\r\n labelRotation: labelRotation,\r\n labelPosOpt: parsedLabelPos,\r\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\r\n labelBaseline: timelineModel.get(['label', 'verticalAlign'])\r\n || timelineModel.get(['label', 'baseline'])\r\n || labelBaselineMap[orient],\r\n playPosition: playPosition,\r\n prevBtnPosition: prevBtnPosition,\r\n nextBtnPosition: nextBtnPosition,\r\n axisExtent: axisExtent,\r\n controlSize: controlSize,\r\n controlGap: controlGap\r\n };\r\n };\r\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\r\n var mainGroup = this._mainGroup;\r\n var labelGroup = this._labelGroup;\r\n var viewRect = layoutInfo.viewRect;\r\n if (layoutInfo.orient === 'vertical') {\r\n var m = create$1();\r\n var rotateOriginX = viewRect.x;\r\n var rotateOriginY = viewRect.y + viewRect.height;\r\n translate(m, m, [-rotateOriginX, -rotateOriginY]);\r\n rotate(m, m, -PI$9 / 2);\r\n translate(m, m, [rotateOriginX, rotateOriginY]);\r\n viewRect = viewRect.clone();\r\n viewRect.applyTransform(m);\r\n }\r\n var viewBound = getBound(viewRect);\r\n var mainBound = getBound(mainGroup.getBoundingRect());\r\n var labelBound = getBound(labelGroup.getBoundingRect());\r\n var mainPosition = [mainGroup.x, mainGroup.y];\r\n var labelsPosition = [labelGroup.x, labelGroup.y];\r\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\r\n var labelPosOpt = layoutInfo.labelPosOpt;\r\n if (labelPosOpt == null || isString(labelPosOpt)) {\r\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\r\n }\r\n else {\r\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\r\n }\r\n mainGroup.setPosition(mainPosition);\r\n labelGroup.setPosition(labelsPosition);\r\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\r\n setOrigin(mainGroup);\r\n setOrigin(labelGroup);\r\n function setOrigin(targetGroup) {\r\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\r\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\r\n }\r\n function getBound(rect) {\r\n return [\r\n [rect.x, rect.x + rect.width],\r\n [rect.y, rect.y + rect.height]\r\n ];\r\n }\r\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\r\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\r\n }\r\n };\r\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\r\n var data = timelineModel.getData();\r\n var axisType = timelineModel.get('axisType');\r\n var scale = createScaleByModel$1(timelineModel, axisType);\r\n scale.getTicks = function () {\r\n return data.mapArray(['value'], function (value) {\r\n return { value: value };\r\n });\r\n };\r\n var dataExtent = data.getDataExtent('value');\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n scale.niceTicks();\r\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\r\n axis.model = timelineModel;\r\n return axis;\r\n };\r\n SliderTimelineView.prototype._createGroup = function (key) {\r\n var newGroup = this[key] = new Group();\r\n this.group.add(newGroup);\r\n return newGroup;\r\n };\r\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\r\n var axisExtent = axis.getExtent();\r\n if (!timelineModel.get(['lineStyle', 'show'])) {\r\n return;\r\n }\r\n var line = new Line({\r\n shape: {\r\n x1: axisExtent[0], y1: 0,\r\n x2: axisExtent[1], y2: 0\r\n },\r\n style: extend({ lineCap: 'round' }, timelineModel.getModel('lineStyle').getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(line);\r\n var progressLine = this._progressLine = new Line({\r\n shape: {\r\n x1: axisExtent[0],\r\n x2: this._currentPointer\r\n ? this._currentPointer.x : axisExtent[0],\r\n y1: 0, y2: 0\r\n },\r\n style: defaults({ lineCap: 'round', lineWidth: line.style.lineWidth }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(progressLine);\r\n };\r\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var data = timelineModel.getData();\r\n var ticks = axis.scale.getTicks();\r\n this._tickSymbols = [];\r\n each(ticks, function (tick) {\r\n var tickCoord = axis.dataToCoord(tick.value);\r\n var itemModel = data.getItemModel(tick.value);\r\n var itemStyleModel = itemModel.getModel('itemStyle');\r\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\r\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\r\n var symbolOpt = {\r\n x: tickCoord,\r\n y: 0,\r\n onclick: bind(_this._changeTimeline, _this, tick.value)\r\n };\r\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\r\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\r\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\r\n enableHoverEmphasis(el);\r\n var ecData = getECData(el);\r\n if (itemModel.get('tooltip')) {\r\n ecData.dataIndex = tick.value;\r\n ecData.dataModel = timelineModel;\r\n }\r\n else {\r\n ecData.dataIndex = ecData.dataModel = null;\r\n }\r\n _this._tickSymbols.push(el);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var labelModel = axis.getLabelModel();\r\n if (!labelModel.get('show')) {\r\n return;\r\n }\r\n var data = timelineModel.getData();\r\n var labels = axis.getViewLabels();\r\n this._tickLabels = [];\r\n each(labels, function (labelItem) {\r\n var dataIndex = labelItem.tickValue;\r\n var itemModel = data.getItemModel(dataIndex);\r\n var normalLabelModel = itemModel.getModel('label');\r\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\r\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\r\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: 0,\r\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\r\n onclick: bind(_this._changeTimeline, _this, dataIndex),\r\n silent: false,\r\n style: createTextStyle(normalLabelModel, {\r\n text: labelItem.formattedLabel,\r\n align: layoutInfo.labelAlign,\r\n verticalAlign: layoutInfo.labelBaseline\r\n })\r\n });\r\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\r\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\r\n group.add(textEl);\r\n enableHoverEmphasis(textEl);\r\n labelDataIndexStore(textEl).dataIndex = dataIndex;\r\n _this._tickLabels.push(textEl);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\r\n var controlSize = layoutInfo.controlSize;\r\n var rotation = layoutInfo.rotation;\r\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\r\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\r\n var playState = timelineModel.getPlayState();\r\n var inverse = timelineModel.get('inverse', true);\r\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\r\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\r\n makeBtn(layoutInfo.playPosition, (playState ? 'stop' : 'play'), bind(this._handlePlayClick, this, !playState), true);\r\n function makeBtn(position, iconName, onclick, willRotate) {\r\n if (!position) {\r\n return;\r\n }\r\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\r\n var rect = [0, -iconSize / 2, iconSize, iconSize];\r\n var opt = {\r\n position: position,\r\n origin: [controlSize / 2, 0],\r\n rotation: willRotate ? -rotation : 0,\r\n rectHover: true,\r\n style: itemStyle,\r\n onclick: onclick\r\n };\r\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, opt);\r\n btn.ensureState('emphasis').style = hoverStyle;\r\n group.add(btn);\r\n enableHoverEmphasis(btn);\r\n }\r\n };\r\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\r\n var data = timelineModel.getData();\r\n var currentIndex = timelineModel.getCurrentIndex();\r\n var pointerModel = data.getItemModel(currentIndex)\r\n .getModel('checkpointStyle');\r\n var me = this;\r\n var callback = {\r\n onCreate: function (pointer) {\r\n pointer.draggable = true;\r\n pointer.drift = bind(me._handlePointerDrag, me);\r\n pointer.ondragend = bind(me._handlePointerDragend, me);\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\r\n },\r\n onUpdate: function (pointer) {\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\r\n }\r\n };\r\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\r\n };\r\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\r\n this._clearTimer();\r\n this.api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: nextState,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\r\n this._clearTimer();\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\r\n };\r\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\r\n };\r\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\r\n var toCoord = this._toAxisCoord(mousePos)[0];\r\n var axis = this._axis;\r\n var axisExtent = asc(axis.getExtent().slice());\r\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\r\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\r\n this._currentPointer.x = toCoord;\r\n this._currentPointer.markRedraw();\r\n this._progressLine.shape.x2 = toCoord;\r\n this._progressLine.dirty();\r\n var targetDataIndex = this._findNearestTick(toCoord);\r\n var timelineModel = this.model;\r\n if (trigger || (targetDataIndex !== timelineModel.getCurrentIndex()\r\n && timelineModel.get('realtime'))) {\r\n this._changeTimeline(targetDataIndex);\r\n }\r\n };\r\n SliderTimelineView.prototype._doPlayStop = function () {\r\n var _this = this;\r\n this._clearTimer();\r\n if (this.model.getPlayState()) {\r\n this._timer = setTimeout(function () {\r\n var timelineModel = _this.model;\r\n _this._changeTimeline(timelineModel.getCurrentIndex()\r\n + (timelineModel.get('rewind', true) ? -1 : 1));\r\n }, this.model.get('playInterval'));\r\n }\r\n };\r\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\r\n var trans = this._mainGroup.getLocalTransform();\r\n return applyTransform$1(vertex, trans, true);\r\n };\r\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\r\n var data = this.model.getData();\r\n var dist = Infinity;\r\n var targetDataIndex;\r\n var axis = this._axis;\r\n data.each(['value'], function (value, dataIndex) {\r\n var coord = axis.dataToCoord(value);\r\n var d = Math.abs(coord - axisCoord);\r\n if (d < dist) {\r\n dist = d;\r\n targetDataIndex = dataIndex;\r\n }\r\n });\r\n return targetDataIndex;\r\n };\r\n SliderTimelineView.prototype._clearTimer = function () {\r\n if (this._timer) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n };\r\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\r\n var currentIndex = this.model.getCurrentIndex();\r\n if (nextIndex === '+') {\r\n nextIndex = currentIndex + 1;\r\n }\r\n else if (nextIndex === '-') {\r\n nextIndex = currentIndex - 1;\r\n }\r\n this.api.dispatchAction({\r\n type: 'timelineChange',\r\n currentIndex: nextIndex,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._updateTicksStatus = function () {\r\n var currentIndex = this.model.getCurrentIndex();\r\n var tickSymbols = this._tickSymbols;\r\n var tickLabels = this._tickLabels;\r\n if (tickSymbols) {\r\n for (var i = 0; i < tickSymbols.length; i++) {\r\n tickSymbols && tickSymbols[i]\r\n && tickSymbols[i].toggleState('progress', i < currentIndex);\r\n }\r\n }\r\n if (tickLabels) {\r\n for (var i = 0; i < tickLabels.length; i++) {\r\n tickLabels && tickLabels[i]\r\n && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\r\n }\r\n }\r\n };\r\n SliderTimelineView.type = 'timeline.slider';\r\n return SliderTimelineView;\r\n}(TimelineView));\r\nfunction createScaleByModel$1(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new IntervalScale();\r\n }\r\n }\r\n}\r\nfunction getViewRect$5(model, api) {\r\n return getLayoutRect(model.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, model.get('padding'));\r\n}\r\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\r\n var style = opts.style;\r\n var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\r\n if (style) {\r\n icon.setStyle(style);\r\n }\r\n return icon;\r\n}\r\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\r\n var color = itemStyleModel.get('color');\r\n if (!symbol) {\r\n var symbolType = hostModel.get('symbol');\r\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n symbol.setStyle('strokeNoScale', true);\r\n group.add(symbol);\r\n callback && callback.onCreate(symbol);\r\n }\r\n else {\r\n symbol.setColor(color);\r\n group.add(symbol);\r\n callback && callback.onUpdate(symbol);\r\n }\r\n var itemStyle = itemStyleModel.getItemStyle(['color']);\r\n symbol.setStyle(itemStyle);\r\n opt = merge({\r\n rectHover: true,\r\n z2: 100\r\n }, opt, true);\r\n var symbolSize = hostModel.get('symbolSize');\r\n symbolSize = symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n opt.scaleX = symbolSize[0] / 2;\r\n opt.scaleY = symbolSize[1] / 2;\r\n var symbolOffset = hostModel.get('symbolOffset');\r\n if (symbolOffset) {\r\n opt.x = opt.x || 0;\r\n opt.y = opt.y || 0;\r\n opt.x += parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n opt.y += parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = hostModel.get('symbolRotate');\r\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n symbol.attr(opt);\r\n symbol.updateTransform();\r\n return symbol;\r\n}\r\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\r\n if (pointer.dragging) {\r\n return;\r\n }\r\n var pointerModel = timelineModel.getModel('checkpointStyle');\r\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\r\n if (noAnimation || !pointerModel.get('animation', true)) {\r\n pointer.attr({\r\n x: toCoord,\r\n y: 0\r\n });\r\n progressLine && progressLine.attr({\r\n shape: { x2: toCoord }\r\n });\r\n }\r\n else {\r\n var animationCfg = {\r\n duration: pointerModel.get('animationDuration', true),\r\n easing: pointerModel.get('animationEasing', true)\r\n };\r\n pointer.stopAnimation(null, true);\r\n pointer.animateTo({\r\n x: toCoord,\r\n y: 0\r\n }, animationCfg);\r\n progressLine && progressLine.animateTo({\r\n shape: { x2: toCoord }\r\n }, animationCfg);\r\n }\r\n}\r\nComponentView.registerClass(SliderTimelineView);\n\nregisterPreprocessor(timelinePreprocessor);\n\nfunction fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n}\r\nvar inner$i = makeInner();\r\nvar MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$i(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$i(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$i(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$i(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n}(ComponentModel));\r\nmixin(MarkerModel, DataFormatMixin.prototype);\n\nvar MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkPointModel);\n\nfunction hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n}\r\nfunction hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n}\r\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n}\r\nvar markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n};\r\nfunction dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n}\r\nfunction getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n}\r\nfunction dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n}\r\nfunction dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n}\r\nfunction dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n}\r\nfunction numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n}\n\nvar inner$j = makeInner();\r\nvar MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$j(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$j(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$j(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n}(ComponentView));\n\nfunction updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n}\r\nvar MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n}(MarkerView));\r\nfunction createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n}\r\nComponentView.registerClass(MarkPointView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n});\n\nvar MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkLineModel);\n\nvar inner$k = makeInner();\r\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n};\r\nfunction isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n}\r\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n}\r\nfunction markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n}\r\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n}\r\nvar MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$k(mlModel).from;\r\n var toData_1 = inner$k(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$k(mlModel).from = fromData;\r\n inner$k(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n}(MarkerView));\r\nfunction createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n}\r\nComponentView.registerClass(MarkLineView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n});\n\nvar MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n}(MarkerModel));\r\nComponentModel.registerClass(MarkAreaModel);\n\nvar inner$l = makeInner();\r\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n};\r\nfunction isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n}\r\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n}\r\nfunction markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n}\r\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n}\r\nvar dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\nvar MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$l(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$l(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n}(MarkerView));\r\nfunction createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n}\r\nComponentView.registerClass(MarkAreaView);\n\nregisterPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n});\n\nvar getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n};\r\nvar LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n}(ComponentModel));\r\nComponentModel.registerClass(LegendModel);\n\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n}\r\nregisterAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\nregisterAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\nregisterAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\nregisterAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\nregisterAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\nvar curry$1 = curry;\r\nvar each$e = each;\r\nvar Group$2 = Group;\r\nvar LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$2());\r\n this.group.add(this._selectorGroup = new Group$2());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$e(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$2();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$e(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$2();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n}(ComponentView));\r\nfunction setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n}\r\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n}\r\nfunction isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n}\r\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\nComponentView.registerClass(LegendView);\n\nfunction legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n}\n\nregisterProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\nComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n});\n\nvar ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n}(LegendModel));\r\nfunction mergeAndNormalizeLayoutParams$1(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n}\r\nComponentModel.registerClass(ScrollableLegendModel);\n\nvar Group$3 = Group;\r\nvar WH$1 = ['width', 'height'];\r\nvar XY$1 = ['x', 'y'];\r\nvar ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$3());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$3());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var hw = WH$1[1 - orientIdx];\r\n var yx = XY$1[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n}(LegendView));\r\nComponentView.registerClass(ScrollableLegendView);\n\nregisterAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n});\n\nvar SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(SliderZoomModel);\n\nvar Rect$2 = Rect;\r\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\r\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\r\nvar DEFAULT_FILLER_SIZE = 30;\r\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\r\nvar HORIZONTAL = 'horizontal';\r\nvar VERTICAL = 'vertical';\r\nvar LABEL_GAP = 5;\r\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\nvar REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n};\r\nvar SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$2({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$2({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$2({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$2({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$2({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n}(DataZoomView));\r\nfunction getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n}\r\nfunction getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\nComponentView.registerClass(SliderZoomView);\n\nvar InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n}(DataZoomModel));\r\nComponentModel.registerClass(InsideZoomModel);\n\nvar inner$m = makeInner();\r\nregisterProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$m(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n});\r\nfunction setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$m(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n}\r\nfunction disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$m(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n}\r\nfunction createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction$1, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n}\r\nfunction dispatchAction$1(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n}\r\nfunction containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n}\r\nfunction mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n}\n\nvar InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n}(DataZoomView));\r\nvar getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n};\r\nfunction makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n}\r\nvar getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n};\r\nComponentView.registerClass(InsideZoomView);\n\nvar each$f = each;\r\nfunction visualMapPreprocessor(option) {\r\n var visualMap = option && option.visualMap;\r\n if (!isArray(visualMap)) {\r\n visualMap = visualMap ? [visualMap] : [];\r\n }\r\n each$f(visualMap, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) {\r\n opt.pieces = opt.splitList;\r\n delete opt.splitList;\r\n }\r\n var pieces = opt.pieces;\r\n if (pieces && isArray(pieces)) {\r\n each$f(pieces, function (piece) {\r\n if (isObject(piece)) {\r\n if (has$1(piece, 'start') && !has$1(piece, 'min')) {\r\n piece.min = piece.start;\r\n }\r\n if (has$1(piece, 'end') && !has$1(piece, 'max')) {\r\n piece.max = piece.end;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\r\nfunction has$1(obj, name) {\r\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\r\n}\n\nComponentModel.registerSubTypeDefaulter('visualMap', function (option) {\r\n return (!option.categories\r\n && (!(option.pieces\r\n ? option.pieces.length > 0\r\n : option.splitNumber > 0)\r\n || option.calculable))\r\n ? 'continuous' : 'piecewise';\r\n});\n\nvar VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT;\r\nregisterVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var resetDefines = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!visualMapModel.isTargetSeries(seriesModel)\r\n || (pipelineContext && pipelineContext.large)) {\r\n return;\r\n }\r\n resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\r\n });\r\n return resetDefines;\r\n }\r\n});\r\nregisterVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var visualMetaList = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n if (visualMapModel.isTargetSeries(seriesModel)) {\r\n var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {\r\n stops: [],\r\n outerColors: []\r\n };\r\n var concreteDim = visualMapModel.getDataDimension(data);\r\n var dimInfo = data.getDimensionInfo(concreteDim);\r\n if (dimInfo != null) {\r\n visualMeta.dimension = dimInfo.index;\r\n visualMetaList.push(visualMeta);\r\n }\r\n }\r\n });\r\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\r\n }\r\n});\r\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\r\n var mappings = visualMapModel.targetVisuals[valueState];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n var resultVisual = {\r\n color: getVisualFromData(seriesModel.getData(), 'color')\r\n };\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n var mapping = mappings[(type === 'opacity' ? '__alphaForOpacity' : type)];\r\n mapping && mapping.applyVisual(value, getVisual, setVisual);\r\n }\r\n return resultVisual.color;\r\n function getVisual(key) {\r\n return resultVisual[key];\r\n }\r\n function setVisual(key, value) {\r\n resultVisual[key] = value;\r\n }\r\n}\n\nvar visualDefault = {\r\n get: function (visualType, key, isCategory) {\r\n var value = clone((defaultOption$2[visualType] || {})[key]);\r\n return isCategory\r\n ? (isArray(value) ? value[value.length - 1] : value)\r\n : value;\r\n }\r\n};\r\nvar defaultOption$2 = {\r\n color: {\r\n active: ['#006edd', '#e0ffff'],\r\n inactive: ['rgba(0,0,0,0)']\r\n },\r\n colorHue: {\r\n active: [0, 360],\r\n inactive: [0, 0]\r\n },\r\n colorSaturation: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n colorLightness: {\r\n active: [0.9, 0.5],\r\n inactive: [0, 0]\r\n },\r\n colorAlpha: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n opacity: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n symbol: {\r\n active: ['circle', 'roundRect', 'diamond'],\r\n inactive: ['none']\r\n },\r\n symbolSize: {\r\n active: [10, 50],\r\n inactive: [0, 0]\r\n }\r\n};\n\nvar mapVisual$1 = VisualMapping.mapVisual;\r\nvar eachVisual = VisualMapping.eachVisual;\r\nvar isArray$1 = isArray;\r\nvar each$g = each;\r\nvar asc$2 = asc;\r\nvar linearMap$1 = linearMap;\r\nvar VisualMapModel = (function (_super) {\r\n __extends(VisualMapModel, _super);\r\n function VisualMapModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapModel.type;\r\n _this.stateList = ['inRange', 'outOfRange'];\r\n _this.replacableOptionKeys = [\r\n 'inRange', 'outOfRange', 'target', 'controller', 'color'\r\n ];\r\n _this.layoutMode = {\r\n type: 'box', ignoreSize: true\r\n };\r\n _this.dataBound = [-Infinity, Infinity];\r\n _this.targetVisuals = {};\r\n _this.controllerVisuals = {};\r\n return _this;\r\n }\r\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n if (!env.canvasSupported) {\r\n thisOption.realtime = false;\r\n }\r\n !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\r\n this.textStyleModel = this.getModel('textStyle');\r\n this.resetItemSize();\r\n this.completeVisualOption();\r\n };\r\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\r\n var stateList = this.stateList;\r\n supplementVisualOption = bind(supplementVisualOption, this);\r\n this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);\r\n this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);\r\n };\r\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\r\n var optionSeriesIndex = this.option.seriesIndex;\r\n var seriesIndices = [];\r\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\r\n this.ecModel.eachSeries(function (seriesModel, index) {\r\n seriesIndices.push(index);\r\n });\r\n }\r\n else {\r\n seriesIndices = normalizeToArray(optionSeriesIndex);\r\n }\r\n return seriesIndices;\r\n };\r\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\r\n each(this.getTargetSeriesIndices(), function (seriesIndex) {\r\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\r\n if (seriesModel) {\r\n callback.call(context, seriesModel);\r\n }\r\n }, this);\r\n };\r\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\r\n var is = false;\r\n this.eachTargetSeries(function (model) {\r\n model === seriesModel && (is = true);\r\n });\r\n return is;\r\n };\r\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\r\n var option = this.option;\r\n var precision = option.precision;\r\n var dataBound = this.dataBound;\r\n var formatter = option.formatter;\r\n var isMinMax;\r\n edgeSymbols = edgeSymbols || ['<', '>'];\r\n if (isArray(value)) {\r\n value = value.slice();\r\n isMinMax = true;\r\n }\r\n var textValue = isCategory\r\n ? value\r\n : (isMinMax\r\n ? [toFixed(value[0]), toFixed(value[1])]\r\n : toFixed(value));\r\n if (isString(formatter)) {\r\n return formatter\r\n .replace('{value}', isMinMax ? textValue[0] : textValue)\r\n .replace('{value2}', isMinMax ? textValue[1] : textValue);\r\n }\r\n else if (isFunction(formatter)) {\r\n return isMinMax\r\n ? formatter(value[0], value[1])\r\n : formatter(value);\r\n }\r\n if (isMinMax) {\r\n if (value[0] === dataBound[0]) {\r\n return edgeSymbols[0] + ' ' + textValue[1];\r\n }\r\n else if (value[1] === dataBound[1]) {\r\n return edgeSymbols[1] + ' ' + textValue[0];\r\n }\r\n else {\r\n return textValue[0] + ' - ' + textValue[1];\r\n }\r\n }\r\n else {\r\n return textValue;\r\n }\r\n function toFixed(val) {\r\n return val === dataBound[0]\r\n ? 'min'\r\n : val === dataBound[1]\r\n ? 'max'\r\n : (+val).toFixed(Math.min(precision, 20));\r\n }\r\n };\r\n VisualMapModel.prototype.resetExtent = function () {\r\n var thisOption = this.option;\r\n var extent = asc$2([thisOption.min, thisOption.max]);\r\n this._dataExtent = extent;\r\n };\r\n VisualMapModel.prototype.getDataDimension = function (list) {\r\n var optDim = this.option.dimension;\r\n var listDimensions = list.dimensions;\r\n if (optDim == null && !listDimensions.length) {\r\n return;\r\n }\r\n if (optDim != null) {\r\n return list.getDimension(optDim);\r\n }\r\n var dimNames = list.dimensions;\r\n for (var i = dimNames.length - 1; i >= 0; i--) {\r\n var dimName = dimNames[i];\r\n var dimInfo = list.getDimensionInfo(dimName);\r\n if (!dimInfo.isCalculationCoord) {\r\n return dimName;\r\n }\r\n }\r\n };\r\n VisualMapModel.prototype.getExtent = function () {\r\n return this._dataExtent.slice();\r\n };\r\n VisualMapModel.prototype.completeVisualOption = function () {\r\n var ecModel = this.ecModel;\r\n var thisOption = this.option;\r\n var base = {\r\n inRange: thisOption.inRange,\r\n outOfRange: thisOption.outOfRange\r\n };\r\n var target = thisOption.target || (thisOption.target = {});\r\n var controller = thisOption.controller || (thisOption.controller = {});\r\n merge(target, base);\r\n merge(controller, base);\r\n var isCategory = this.isCategory();\r\n completeSingle.call(this, target);\r\n completeSingle.call(this, controller);\r\n completeInactive.call(this, target, 'inRange', 'outOfRange');\r\n completeController.call(this, controller);\r\n function completeSingle(base) {\r\n if (isArray$1(thisOption.color)\r\n && !base.inRange) {\r\n base.inRange = { color: thisOption.color.slice().reverse() };\r\n }\r\n base.inRange = base.inRange || { color: ecModel.get('gradientColor') };\r\n }\r\n function completeInactive(base, stateExist, stateAbsent) {\r\n var optExist = base[stateExist];\r\n var optAbsent = base[stateAbsent];\r\n if (optExist && !optAbsent) {\r\n optAbsent = base[stateAbsent] = {};\r\n each$g(optExist, function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\r\n if (defa != null) {\r\n optAbsent[visualType] = defa;\r\n if (visualType === 'color'\r\n && !optAbsent.hasOwnProperty('opacity')\r\n && !optAbsent.hasOwnProperty('colorAlpha')) {\r\n optAbsent.opacity = [0, 0];\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function completeController(controller) {\r\n var symbolExists = (controller.inRange || {}).symbol\r\n || (controller.outOfRange || {}).symbol;\r\n var symbolSizeExists = (controller.inRange || {}).symbolSize\r\n || (controller.outOfRange || {}).symbolSize;\r\n var inactiveColor = this.get('inactiveColor');\r\n each$g(this.stateList, function (state) {\r\n var itemSize = this.itemSize;\r\n var visuals = controller[state];\r\n if (!visuals) {\r\n visuals = controller[state] = {\r\n color: isCategory ? inactiveColor : [inactiveColor]\r\n };\r\n }\r\n if (visuals.symbol == null) {\r\n visuals.symbol = symbolExists\r\n && clone(symbolExists)\r\n || (isCategory ? 'roundRect' : ['roundRect']);\r\n }\r\n if (visuals.symbolSize == null) {\r\n visuals.symbolSize = symbolSizeExists\r\n && clone(symbolSizeExists)\r\n || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\r\n }\r\n visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) {\r\n return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol;\r\n });\r\n var symbolSize = visuals.symbolSize;\r\n if (symbolSize != null) {\r\n var max_1 = -Infinity;\r\n eachVisual(symbolSize, function (value) {\r\n value > max_1 && (max_1 = value);\r\n });\r\n visuals.symbolSize = mapVisual$1(symbolSize, function (value) {\r\n return linearMap$1(value, [0, max_1], [0, itemSize[0]], true);\r\n });\r\n }\r\n }, this);\r\n }\r\n };\r\n VisualMapModel.prototype.resetItemSize = function () {\r\n this.itemSize = [\r\n parseFloat(this.get('itemWidth')),\r\n parseFloat(this.get('itemHeight'))\r\n ];\r\n };\r\n VisualMapModel.prototype.isCategory = function () {\r\n return !!this.option.categories;\r\n };\r\n VisualMapModel.prototype.setSelected = function (selected) { };\r\n VisualMapModel.prototype.getSelected = function () {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getValueState = function (value) {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\r\n return null;\r\n };\r\n VisualMapModel.type = 'visualMap';\r\n VisualMapModel.dependencies = ['series'];\r\n VisualMapModel.defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 4,\r\n seriesIndex: 'all',\r\n min: 0,\r\n max: 200,\r\n left: 0,\r\n right: null,\r\n top: null,\r\n bottom: 0,\r\n itemWidth: null,\r\n itemHeight: null,\r\n inverse: false,\r\n orient: 'vertical',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n contentColor: '#5793f3',\r\n inactiveColor: '#aaa',\r\n borderWidth: 0,\r\n padding: 5,\r\n textGap: 10,\r\n precision: 0,\r\n textStyle: {\r\n color: '#333'\r\n }\r\n };\r\n return VisualMapModel;\r\n}(ComponentModel));\n\nvar DEFAULT_BAR_BOUND = [20, 140];\r\nvar ContinuousModel = (function (_super) {\r\n __extends(ContinuousModel, _super);\r\n function ContinuousModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousModel.type;\r\n return _this;\r\n }\r\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n this.resetVisual(function (mappingOption) {\r\n mappingOption.mappingMethod = 'linear';\r\n mappingOption.dataExtent = this.getExtent();\r\n });\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.resetItemSize = function () {\r\n _super.prototype.resetItemSize.apply(this, arguments);\r\n var itemSize = this.itemSize;\r\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\r\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\r\n };\r\n ContinuousModel.prototype._resetRange = function () {\r\n var dataExtent = this.getExtent();\r\n var range = this.option.range;\r\n if (!range || range.auto) {\r\n dataExtent.auto = 1;\r\n this.option.range = dataExtent;\r\n }\r\n else if (isArray(range)) {\r\n if (range[0] > range[1]) {\r\n range.reverse();\r\n }\r\n range[0] = Math.max(range[0], dataExtent[0]);\r\n range[1] = Math.min(range[1], dataExtent[1]);\r\n }\r\n };\r\n ContinuousModel.prototype.completeVisualOption = function () {\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n each(this.stateList, function (state) {\r\n var symbolSize = this.option.controller[state].symbolSize;\r\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\r\n symbolSize[0] = symbolSize[1] / 3;\r\n }\r\n }, this);\r\n };\r\n ContinuousModel.prototype.setSelected = function (selected) {\r\n this.option.range = selected.slice();\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.getSelected = function () {\r\n var dataExtent = this.getExtent();\r\n var dataInterval = asc((this.get('range') || []).slice());\r\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\r\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\r\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\r\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\r\n return dataInterval;\r\n };\r\n ContinuousModel.prototype.getValueState = function (value) {\r\n var range = this.option.range;\r\n var dataExtent = this.getExtent();\r\n return ((range[0] <= dataExtent[0] || range[0] <= value)\r\n && (range[1] >= dataExtent[1] || value <= range[1])) ? 'inRange' : 'outOfRange';\r\n };\r\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\r\n var result = [];\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndices\r\n });\r\n }, this);\r\n return result;\r\n };\r\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\r\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\r\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\r\n var stops = [];\r\n function setStop(value, valueState) {\r\n stops.push({\r\n value: value,\r\n color: getColorVisual(value, valueState)\r\n });\r\n }\r\n var iIdx = 0;\r\n var oIdx = 0;\r\n var iLen = iVals.length;\r\n var oLen = oVals.length;\r\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\r\n if (oVals[oIdx] < iVals[iIdx]) {\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\r\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\r\n setStop(iVals[iIdx], 'inRange');\r\n }\r\n for (var first = 1; oIdx < oLen; oIdx++) {\r\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\r\n if (first) {\r\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\r\n first = 0;\r\n }\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n var stopsLen = stops.length;\r\n return {\r\n stops: stops,\r\n outerColors: [\r\n stopsLen ? stops[0].color : 'transparent',\r\n stopsLen ? stops[stopsLen - 1].color : 'transparent'\r\n ]\r\n };\r\n };\r\n ContinuousModel.type = 'visualMap.continuous';\r\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n align: 'auto',\r\n calculable: false,\r\n hoverLink: true,\r\n realtime: true,\r\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\r\n handleSize: '120%',\r\n handleStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n indicatorIcon: 'circle',\r\n indicatorSize: '50%',\r\n indicatorStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n });\r\n return ContinuousModel;\r\n}(VisualMapModel));\r\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\r\n if (dataExtent[0] === dataExtent[1]) {\r\n return dataExtent.slice();\r\n }\r\n var count = 200;\r\n var step = (dataExtent[1] - dataExtent[0]) / count;\r\n var value = dataExtent[0];\r\n var stopValues = [];\r\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\r\n stopValues.push(value);\r\n value += step;\r\n }\r\n stopValues.push(dataExtent[1]);\r\n return stopValues;\r\n}\r\nComponentModel.registerClass(ContinuousModel);\n\nvar VisualMapView = (function (_super) {\r\n __extends(VisualMapView, _super);\r\n function VisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapView.type;\r\n _this.autoPositionValues = { left: 1, right: 1, top: 1, bottom: 1 };\r\n return _this;\r\n }\r\n VisualMapView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload) {\r\n this.visualMapModel = visualMapModel;\r\n if (visualMapModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n this.doRender(visualMapModel, ecModel, api, payload);\r\n };\r\n VisualMapView.prototype.renderBackground = function (group) {\r\n var visualMapModel = this.visualMapModel;\r\n var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0);\r\n var rect = group.getBoundingRect();\r\n group.add(new Rect({\r\n z2: -1,\r\n silent: true,\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[3] + padding[1],\r\n height: rect.height + padding[0] + padding[2]\r\n },\r\n style: {\r\n fill: visualMapModel.get('backgroundColor'),\r\n stroke: visualMapModel.get('borderColor'),\r\n lineWidth: visualMapModel.get('borderWidth')\r\n }\r\n }));\r\n };\r\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\r\n opts = opts || {};\r\n var forceState = opts.forceState;\r\n var visualMapModel = this.visualMapModel;\r\n var visualObj = {};\r\n if (visualCluster === 'symbol') {\r\n visualObj.symbol = visualMapModel.get('itemSymbol');\r\n }\r\n if (visualCluster === 'color') {\r\n var defaultColor = visualMapModel.get('contentColor');\r\n visualObj.color = defaultColor;\r\n }\r\n function getter(key) {\r\n return visualObj[key];\r\n }\r\n function setter(key, value) {\r\n visualObj[key] = value;\r\n }\r\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n each(visualTypes, function (type) {\r\n var visualMapping = mappings[type];\r\n if (opts.convertOpacityToAlpha && type === 'opacity') {\r\n type = 'colorAlpha';\r\n visualMapping = mappings.__alphaForOpacity;\r\n }\r\n if (VisualMapping.dependsOn(type, visualCluster)) {\r\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\r\n }\r\n });\r\n return visualObj[visualCluster];\r\n };\r\n VisualMapView.prototype.positionGroup = function (group) {\r\n var model = this.visualMapModel;\r\n var api = this.api;\r\n positionElement(group, model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() });\r\n };\r\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { };\r\n VisualMapView.type = 'visualMap';\r\n return VisualMapView;\r\n}(ComponentView));\r\nComponentView.registerClass(VisualMapView);\n\nvar paramsSet = [\r\n ['left', 'right', 'width'],\r\n ['top', 'bottom', 'height']\r\n];\r\nfunction getItemAlign(visualMapModel, api, itemSize) {\r\n var modelOption = visualMapModel.option;\r\n var itemAlign = modelOption.align;\r\n if (itemAlign != null && itemAlign !== 'auto') {\r\n return itemAlign;\r\n }\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\r\n var reals = paramsSet[realIndex];\r\n var fakeValue = [0, null, 10];\r\n var layoutInput = {};\r\n for (var i = 0; i < 3; i++) {\r\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\r\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\r\n }\r\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\r\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\r\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5\r\n < ecSize[rParam[1]] * 0.5 ? 0 : 1];\r\n}\r\nfunction makeHighDownBatch(batch, visualMapModel) {\r\n each(batch || [], function (batchItem) {\r\n if (batchItem.dataIndex != null) {\r\n batchItem.dataIndexInside = batchItem.dataIndex;\r\n batchItem.dataIndex = null;\r\n }\r\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\r\n });\r\n return batch;\r\n}\n\nvar linearMap$2 = linearMap;\r\nvar each$h = each;\r\nvar mathMin$a = Math.min;\r\nvar mathMax$a = Math.max;\r\nvar HOVER_LINK_SIZE = 12;\r\nvar HOVER_LINK_OUT = 6;\r\nvar ContinuousView = (function (_super) {\r\n __extends(ContinuousView, _super);\r\n function ContinuousView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousView.type;\r\n _this._shapes = {};\r\n _this._dataInterval = [];\r\n _this._handleEnds = [];\r\n _this._hoverLinkDataIndices = [];\r\n return _this;\r\n }\r\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\r\n this._api = api;\r\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n };\r\n ContinuousView.prototype._buildView = function () {\r\n this.group.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var thisGroup = this.group;\r\n this._orient = visualMapModel.get('orient');\r\n this._useHandle = visualMapModel.get('calculable');\r\n this._resetInterval();\r\n this._renderBar(thisGroup);\r\n var dataRangeText = visualMapModel.get('text');\r\n this._renderEndsText(thisGroup, dataRangeText, 0);\r\n this._renderEndsText(thisGroup, dataRangeText, 1);\r\n this._updateView(true);\r\n this.renderBackground(thisGroup);\r\n this._updateView();\r\n this._enableHoverLinkToSeries();\r\n this._enableHoverLinkFromSeries();\r\n this.positionGroup(thisGroup);\r\n };\r\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\r\n if (!dataRangeText) {\r\n return;\r\n }\r\n var text = dataRangeText[1 - endsIndex];\r\n text = text != null ? text + '' : '';\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var itemSize = visualMapModel.itemSize;\r\n var barGroup = this._shapes.mainGroup;\r\n var position = this._applyTransform([\r\n itemSize[0] / 2,\r\n endsIndex === 0 ? -textGap : itemSize[1] + textGap\r\n ], barGroup);\r\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\r\n var orient = this._orient;\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n this.group.add(new ZRText({\r\n style: {\r\n x: position[0],\r\n y: position[1],\r\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\r\n align: orient === 'horizontal' ? align : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n };\r\n ContinuousView.prototype._renderBar = function (targetGroup) {\r\n var visualMapModel = this.visualMapModel;\r\n var shapes = this._shapes;\r\n var itemSize = visualMapModel.itemSize;\r\n var orient = this._orient;\r\n var useHandle = this._useHandle;\r\n var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);\r\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\r\n var gradientBarGroup = new Group();\r\n mainGroup.add(gradientBarGroup);\r\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\r\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true)));\r\n gradientBarGroup.setClipPath(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: itemSize[0],\r\n height: itemSize[1],\r\n r: 3\r\n }\r\n }));\r\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\r\n var textSize = mathMax$a(textRect.width, textRect.height);\r\n if (useHandle) {\r\n shapes.handleThumbs = [];\r\n shapes.handleLabels = [];\r\n shapes.handleLabelPoints = [];\r\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\r\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\r\n }\r\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\r\n targetGroup.add(mainGroup);\r\n };\r\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\r\n var onDrift = bind(this._dragHandle, this, handleIndex, false);\r\n var onDragEnd = bind(this._dragHandle, this, handleIndex, true);\r\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\r\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\r\n var cursor = getCursor$1(this._orient);\r\n handleThumb.attr({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n ondragend: onDragEnd,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n }\r\n });\r\n handleThumb.x = itemSize[0] / 2;\r\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\r\n handleThumb.setStyle({\r\n strokeNoScale: true,\r\n strokeFirst: true\r\n });\r\n handleThumb.style.lineWidth *= 2;\r\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n setAsHighDownDispatcher(handleThumb, true);\r\n mainGroup.add(handleThumb);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var handleLabel = new ZRText({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n handleLabel.ensureState('blur').style = {\r\n opacity: 0.1\r\n };\r\n handleLabel.stateTransition = { duration: 200 };\r\n this.group.add(handleLabel);\r\n var handleLabelPoint = [handleSize, 0];\r\n var shapes = this._shapes;\r\n shapes.handleThumbs[handleIndex] = handleThumb;\r\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\r\n shapes.handleLabels[handleIndex] = handleLabel;\r\n };\r\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\r\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\r\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\r\n indicator.attr({\r\n cursor: 'move',\r\n invisible: true,\r\n silent: true,\r\n x: itemSize[0] / 2\r\n });\r\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\r\n if (indicator instanceof ZRImage) {\r\n var pathStyle = indicator.style;\r\n indicator.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, indicatorStyle));\r\n }\r\n else {\r\n indicator.useStyle(indicatorStyle);\r\n }\r\n mainGroup.add(indicator);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var indicatorLabel = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n this.group.add(indicatorLabel);\r\n var indicatorLabelPoint = [\r\n (orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2,\r\n 0\r\n ];\r\n var shapes = this._shapes;\r\n shapes.indicator = indicator;\r\n shapes.indicatorLabel = indicatorLabel;\r\n shapes.indicatorLabelPoint = indicatorLabelPoint;\r\n this._firstShowIndicator = true;\r\n };\r\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, dx, dy) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n this._dragging = !isEnd;\r\n if (!isEnd) {\r\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\r\n this._updateInterval(handleIndex, vertex[1]);\r\n this._hideIndicator();\r\n this._updateView();\r\n }\r\n if (isEnd === !this.visualMapModel.get('realtime')) {\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: this._dataInterval.slice()\r\n });\r\n }\r\n if (isEnd) {\r\n !this._hovering && this._clearHoverLinkToSeries();\r\n }\r\n else if (useHoverLinkOnHandle(this.visualMapModel)) {\r\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\r\n }\r\n };\r\n ContinuousView.prototype._resetInterval = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\r\n var dataExtent = visualMapModel.getExtent();\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n this._handleEnds = [\r\n linearMap$2(dataInterval[0], dataExtent, sizeExtent, true),\r\n linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\r\n delta = delta || 0;\r\n var visualMapModel = this.visualMapModel;\r\n var handleEnds = this._handleEnds;\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, 0);\r\n var dataExtent = visualMapModel.getExtent();\r\n this._dataInterval = [\r\n linearMap$2(handleEnds[0], sizeExtent, dataExtent, true),\r\n linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateView = function (forSketch) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var shapes = this._shapes;\r\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\r\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\r\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\r\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\r\n shapes.inRange\r\n .setStyle({\r\n fill: visualInRange.barColor\r\n })\r\n .setShape('points', visualInRange.barPoints);\r\n shapes.outOfRange\r\n .setStyle({\r\n fill: visualOutOfRange.barColor\r\n })\r\n .setShape('points', visualOutOfRange.barPoints);\r\n this._updateHandle(inRangeHandleEnds, visualInRange);\r\n };\r\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\r\n var opts = {\r\n forceState: forceState,\r\n convertOpacityToAlpha: true\r\n };\r\n var colorStops = this._makeColorGradient(dataInterval, opts);\r\n var symbolSizes = [\r\n this.getControllerVisual(dataInterval[0], 'symbolSize', opts),\r\n this.getControllerVisual(dataInterval[1], 'symbolSize', opts)\r\n ];\r\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\r\n return {\r\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\r\n barPoints: barPoints,\r\n handlesColor: [\r\n colorStops[0].color,\r\n colorStops[colorStops.length - 1].color\r\n ]\r\n };\r\n };\r\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\r\n var sampleNumber = 100;\r\n var colorStops = [];\r\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\r\n offset: 0\r\n });\r\n for (var i = 1; i < sampleNumber; i++) {\r\n var currValue = dataInterval[0] + step * i;\r\n if (currValue > dataInterval[1]) {\r\n break;\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(currValue, 'color', opts),\r\n offset: i / sampleNumber\r\n });\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\r\n offset: 1\r\n });\r\n return colorStops;\r\n };\r\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\r\n var itemSize = this.visualMapModel.itemSize;\r\n return [\r\n [itemSize[0] - symbolSizes[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[1]],\r\n [itemSize[0] - symbolSizes[1], handleEnds[1]]\r\n ];\r\n };\r\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\r\n var orient = this._orient;\r\n var inverse = this.visualMapModel.get('inverse');\r\n return new Group((orient === 'horizontal' && !inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? 1 : -1, rotation: Math.PI / 2 }\r\n : (orient === 'horizontal' && inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? -1 : 1, rotation: -Math.PI / 2 }\r\n : (orient === 'vertical' && !inverse)\r\n ? { scaleX: itemAlign === 'left' ? 1 : -1, scaleY: -1 }\r\n : { scaleX: itemAlign === 'left' ? 1 : -1 });\r\n };\r\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n var shapes = this._shapes;\r\n var visualMapModel = this.visualMapModel;\r\n var handleThumbs = shapes.handleThumbs;\r\n var handleLabels = shapes.handleLabels;\r\n var itemSize = visualMapModel.itemSize;\r\n var dataExtent = visualMapModel.getExtent();\r\n each$h([0, 1], function (handleIndex) {\r\n var handleThumb = handleThumbs[handleIndex];\r\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\r\n handleThumb.y = handleEnds[handleIndex];\r\n var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\r\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\r\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\r\n handleThumb.x = itemSize[0] - symbolSize / 2;\r\n var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\r\n verticalAlign: 'middle',\r\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\r\n });\r\n }, this);\r\n };\r\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var itemSize = visualMapModel.itemSize;\r\n var sizeExtent = [0, itemSize[1]];\r\n var shapes = this._shapes;\r\n var indicator = shapes.indicator;\r\n if (!indicator) {\r\n return;\r\n }\r\n indicator.attr('invisible', false);\r\n var opts = { convertOpacityToAlpha: true };\r\n var color = this.getControllerVisual(cursorValue, 'color', opts);\r\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\r\n var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true);\r\n var x = itemSize[0] - symbolSize / 2;\r\n var oldIndicatorPos = { x: indicator.x, y: indicator.y };\r\n indicator.y = y;\r\n indicator.x = x;\r\n var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group));\r\n var indicatorLabel = shapes.indicatorLabel;\r\n indicatorLabel.attr('invisible', false);\r\n var align = this._applyTransform('left', shapes.mainGroup);\r\n var orient = this._orient;\r\n var isHorizontal = orient === 'horizontal';\r\n indicatorLabel.setStyle({\r\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\r\n verticalAlign: isHorizontal ? align : 'middle',\r\n align: isHorizontal ? 'center' : align\r\n });\r\n var indicatorNewProps = {\r\n x: x,\r\n y: y,\r\n style: {\r\n fill: color\r\n }\r\n };\r\n var labelNewProps = {\r\n style: {\r\n x: textPoint[0],\r\n y: textPoint[1]\r\n }\r\n };\r\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\r\n var animationCfg = {\r\n duration: 100,\r\n easing: 'cubicInOut',\r\n additive: true\r\n };\r\n indicator.x = oldIndicatorPos.x;\r\n indicator.y = oldIndicatorPos.y;\r\n indicator.animateTo(indicatorNewProps, animationCfg);\r\n indicatorLabel.animateTo(labelNewProps, animationCfg);\r\n }\r\n else {\r\n indicator.attr(indicatorNewProps);\r\n indicatorLabel.attr(labelNewProps);\r\n }\r\n this._firstShowIndicator = false;\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.enterBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\r\n var self = this;\r\n this._shapes.mainGroup\r\n .on('mousemove', function (e) {\r\n self._hovering = true;\r\n if (!self._dragging) {\r\n var itemSize = self.visualMapModel.itemSize;\r\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\r\n pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]);\r\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\r\n }\r\n })\r\n .on('mouseout', function () {\r\n self._hovering = false;\r\n !self._dragging && self._clearHoverLinkToSeries();\r\n });\r\n };\r\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\r\n var zr = this.api.getZr();\r\n if (this.visualMapModel.option.hoverLink) {\r\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\r\n zr.on('mouseout', this._hideIndicator, this);\r\n }\r\n else {\r\n this._clearHoverLinkFromSeries();\r\n }\r\n };\r\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\r\n var visualMapModel = this.visualMapModel;\r\n var itemSize = visualMapModel.itemSize;\r\n if (!visualMapModel.option.hoverLink) {\r\n return;\r\n }\r\n var sizeExtent = [0, itemSize[1]];\r\n var dataExtent = visualMapModel.getExtent();\r\n cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]);\r\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\r\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\r\n var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true);\r\n var valueRange = [\r\n linearMap$2(hoverRange[0], sizeExtent, dataExtent, true),\r\n linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)\r\n ];\r\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\r\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\r\n if (hoverOnBar) {\r\n if (valueRange[0] === -Infinity) {\r\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\r\n }\r\n else if (valueRange[1] === Infinity) {\r\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\r\n }\r\n else {\r\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\r\n }\r\n }\r\n var oldBatch = this._hoverLinkDataIndices;\r\n var newBatch = [];\r\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\r\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\r\n }\r\n var resultBatches = compressBatches(oldBatch, newBatch);\r\n this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel));\r\n this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel));\r\n };\r\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\r\n var el = e.target;\r\n var visualMapModel = this.visualMapModel;\r\n if (!el || getECData(el).dataIndex == null) {\r\n return;\r\n }\r\n var ecData = getECData(el);\r\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n if (!visualMapModel.isTargetSeries(dataModel)) {\r\n return;\r\n }\r\n var data = dataModel.getData(ecData.dataType);\r\n var value = data.get(visualMapModel.getDataDimension(data), ecData.dataIndex);\r\n if (!isNaN(value)) {\r\n this._showIndicator(value, value);\r\n }\r\n };\r\n ContinuousView.prototype._hideIndicator = function () {\r\n var shapes = this._shapes;\r\n shapes.indicator && shapes.indicator.attr('invisible', true);\r\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.leaveBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\r\n this._hideIndicator();\r\n var indices = this._hoverLinkDataIndices;\r\n this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel));\r\n indices.length = 0;\r\n };\r\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\r\n this._hideIndicator();\r\n var zr = this.api.getZr();\r\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\r\n zr.off('mouseout', this._hideIndicator);\r\n };\r\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\r\n var transform = getTransform(element, global ? null : this.group);\r\n return isArray(vertex)\r\n ? applyTransform$1(vertex, transform, inverse)\r\n : transformDirection(vertex, transform, inverse);\r\n };\r\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\r\n batch && batch.length && this.api.dispatchAction({\r\n type: type,\r\n batch: batch\r\n });\r\n };\r\n ContinuousView.prototype.dispose = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.prototype.remove = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.type = 'visualMap.continuous';\r\n return ContinuousView;\r\n}(VisualMapView));\r\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\r\n return new Polygon({\r\n shape: { points: points },\r\n draggable: !!onDrift,\r\n cursor: cursor,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd\r\n });\r\n}\r\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\r\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\r\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\r\n if (hoverLinkDataSize) {\r\n halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\r\n }\r\n return halfHoverLinkSize;\r\n}\r\nfunction useHoverLinkOnHandle(visualMapModel) {\r\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\r\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\r\n}\r\nfunction getCursor$1(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\nComponentView.registerClass(ContinuousView);\n\nvar actionInfo$2 = {\r\n type: 'selectDataRange',\r\n event: 'dataRangeSelected',\r\n update: 'update'\r\n};\r\nregisterAction(actionInfo$2, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'visualMap', query: payload }, function (model) {\r\n model.setSelected(payload.selected);\r\n });\r\n});\n\nregisterPreprocessor(visualMapPreprocessor);\n\nvar PiecewiseModel = (function (_super) {\r\n __extends(PiecewiseModel, _super);\r\n function PiecewiseModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseModel.type;\r\n _this._pieceList = [];\r\n return _this;\r\n }\r\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n var mode = this._mode = this._determineMode();\r\n this._pieceList = [];\r\n resetMethods[this._mode].call(this, this._pieceList);\r\n this._resetSelected(newOption, isInit);\r\n var categories = this.option.categories;\r\n this.resetVisual(function (mappingOption, state) {\r\n if (mode === 'categories') {\r\n mappingOption.mappingMethod = 'category';\r\n mappingOption.categories = clone(categories);\r\n }\r\n else {\r\n mappingOption.dataExtent = this.getExtent();\r\n mappingOption.mappingMethod = 'piecewise';\r\n mappingOption.pieceList = map(this._pieceList, function (piece) {\r\n piece = clone(piece);\r\n if (state !== 'inRange') {\r\n piece.visual = null;\r\n }\r\n return piece;\r\n });\r\n }\r\n });\r\n };\r\n PiecewiseModel.prototype.completeVisualOption = function () {\r\n var option = this.option;\r\n var visualTypesInPieces = {};\r\n var visualTypes = VisualMapping.listVisualTypes();\r\n var isCategory = this.isCategory();\r\n each(option.pieces, function (piece) {\r\n each(visualTypes, function (visualType) {\r\n if (piece.hasOwnProperty(visualType)) {\r\n visualTypesInPieces[visualType] = 1;\r\n }\r\n });\r\n });\r\n each(visualTypesInPieces, function (v, visualType) {\r\n var exists = false;\r\n each(this.stateList, function (state) {\r\n exists = exists || has(option, state, visualType)\r\n || has(option.target, state, visualType);\r\n }, this);\r\n !exists && each(this.stateList, function (state) {\r\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\r\n });\r\n }, this);\r\n function has(obj, state, visualType) {\r\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\r\n }\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n };\r\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var pieceList = this._pieceList;\r\n var selected = (isInit ? thisOption : newOption).selected || {};\r\n thisOption.selected = selected;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (!selected.hasOwnProperty(key)) {\r\n selected[key] = true;\r\n }\r\n }, this);\r\n if (thisOption.selectedMode === 'single') {\r\n var hasSel_1 = false;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (selected[key]) {\r\n hasSel_1\r\n ? (selected[key] = false)\r\n : (hasSel_1 = true);\r\n }\r\n }, this);\r\n }\r\n };\r\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\r\n return this._mode === 'categories'\r\n ? piece.value + '' : piece.index + '';\r\n };\r\n PiecewiseModel.prototype.getPieceList = function () {\r\n return this._pieceList;\r\n };\r\n PiecewiseModel.prototype._determineMode = function () {\r\n var option = this.option;\r\n return option.pieces && option.pieces.length > 0\r\n ? 'pieces'\r\n : this.option.categories\r\n ? 'categories'\r\n : 'splitNumber';\r\n };\r\n PiecewiseModel.prototype.setSelected = function (selected) {\r\n this.option.selected = clone(selected);\r\n };\r\n PiecewiseModel.prototype.getValueState = function (value) {\r\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\r\n return index != null\r\n ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]\r\n ? 'inRange' : 'outOfRange')\r\n : 'outOfRange';\r\n };\r\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\r\n var result = [];\r\n var pieceList = this._pieceList;\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\r\n pIdx === pieceIndex && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({ seriesId: seriesModel.id, dataIndex: dataIndices });\r\n }, this);\r\n return result;\r\n };\r\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\r\n var representValue;\r\n if (this.isCategory()) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n if (piece.value != null) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n var pieceInterval = piece.interval || [];\r\n representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)\r\n ? 0\r\n : (pieceInterval[0] + pieceInterval[1]) / 2;\r\n }\r\n }\r\n return representValue;\r\n };\r\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\r\n if (this.isCategory()) {\r\n return;\r\n }\r\n var stops = [];\r\n var outerColors = ['', ''];\r\n var visualMapModel = this;\r\n function setStop(interval, valueState) {\r\n var representValue = visualMapModel.getRepresentValue({\r\n interval: interval\r\n });\r\n if (!valueState) {\r\n valueState = visualMapModel.getValueState(representValue);\r\n }\r\n var color = getColorVisual(representValue, valueState);\r\n if (interval[0] === -Infinity) {\r\n outerColors[0] = color;\r\n }\r\n else if (interval[1] === Infinity) {\r\n outerColors[1] = color;\r\n }\r\n else {\r\n stops.push({ value: interval[0], color: color }, { value: interval[1], color: color });\r\n }\r\n }\r\n var pieceList = this._pieceList.slice();\r\n if (!pieceList.length) {\r\n pieceList.push({ interval: [-Infinity, Infinity] });\r\n }\r\n else {\r\n var edge = pieceList[0].interval[0];\r\n edge !== -Infinity && pieceList.unshift({ interval: [-Infinity, edge] });\r\n edge = pieceList[pieceList.length - 1].interval[1];\r\n edge !== Infinity && pieceList.push({ interval: [edge, Infinity] });\r\n }\r\n var curr = -Infinity;\r\n each(pieceList, function (piece) {\r\n var interval = piece.interval;\r\n if (interval) {\r\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\r\n setStop(interval.slice());\r\n curr = interval[1];\r\n }\r\n }, this);\r\n return { stops: stops, outerColors: outerColors };\r\n };\r\n PiecewiseModel.type = 'visualMap.piecewise';\r\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n selected: null,\r\n minOpen: false,\r\n maxOpen: false,\r\n align: 'auto',\r\n itemWidth: 20,\r\n itemHeight: 14,\r\n itemSymbol: 'roundRect',\r\n pieces: null,\r\n categories: null,\r\n splitNumber: 5,\r\n selectedMode: 'multiple',\r\n itemGap: 10,\r\n hoverLink: true\r\n });\r\n return PiecewiseModel;\r\n}(VisualMapModel));\r\nvar resetMethods = {\r\n splitNumber: function (outPieceList) {\r\n var thisOption = this.option;\r\n var precision = Math.min(thisOption.precision, 20);\r\n var dataExtent = this.getExtent();\r\n var splitNumber = thisOption.splitNumber;\r\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\r\n thisOption.splitNumber = splitNumber;\r\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\r\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\r\n precision++;\r\n }\r\n thisOption.precision = precision;\r\n splitStep = +splitStep.toFixed(precision);\r\n if (thisOption.minOpen) {\r\n outPieceList.push({\r\n interval: [-Infinity, dataExtent[0]],\r\n close: [0, 0]\r\n });\r\n }\r\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\r\n var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);\r\n outPieceList.push({\r\n interval: [curr, max],\r\n close: [1, 1]\r\n });\r\n }\r\n if (thisOption.maxOpen) {\r\n outPieceList.push({\r\n interval: [dataExtent[1], Infinity],\r\n close: [0, 0]\r\n });\r\n }\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece, index) {\r\n piece.index = index;\r\n piece.text = this.formatValueText(piece.interval);\r\n }, this);\r\n },\r\n categories: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.categories, function (cate) {\r\n outPieceList.push({\r\n text: this.formatValueText(cate, true),\r\n value: cate\r\n });\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n },\r\n pieces: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.pieces, function (pieceListItem, index) {\r\n if (!isObject(pieceListItem)) {\r\n pieceListItem = { value: pieceListItem };\r\n }\r\n var item = { text: '', index: index };\r\n if (pieceListItem.label != null) {\r\n item.text = pieceListItem.label;\r\n }\r\n if (pieceListItem.hasOwnProperty('value')) {\r\n var value = item.value = pieceListItem.value;\r\n item.interval = [value, value];\r\n item.close = [1, 1];\r\n }\r\n else {\r\n var interval = item.interval = [];\r\n var close_1 = item.close = [0, 0];\r\n var closeList = [1, 0, 1];\r\n var infinityList = [-Infinity, Infinity];\r\n var useMinMax = [];\r\n for (var lg = 0; lg < 2; lg++) {\r\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\r\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\r\n interval[lg] = pieceListItem[names[i]];\r\n close_1[lg] = closeList[i];\r\n useMinMax[lg] = i === 2;\r\n }\r\n interval[lg] == null && (interval[lg] = infinityList[lg]);\r\n }\r\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\r\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\r\n if (__DEV__) {\r\n if (interval[0] > interval[1]) {\r\n console.warn('Piece ' + index + 'is illegal: ' + interval\r\n + ' lower bound should not greater then uppper bound.');\r\n }\r\n }\r\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\r\n item.value = interval[0];\r\n }\r\n }\r\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\r\n outPieceList.push(item);\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece) {\r\n var close = piece.close;\r\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\r\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\r\n }, this);\r\n }\r\n};\r\nfunction normalizeReverse(thisOption, pieceList) {\r\n var inverse = thisOption.inverse;\r\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\r\n pieceList.reverse();\r\n }\r\n}\r\nComponentModel.registerClass(PiecewiseModel);\n\nvar PiecewiseVisualMapView = (function (_super) {\r\n __extends(PiecewiseVisualMapView, _super);\r\n function PiecewiseVisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseVisualMapView.type;\r\n return _this;\r\n }\r\n PiecewiseVisualMapView.prototype.doRender = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var textStyleModel = visualMapModel.textStyleModel;\r\n var textFont = textStyleModel.getFont();\r\n var textFill = textStyleModel.getTextColor();\r\n var itemAlign = this._getItemAlign();\r\n var itemSize = visualMapModel.itemSize;\r\n var viewData = this._getViewData();\r\n var endsText = viewData.endsText;\r\n var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText);\r\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\r\n each(viewData.viewPieceList, function (item) {\r\n var piece = item.piece;\r\n var itemGroup = new Group();\r\n itemGroup.onclick = bind(this._onItemClick, this, piece);\r\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\r\n var representValue = visualMapModel.getRepresentValue(piece);\r\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\r\n if (showLabel) {\r\n var visualState = this.visualMapModel.getValueState(representValue);\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\r\n y: itemSize[1] / 2,\r\n text: piece.text,\r\n verticalAlign: 'middle',\r\n align: itemAlign,\r\n font: textFont,\r\n fill: textFill,\r\n opacity: visualState === 'outOfRange' ? 0.5 : 1\r\n }\r\n }));\r\n }\r\n thisGroup.add(itemGroup);\r\n }, this);\r\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\r\n box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\r\n this.renderBackground(thisGroup);\r\n this.positionGroup(thisGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\r\n var _this = this;\r\n itemGroup\r\n .on('mouseover', function () { return onHoverLink('highlight'); })\r\n .on('mouseout', function () { return onHoverLink('downplay'); });\r\n var onHoverLink = function (method) {\r\n var visualMapModel = _this.visualMapModel;\r\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\r\n type: method,\r\n batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\r\n });\r\n };\r\n };\r\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var modelOption = visualMapModel.option;\r\n if (modelOption.orient === 'vertical') {\r\n return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\r\n }\r\n else {\r\n var align = modelOption.align;\r\n if (!align || align === 'auto') {\r\n align = 'left';\r\n }\r\n return align;\r\n }\r\n };\r\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\r\n if (!text) {\r\n return;\r\n }\r\n var itemGroup = new Group();\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2,\r\n y: itemSize[1] / 2,\r\n verticalAlign: 'middle',\r\n align: showLabel ? itemAlign : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n group.add(itemGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._getViewData = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) {\r\n return { piece: piece, indexInModelPieceList: index };\r\n });\r\n var endsText = visualMapModel.get('text');\r\n var orient = visualMapModel.get('orient');\r\n var inverse = visualMapModel.get('inverse');\r\n if (orient === 'horizontal' ? inverse : !inverse) {\r\n viewPieceList.reverse();\r\n }\r\n else if (endsText) {\r\n endsText = endsText.slice().reverse();\r\n }\r\n return { viewPieceList: viewPieceList, endsText: endsText };\r\n };\r\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\r\n group.add(createSymbol(this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, 'color')));\r\n };\r\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\r\n var visualMapModel = this.visualMapModel;\r\n var option = visualMapModel.option;\r\n var selected = clone(option.selected);\r\n var newKey = visualMapModel.getSelectedMapKey(piece);\r\n if (option.selectedMode === 'single') {\r\n selected[newKey] = true;\r\n each(selected, function (o, key) {\r\n selected[key] = key === newKey;\r\n });\r\n }\r\n else {\r\n selected[newKey] = !selected[newKey];\r\n }\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: selected\r\n });\r\n };\r\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\r\n return PiecewiseVisualMapView;\r\n}(VisualMapView));\r\nComponentView.registerClass(PiecewiseVisualMapView);\n\nregisterPreprocessor(visualMapPreprocessor);\n\nvar DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n};\r\nvar inner$n = makeInner();\r\nvar decalPaletteScope = {};\r\nfunction ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$n(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$n(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n}\n\nfunction ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n}\n\nvar PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\nregisterPreprocessor(ariaPreprocessor);\r\nregisterVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\nfunction createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n}\n\nvar NONE = 'none';\r\nvar mathRound = Math.round;\r\nvar mathSin$4 = Math.sin;\r\nvar mathCos$4 = Math.cos;\r\nvar PI$a = Math.PI;\r\nvar PI2$a = Math.PI * 2;\r\nvar degree = 180 / PI$a;\r\nvar EPSILON$4 = 1e-4;\r\nfunction round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n}\r\nfunction round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n}\r\nfunction isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n}\r\nfunction pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n}\r\nfunction pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n}\r\nfunction setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n}\r\nfunction attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n}\r\nfunction attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n}\r\nfunction attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n}\r\nfunction bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n}\r\nvar SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$a)\r\n || (clockwise ? dTheta >= PI2$a : -dTheta >= PI2$a);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$a : (dTheta % PI2$a + PI2$a);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$a) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$a - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$a + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n}());\r\nvar svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n};\r\nvar svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n};\r\nvar TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n};\r\nfunction adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n}\r\nvar svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n};\n\nfunction diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n}\r\nfunction extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n}\r\nfunction pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n}\r\nfunction buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n}\r\nfunction clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n}\r\nfunction arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n}\n\nvar MARK_UNUSED = '0';\r\nvar MARK_USED = '1';\r\nvar Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n}());\n\nfunction isLinearGradient(value) {\r\n return value.type === 'linear';\r\n}\r\nfunction isRadialGradient(value) {\r\n return value.type === 'radial';\r\n}\r\nfunction isGradient(value) {\r\n return value && (value.type === 'linear'\r\n || value.type === 'radial');\r\n}\r\nvar GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (isGradient(value)) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n if (!isGradient(gradient)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n}(Definable));\n\nfunction isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n}\r\nvar patternDomMap = new WeakMap();\r\nvar PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n}(Definable));\n\nfunction generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n}\r\nfunction hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n}\r\nvar ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n}(Definable));\n\nvar ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n}(Definable));\r\nfunction hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n}\r\nfunction getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n}\n\nfunction parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n}\r\nfunction getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n}\r\nfunction checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n}\r\nfunction insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n}\r\nfunction prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n}\r\nfunction remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n}\r\nfunction removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n}\r\nfunction getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n}\r\nvar SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n}());\r\nfunction createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n}\n\nregisterPainter('svg', SVGPainter);\n\nexport { Axis, List, Model, PRIORITY, color, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format$1 as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic$1 as graphic, helper, init$1 as init, brushSingle as innerDrawElementOnCanvas, matrix, number, parseGeoJSON, parseGeoJson, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerVisual, setCanvasCreator, throttle, time, ecUtil as util, vector, version$1 as version, zrender };\n\n"]} \ No newline at end of file diff --git a/dist/echarts.esm.min.js b/dist/echarts.esm.min.js index a02f897914..aaea182b1c 100644 --- a/dist/echarts.esm.min.js +++ b/dist/echarts.esm.min.js @@ -33,4 +33,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=11),t.domSupported="undefined"!=typeof document}"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(env.wxa=!0,env.canvasSupported=!0,env.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(env.worker=!0,env.canvasSupported=!0):"undefined"==typeof navigator?(env.node=!0,env.canvasSupported=!0,env.svgSupported=!0):detect(navigator.userAgent,env);var BUILTIN_OBJECT={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},TYPED_ARRAY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},objToString=Object.prototype.toString,arrayProto=Array.prototype,nativeForEach=arrayProto.forEach,nativeFilter=arrayProto.filter,nativeSlice=arrayProto.slice,nativeMap=arrayProto.map,ctorFunction=function(){}.constructor,protoFunction=ctorFunction?ctorFunction.prototype:null,methods={};function $override(e,t){methods[e]=t}var idStart=2311;function guid(){return idStart++}function logError(){for(var e=[],t=0;t>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return n}function preparePointerTransformer(e,t,n){for(var i=n?"invTrans":"trans",r=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,p=c.left,d=c.top;o.push(p,d),l=l&&a&&p===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&r?r:(t.srcCoords=o,t[i]=n?buildTransformer(s,o):buildTransformer(o,s))}function isCanvasEl(e){return"CANVAS"===e.nodeName.toUpperCase()}var isDomLevel2="undefined"!=typeof window&&!!window.addEventListener,MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_calcOut$1=[];function clientToLocal(e,t,n,i){return n=n||{},i||!env.canvasSupported?calculateZrXY(e,t,n):env.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):calculateZrXY(e,t,n),n}function calculateZrXY(e,t,n){if(env.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(isCanvasEl(e)){var a=e.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=r-a.top)}if(transformCoordWithViewport(_calcOut$1,e,i,r))return n.zrX=_calcOut$1[0],void(n.zrY=_calcOut$1[1])}n.zrX=n.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(e,t,n){if(null!=(t=getNativeEvent(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];r&&clientToLocal(e,r,t,n)}else{clientToLocal(e,t,t,n);var a=getWheelDeltaMayPolyfill(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return null==t.which&&void 0!==o&&MOUSE_EVENT_REG.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function getWheelDeltaMayPolyfill(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;return null==n||null==i?t:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}function addEventListener(e,t,n,i){isDomLevel2?e.addEventListener(t,n,i):e.attachEvent("on"+t,n)}function removeEventListener(e,t,n,i){isDomLevel2?e.removeEventListener(t,n,i):e.detachEvent("on"+t,n)}var stop=isDomLevel2?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(e){return 2===e.which||3===e.which}var GestureMgr=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var r={points:[],touches:[],target:t,event:e},a=0,o=i.length;a1&&i&&i.length>1){var a=dist$1(i)/dist$1(r);!isFinite(a)&&(a=1),t.pinchScale=a;var o=center(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}},SILENT="silent";function makeEventPacket(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:stopEvent}}function stopEvent(){stop(this.event)}var EmptyProxy=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return __extends(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Eventful),HoveredResult=function(e,t){this.x=e,this.y=t},handlerNames=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Handler=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a._hovered=new HoveredResult(0,0),a.storage=t,a.painter=n,a.painterRoot=r,i=i||new EmptyProxy,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Draggable(a),a}return __extends(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(each(handlerNames,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=isOutsideBoundary(this,t,n),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=i?new HoveredResult(t,n):this.findHover(t,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl,n=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!n&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new HoveredResult(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var r="on"+t,a=makeEventPacket(t,e,n);i&&(i[r]&&(a.cancelBubble=!!i[r].call(i,a)),i.trigger(t,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},t.prototype.findHover=function(e,t,n){for(var i=this.storage.getDisplayList(),r=new HoveredResult(e,t),a=i.length-1;a>=0;a--){var o=void 0;if(i[a]!==n&&!i[a].ignore&&(o=isHover(i[a],e,t))&&(!r.topTarget&&(r.topTarget=i[a]),o!==SILENT)){r.target=i[a];break}}return r},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new GestureMgr);var n=this._gestureMgr;"start"===t&&n.clear();var i=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),i){var r=i.type;e.gestureEvent=r;var a=new HoveredResult;a.target=i.target,this.dispatchToElement(a,r,i.event)}},t}(Eventful);function isHover(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var i=e,r=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,n))return!1;i.silent&&(r=!0)}var s=i.__hostTarget;i=s||i.parent}return!r||SILENT}return!1}function isOutsideBoundary(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function create$1(){return[1,0,0,1,0,0]}function identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function copy$1(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function mul$1(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function translate(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function rotate(e,t,n){var i=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=i*c+o*u,e[1]=-i*u+o*c,e[2]=r*c+s*u,e[3]=-r*u+c*s,e[4]=c*a+u*l,e[5]=c*l-u*a,e}function scale$1(e,t,n){var i=n[0],r=n[1];return e[0]=t[0]*i,e[1]=t[1]*r,e[2]=t[2]*i,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*r,e}function invert(e,t){var n=t[0],i=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=n*o-a*i;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*r)*l,e[5]=(a*r-n*s)*l,e):null}function clone$2(e){var t=create$1();return copy$1(t,e),t}each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Handler.prototype[e]=function(t){var n,i,r=t.zrX,a=t.zrY,o=isOutsideBoundary(this,r,a);if("mouseup"===e&&o||(i=(n=this.findHover(r,a)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));var matrix=Object.freeze({__proto__:null,create:create$1,identity:identity,copy:copy$1,mul:mul$1,translate:translate,rotate:rotate,scale:scale$1,invert:invert,clone:clone$2}),mIdentity=identity,EPSILON=5e-5;function isNotAroundZero(e){return e>EPSILON||e<-EPSILON}var scaleTmp=[],tmpTransform=[],originTransform=create$1(),abs=Math.abs,Transformable=function(){function e(){}return e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)},e.prototype.updateTransform=function(){var e=this.parent,t=e&&e.transform,n=this.needLocalTransform(),i=this.transform;n||t?(i=i||create$1(),n?this.getLocalTransform(i):mIdentity(i),t&&(n?mul$1(i,e.transform,i):copy$1(i,e.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&mIdentity(i)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(scaleTmp);var n=scaleTmp[0]<0?-1:1,i=scaleTmp[1]<0?-1:1,r=((scaleTmp[0]-n)*t+n)/scaleTmp[0]||0,a=((scaleTmp[1]-i)*t+i)/scaleTmp[1]||0;e[0]*=r,e[1]*=r,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||create$1(),invert(this.invTransform,e)},e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3];isNotAroundZero(t-1)&&(t=Math.sqrt(t)),isNotAroundZero(n-1)&&(n=Math.sqrt(n)),e[0]<0&&(t=-t),e[3]<0&&(n=-n),this.rotation=Math.atan2(-e[1]/n,e[0]/t),t<0&&n<0&&(this.rotation+=Math.PI,t=-t,n=-n),this.x=e[4],this.y=e[5],this.scaleX=t,this.scaleY=n}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(mul$1(tmpTransform,e.invTransform,t),t=tmpTransform);var n=this.originX,i=this.originY;(n||i)&&(originTransform[4]=n,originTransform[5]=i,mul$1(tmpTransform,t,originTransform),tmpTransform[4]-=n,tmpTransform[5]-=i,t=tmpTransform),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&applyTransform(n,n,i),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&applyTransform(n,n,i),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&abs(e[0]-1)>1e-10&&abs(e[3]-1)>1e-10?Math.sqrt(abs(e[0]*e[3]-e[2]*e[1])):1},e.getLocalTransform=function(e,t){mIdentity(t=t||[]);var n=e.originX||0,i=e.originY||0,r=e.scaleX,a=e.scaleY,o=e.rotation||0,s=e.x,l=e.y;return t[4]-=n,t[5]-=i,t[0]*=r,t[1]*=a,t[2]*=r,t[3]*=a,t[4]*=r,t[5]*=a,o&&rotate(t,t,o),t[4]+=n,t[5]+=i,t[4]+=s,t[5]+=l,t},e.initDefaultProps=function(){var t=e.prototype;t.x=0,t.y=0,t.scaleX=1,t.scaleY=1,t.originX=0,t.originY=0,t.rotation=0,t.globalScaleRatio=1}(),e}(),easing={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-easing.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*easing.bounceIn(2*e):.5*easing.bounceOut(2*e-1)+.5}},Clip=function(){function e(e){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}return e.prototype.step=function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),!this._paused){var n=(e-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var i=this.easing,r="string"==typeof i?easing[i]:i,a="function"==typeof r?r(n):n;if(this.onframe&&this.onframe(a),1===n){if(!this.loop)return!0;this._restart(e),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=t},e.prototype._restart=function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e}(),Entry=function(e){this.value=e},LinkedList=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Entry(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),LRU=function(){function e(e){this._list=new LinkedList,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,r=null;if(null==i[e]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Entry(t),o.key=e,n.insertEntry(o),i[e]=o}return r},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function clampCssByte(e){return(e=Math.round(e))<0?0:e>255?255:e}function clampCssAngle(e){return(e=Math.round(e))<0?0:e>360?360:e}function clampCssFloat(e){return e<0?0:e>1?1:e}function parseCssInt(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssByte(parseFloat(t)/100*255):clampCssByte(parseInt(t,10))}function parseCssFloat(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssFloat(parseFloat(t)/100):clampCssFloat(parseFloat(t))}function cssHueToRgb(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function lerpNumber(e,t,n){return e+(t-e)*n}function setRgba(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function copyRgba(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var colorCache=new LRU(20),lastRemovedArr=null;function putToCache(e,t){lastRemovedArr&©Rgba(lastRemovedArr,t),lastRemovedArr=colorCache.put(e,lastRemovedArr||t.slice())}function parse(e,t){if(e){t=t||[];var n=colorCache.get(e);if(n)return copyRgba(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in kCSSColorTable)return copyRgba(t,kCSSColorTable[i]),putToCache(e,t),t;var r,a=i.length;if("#"===i.charAt(0))return 4===a||5===a?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(setRgba(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===a?parseInt(i.slice(4),16)/15:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):7===a||9===a?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(setRgba(t,(16711680&r)>>16,(65280&r)>>8,255&r,9===a?parseInt(i.slice(7),16)/255:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===a){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?setRgba(t,+u[0],+u[1],+u[2],1):setRgba(t,0,0,0,1);c=parseCssFloat(u.pop());case"rgb":return 3!==u.length?void setRgba(t,0,0,0,1):(setRgba(t,parseCssInt(u[0]),parseCssInt(u[1]),parseCssInt(u[2]),c),putToCache(e,t),t);case"hsla":return 4!==u.length?void setRgba(t,0,0,0,1):(u[3]=parseCssFloat(u[3]),hsla2rgba(u,t),putToCache(e,t),t);case"hsl":return 3!==u.length?void setRgba(t,0,0,0,1):(hsla2rgba(u,t),putToCache(e,t),t);default:return}}setRgba(t,0,0,0,1)}}function hsla2rgba(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=parseCssFloat(e[1]),r=parseCssFloat(e[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return setRgba(t=t||[],clampCssByte(255*cssHueToRgb(o,a,n+1/3)),clampCssByte(255*cssHueToRgb(o,a,n)),clampCssByte(255*cssHueToRgb(o,a,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function rgba2hsla(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,p=((s-a)/6+l/2)/l;i===s?t=p-h:r===s?t=1/3+c-p:a===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var d=[360*t,n,u];return null!=e[3]&&d.push(e[3]),d}}function lift(e,t){var n=parse(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return stringify(n,4===n.length?"rgba":"rgb")}}function toHex(e){var t=parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function fastLerp(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=t[r],s=t[a],l=i-r;return n[0]=clampCssByte(lerpNumber(o[0],s[0],l)),n[1]=clampCssByte(lerpNumber(o[1],s[1],l)),n[2]=clampCssByte(lerpNumber(o[2],s[2],l)),n[3]=clampCssFloat(lerpNumber(o[3],s[3],l)),n}}var fastMapToColor=fastLerp;function lerp$1(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=parse(t[r]),s=parse(t[a]),l=i-r,u=stringify([clampCssByte(lerpNumber(o[0],s[0],l)),clampCssByte(lerpNumber(o[1],s[1],l)),clampCssByte(lerpNumber(o[2],s[2],l)),clampCssFloat(lerpNumber(o[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:a,value:i}:u}}var mapToColor=lerp$1;function modifyHSL(e,t,n,i){var r=parse(e);if(e)return r=rgba2hsla(r),null!=t&&(r[0]=clampCssAngle(t)),null!=n&&(r[1]=parseCssFloat(n)),null!=i&&(r[2]=parseCssFloat(i)),stringify(hsla2rgba(r),"rgba")}function modifyAlpha(e,t){var n=parse(e);if(n&&null!=t)return n[3]=clampCssFloat(t),stringify(n,"rgba")}function stringify(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function lum(e,t){var n=parse(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}function random(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}var color=Object.freeze({__proto__:null,parse:parse,lift:lift,toHex:toHex,fastLerp:fastLerp,fastMapToColor:fastMapToColor,lerp:lerp$1,mapToColor:mapToColor,modifyHSL:modifyHSL,modifyAlpha:modifyAlpha,stringify:stringify,lum:lum,random:random}),arraySlice=Array.prototype.slice;function interpolateNumber(e,t,n){return(t-e)*n+e}function step(e,t,n){return n>.5?t:e}function interpolate1DArray(e,t,n,i){for(var r=t.length,a=0;ao)i.length=o;else for(var s=a;s=2&&this.interpolable},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t){e>=this.maxTime?this.maxTime=e:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(isArrayLike(t)){var r=guessArrayDim(t);if(i>0&&this.arrDim!==r)return void(this.interpolable=!1);if(1===r&&"number"!=typeof t[0]||2===r&&"number"!=typeof t[0][0])return void(this.interpolable=!1);if(i>0){var a=n[i-1];this._isAllValueEqual&&(1===r&&is1DArraySame(t,a.value)||(this._isAllValueEqual=!1))}this.arrDim=r}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"==typeof t){var o=parse(t);o?(t=o,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof t)return void(this.interpolable=!1);if(this._isAllValueEqual&&i>0){a=n[i-1];(this.isValueColor&&!is1DArraySame(a.value,t)||a.value!==t)&&(this._isAllValueEqual=!1)}}var s={time:e,value:t,percent:0};return this.keyframes.push(s),s},e.prototype.prepare=function(e){var t=this.keyframes;this._needsSort&&t.sort((function(e,t){return e.time-t.time}));for(var n=this.arrDim,i=t.length,r=t[i-1],a=0;a0&&a!==i-1&&fillArray(t[a].value,r.value,n);if(e&&this.needsAnimate()&&e.needsAnimate()&&n===e.arrDim&&this.isValueColor===e.isValueColor&&!e._finished){this._additiveTrack=e;var o=t[0].value;for(a=0;a=0&&!(a[n].percent<=t);n--);n=Math.min(n,o-2)}else{for(n=this._lastFrame;nt);n++);n=Math.min(n-1,o-2)}var c=a[n+1],h=a[n];if(h&&c){this._lastFrame=n,this._lastFramePercent=t;var p=c.percent-h.percent;if(0!==p){var d=(t-h.percent)/p,f=i?this._additiveValue:u?tmpRgba:e[s];if((l>0||u)&&!f&&(f=this._additiveValue=[]),this.useSpline){var g=a[n][r],m=a[0===n?n:n-1][r],y=a[n>o-2?o-1:n+1][r],v=a[n>o-3?o-1:n+2][r];if(l>0)1===l?catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d):catmullRomInterpolate2DArray(f,m,g,y,v,d,d*d,d*d*d);else if(u)catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d),i||(e[s]=rgba2String(f));else{var _=void 0;_=this.interpolable?catmullRomInterpolate(m,g,y,v,d,d*d,d*d*d):y,i?this._additiveValue=_:e[s]=_}}else if(l>0)1===l?interpolate1DArray(f,h[r],c[r],d):interpolate2DArray(f,h[r],c[r],d);else if(u)interpolate1DArray(f,h[r],c[r],d),i||(e[s]=rgba2String(f));else{_=void 0;_=this.interpolable?interpolateNumber(h[r],c[r],d):step(h[r],c[r],d),i?this._additiveValue=_:e[s]=_}i&&this._addToTarget(e)}}}},e.prototype._addToTarget=function(e){var t=this.arrDim,n=this.propName,i=this._additiveValue;0===t?this.isValueColor?(parse(e[n],tmpRgba),add1DArray(tmpRgba,tmpRgba,i,1),e[n]=rgba2String(tmpRgba)):e[n]=e[n]+i:1===t?add1DArray(e[n],e[n],i,1):2===t&&add2DArray(e[n],e[n],i,1)},e}(),Animator=function(){function e(e,t,n){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=e,this._loop=t,t?logError("Can' use additive animation on looped animation."):this._additiveAnimators=n}return e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t){return this.whenWithKeys(e,t,keys(t))},e.prototype.whenWithKeys=function(e,t,n){for(var i=this._tracks,r=0;r0)){this._started=1;for(var n=this,i=[],r=0;r1){var o=a.pop();r.addKeyframe(o.time,e[i]),r.prepare(r.getAdditiveTrack())}}}},e}(),Point=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var r=1-i;e.x=r*t.x+i*n.x,e.y=r*t.y+i*n.y},e}(),mathMin=Math.min,mathMax=Math.max,lt=new Point,rb=new Point,lb=new Point,rt=new Point,minTv=new Point,maxTv=new Point,BoundingRect=function(){function e(e,t,n,i){n<0&&isFinite(n)&&(e+=n,n=-n),i<0&&isFinite(i)&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=mathMin(e.x,this.x),n=mathMin(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=mathMax(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=mathMax(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,r=create$1();return translate(r,r,[-t.x,-t.y]),scale$1(r,r,[n,i]),translate(r,r,[e.x,e.y]),r},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,r=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,p=!(af&&(f=_,gf&&(f=x,y=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],a=i[3],o=i[4],s=i[5];return t.x=n.x*r+o,t.y=n.y*a+s,t.width=n.width*r,t.height=n.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}lt.x=lb.x=n.x,lt.y=rt.y=n.y,rb.x=rt.x=n.x+n.width,rb.y=lb.y=n.y+n.height,lt.transform(i),rt.transform(i),rb.transform(i),lb.transform(i),t.x=mathMin(lt.x,rb.x,lb.x,rt.x),t.y=mathMin(lt.y,rb.y,lb.y,rt.y);var l=mathMax(lt.x,rb.x,lb.x,rt.x),u=mathMax(lt.y,rb.y,lb.y,rt.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),textWidthCache={},DEFAULT_FONT="12px sans-serif";function defaultMeasureText(e,t){return _ctx||(_ctx=createCanvas().getContext("2d")),_cachedFont!==t&&(_cachedFont=_ctx.font=t||DEFAULT_FONT),_ctx.measureText(e)}var methods$1={measureText:defaultMeasureText};function getWidth(e,t){var n=textWidthCache[t=t||DEFAULT_FONT];n||(n=textWidthCache[t]=new LRU(500));var i=n.get(e);return null==i&&(i=methods$1.measureText(e,t).width,n.put(e,i)),i}function innerGetBoundingRect(e,t,n,i){var r=getWidth(e,t),a=getLineHeight(t),o=adjustTextX(0,r,n),s=adjustTextY(0,a,i);return new BoundingRect(o,s,r,a)}function getBoundingRect(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return innerGetBoundingRect(r[0],t,n,i);for(var a=new BoundingRect(0,0,0,0),o=0;o=0?parseFloat(e)/100*t:parseFloat(e):e}function calculateTextPosition(e,t,n){var i=t.position||"inside",r=null!=t.distance?t.distance:5,a=n.height,o=n.width,s=a/2,l=n.x,u=n.y,c="left",h="top";if(i instanceof Array)l+=parsePercent(i[0],n.width),u+=parsePercent(i[1],n.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+o,u+=s,h="middle";break;case"top":l+=o/2,u-=r,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+r,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=o-r,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=r,c="center";break;case"insideBottom":l+=o/2,u+=a-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=o-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=a-r,h="bottom";break;case"insideBottomRight":l+=o-r,u+=a-r,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var dpr=1;"undefined"!=typeof window&&(dpr=Math.max(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var devicePixelRatio=dpr,DARK_MODE_THRESHOLD=.4,DARK_LABEL_COLOR="#333",LIGHT_LABEL_COLOR="#ccc",LIGHTER_LABEL_COLOR="#eee",PRESERVED_NORMAL_STATE="__zr_normal__",PRIMARY_STATES_KEYS=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],DEFAULT_ANIMATABLE_MAP={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},tmpTextPosCalcRes={},tmpBoundingRect=new BoundingRect(0,0,0,0),Element=function(){function e(e){this.id=guid(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=t.attachedTransform,a=void 0,o=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.x=t.x,r.y=t.y,r.originX=t.originX,r.originY=t.originY,r.rotation=t.rotation,r.scaleX=t.scaleX,r.scaleY=t.scaleY,null!=n.position){var u=tmpBoundingRect;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(tmpTextPosCalcRes,n,u):calculateTextPosition(tmpTextPosCalcRes,n,u),r.x=tmpTextPosCalcRes.x,r.y=tmpTextPosCalcRes.y,a=tmpTextPosCalcRes.align,o=tmpTextPosCalcRes.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,p=void 0;"center"===c?(h=.5*u.width,p=.5*u.height):(h=parsePercent(c[0],u.width),p=parsePercent(c[1],u.height)),l=!0,r.originX=-r.x+h+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,v=void 0;f&&this.canBeInsideText()?(m=n.insideFill,y=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(m),v=!0)):(m=n.outsideFill,y=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(m),v=!0)),(m=m||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&a===g.align&&o===g.verticalAlign||(s=!0,g.fill=m,g.stroke=y,g.autoStroke=v,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),s&&t.dirtyStyle(),t.markRedraw()}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?LIGHT_LABEL_COLOR:DARK_LABEL_COLOR},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&parse(t);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*i+(r?0:255)*(1-i);return n[3]=1,stringify(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},extend(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(isObject(e))for(var n=keys(e),i=0;i0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(PRESERVED_NORMAL_STATE,!1,e)},e.prototype.useState=function(t,n,i){var r=t===PRESERVED_NORMAL_STATE;if(this.hasState()||!r){var a=this.currentStates,o=this.stateTransition;if(!(indexOf(a,t)>=0)||!n&&1!==a.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!(!s||!s.hoverLayer);return l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,n,!i&&!this.__inHover&&o&&o.duration>0,o),this._textContent&&this._textContent.useState(t,n),this._textGuide&&this._textGuide.useState(t,n),r?(this.currentStates=[],this._normalState={}):n?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT),s}logError("State "+t+" not exists.")}}},e.prototype.useStates=function(t,n){if(t.length){var i=[],r=this.currentStates,a=t.length,o=a===r.length;if(o)for(var s=0;s0,p),this._textContent&&this._textContent.useStates(t),this._textGuide&&this._textGuide.useStates(t),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT)}else this.clearStates()},e.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),r=indexOf(i,e),a=indexOf(i,t)>=0;r>=0?a?i.splice(r,1):i[r]=t:n&&!a&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,r=[],a=0;a8)&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),e}();function animateTo(e,t,n,i,r){var a=[];animateToShallow(e,"",e,t,n=n||{},i,a,r);var o=a.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--o<=0&&(s?l&&l():u&&u())},h=function(){--o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&n.during&&a[0].during((function(e,t){n.during(t)}));for(var p=0;p0||r.force&&!o.length){for(var v=e.animators,_=[],x=0;x=DEFAULT_MIN_MERGE;)t|=1&e,e>>=1;return e+t}function makeAscendingRun(e,t,n,i){var r=t+1;if(r===n)return 1;if(i(e[r++],e[t])<0){for(;r=0;)r++;return r-t}function reverseRun(e,t,n){for(n--;t>>1])<0?l=a:s=a+1;var u=i-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=o}}function gallopLeft(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])>0){for(s=i-r;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o>>1);a(e,t[n+c])>0?o=c+1:l=c}return l}function gallopRight(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])<0){for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=i-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o>>1);a(e,t[n+c])<0?l=c:o=c+1}return l}function TimSort(e,t){var n,i,r=DEFAULT_MIN_GALLOPING,a=0;e.length;var o=[];function s(s){var l=n[s],u=i[s],c=n[s+1],h=i[s+1];i[s]=u+h,s===a-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),a--;var p=gallopRight(e[c],e,l,u,0,t);l+=p,0!==(u-=p)&&0!==(h=gallopLeft(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,i,a,s){var l=0;for(l=0;l=DEFAULT_MIN_GALLOPING||d>=DEFAULT_MIN_GALLOPING);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)e[d+l]=e[p+l];return void(e[h]=o[c])}var f=r;for(;;){var g=0,m=0,y=!1;do{if(t(o[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--i){y=!0;break}}else if(e[h--]=o[c--],m++,g=0,1==--s){y=!0;break}}while((g|m)=0;l--)e[d+l]=e[p+l];if(0===i){y=!0;break}}if(e[h--]=o[c--],1==--s){y=!0;break}if(0!==(m=s-gallopLeft(e[u],o,0,s,s-1,t))){for(s-=m,d=(h-=m)+1,p=(c-=m)+1,l=0;l=DEFAULT_MIN_GALLOPING||m>=DEFAULT_MIN_GALLOPING);if(y)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===s){for(d=(h-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)e[d+l]=e[p+l];e[h]=o[c]}else{if(0===s)throw new Error;for(p=h-(s-1),l=0;l1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;s(e)}},forceMergeRuns:function(){for(;a>1;){var e=a-2;e>0&&i[e-1]s&&(l=s),binaryInsertionSort(e,n,n+l,n+a,t),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}}var invalidZErrorLogged=!1;function logInvalidZError(){invalidZErrorLogged||(invalidZErrorLogged=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function shapeCompareFunc(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var requestAnimationFrame,Storage=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}return e.prototype.traverse=function(e,t){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(logInvalidZError(),u.z=0),isNaN(u.z2)&&(logInvalidZError(),u.z2=0),isNaN(u.zlevel)&&(logInvalidZError(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var p=e.getTextContent();p&&this._updateAndAddDisplayable(p,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),requestAnimationFrame$1=requestAnimationFrame="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},Animation=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n.onframe=t.onframe||function(){},n}return __extends(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._clipsHead?(this._clipsTail.next=e,e.prev=this._clipsTail,e.next=null,this._clipsTail=e):this._clipsHead=this._clipsTail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._clipsHead=n,n?n.prev=t:this._clipsTail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=(new Date).getTime()-this._pausedTime,n=t-this._time,i=this._clipsHead;i;){var r=i.next;i.step(t,n)?(i.ondestroy&&i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=t,e||(this.onframe(n),this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,requestAnimationFrame$1((function t(){e._running&&(requestAnimationFrame$1(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._clipsHead;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._clipsHead=this._clipsTail=null},t.prototype.isFinished=function(){return null==this._clipsHead},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Animator(e,t.loop);return this.addAnimator(n),n},t}(Eventful),TOUCH_CLICK_DELAY=300,globalEventSupported=env.domSupported,localNativeListenerNames=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:["touchstart","touchend","touchmove"],pointer:map(e,(function(e){var n=e.replace("mouse","pointer");return t.hasOwnProperty(n)?n:e}))}}(),globalNativeListenerNames={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wheelEventSupported=!1;function isPointerFromTouch(e){var t=e.pointerType;return"pen"===t||"touch"===t}function setTouchTimer(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}function markTouch(e){e&&(e.zrByTouch=!0)}function normalizeGlobalEvent(e,t){return normalizeEvent(e.dom,new FakeGlobalEvent(e,t),!0)}function isLocalEl(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var FakeGlobalEvent=function(e,t){this.stopPropagation=noop,this.stopImmediatePropagation=noop,this.preventDefault=noop,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},localDOMHandlers={mousedown:function(e){e=normalizeEvent(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=normalizeEvent(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=normalizeEvent(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){if(e.target===this.dom){e=normalizeEvent(this.dom,e),this.__pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=isLocalEl(this,t),this.trigger("mouseout",e)}},wheel:function(e){wheelEventSupported=!0,e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){wheelEventSupported||(e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),localDOMHandlers.mousemove.call(this,e),localDOMHandlers.mousedown.call(this,e)},touchmove:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"change"),localDOMHandlers.mousemove.call(this,e)},touchend:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"end"),localDOMHandlers.mouseup.call(this,e),+new Date-+this.__lastTouchMoment-EPSILON$1&&eEPSILON$1||e<-EPSILON$1}function cubicAt(e,t,n,i,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*i+3*a*n)}function cubicDerivativeAt(e,t,n,i,r){var a=1-r;return 3*(((t-e)*a+2*(n-t)*r)*a+(i-n)*r*r)}function cubicRootAt(e,t,n,i,r,a){var o=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-r,c=s*s-3*o*l,h=s*l-9*o*u,p=l*l-3*s*u,d=0;if(isAroundZero(c)&&isAroundZero(h)){if(isAroundZero(s))a[0]=0;else(M=-l/s)>=0&&M<=1&&(a[d++]=M)}else{var f=h*h-4*c*p;if(isAroundZero(f)){var g=h/c,m=-g/2;(M=-s/o+g)>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m)}else if(f>0){var y=mathSqrt(f),v=c*s+1.5*o*(-h+y),_=c*s+1.5*o*(-h-y);(M=(-s-((v=v<0?-mathPow(-v,ONE_THIRD):mathPow(v,ONE_THIRD))+(_=_<0?-mathPow(-_,ONE_THIRD):mathPow(_,ONE_THIRD))))/(3*o))>=0&&M<=1&&(a[d++]=M)}else{var x=(2*c*s-3*o*h)/(2*mathSqrt(c*c*c)),S=Math.acos(x)/3,b=mathSqrt(c),T=Math.cos(S),M=(-s-2*b*T)/(3*o),A=(m=(-s+b*(T+THREE_SQRT*Math.sin(S)))/(3*o),(-s+b*(T-THREE_SQRT*Math.sin(S)))/(3*o));M>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m),A>=0&&A<=1&&(a[d++]=A)}}return d}function cubicExtrema(e,t,n,i,r){var a=6*n-12*t+6*e,o=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(isAroundZero(o)){if(isNotAroundZero$1(a))(c=-s/a)>=0&&c<=1&&(r[l++]=c)}else{var u=a*a-4*o*s;if(isAroundZero(u))r[0]=-a/(2*o);else if(u>0){var c,h=mathSqrt(u),p=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function cubicSubdivide(e,t,n,i,r,a){var o=(t-e)*r+e,s=(n-t)*r+t,l=(i-n)*r+n,u=(s-o)*r+o,c=(l-s)*r+s,h=(c-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=i}function cubicProjectPoint(e,t,n,i,r,a,o,s,l,u,c){var h,p,d,f,g,m=.005,y=1/0;_v0[0]=l,_v0[1]=u;for(var v=0;v<1;v+=.05)_v1[0]=cubicAt(e,n,r,o,v),_v1[1]=cubicAt(t,i,a,s,v),(f=distSquare(_v0,_v1))=0&&f=0&&c<=1&&(r[l++]=c)}else{var u=o*o-4*a*s;if(isAroundZero(u))(c=-o/(2*a))>=0&&c<=1&&(r[l++]=c);else if(u>0){var c,h=mathSqrt(u),p=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function quadraticExtremum(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function quadraticSubdivide(e,t,n,i,r){var a=(t-e)*i+e,o=(n-t)*i+t,s=(o-a)*i+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=n}function quadraticProjectPoint(e,t,n,i,r,a,o,s,l){var u,c=.005,h=1/0;_v0[0]=o,_v0[1]=s;for(var p=0;p<1;p+=.05){_v1[0]=quadraticAt(e,n,r,p),_v1[1]=quadraticAt(t,i,a,p),(m=distSquare(_v0,_v1))=0&&m1e-4)return s[0]=e-n,s[1]=t-i,l[0]=e+n,void(l[1]=t+i);if(start[0]=mathCos(r)*n+e,start[1]=mathSin(r)*i+t,end[0]=mathCos(a)*n+e,end[1]=mathSin(a)*i+t,u(s,start,end),c(l,start,end),(r%=PI2)<0&&(r+=PI2),(a%=PI2)<0&&(a+=PI2),r>a&&!o?a+=PI2:rr&&(extremity[0]=mathCos(d)*n+e,extremity[1]=mathSin(d)*i+t,u(s,extremity,s),c(l,extremity,l))}var CMD={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tmpOutX=[],tmpOutY=[],min$1=[],max$1=[],min2=[],max2=[],mathMin$2=Math.min,mathMax$2=Math.max,mathCos$1=Math.cos,mathSin$1=Math.sin,mathSqrt$1=Math.sqrt,mathAbs=Math.abs,PI=Math.PI,PI2$1=2*PI,hasTypedArray="undefined"!=typeof Float32Array,tmpAngles=[];function modPI2(e){return Math.round(e/PI*1e8)/1e8%2*PI}function normalizeArcAngles(e,t){var n=modPI2(e[0]);n<0&&(n+=PI2$1);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=PI2$1?r=n+PI2$1:t&&n-r>=PI2$1?r=n-PI2$1:!t&&n>r?r=n+(PI2$1-modPI2(n-r)):t&&n0&&(this._ux=mathAbs(n/devicePixelRatio/e)||0,this._uy=mathAbs(n/devicePixelRatio/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this.addData(CMD.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=mathAbs(e-this._xi)>this._ux||mathAbs(t-this._yi)>this._uy||this._len<5;return this.addData(CMD.L,e,t),this._ctx&&n&&(this._needsDash?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),n&&(this._xi=e,this._yi=t),this},e.prototype.bezierCurveTo=function(e,t,n,i,r,a){return this.addData(CMD.C,e,t,n,i,r,a),this._ctx&&(this._needsDash?this._dashedBezierTo(e,t,n,i,r,a):this._ctx.bezierCurveTo(e,t,n,i,r,a)),this._xi=r,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,i){return this.addData(CMD.Q,e,t,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(e,t,n,i):this._ctx.quadraticCurveTo(e,t,n,i)),this._xi=n,this._yi=i,this},e.prototype.arc=function(e,t,n,i,r,a){tmpAngles[0]=i,tmpAngles[1]=r,normalizeArcAngles(tmpAngles,a),i=tmpAngles[0];var o=(r=tmpAngles[1])-i;return this.addData(CMD.A,e,t,n,n,i,o,0,a?0:1),this._ctx&&this._ctx.arc(e,t,n,i,r,a),this._xi=mathCos$1(r)*n+e,this._yi=mathSin$1(r)*n+t,this},e.prototype.arcTo=function(e,t,n,i,r){return this._ctx&&this._ctx.arcTo(e,t,n,i,r),this},e.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this.addData(CMD.R,e,t,n,i),this},e.prototype.closePath=function(){this.addData(CMD.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&(this._needsDash&&this._dashedLineTo(t,n),e.closePath()),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.setLineDash=function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var c=0;c0&&d<=e||c<0&&d>=e||0===c&&(h>0&&f<=t||h<0&&f>=t);)d+=c*(n=a[i=this._dashIdx]),f+=h*n,this._dashIdx=(i+1)%g,c>0&&dl||h>0&&fu||o[i%2?"moveTo":"lineTo"](c>=0?mathMin$2(d,e):mathMax$2(d,e),h>=0?mathMin$2(f,t):mathMax$2(f,t));c=d-e,h=f-t,this._dashOffset=-mathSqrt$1(c*c+h*h)},e.prototype._dashedBezierTo=function(e,t,n,i,r,a){var o,s,l,u,c,h=this._ctx,p=this._dashSum,d=this._dashOffset,f=this._lineDash,g=this._xi,m=this._yi,y=0,v=this._dashIdx,_=f.length,x=0;for(d<0&&(d=p+d),d%=p,o=0;o<1;o+=.1)s=cubicAt(g,e,n,r,o+.1)-cubicAt(g,e,n,r,o),l=cubicAt(m,t,i,a,o+.1)-cubicAt(m,t,i,a,o),y+=mathSqrt$1(s*s+l*l);for(;v<_&&!((x+=f[v])>d);v++);for(o=(x-d)/y;o<=1;)u=cubicAt(g,e,n,r,o),c=cubicAt(m,t,i,a,o),v%2?h.moveTo(u,c):h.lineTo(u,c),o+=f[v]/y,v=(v+1)%_;v%2!=0&&h.lineTo(r,a),s=r-u,l=a-c,this._dashOffset=-mathSqrt$1(s*s+l*l)},e.prototype._dashedQuadraticTo=function(e,t,n,i){var r=n,a=i;n=(n+2*e)/3,i=(i+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,n,i,r,a)},e.prototype.toStatic=function(){if(this._saveData){var e=this.data;e instanceof Array&&(e.length=this._len,hasTypedArray&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){min$1[0]=min$1[1]=min2[0]=min2[1]=Number.MAX_VALUE,max$1[0]=max$1[1]=max2[0]=max2[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,r=0,a=0;for(e=0;en||mathAbs(m)>i||h===t-1)&&(f=Math.sqrt(P*P+m*m),r=g,a=_);break;case CMD.C:var y=e[h++],v=e[h++],_=(g=e[h++],e[h++]),x=e[h++],S=e[h++];f=cubicLength(r,a,y,v,g,_,x,S,10),r=x,a=S;break;case CMD.Q:f=quadraticLength(r,a,y=e[h++],v=e[h++],g=e[h++],_=e[h++],10),r=g,a=_;break;case CMD.A:var b=e[h++],T=e[h++],M=e[h++],A=e[h++],I=e[h++],C=e[h++],w=C+I;h+=1;e[h++];d&&(o=mathCos$1(I)*M+b,s=mathSin$1(I)*A+T),f=mathMax$2(M,A)*mathMin$2(PI2$1,Math.abs(C)),r=mathCos$1(w)*M+b,a=mathSin$1(w)*A+T;break;case CMD.R:o=r=e[h++],s=a=e[h++],f=2*e[h++]+2*e[h++];break;case CMD.Z:var P=o-r;m=s-a;f=Math.sqrt(P*P+m*m),r=o,a=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,i,r,a,o,s,l,u,c=this.data,h=this._ux,p=this._uy,d=this._len,f=t<1,g=0,m=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var y=0;yh||mathAbs(s-a)>p||y===d-1){if(f){if(g+(G=l[m++])>u){var x=(u-g)/G;e.lineTo(r*(1-x)+o*x,a*(1-x)+s*x);break e}g+=G}e.lineTo(o,s),r=o,a=s}break;case CMD.C:var S=c[y++],b=c[y++],T=c[y++],M=c[y++],A=c[y++],I=c[y++];if(f){if(g+(G=l[m++])>u){cubicSubdivide(r,S,T,A,x=(u-g)/G,tmpOutX),cubicSubdivide(a,b,M,I,x,tmpOutY),e.bezierCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2],tmpOutX[3],tmpOutY[3]);break e}g+=G}e.bezierCurveTo(S,b,T,M,A,I),r=A,a=I;break;case CMD.Q:S=c[y++],b=c[y++],T=c[y++],M=c[y++];if(f){if(g+(G=l[m++])>u){quadraticSubdivide(r,S,T,x=(u-g)/G,tmpOutX),quadraticSubdivide(a,b,M,x,tmpOutY),e.quadraticCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2]);break e}g+=G}e.quadraticCurveTo(S,b,T,M),r=T,a=M;break;case CMD.A:var C=c[y++],w=c[y++],P=c[y++],L=c[y++],E=c[y++],D=c[y++],R=c[y++],O=!c[y++],k=P>L?P:L,N=mathAbs(P-L)>.001,B=E+D,V=!1;if(f)g+(G=l[m++])>u&&(B=E+D*(u-g)/G,V=!0),g+=G;if(N&&e.ellipse?e.ellipse(C,w,P,L,R,E,B,O):e.arc(C,w,k,E,B,O),V)break e;_&&(n=mathCos$1(E)*P+C,i=mathSin$1(E)*L+w),r=mathCos$1(B)*P+C,a=mathSin$1(B)*L+w;break;case CMD.R:n=r=c[y],i=a=c[y+1],o=c[y++],s=c[y++];var F=c[y++],$=c[y++];if(f){if(g+(G=l[m++])>u){var z=u-g;e.moveTo(o,s),e.lineTo(o+mathMin$2(z,F),s),(z-=F)>0&&e.lineTo(o+F,s+mathMin$2(z,$)),(z-=$)>0&&e.lineTo(o+mathMax$2(F-z,0),s+$),(z-=F)>0&&e.lineTo(o,s+mathMax$2($-z,0));break e}g+=G}e.rect(o,s,F,$);break;case CMD.Z:if(f){var G;if(g+(G=l[m++])>u){x=(u-g)/G;e.lineTo(r*(1-x)+n*x,a*(1-x)+i*x);break e}g+=G}e.closePath(),r=n,a=i}}},e.CMD=CMD,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._needsDash=!1,t._dashOffset=0,t._dashIdx=0,t._dashSum=0,t._ux=0,t._uy=0}(),e}();function containStroke(e,t,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>i+s||oe+s&&a>n+s||at+h&&c>i+h&&c>a+h&&c>s+h||ce+h&&u>n+h&&u>r+h&&u>o+h||ut+u&&l>i+u&&l>a+u||le+u&&s>n+u&&s>r+u||sn||c+ur&&(r+=PI2$3);var p=Math.atan2(l,s);return p<0&&(p+=PI2$3),p>=i&&p<=r||p+PI2$3>=i&&p+PI2$3<=r}function windingLine(e,t,n,i,r,a){if(a>t&&a>i||ar?s:0}var CMD$1=PathProxy.CMD,PI2$4=2*Math.PI,EPSILON$2=1e-4;function isAroundEqual(e,t){return Math.abs(e-t)t&&u>i&&u>a&&u>s||u1&&swapExtrema(),d=cubicAt(t,i,a,s,extrema[0]),p>1&&(f=cubicAt(t,i,a,s,extrema[1]))),2===p?mt&&s>i&&s>a||s=0&&u<=1){for(var c=0,h=quadraticAt(t,i,a,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);roots[0]=-l,roots[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=PI2$4-1e-4){i=0,r=PI2$4;var c=a?1:-1;return o>=roots[0]+e&&o<=roots[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=PI2$4,r+=PI2$4);for(var p=0,d=0;d<2;d++){var f=roots[d];if(f+e>o){var g=Math.atan2(s,f);c=a?1:-1;g<0&&(g=PI2$4+g),(g>=i&&g<=r||g+PI2$4>=i&&g+PI2$4<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),p+=c)}}return p}function containPath(e,t,n,i,r){for(var a,o,s=e.data,l=e.len(),u=0,c=0,h=0,p=0,d=0,f=0;f1&&(n||(u+=windingLine(c,h,p,d,i,r))),m&&(p=c=s[f],d=h=s[f+1]),g){case CMD$1.M:c=p=s[f++],h=d=s[f++];break;case CMD$1.L:if(n){if(containStroke(c,h,s[f],s[f+1],t,i,r))return!0}else u+=windingLine(c,h,s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.C:if(n){if(containStroke$1(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingCubic(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.Q:if(n){if(containStroke$2(c,h,s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingQuadratic(c,h,s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],S=s[f++],b=s[f++];f+=1;var T=!!(1-s[f++]);a=Math.cos(S)*_+y,o=Math.sin(S)*x+v,m?(p=a,d=o):u+=windingLine(c,h,a,o,i,r);var M=(i-y)*x/_+y;if(n){if(containStroke$3(y,v,x,S,S+b,T,t,M,r))return!0}else u+=windingArc(y,v,x,S,S+b,T,M,r);c=Math.cos(S+b)*_+y,h=Math.sin(S+b)*x+v;break;case CMD$1.R:if(p=c=s[f++],d=h=s[f++],a=p+s[f++],o=d+s[f++],n){if(containStroke(p,d,a,d,t,i,r)||containStroke(a,d,a,o,t,i,r)||containStroke(a,o,p,o,t,i,r)||containStroke(p,o,p,d,t,i,r))return!0}else u+=windingLine(a,d,a,o,i,r),u+=windingLine(p,o,p,d,i,r);break;case CMD$1.Z:if(n){if(containStroke(c,h,p,d,t,i,r))return!0}else u+=windingLine(c,h,p,d,i,r);c=p,h=d}}return n||isAroundEqual(h,d)||(u+=windingLine(c,h,p,d,i,r)||0),0!==u}function contain(e,t,n){return containPath(e,0,!1,t,n)}function containStroke$4(e,t,n,i){return containPath(e,t,!0,n,i)}var DEFAULT_PATH_STYLE=defaults({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},DEFAULT_COMMON_STYLE),DEFAULT_PATH_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},pathCopyParams=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],Path=function(e){function t(t){return e.call(this,t)||this}var n;return __extends(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new t;r.buildPath===t.prototype.buildPath&&(r.buildPath=function(e){n.buildPath(e,n.shape)}),r.silent=!0;var a=r.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?DARK_LABEL_COLOR:t>.2?LIGHTER_LABEL_COLOR:LIGHT_LABEL_COLOR}if(e)return LIGHT_LABEL_COLOR}return DARK_LABEL_COLOR},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(isString(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===lum(e,0)0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,n=this.style,i=!e;if(i){var r=!1;this.path||(r=!0,this.createPathProxy());var a=this.path;(r||this.__dirty&t.SHAPE_CHANGED_BIT)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),e=a.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){o.copy(e);var s=n.strokeNoScale?this.getLineScale():1,l=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;l=Math.max(l,null==u?4:u)}s>1e-10&&(o.width+=l/s,o.height+=l/s,o.x-=l/s/2,o.y-=l/s/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),r=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),containStroke$4(a,o/s,e,t)))return!0}if(this.hasFill())return contain(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=t.SHAPE_CHANGED_BIT,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:extend(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&t.SHAPE_CHANGED_BIT)},t.prototype.createStyle=function(e){return createObject(DEFAULT_PATH_STYLE,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=extend({},this.shape))},t.prototype._applyStateObj=function(t,n,i,r,a,o){e.prototype._applyStateObj.call(this,t,n,i,r,a,o);var s,l=!(n&&r);if(n&&n.shape?a?r?s=n.shape:(s=extend({},i.shape),extend(s,n.shape)):(s=extend({},r?this.shape:i.shape),extend(s,n.shape)):l&&(s=i.shape),s)if(a){this.shape=extend({},this.shape);for(var u={},c=keys(s),h=0;h1&&(o*=mathSqrt$3(f),s*=mathSqrt$3(f));var g=(r===a?-1:1)*mathSqrt$3((o*o*(s*s)-o*o*(d*d)-s*s*(p*p))/(o*o*(d*d)+s*s*(p*p)))||0,m=g*o*d/s,y=g*-s*p/o,v=(e+n)/2+mathCos$2(h)*m-mathSin$2(h)*y,_=(t+i)/2+mathSin$2(h)*m+mathCos$2(h)*y,x=vAngle([1,0],[(p-m)/o,(d-y)/s]),S=[(p-m)/o,(d-y)/s],b=[(-1*p-m)/o,(-1*d-y)/s],T=vAngle(S,b);if(vRatio(S,b)<=-1&&(T=PI$1),vRatio(S,b)>=1&&(T=0),T<0){var M=Math.round(T/PI$1*1e6)/1e6;T=2*PI$1+M%2*PI$1}c.addData(u,v,_,o,s,x,T,h,a)}var commandReg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,numberReg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function createPathProxyFromString(e){if(!e)return new PathProxy;for(var t,n=0,i=0,r=n,a=i,o=new PathProxy,s=PathProxy.CMD,l=e.match(commandReg),u=0;u=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=indexOf(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nu&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),i+r>c&&(i*=c/(o=i+r),r*=c/o),n+a>c&&(n*=c/(o=n+a),a*=c/o),e.moveTo(s+n,l),e.lineTo(s+u-i,l),0!==i&&e.arc(s+u-i,l+i,i,-Math.PI/2,0),e.lineTo(s+u,l+c-r),0!==r&&e.arc(s+u-r,l+c-r,r,0,Math.PI/2),e.lineTo(s+a,l+c),0!==a&&e.arc(s+a,l+c-a,a,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}Circle.prototype.type="circle";var round=Math.round;function subPixelOptimizeLine(e,t,n){if(t){var i=t.x1,r=t.x2,a=t.y1,o=t.y2;e.x1=i,e.x2=r,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(round(2*i)===round(2*r)&&(e.x1=e.x2=subPixelOptimize(i,s,!0)),round(2*a)===round(2*o)&&(e.y1=e.y2=subPixelOptimize(a,s,!0)),e):e}}function subPixelOptimizeRect(e,t,n){if(t){var i=t.x,r=t.y,a=t.width,o=t.height;e.x=i,e.y=r,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=subPixelOptimize(i,s,!0),e.y=subPixelOptimize(r,s,!0),e.width=Math.max(subPixelOptimize(i+a,s,!1)-e.x,0===a?0:1),e.height=Math.max(subPixelOptimize(r+o,s,!1)-e.y,0===o?0:1),e):e}}function subPixelOptimize(e,t,n){if(!t)return e;var i=round(2*e);return(i+round(t))%2==0?i/2:(i+(n?1:-1))/2}var RectShape=function(){this.x=0,this.y=0,this.width=0,this.height=0},subPixelOptimizeOutputShape={},Rect=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new RectShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeRect(subPixelOptimizeOutputShape,t,this.style);n=o.x,i=o.y,r=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,i=t.y,r=t.width,a=t.height;t.r?buildPath(e,t):e.rect(n,i,r,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Path);Rect.prototype.type="rect";var EllipseShape=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Ellipse=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new EllipseShape},t.prototype.buildPath=function(e,t){var n=.5522848,i=t.cx,r=t.cy,a=t.rx,o=t.ry,s=a*n,l=o*n;e.moveTo(i-a,r),e.bezierCurveTo(i-a,r-l,i-s,r-o,i,r-o),e.bezierCurveTo(i+s,r-o,i+a,r-l,i+a,r),e.bezierCurveTo(i+a,r+l,i+s,r+o,i,r+o),e.bezierCurveTo(i-s,r+o,i-a,r+l,i-a,r),e.closePath()},t}(Path);Ellipse.prototype.type="ellipse";var subPixelOptimizeOutputShape$1={},LineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Line=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LineShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeLine(subPixelOptimizeOutputShape$1,t,this.style);n=o.x1,i=o.y1,r=o.x2,a=o.y2}else n=t.x1,i=t.y1,r=t.x2,a=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,a=i*(1-s)+a*s),e.lineTo(r,a))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(Path);function interpolate(e,t,n,i,r,a,o){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*o+(-3*(t-n)-2*s-l)*a+s*r+t}function smoothSpline(e,t){for(var n=e.length,i=[],r=0,a=1;an-2?n-1:l+1],d=e[l>n-3?n-1:l+2]);var f=u*u,g=u*f;i.push([interpolate(c[0],h[0],p[0],d[0],u,f,g),interpolate(c[1],h[1],p[1],d[1],u,f,g)])}return i}function smoothBezier(e,t,n,i){var r,a,o,s,l=[],u=[],c=[],h=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=e.length;p=2){if(i&&"spline"!==i){var a=smoothBezier(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var o=r.length,s=0;s<(n?o:o-1);s++){var l=a[2*s],u=a[2*s+1],c=r[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{"spline"===i&&(r=smoothSpline(r,n)),e.moveTo(r[0][0],r[0][1]);s=1;for(var h=r.length;s0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return createObject(DEFAULT_TSPAN_STYLE,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=getBoundingRect(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(Displayable);TSpan.prototype.type="tspan";var nodeParsers,DILIMITER_REG=/[\s,]+/;function parseXML(e){isString(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var SVGParser=function(){function e(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}return e.prototype.parse=function(e,t){t=t||{};var n=parseXML(e);if(!n)throw new Error("Illegal svg");var i=new Group;this._root=i;var r=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),o=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),parseAttributes(n,i,null,!0);for(var s,l,u=n.firstChild;u;)this._parseNode(u,i),u=u.nextSibling;if(r){var c=trim(r).split(DILIMITER_REG);c.length>=4&&(s={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(s&&null!=a&&null!=o&&(l=makeViewBoxTransform(s,a,o),!t.ignoreViewBox)){var h=i;(i=new Group).add(h),h.scaleX=h.scaleY=l.scale,h.x=l.x,h.y=l.y}return t.ignoreRootClip||null==a||null==o||i.setClipPath(new Rect({shape:{x:0,y:0,width:a,height:o}})),{root:i,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},e.prototype._parseNode=function(e,t){var n,i,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(i=defineParsers[r]){var a=i.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(i=nodeParsers[r])&&(n=i.call(this,e,t),t.add(n));if(n)for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,n),3===s.nodeType&&this._isText&&this._parseText(s,n),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},e.prototype._parseText=function(e,t){if(1===e.nodeType){var n=e.getAttribute("dx")||0,i=e.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new TSpan({style:{text:e.textContent},x:this._textX||0,y:this._textY||0});inheritStyle(t,r),parseAttributes(e,r,this._defs);var a=r.style,o=a.fontSize;o&&o<9&&(a.fontSize=9,r.scaleX*=o/9,r.scaleY*=o/9);var s=(a.fontSize||a.fontFamily)&&[a.fontStyle,a.fontWeight,(a.fontSize||12)+"px",a.fontFamily||"sans-serif"].join(" ");a.font=s;var l=r.getBoundingRect();return this._textX+=l.width,t.add(r),r},e.internalField=void(nodeParsers={g:function(e,t){var n=new Group;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n},rect:function(e,t){var n=new Rect;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n},circle:function(e,t){var n=new Circle;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n},line:function(e,t){var n=new Line;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n},ellipse:function(e,t){var n=new Ellipse;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n},polygon:function(e,t){var n,i=e.getAttribute("points");i&&(n=parsePoints(i));var r=new Polygon({shape:{points:n||[]}});return inheritStyle(t,r),parseAttributes(e,r,this._defs),r},polyline:function(e,t){var n=new Path;inheritStyle(t,n),parseAttributes(e,n,this._defs);var i,r=e.getAttribute("points");return r&&(i=parsePoints(r)),new Polyline({shape:{points:i||[]}})},image:function(e,t){var n=new ZRImage;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setStyle({image:e.getAttribute("xlink:href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",r=e.getAttribute("dx")||"0",a=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(a);var o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),o},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var n=createFromString(e.getAttribute("d")||"");return inheritStyle(t,n),parseAttributes(e,n,this._defs),n}}),e}(),defineParsers={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),r=parseInt(e.getAttribute("y2")||"0",10),a=new LinearGradient(t,n,i,r);return _parseGradientColorStops(e,a),a}};function _parseGradientColorStops(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType){var i=n.getAttribute("offset"),r=void 0;r=i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var a=n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function inheritStyle(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),defaults(t.__inheritedStyle,e.__inheritedStyle))}function parsePoints(e){for(var t=trim(e).split(DILIMITER_REG),n=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=void 0;switch(r=r||create$1(),s){case"translate":l=trim(o).split(DILIMITER_REG),translate(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":l=trim(o).split(DILIMITER_REG),scale$1(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":l=trim(o).split(DILIMITER_REG),rotate(r,r,parseFloat(l[0]));break;case"skew":l=trim(o).split(DILIMITER_REG),console.warn("Skew transform is not supported yet");break;case"matrix":l=trim(o).split(DILIMITER_REG),r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}t.setLocalTransform(r)}}var styleRegex=/([^\s:;]+)\s*:\s*([^:;]+)/g;function parseStyleAttribute(e){var t=e.getAttribute("style"),n={};if(!t)return n;var i,r={};for(styleRegex.lastIndex=0;null!=(i=styleRegex.exec(t));)r[i[1]]=i[2];for(var a in attributesMap)attributesMap.hasOwnProperty(a)&&null!=r[a]&&(n[attributesMap[a]]=r[a]);return n}function makeViewBoxTransform(e,t,n){var i=t/e.width,r=n/e.height,a=Math.min(i,r);return{scale:a,x:-(e.x+e.width/2)*a+t/2,y:-(e.y+e.height/2)*a+n/2}}function parseSVG(e,t){return(new SVGParser).parse(e,t)}var PI$2=Math.PI,PI2$5=2*PI$2,mathSin$3=Math.sin,mathCos$3=Math.cos,mathACos=Math.acos,mathATan2=Math.atan2,mathAbs$1=Math.abs,mathSqrt$4=Math.sqrt,mathMax$3=Math.max,mathMin$3=Math.min,e=1e-4;function intersect(t,n,i,r,a,o,s,l){var u=i-t,c=r-n,h=s-a,p=l-o,d=p*u-h*c;if(!(d*dL*L+E*E&&(M=I,A=C),{cx:M,cy:A,x01:-c,y01:-h,x11:M*(r/S-1),y11:A*(r/S-1)}}function buildPath$2(t,n){var i=mathMax$3(n.r,0),r=mathMax$3(n.r0||0,0),a=i>0;if(a||r>0){if(a||(i=r,r=0),r>i){var o=i;i=r,r=o}var s=!!n.clockwise,l=n.startAngle,u=n.endAngle,c=[l,u];normalizeArcAngles(c,!s);var h=mathAbs$1(c[0]-c[1]),p=n.cx,d=n.cy,f=n.cornerRadius||0,g=n.innerCornerRadius||0;if(i>e)if(h>PI2$5-e)t.moveTo(p+i*mathCos$3(l),d+i*mathSin$3(l)),t.arc(p,d,i,l,u,!s),r>e&&(t.moveTo(p+r*mathCos$3(u),d+r*mathSin$3(u)),t.arc(p,d,r,u,l,s));else{var m=mathAbs$1(i-r)/2,y=mathMin$3(m,f),v=mathMin$3(m,g),_=v,x=y,S=i*mathCos$3(l),b=i*mathSin$3(l),T=r*mathCos$3(u),M=r*mathSin$3(u),A=void 0,I=void 0,C=void 0,w=void 0;if((y>e||v>e)&&(A=i*mathCos$3(u),I=i*mathSin$3(u),C=r*mathCos$3(l),w=r*mathSin$3(l),he)if(x>e){var N=computeCornerTangents(C,w,S,b,i,x,s),B=computeCornerTangents(A,I,T,M,i,x,s);t.moveTo(p+N.cx+N.x01,d+N.cy+N.y01),xe&&h>e)if(_>e){N=computeCornerTangents(T,M,A,I,r,-_,s),B=computeCornerTangents(S,b,C,w,r,-_,s);t.lineTo(p+N.cx+N.x01,d+N.cy+N.y01),_2&&l.push(t),t=[e,n]}function f(e,n,i,r){aroundEqual(e,i)&&aroundEqual(n,r)||t.push(e,n,i,r,i,r)}function g(e,n,i,r,a,o){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=nM:C2&&l.push(t),l}function alignSubpath(e,t){var n=e.length,i=t.length;if(n===i)return[e,t];for(var r=n0)for(var S=i/n,b=-i/2;b<=i/2;b+=S){var T=Math.sin(b),M=Math.cos(b),A=0;for(_=0;_h.width?1:0,r=PROP_WH[i],a=PROP_XY[i],o=h[r]/t,s=h[a],l=0;l=o;l++)s-=o;var u=getWidth(n,t);return u>s&&(n="",u=0),s=e-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=e,r}function truncateSingleLine(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var a=getWidth(e,i);if(a<=n)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?estimateLength(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=getWidth(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}function estimateLength(e,t,n,i){for(var r=0,a=0,o=e.length;ap&&u){var d=Math.floor(p/l);n=n.slice(0,d)}var f=p,g=c;if(r&&(f+=r[0]+r[2],null!=g&&(g+=r[1]+r[3])),e&&o&&null!=g)for(var m=prepareTruncateOptions(c,a,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),y=0;yl&&pushTokens(n,e.substring(l,u),t,s),pushTokens(n,i[2],t,s,i[1]),l=STYLE_REG.lastIndex}la){S>0?(v.tokens=v.tokens.slice(0,S),m(v,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break e}var C=b.width,w=null==C||"auto"===C;if("string"==typeof C&&"%"===C.charAt(C.length-1))D.percentWidth=C,c.push(D),D.contentWidth=getWidth(D.text,A);else{if(w){var P=b.backgroundColor,L=P&&P.image;L&&isImageReady(L=findExistImage(L))&&(D.width=Math.max(D.width,L.width*I/L.height))}var E=f&&null!=r?r-x:null;null!=E&&E0&&f+i.accumWidth>i.width&&(a=t.split("\n"),h=!0),i.accumWidth=f}else{var g=wrapText(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,o=g.linesWidths,a=g.lines}}else a=t.split("\n");for(var m=0;m=33&&t<=255}var breakCharMap=reduce(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function isWordBreakChar(e){return!isLatin(e)||!!breakCharMap[e]}function wrapText(e,t,n,i,r){for(var a=[],o=[],s="",l="",u=0,c=0,h=0;hn:r+c+d>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),a.push(s),o.push(c-u),l+=p,s="",c=u+=d):(l&&(s+=l,c+=u,l="",u=0),a.push(s),o.push(c),s=p,c=d)):f?(a.push(l),o.push(u),l=p,u=d):(a.push(p),o.push(d)):(c+=d,f?(l+=p,u+=d):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,c+=u),a.push(s),o.push(c),s="",l="",u=0,c=0}return a.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),1===a.length&&(c+=r),{accumWidth:c,lines:a,linesWidths:o}}function parsePercent$1(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}var DEFAULT_RICH_TEXT_COLOR={fill:"#000"},DEFAULT_STROKE_LINE_WIDTH=2,DEFAULT_TEXT_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},ZRText=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=DEFAULT_RICH_TEXT_COLOR,n.attr(t),n}return __extends(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,M=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=i.calculatedLineHeight,I=0;I=0&&"right"===(C=_[I]).align;)this._placeToken(C,e,S,f,A,"right",m),b-=C.width,A-=C.width,I--;for(M+=(n-(M-d)-(g-A)-b)/2;T<=I;)C=_[T],this._placeToken(C,e,S,f,M+C.width/2,"center",m),M+=C.width,T++;f+=S}},t.prototype._placeToken=function(e,t,n,i,r,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=i+n/2;"top"===l?u=i+e.height/2:"bottom"===l&&(u=i+n-e.height/2),!e.isLineHolder&&needDrawBackground(s)&&this._renderBackground(s,t,"right"===a?r-e.width:"center"===a?r-e.width/2:r,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(r=getTextXForPadding(r,a,h),u-=e.height/2-h[0]-e.innerHeight/2);var p=this._getOrCreateChild(TSpan),d=p.createStyle();p.useStyle(d);var f=this._defaultStyle,g=!1,m=0,y=getStroke("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),v=getStroke("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||o||f.autoStroke&&!g?null:(m=DEFAULT_STROKE_LINE_WIDTH,f.stroke)),_=s.textShadowBlur>0||t.textShadowBlur>0;d.text=e.text,d.x=r,d.y=u,_&&(d.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,d.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",d.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,d.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),d.textAlign=a,d.textBaseline="middle",d.font=e.font||DEFAULT_FONT,d.opacity=retrieve3(s.opacity,t.opacity,1),v&&(d.lineWidth=retrieve3(s.lineWidth,t.lineWidth,m),d.lineDash=retrieve2(s.lineDash,t.lineDash),d.lineDashOffset=t.lineDashOffset||0,d.stroke=v),y&&(d.fill=y);var x=e.contentWidth,S=e.contentHeight;p.setBoundingRect(new BoundingRect(adjustTextX(d.x,x,d.textAlign),adjustTextY(d.y,S,d.textBaseline),x,S))},t.prototype._renderBackground=function(e,t,n,i,r,a){var o,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,p=isString(u),d=e.borderRadius,f=this;if(p||c&&h){(o=this._getOrCreateChild(Rect)).useStyle(o.createStyle()),o.style.fill=null;var g=o.shape;g.x=n,g.y=i,g.width=r,g.height=a,g.r=d,o.dirtyShape()}if(p)(l=o.style).fill=u||null,l.fillOpacity=retrieve2(e.fillOpacity,1);else if(u&&u.image){(s=this._getOrCreateChild(ZRImage)).onload=function(){f.dirtyStyle()};var m=s.style;m.image=u.image,m.x=n,m.y=i,m.width=r,m.height=a}c&&h&&((l=o.style).lineWidth=c,l.stroke=h,l.strokeOpacity=retrieve2(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(o||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=retrieve3(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";if(e.fontSize||e.fontFamily||e.fontWeight){var n="";n="string"!=typeof e.fontSize||-1===e.fontSize.indexOf("px")&&-1===e.fontSize.indexOf("rem")&&-1===e.fontSize.indexOf("em")?isNaN(+e.fontSize)?"12px":e.fontSize+"px":e.fontSize,t=[e.fontStyle,e.fontWeight,n,e.fontFamily||"sans-serif"].join(" ")}return t&&trim(t)||e.textFont||e.font},t}(Displayable),VALID_TEXT_ALIGN={left:!0,right:1,center:1},VALID_TEXT_VERTICAL_ALIGN={top:1,bottom:1,middle:1};function normalizeTextStyle(e){return normalizeStyle(e),each(e.rich,normalizeStyle),e}function normalizeStyle(e){if(e){e.font=ZRText.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||VALID_TEXT_ALIGN[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||VALID_TEXT_VERTICAL_ALIGN[n]?n:"top",e.padding&&(e.padding=normalizeCssArray(e.padding))}}function getStroke(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function getFill(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function getTextXForPadding(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function getStyleText(e){var t=e.text;return null!=t&&(t+=""),t}function needDrawBackground(e){return!!(e.backgroundColor||e.borderWidth&&e.borderColor)}var ArcShape=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Arc=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ArcShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(a),u=Math.sin(a);e.moveTo(l*r+n,u*r+i),e.arc(n,i,r,a,o,!s)},t}(Path);Arc.prototype.type="arc";var out=[],BezierCurveShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function someVectorAt(e,t,n){var i=e.cpx2,r=e.cpy2;return null===i||null===r?[(n?cubicDerivativeAt:cubicAt)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?cubicDerivativeAt:cubicAt)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?quadraticDerivativeAt:quadraticAt)(e.x1,e.cpx1,e.x2,t),(n?quadraticDerivativeAt:quadraticAt)(e.y1,e.cpy1,e.y2,t)]}var BezierCurve=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new BezierCurveShape},t.prototype.buildPath=function(e,t){var n=t.x1,i=t.y1,r=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,i),null==l||null==u?(c<1&&(quadraticSubdivide(n,o,r,c,out),o=out[1],r=out[2],quadraticSubdivide(i,s,a,c,out),s=out[1],a=out[2]),e.quadraticCurveTo(o,s,r,a)):(c<1&&(cubicSubdivide(n,o,l,r,c,out),o=out[1],l=out[2],r=out[3],cubicSubdivide(i,s,u,a,c,out),s=out[1],u=out[2],a=out[3]),e.bezierCurveTo(o,s,l,u,r,a)))},t.prototype.pointAt=function(e){return someVectorAt(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=someVectorAt(this.shape,e,!0);return normalize(t,t)},t}(Path);BezierCurve.prototype.type="bezier-curve";var DropletShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Droplet=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new DropletShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i+r),e.bezierCurveTo(n+r,i+r,n+3*r/2,i-r/3,n,i-a),e.bezierCurveTo(n-3*r/2,i-r/3,n-r,i+r,n,i+r),e.closePath()},t}(Path);Droplet.prototype.type="droplet";var HeartShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Heart=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new HeartShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i),e.bezierCurveTo(n+r/2,i-2*a/3,n+2*r,i+a/3,n,i+a),e.bezierCurveTo(n-2*r,i+a/3,n-r/2,i-2*a/3,n,i)},t}(Path);Heart.prototype.type="heart";var PI$3=Math.PI,sin=Math.sin,cos=Math.cos,IsogonShape=function(){this.x=0,this.y=0,this.r=0,this.n=0},Isogon=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new IsogonShape},t.prototype.buildPath=function(e,t){var n=t.n;if(n&&!(n<2)){var i=t.x,r=t.y,a=t.r,o=2*PI$3/n,s=-PI$3/2;e.moveTo(i+a*cos(s),r+a*sin(s));for(var l=0,u=n-1;l4?a*cos$2(2*PI$4/n)/cos$2(PI$4/n):a/3);var s=PI$4/n,l=-PI$4/2,u=i+a*cos$2(l),c=r+a*sin$2(l);l+=s,e.moveTo(u,c);for(var h=0,p=2*n-1,d=void 0;hextent2[1]){if(o=!1,r)return o;var u=Math.abs(extent2[0]-extent[1]),c=Math.abs(extent[0]-extent2[1]);Math.min(u,c)>i.len()&&(u0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},e.prototype.addHover=function(e){},e.prototype.removeHover=function(e){},e.prototype.clearHover=function(){},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},e.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},e.prototype.clearAnimation=function(){this.animation.clear()},e.prototype.getWidth=function(){return this.painter.getWidth()},e.prototype.getHeight=function(){return this.painter.getHeight()},e.prototype.pathToImage=function(e,t){if(this.painter.pathToImage)return this.painter.pathToImage(e,t)},e.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this.handler.off(e,t)},e.prototype.trigger=function(e,t){this.handler.trigger(e,t)},e.prototype.clear=function(){for(var e=this.storage.getRoots(),t=0;t0){if(e<=t[0])return n[0];if(e>=t[1])return n[1]}else{if(e>=t[0])return n[0];if(e<=t[1])return n[1]}else{if(e===t[0])return n[0];if(e===t[1])return n[1]}return(e-t[0])/r*a+n[0]}function parsePercent$2(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?_trim(e).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function round$1(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function asc(e){return e.sort((function(e,t){return e-t})),e}function getPrecision(e){if(e=+e,isNaN(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}function getPrecisionSafe(e){var t=e.toString(),n=t.indexOf("e");if(n>0){var i=+t.slice(n+1);return i<0?-i:0}var r=t.indexOf(".");return r<0?0:t.length-1-r}function getPixelPrecision(e,t){var n=Math.log,i=Math.LN10,r=Math.floor(n(e[1]-e[0])/i),a=Math.round(n(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20}function getPercentWithPrecision(e,t,n){if(!e[t])return 0;var i=reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===i)return 0;for(var r=Math.pow(10,n),a=map(e,(function(e){return(isNaN(e)?0:e)/i*r*100})),o=100*r,s=map(a,(function(e){return Math.floor(e)})),l=reduce(s,(function(e,t){return e+t}),0),u=map(a,(function(e,t){return e-s[t]}));lc&&(c=u[p],h=p);++s[h],u[h]=0,++l}return s[t]/r}var MAX_SAFE_INTEGER=9007199254740991;function remRadian(e){var t=2*Math.PI;return(e%t+t)%t}function isRadianAroundZero(e){return e>-RADIAN_EPSILON&&e=10&&t++,t}function nice(e,t){var n=quantityExponent(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function quantile(e,t){var n=(e.length-1)*t+1,i=Math.floor(n),r=+e[i-1],a=n-i;return a?r+a*(e[i]-r):r}function reformIntervals(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i=0||r&&indexOf(r,s)<0)){var l=n.getShallow(s,t);null!=l&&(a[e[o][0]]=l)}}return a}}var AREA_STYLE_KEY_MAP=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],getAreaStyle=makeStyleMapper(AREA_STYLE_KEY_MAP),AreaStyleMixin=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return getAreaStyle(this,e,t)},e}(),getECData=makeInner(),_highlightNextDigit=1,_highlightKeyMap={},getSavedStates=makeInner(),HOVER_STATE_NORMAL=0,HOVER_STATE_BLUR=1,HOVER_STATE_EMPHASIS=2,SPECIAL_STATES=["emphasis","blur","select"],DISPLAY_STATES=["normal","emphasis","blur","select"],Z2_EMPHASIS_LIFT=10,Z2_SELECT_LIFT=9,HIGHLIGHT_ACTION_TYPE="highlight",DOWNPLAY_ACTION_TYPE="downplay",SELECT_ACTION_TYPE="select",UNSELECT_ACTION_TYPE="unselect",TOGGLE_SELECT_ACTION_TYPE="toggleSelect";function hasFillOrStroke(e){return null!=e&&"none"!==e}var liftedColorCache=new LRU(100);function liftColor(e){if("string"!=typeof e)return e;var t=liftedColorCache.get(e);return t||(t=lift(e,-.1),liftedColorCache.put(e,t)),t}function doChangeHoverState(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function singleEnterEmphasis(e){doChangeHoverState(e,"emphasis",HOVER_STATE_EMPHASIS)}function singleLeaveEmphasis(e){e.hoverState===HOVER_STATE_EMPHASIS&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterBlur(e){doChangeHoverState(e,"blur",HOVER_STATE_BLUR)}function singleLeaveBlur(e){e.hoverState===HOVER_STATE_BLUR&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterSelect(e){e.selected=!0}function singleLeaveSelect(e){e.selected=!1}function updateElementState(e,t,n){t(e,n)}function traverseUpdateState(e,t,n){updateElementState(e,t,n),e.isGroup&&e.traverse((function(e){updateElementState(e,t,n)}))}function setStatesFlag(e,t){switch(t){case"emphasis":e.hoverState=HOVER_STATE_EMPHASIS;break;case"normal":e.hoverState=HOVER_STATE_NORMAL;break;case"blur":e.hoverState=HOVER_STATE_BLUR;break;case"select":e.selected=!0}}function getFromStateStyle(e,t,n,i){for(var r=e.style,a={},o=0;o=0,a=!1;if(e instanceof Path){var o=getSavedStates(e),s=r&&o.selectFill||o.normalFill,l=r&&o.selectStroke||o.normalStroke;if(hasFillOrStroke(s)||hasFillOrStroke(l)){var u=(i=i||{}).style||{};!hasFillOrStroke(u.fill)&&hasFillOrStroke(s)?(a=!0,i=extend({},i),(u=extend({},u)).fill=liftColor(s)):!hasFillOrStroke(u.stroke)&&hasFillOrStroke(l)&&(a||(i=extend({},i),u=extend({},u)),u.stroke=liftColor(l)),i.style=u}}if(i&&null==i.z2){a||(i=extend({},i));var c=e.z2EmphasisLift;i.z2=e.z2+(null!=c?c:Z2_EMPHASIS_LIFT)}return i}function createSelectDefaultState(e,t,n){if(n&&null==n.z2){n=extend({},n);var i=e.z2SelectLift;n.z2=e.z2+(null!=i?i:Z2_SELECT_LIFT)}return n}function createBlurDefaultState(e,t,n){var i=indexOf(e.currentStates,t)>=0,r=e.style.opacity,a=i?null:getFromStateStyle(e,["opacity"],t,{opacity:1}),o=(n=n||{}).style||{};return null==o.opacity&&(n=extend({},n),o=extend({opacity:i?r:.1*a.opacity},o),n.style=o),n}function elementStateProxy(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return createEmphasisDefaultState(this,e,t,n);if("blur"===e)return createBlurDefaultState(this,e,n);if("select"===e)return createSelectDefaultState(this,e,n)}return n}function setDefaultStateProxy(e){e.stateProxy=elementStateProxy;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=elementStateProxy),n&&(n.stateProxy=elementStateProxy)}function enterEmphasisWhenMouseOver(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasisWhenMouseOut(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleLeaveEmphasis)}function enterEmphasis(e,t){e.__highByOuter|=1<<(t||0),traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasis(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&traverseUpdateState(e,singleLeaveEmphasis)}function enterBlur(e){traverseUpdateState(e,singleEnterBlur)}function leaveBlur(e){traverseUpdateState(e,singleLeaveBlur)}function enterSelect(e){traverseUpdateState(e,singleEnterSelect)}function leaveSelect(e){traverseUpdateState(e,singleLeaveSelect)}function shouldSilent(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function allLeaveBlur(e){e.getModel().eachComponent((function(t,n){("series"===t?e.getViewOfSeriesModel(n):e.getViewOfComponentModel(n)).group.traverse((function(e){singleLeaveBlur(e)}))}))}function toggleSeriesBlurState(e,t,n,i,r){var a=i.getModel();function o(e,t){for(var n=0;n0){var a={dataIndex:r,seriesIndex:e.seriesIndex};null!=i&&(a.dataType=i),t.push(a)}}))})),t}function enableHoverEmphasis(e,t,n){setAsHighDownDispatcher(e,!0),traverseUpdateState(e,setDefaultStateProxy),enableHoverFocus(e,t,n)}function enableHoverFocus(e,t,n){var i=getECData(e);null!=t?(i.focus=t,i.blurScope=n):i.focus&&(i.focus=null)}var OTHER_STATES=["emphasis","blur","select"],defaultStyleGetterMap={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function setStatesStylesFromModel(e,t,n,i){n=n||"itemStyle";for(var r=0;r0?l?t.animateFrom(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,scope:e,during:o}):t.animateTo(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,setToFinal:!0,scope:e,during:o}):(t.stopAnimation(),!l&&t.attr(n),a&&a())}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),a&&a()}function updateProps(e,t,n,i,r,a){animateOrSetProps("update",e,t,n,i,r,a)}function initProps(e,t,n,i,r,a){animateOrSetProps("init",e,t,n,i,r,a)}function removeElement(e,t,n,i,r,a){isElementRemoved(e)||animateOrSetProps("remove",e,t,n,i,r,a)}function fadeOutDisplayable(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),removeElement(e,{style:{opacity:0}},t,n,i)}function removeElementWithFadeOut(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||fadeOutDisplayable(e,t,n,i)})):fadeOutDisplayable(e,t,n,i)}function isElementRemoved(e){if(!e.__zr)return!0;for(var t=0;tMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function isNotGroup(e){return!e.isGroup}function isPath(e){return null!=e.shape}function groupTransition(e,t,n){if(e&&t){var i,r=(i={},e.traverse((function(e){isNotGroup(e)&&e.anid&&(i[e.anid]=e)})),i);t.traverse((function(e){if(isNotGroup(e)&&e.anid){var t=r[e.anid];if(t){var i=a(e);e.attr(a(t)),updateProps(e,i,n,getECData(e).dataIndex)}}}))}function a(e){var t={x:e.x,y:e.y,rotation:e.rotation};return isPath(e)&&(t.shape=extend({},e.shape)),t}}function clipPointsByRect(e,t){return map(e,(function(e){var n=e[0];n=mathMax$4(n,t.x),n=mathMin$4(n,t.x+t.width);var i=e[1];return i=mathMax$4(i,t.y),[n,i=mathMin$4(i,t.y+t.height)]}))}function clipRectByRect(e,t){var n=mathMax$4(e.x,t.x),i=mathMin$4(e.x+e.width,t.x+t.width),r=mathMax$4(e.y,t.y),a=mathMin$4(e.y+e.height,t.y+t.height);if(i>=n&&a>=r)return{x:n,y:r,width:i-n,height:a-r}}function createIcon(e,t,n){var i=extend({rectHover:!0},t),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(r.image=e.slice(8),defaults(r,n),new ZRImage(i)):makePath(e.replace("path://",""),i,n,"center")}function linePolygonIntersect(e,t,n,i,r){for(var a=0,o=r[r.length-1];a1)return!1;var m=crossProduct2d(d,f,c,h)/p;return!(m<0||m>1)}function crossProduct2d(e,t,n,i){return e*i-n*t}function nearZero(e){return e<=1e-6&&e>=-1e-6}registerShape("circle",Circle),registerShape("ellipse",Ellipse),registerShape("sector",Sector),registerShape("ring",Ring),registerShape("polygon",Polygon),registerShape("polyline",Polyline),registerShape("rect",Rect),registerShape("line",Line),registerShape("bezierCurve",BezierCurve),registerShape("arc",Arc);var graphic=Object.freeze({__proto__:null,extendShape:extendShape,extendPath:extendPath,registerShape:registerShape,getShapeClass:getShapeClass,makePath:makePath,makeImage:makeImage,mergePath:mergePath$1,resizePath:resizePath,subPixelOptimizeLine:subPixelOptimizeLine$1,subPixelOptimizeRect:subPixelOptimizeRect$1,subPixelOptimize:subPixelOptimize$1,updateProps:updateProps,initProps:initProps,removeElement:removeElement,removeElementWithFadeOut:removeElementWithFadeOut,isElementRemoved:isElementRemoved,getTransform:getTransform,applyTransform:applyTransform$1,transformDirection:transformDirection,groupTransition:groupTransition,clipPointsByRect:clipPointsByRect,clipRectByRect:clipRectByRect,createIcon:createIcon,linePolygonIntersect:linePolygonIntersect,lineLineIntersect:lineLineIntersect,Group:Group,Image:ZRImage,Text:ZRText,Circle:Circle,Ellipse:Ellipse,Sector:Sector,Ring:Ring,Polygon:Polygon,Polyline:Polyline,Rect:Rect,Line:Line,BezierCurve:BezierCurve,Arc:Arc,IncrementalDisplayable:IncrementalDisplayble,CompoundPath:CompoundPath,LinearGradient:LinearGradient,RadialGradient:RadialGradient,BoundingRect:BoundingRect,OrientedBoundingRect:OrientedBoundingRect,Point:Point,Path:Path}),EMPTY_OBJ={};function setLabelText(e,t){for(var n=0;n=0&&n.push(e)})),n}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),each(s,(function(e){indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=n(i,e);indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:i,noEntryList:r}}(i),s=o.graph,l=o.noEntryList,u={};for(each(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],p=!!u[c];p&&(r.call(a,c,h.originalDeps.slice()),delete u[c]),each(h.successor,p?f:d)}each(u,(function(){var e="";throw new Error(e)}))}function d(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,d(e)}}}function inheritDefaultOption(e,t){return merge(merge({},e,!0),t,!0)}var langEN={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Guage",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},langZH={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},LOCALE_ZH="ZH",LOCALE_EN="EN",DEFAULT_LOCALE=LOCALE_EN,localeStorage={},localeModels={},SYSTEM_LANG=env.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase().indexOf(LOCALE_ZH)>-1?LOCALE_ZH:DEFAULT_LOCALE;function registerLocale(e,t){e=e.toUpperCase(),localeModels[e]=new Model(t),localeStorage[e]=t}function createLocaleObject(e){if(isString(e)){var t=localeStorage[e.toUpperCase()]||{};return e===LOCALE_ZH||e===LOCALE_EN?clone(t):merge(clone(t),clone(localeStorage[DEFAULT_LOCALE]),!1)}return merge(clone(e),clone(localeStorage[DEFAULT_LOCALE]),!1)}function getLocaleModel(e){return localeModels[e]}function getDefaultLocaleModel(){return localeModels[DEFAULT_LOCALE]}registerLocale(LOCALE_EN,langEN),registerLocale(LOCALE_ZH,langZH);var ONE_SECOND=1e3,ONE_MINUTE=60*ONE_SECOND,ONE_HOUR=60*ONE_MINUTE,ONE_DAY=24*ONE_HOUR,ONE_YEAR=365*ONE_DAY,defaultLeveledFormatter={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{hh}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}"},fullDayFormatter="{yyyy}-{MM}-{dd}",fullLeveledFormatter={year:"{yyyy}",month:"{yyyy}:{MM}",day:fullDayFormatter,hour:fullDayFormatter+" "+defaultLeveledFormatter.hour,minute:fullDayFormatter+" "+defaultLeveledFormatter.minute,second:fullDayFormatter+" "+defaultLeveledFormatter.second,millisecond:defaultLeveledFormatter.none},primaryTimeUnits=["year","month","day","hour","minute","second","millisecond"],timeUnits=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function pad(e,t){return"0000".substr(0,t-(e+="").length)+e}function getPrimaryTimeUnit(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function isPrimaryTimeUnit(e){return e===getPrimaryTimeUnit(e)}function getDefaultFormatPrecisionOfInterval(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function format(e,t,n,i){var r=parseDate(e),a=r[fullYearGetterName(n)](),o=r[monthGetterName(n)]()+1,s=Math.floor((o-1)/4)+1,l=r[dateGetterName(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[hoursGetterName(n)](),h=(c-1)%12+1,p=r[minutesGetterName(n)](),d=r[secondsGetterName(n)](),f=r[millisecondsGetterName(n)](),g=(i instanceof Model?i:getLocaleModel(i||SYSTEM_LANG)||getDefaultLocaleModel()).getModel("time"),m=g.get("month"),y=g.get("monthAbbr"),v=g.get("dayOfWeek"),_=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,a%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,pad(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,pad(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,pad(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,pad(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,pad(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,pad(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,pad(f,3)).replace(/{S}/g,f+"")}function leveledFormat(e,t,n,i,r){var a=null;if("string"==typeof n)a=n;else if("function"==typeof n)a=n(e.value,t,{level:e.level});else{var o=extend({},defaultLeveledFormatter);if(e.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(isArray(a)){var c=null==e.level?0:e.level>=0?e.level:a.length+e.level;a=a[c=Math.min(c,a.length-1)]}}return format(new Date(e.value),a,r,i)}function getUnitFromValue(e,t){var n=parseDate(e),i=n[monthGetterName(t)]()+1,r=n[dateGetterName(t)](),a=n[hoursGetterName(t)](),o=n[minutesGetterName(t)](),s=n[secondsGetterName(t)](),l=0===n[millisecondsGetterName(t)](),u=l&&0===s,c=u&&0===o,h=c&&0===a,p=h&&1===r;return p&&1===i?"year":p?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function getUnitValue(e,t,n){var i="number"==typeof e?parseDate(e):e;switch(t=t||getUnitFromValue(e,n)){case"year":return i[fullYearGetterName(n)]();case"half-year":return i[monthGetterName(n)]()>=6?1:0;case"quarter":return Math.floor((i[monthGetterName(n)]()+1)/4);case"month":return i[monthGetterName(n)]();case"day":return i[dateGetterName(n)]();case"half-day":return i[hoursGetterName(n)]()/24;case"hour":return i[hoursGetterName(n)]();case"minute":return i[minutesGetterName(n)]();case"second":return i[secondsGetterName(n)]();case"millisecond":return i[millisecondsGetterName(n)]()}}function fullYearGetterName(e){return e?"getUTCFullYear":"getFullYear"}function monthGetterName(e){return e?"getUTCMonth":"getMonth"}function dateGetterName(e){return e?"getUTCDate":"getDate"}function hoursGetterName(e){return e?"getUTCHours":"getHours"}function minutesGetterName(e){return e?"getUTCMinutes":"getMinutes"}function secondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function millisecondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function fullYearSetterName(e){return e?"setUTCFullYear":"setFullYear"}function monthSetterName(e){return e?"setUTCMonth":"setMonth"}function dateSetterName(e){return e?"setUTCDate":"setDate"}function hoursSetterName(e){return e?"setUTCHours":"setHours"}function minutesSetterName(e){return e?"setUTCMinutes":"setMinutes"}function secondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function millisecondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function getTextRect(e,t,n,i,r,a,o,s){return deprecateLog("getTextRect is deprecated."),new ZRText({style:{text:e,font:t,align:n,verticalAlign:i,padding:r,rich:a,overflow:o?"truncate":null,lineHeight:s}}).getBoundingRect()}function addCommas(e){if(!isNumeric(e))return isString(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function toCamelCase(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var normalizeCssArray$1=normalizeCssArray,replaceReg=/([&<>"'])/g,replaceMap={"&":"&","<":"<",">":">",'"':""","'":"'"};function encodeHTML(e){return null==e?"":(e+"").replace(replaceReg,(function(e,t){return replaceMap[t]}))}function makeValueReadable(e,t,n){function i(e){return e&&trim(e)?e:"-"}function r(e){return!(null==e||isNaN(e)||!isFinite(e))}var a="time"===t,o=e instanceof Date;if(a||o){var s=a?parseDate(e):e;if(!isNaN(+s))return format(s,"yyyy-MM-dd hh:mm:ss",n);if(o)return"-"}if("ordinal"===t)return isStringSafe(e)?i(e):isNumber(e)&&r(e)?e+"":"-";var l=numericToNumber(e);return r(l)?addCommas(l):isStringSafe(e)?i(e):"-"}var TPL_VAR_ALIAS=["a","b","c","d","e","f","g"],wrapVar=function(e,t){return"{"+e+(null==t?"":t)+"}"};function formatTpl(e,t,n){isArray(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],a=0;a':'':{renderMode:a,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function formatTime(e,t,n){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var i=parseDate(t),r=n?"UTC":"",a=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),c=i["get"+r+"Seconds"](),h=i["get"+r+"Milliseconds"]();return e=e.replace("MM",pad(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100+"").replace("dd",pad(s,2)).replace("d",s).replace("hh",pad(l,2)).replace("h",l).replace("mm",pad(u,2)).replace("m",u).replace("ss",pad(c,2)).replace("s",c).replace("SSS",pad(h,3))}function capitalFirst(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e}function convertToColorString(e,t){return t=t||"transparent",isString(e)?e:isObject(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function windowOpen(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var formatUtil=Object.freeze({__proto__:null,addCommas:addCommas,toCamelCase:toCamelCase,normalizeCssArray:normalizeCssArray$1,encodeHTML:encodeHTML,makeValueReadable:makeValueReadable,formatTpl:formatTpl,formatTplSimple:formatTplSimple,getTooltipMarker:getTooltipMarker,formatTime:formatTime,capitalFirst:capitalFirst,convertToColorString:convertToColorString,windowOpen:windowOpen,truncateText:truncateText,getTextRect:getTextRect}),each$1=each,LOCATION_PARAMS=["left","right","top","bottom","width","height"],HV_NAMES=[["width","left","right"],["height","top","bottom"]];function boxLayout(e,t,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var c,h,p=l.getBoundingRect(),d=t.childAt(u+1),f=d&&d.getBoundingRect();if("horizontal"===e){var g=p.width+(f?-f.x+p.x:0);(c=a+g)>i||l.newline?(a=0,c=g,o+=s+n,s=p.height):s=Math.max(s,p.height)}else{var m=p.height+(f?-f.y+p.y:0);(h=o+m)>r||l.newline?(a+=s+n,o=0,h=m,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),"horizontal"===e?a=c+n:o=h+n)}))}var box=boxLayout,vbox=curry(boxLayout,"vertical"),hbox=curry(boxLayout,"horizontal");function getAvailableSize(e,t,n){var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r);return(isNaN(a)||isNaN(parseFloat(e.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(e.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=r),n=normalizeCssArray$1(n||0),{width:Math.max(s-a-n[1]-n[3],0),height:Math.max(l-o-n[0]-n[2],0)}}function getLayoutRect(e,t,n){n=normalizeCssArray$1(n||0);var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r),u=parsePercent$2(e.width,i),c=parsePercent$2(e.height,r),h=n[2]+n[0],p=n[1]+n[3],d=e.aspect;switch(isNaN(u)&&(u=i-s-p-a),isNaN(c)&&(c=r-l-h-o),null!=d&&(isNaN(u)&&isNaN(c)&&(d>i/r?u=.8*i:c=.8*r),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=i-s-u-p),isNaN(o)&&(o=r-l-c-h),e.left||e.right){case"center":a=i/2-u/2-n[3];break;case"right":a=i-u-p}switch(e.top||e.bottom){case"middle":case"center":o=r/2-c/2-n[0];break;case"bottom":o=r-c-h}a=a||0,o=o||0,isNaN(u)&&(u=i-p-a-(s||0)),isNaN(c)&&(c=r-h-o-(l||0));var f=new BoundingRect(a+n[3],o+n[0],u,c);return f.margin=n,f}function positionElement(e,t,n,i,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new BoundingRect(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}var c=getLayoutRect(defaults({width:l.width,height:l.height},t),n,i),h=a?c.x-l.x:0,p=o?c.y-l.y:0;"raw"===s?(e.x=h,e.y=p):(e.x+=h,e.y+=p),e.markRedraw()}}function sizeCalculable(e,t){return null!=e[HV_NAMES[t][0]]||null!=e[HV_NAMES[t][1]]&&null!=e[HV_NAMES[t][2]]}function fetchLayoutMode(e){var t=e.layoutMode||e.constructor.layoutMode;return isObject(t)?t:t?{type:t}:null}function mergeLayoutParam(e,t,n){var i=n&&n.ignoreSize;!isArray(i)&&(i=[i,i]);var r=o(HV_NAMES[0],0),a=o(HV_NAMES[1],1);function o(n,r){var a={},o=0,u={},c=0;if(each$1(n,(function(t){u[t]=e[t]})),each$1(n,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&c++})),i[r])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&o){if(o>=2)return a;for(var h=0;h=0;o--)a=merge(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",i=e+"Id";return queryReferringComponents(this.ecModel,e,{index:this.get(n,!0),id:this.get(i,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Model);function getDependencies(e){var t=[];return each(ComponentModel.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=map(t,(function(e){return parseClassType(e).main})),"dataset"!==e&&indexOf(t,"dataset")<=0&&t.unshift("dataset"),t}mountExtend(ComponentModel,Model),enableClassManagement(ComponentModel,{registerWhenExtend:!0}),enableSubTypeDefaulter(ComponentModel),enableTopologicalTravel(ComponentModel,getDependencies);var platform="";"undefined"!=typeof navigator&&(platform=navigator.platform||"");var decalColor="rgba(0, 0, 0, 0.2)",globalDefault={darkMode:"auto",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:decalColor,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:decalColor,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:decalColor,dashArrayX:[1,0],dashArrayY:[4,3],dashLineOffset:0,rotation:-Math.PI/4},{color:decalColor,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:decalColor,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:decalColor,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:platform.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},VISUAL_DIMENSIONS=createHashMap(["tooltip","label","itemName","itemId","seriesName"]),SOURCE_FORMAT_ORIGINAL="original",SOURCE_FORMAT_ARRAY_ROWS="arrayRows",SOURCE_FORMAT_OBJECT_ROWS="objectRows",SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",SOURCE_FORMAT_TYPED_ARRAY="typedArray",SOURCE_FORMAT_UNKNOWN="unknown",SERIES_LAYOUT_BY_COLUMN="column",SERIES_LAYOUT_BY_ROW="row",BE_ORDINAL={Must:1,Might:2,Not:3},innerGlobalModel=makeInner();function resetSourceDefaulter(e){innerGlobalModel(e).datasetMap=createHashMap()}function inheritSourceMetaRawOption(e,t){var n=e?e.metaRawOption:null;return{seriesLayoutBy:retrieve2(t.seriesLayoutBy,n?n.seriesLayoutBy:null),sourceHeader:retrieve2(t.sourceHeader,e?e.startIndex:null),dimensions:retrieve2(t.dimensions,e?e.dimensionsDefine:null)}}function makeSeriesEncodeForAxisCoordSys(e,t,n){var i={},r=querySeriesUpstreamDatasetModel(t);if(!r||!e)return i;var a,o,s=[],l=[],u=t.ecModel,c=innerGlobalModel(u).datasetMap,h=r.uid+"_"+n.seriesLayoutBy;each(e=e.slice(),(function(t,n){var r=isObject(t)?t:e[n]={name:t};"ordinal"===r.type&&null==a&&(a=n,o=f(r)),i[r.name]=[]}));var p=c.get(h)||c.set(h,{categoryWayDim:o,valueWayDim:0});function d(e,t,n){for(var i=0;it)return e[i];return e[n-1]}function getFromPalette(e,t,n,i,r,a,o){var s=t(a=a||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=null!=o&&i?getNearestPalette(i,o):n;if((c=c||n)&&c.length){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}function clearPalette(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var OPTION_INNER_KEY="\0_ec_inner",GlobalModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(e,t,n,i,r,a){i=i||{},this.option=null,this._theme=new Model(i),this._locale=new Model(r),this._optionManager=a},t.prototype.setOption=function(e,t,n){assert(!(OPTION_INNER_KEY in e),"please use chart.getOption()");var i=normalizeSetOptionInput(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,normalizeSetOptionInput(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var r=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(r,t)):initBase(this,r),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var a=i.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||"recreate"===e||"media"===e){var o=i.getMediaOption(this);o.length&&each(o,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,r=this._componentsCount,a=[],o=createHashMap(),s=t&&t.replaceMergeMainTypeMap;resetSourceDefaulter(this),each(e,(function(e,t){null!=e&&(ComponentModel.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=null==n[t]?clone(e):merge(n[t],e,!0))})),s&&s.each((function(e,t){ComponentModel.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))})),ComponentModel.topologicalTravel(a,ComponentModel.getAllClassMainTypes(),(function(t){var a=concatInternalOptions(this,t,normalizeToArray(e[t])),o=i.get(t),l=o?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=mappingToExists(o,a,l);setComponentTypeToKeyInfo(u,t,ComponentModel),n[t]=null,i.set(t,null),r.set(t,0);var c=[],h=[],p=0;each(u,(function(e,n){var i=e.existing,r=e.newOption;if(r){var a=ComponentModel.getClass(t,e.keyInfo.subType,!0);if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var o=extend({componentIndex:n},e.keyInfo);extend(i=new a(r,this,this,o),o),e.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),h.push(i),p++):(c.push(void 0),h.push(void 0))}),this),n[t]=c,i.set(t,h),r.set(t,p),"series"===t&&reCreateSeriesIndices(this)}),this),this._seriesIndices||reCreateSeriesIndices(this)},t.prototype.getOption=function(){var e=clone(this.option);return each(e,(function(t,n){if(ComponentModel.hasClass(n)){for(var i=normalizeToArray(t),r=i.length,a=!1,o=r-1;o>=0;o--)i[o]&&!isComponentIdInternal(i[o])?a=!0:(i[o]=null,!a&&r--);i.length=r,e[n]=i}})),delete e[OPTION_INNER_KEY],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.getLocale=function(e){return this.getLocaleModel().get(e)},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t)for(var r=0;r=t:"max"===n?e<=t:e===t}function indicesEquals(e,t){return e.join(",")===t.join(",")}var each$2=each,isObject$1=isObject,POSSIBLE_STYLES=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function compatEC2ItemStyle(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=POSSIBLE_STYLES.length;n=0;f--){var g=e[f];if(s||(h=g.data.rawIndexOf(g.stackedByDimension,c)),h>=0){var m=g.data.getByRawIndex(g.stackResultDimension,h);if(p>=0&&m>0||p<=0&&m<0){p+=m,d=m;break}}}return i[0]=p,i[1]=d,i}));o.hostModel.setData(l),t.data=l}))}var _a,_b,_c,providerMethods,mountMethods,SourceImpl=function(e){this.data=e.data||(e.sourceFormat===SOURCE_FORMAT_KEYED_COLUMNS?{}:[]),this.sourceFormat=e.sourceFormat||SOURCE_FORMAT_UNKNOWN,this.seriesLayoutBy=e.seriesLayoutBy||SERIES_LAYOUT_BY_COLUMN,this.startIndex=e.startIndex||0,this.dimensionsDefine=e.dimensionsDefine,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.encodeDefine=e.encodeDefine,this.metaRawOption=e.metaRawOption};function isSourceInstance(e){return e instanceof SourceImpl}function createSource(e,t,n,i){n=n||detectSourceFormat(e);var r=t.seriesLayoutBy,a=determineSourceDimensions(e,n,r,t.sourceHeader,t.dimensions);return new SourceImpl({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(i),metaRawOption:clone(t)})}function createSourceFromSeriesDataOption(e){return new SourceImpl({data:e,sourceFormat:isTypedArray(e)?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL})}function cloneSourceShallow(e){return new SourceImpl({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:clone(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(e.encodeDefine)})}function makeEncodeDefine(e){return e?createHashMap(e):null}function detectSourceFormat(e){var t=SOURCE_FORMAT_UNKNOWN;if(isTypedArray(e))t=SOURCE_FORMAT_TYPED_ARRAY;else if(isArray(e)){0===e.length&&(t=SOURCE_FORMAT_ARRAY_ROWS);for(var n=0,i=e.length;nu&&(u=d)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(e){for(var t=0;t=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=this._doReset(i)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(a||p1&&i>0?s:o}};return a;function o(){return t=e?null:at},gte:function(e,t){return e>=t}},FilterOrderComparator=function(){function e(e,t){if("number"!=typeof t){var n="";0,throwError(n)}this._opFn=ORDER_COMPARISON_OP_MAP[e],this._rvalFloat=numericToNumber(t)}return e.prototype.evaluate=function(e){return"number"==typeof e?this._opFn(e,this._rvalFloat):this._opFn(numericToNumber(e),this._rvalFloat)},e}(),SortOrderComparator=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=typeof e,i=typeof t,r="number"===n?e:numericToNumber(e),a="number"===i?t:numericToNumber(t),o=isNaN(r),s=isNaN(a);if(o&&(r=this._incomparable),s&&(a=this._incomparable),o&&s){var l="string"===n,u="string"===i;l&&(r=u?e:0),u&&(a=l?t:0)}return ra?-this._resultLT:0},e}(),FilterEqualityComparator=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=numericToNumber(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=numericToNumber(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function createFilterComparator(e,t){return"eq"===e||"ne"===e?new FilterEqualityComparator("eq"===e,t):hasOwn(ORDER_COMPARISON_OP_MAP,e)?new FilterOrderComparator(e,t):null}var ExternalSource=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return parseDataValue(e,t)},e}();function createExternalSource(e,t){var n=new ExternalSource,i=e.data,r=n.sourceFormat=e.sourceFormat,a=e.startIndex,o=[],s={},l=e.dimensionsDefine;if(l)each(l,(function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};if(o.push(i),null!=n){var r="";hasOwn(s,n)&&throwError(r),s[n]=i}}));else for(var u=0;u9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&this._createSource()},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(isSeries(n)){var a=n,o=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),o=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=isTypedArray(o=a.get("data",!0))?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL,t=[];e=[createSource(o,inheritSourceMetaRawOption(l,this._getSourceMetaRawOption()),s,a.get("encode",!0))]}else{var c=n;if(r){var h=this._applyTransform(i);e=h.sourceList,t=h.upstreamSignList}else{e=[createSource(c.get("source",!0),this._getSourceMetaRawOption(),null,null)],t=[]}}this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var a="";1!==e.length&&doThrow(a)}var o=[],s=[];return each(e,(function(e){e.prepareSource();var t=e.getSource(r||0),n="";null==r||t||doThrow(n),o.push(t),s.push(e._getVersionSign())})),i?t=applyDataTransform(i,o,{datasetIndex:n.componentIndex}):null!=r&&(t=[cloneSourceShallow(o[0])]),{sourceList:t,upstreamSignList:s}},e.prototype._isDirty=function(){if(!this._sourceList.length)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!e.noHeader,i=0;each(e.blocks,(function(e){getBuilder(e).planLayout(e);var t=e.__gapLevelBetweenSubBlocks;t>=i&&(i=t+(!n||t&&("section"!==e.type||e.noHeader)?0:1))})),e.__gapLevelBetweenSubBlocks=i},build:function(e,t,n){var i=t.noHeader,r=getGap(t),a=buildSubBlocks(e,t,i?n:r.html);if(i)return a;var o=makeValueReadable(t.header,"ordinal",e.useUTC);return"richText"===e.renderMode?wrapInlineNameRichText(e,o)+r.richText+a:wrapBlockHTML('
'+encodeHTML(o)+"
"+a,n)}},nameValue:{planLayout:function(e){e.__gapLevelBetweenSubBlocks=0},build:function(e,t,n){var i=e.renderMode,r=t.noName,a=t.noValue,o=!t.markerType,s=t.name,l=t.value,u=e.useUTC;if(!r||!a){var c=o?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),h=r?"":makeValueReadable(s,"ordinal",u),p=t.valueType,d=a?[]:isArray(l)?map(l,(function(e,t){return makeValueReadable(e,isArray(p)?p[t]:p,u)})):[makeValueReadable(l,isArray(p)?p[0]:p,u)],f=!o||!r,g=!o&&r;return"richText"===i?(o?"":c)+(r?"":wrapInlineNameRichText(e,h))+(a?"":wrapInlineValueRichText(e,d,f,g)):wrapBlockHTML((o?"":c)+(r?"":wrapInlineNameHTML(h,!o))+(a?"":wrapInlineValueHTML(d,f,g)),n)}}}};function buildSubBlocks(e,t,n){var i=[],r=t.blocks||[];assert(!r||isArray(r)),r=r||[];var a=e.orderMode;if(t.sortBlocks&&a){r=r.slice();var o={valueAsc:"asc",valueDesc:"desc"};if(hasOwn(o,a)){var s=new SortOrderComparator(o[a],null);r.sort((function(e,t){return s.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===a&&r.reverse()}var l=getGap(t);if(each(r,(function(t,n){var r=getBuilder(t).build(e,t,n>0?l.html:0);null!=r&&i.push(r)})),i.length)return"richText"===e.renderMode?i.join(l.richText):wrapBlockHTML(i.join(""),n)}function buildTooltipMarkup(e,t,n,i,r){if(e){var a=getBuilder(e);a.planLayout(e);var o={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t};return a.build(o,e,0)}}function getGap(e){var t=e.__gapLevelBetweenSubBlocks;return{html:HTML_GAPS[t],richText:RICH_TEXT_GAPS[t]}}function wrapBlockHTML(e,t){return'
'+e+'
'}function wrapInlineNameHTML(e,t){return''+encodeHTML(e)+""}function wrapInlineValueHTML(e,t,n){return''+map(e,(function(e){return encodeHTML(e)})).join("  ")+""}function wrapInlineNameRichText(e,t){return e.markupStyleCreator.wrapRichTextStyle(t,TOOLTIP_TEXT_STYLE_RICH)}function wrapInlineValueRichText(e,t,n,i){var r=[TOOLTIP_VALUE_TEXT_STYLE_RICH],a=i?10:20;return n&&r.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(t.join(" "),r)}function retrieveVisualColorForTooltipMarker(e,t){return convertToColorString(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function getPaddingFromTooltipModel(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var TooltipMarkupStyleCreator=function(){function e(){this.richTextStyles={},this._nextStyleNameId=getRandomIdBase()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i="richText"===n?this._generateStyleName():null,r=getTooltipMarker({color:t,type:e,renderMode:n,markerId:i});return isString(r)?r:(this.richTextStyles[i]=r.style,r.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};isArray(t)?each(t,(function(e){return extend(n,e)})):extend(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}();function defaultSeriesFormatTooltip(e){var t,n,i,r,a=e.series,o=e.dataIndex,s=e.multipleSeries,l=a.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=a.getRawValue(o),p=isArray(h),d=retrieveVisualColorForTooltipMarker(a,o);if(c>1||p&&!c){var f=formatTooltipArrayValue(h,a,o,u,d);t=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);r=t=retrieveRawValue(l,o,u[0]),n=g.type}else r=t=p?h[0]:h;var m=isNameSpecified(a),y=m&&a.name||"",v=l.getName(o),_=s?y:v;return createTooltipMarkup("section",{header:y,noHeader:s||!m,sortParam:r,blocks:[createTooltipMarkup("nameValue",{markerType:"item",markerColor:d,name:_,noName:!trim(_),value:t,valueType:n})].concat(i||[])})}function formatTooltipArrayValue(e,t,n,i,r){var a=t.getData(),o=reduce(e,(function(e,t,n){var i=a.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=a.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(o?u.push(createTooltipMarkup("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?each(i,(function(e){c(retrieveRawValue(a,n,e),e)})):each(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}var inner$1=makeInner();function getSelectionKey(e,t){return e.getName(t)||e.getId(t)}var SeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return __extends(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=createTask({count:dataTaskCount,reset:dataTaskReset}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(inner$1(this).sourceManager=new SourceManager(this)).prepareSource();var i=this.getInitialData(e,n);wrapData(i,this),this.dataTask.context.data=i,inner$1(this).dataBeforeProcessed=i,autoSeriesName(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=fetchLayoutMode(this),i=n?getLayoutParams(e):{},r=this.subType;ComponentModel.hasClass(r)&&(r+="Series"),merge(e,t.getTheme().get(this.subType)),merge(e,this.getDefaultOption()),defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&mergeLayoutParam(e,i,n)},t.prototype.mergeOption=function(e,t){e=merge(this.option,e,!0),this.fillDataTextStyle(e.data);var n=fetchLayoutMode(this);n&&mergeLayoutParam(this.option,e,n);var i=inner$1(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);wrapData(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,inner$1(this).dataBeforeProcessed=r,autoSeriesName(this),this._initSelectedMapFromData(r)},t.prototype.fillDataTextStyle=function(e){if(e&&!isTypedArray(e))for(var t=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,r=PaletteMixin.prototype.getColorFromPalette.call(this,e,t,n);return r||(r=i.getColorFromPalette(e,t,n)),r},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n)for(var i=this.getData(t),r=0;r=0&&n.push(r)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;return n&&n[getSelectionKey(this.getData(t),e)]||!1},t.prototype._innerSelect=function(e,t){var n,i,r=this.option.selectedMode,a=t.length;if(r&&a)if("multiple"===r)for(var o=this.option.selectedMap||(this.option.selectedMap={}),s=0;s0&&this._innerSelect(e,t)}},t.registerClass=function(e){return ComponentModel.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.useColorPaletteOnData=!1,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(ComponentModel);function autoSeriesName(e){var t=e.name;isNameSpecified(e)||(e.name=getSeriesAutoName(e)||t)}function getSeriesAutoName(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),i=[];return each(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)})),i.join(" ")}function dataTaskCount(e){return e.model.getRawData().count()}function dataTaskReset(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),dataTaskProgress}function dataTaskProgress(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function wrapData(e,t){each(__spreadArrays(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,curry(onDataChange,t))}))}function onDataChange(e,t){var n=getCurrentTask(e);return n&&n.setOutputEnd((t||this).count()),t}function getCurrentTask(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(e.uid))}return i}}mixin(SeriesModel,DataFormatMixin),mixin(SeriesModel,PaletteMixin),mountExtend(SeriesModel,ComponentModel);var ComponentView=function(){function e(){this.group=new Group,this.uid=getUID("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.blurSeries=function(e,t){},e}();function createRenderPlanner(){var e=makeInner();return function(t){var n=e(t),i=t.pipelineContext,r=!!n.large,a=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===o&&a===s)&&"reset"}}enableClassExtend(ComponentView),enableClassManagement(ComponentView,{registerWhenExtend:!0});var inner$2=makeInner(),renderPlanner=createRenderPlanner(),ChartView=function(){function e(){this.group=new Group,this.uid=getUID("viewChart"),this.renderTask=createTask({plan:renderTaskPlan,reset:renderTaskReset}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.highlight=function(e,t,n,i){toggleHighlight(e.getData(),i,"emphasis")},e.prototype.downplay=function(e,t,n,i){toggleHighlight(e.getData(),i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.markUpdateMethod=function(e,t){inner$2(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function elSetState(e,t,n){e&&("emphasis"===t?enterEmphasis:leaveEmphasis)(e,n)}function toggleHighlight(e,t,n){var i=queryDataIndex(e,t),r=t&&null!=t.highlightKey?getHighlightDigit(t.highlightKey):null;null!=i?each(normalizeToArray(i),(function(t){elSetState(e.getItemGraphicEl(t),n,r)})):e.eachItemGraphicEl((function(e){elSetState(e,n,r)}))}function renderTaskPlan(e){return renderPlanner(e.model)}function renderTaskReset(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=r&&inner$2(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,n,i,r),progressMethodMap[l]}enableClassExtend(ChartView,["dispose"]),enableClassManagement(ChartView,{registerWhenExtend:!0});var progressMethodMap={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},ORIGIN_METHOD="\0__throttleOriginMethod",RATE="\0__throttleRate",THROTTLE_TYPE="\0__throttleType";function throttle(e,t,n){var i,r,a,o,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(a,o||[])}t=t||0;var p=function(){for(var e=[],p=0;p=0?h():c=setTimeout(h,-r),l=i};return p.clear=function(){c&&(clearTimeout(c),c=null)},p.debounceNextCall=function(e){s=e},p}function createOrUpdate(e,t,n,i){var r=e[t];if(r){var a=r[ORIGIN_METHOD]||r,o=r[THROTTLE_TYPE];if(r[RATE]!==n||o!==i){if(null==n||!i)return e[t]=a;(r=e[t]=throttle(a,n,"debounce"===i))[ORIGIN_METHOD]=a,r[THROTTLE_TYPE]=i,r[RATE]=n}return r}}function clear(e,t){var n=e[t];n&&n[ORIGIN_METHOD]&&(e[t]=n[ORIGIN_METHOD])}var inner$3=makeInner(),defaultStyleMappers={itemStyle:makeStyleMapper(ITEM_STYLE_KEY_MAP,!0),lineStyle:makeStyleMapper(LINE_STYLE_KEY_MAP,!0)},defaultColorKey={lineStyle:"stroke",itemStyle:"fill"};function getStyleMapper(e,t){var n=e.visualStyleMapper||defaultStyleMappers[t];return n||(console.warn("Unkown style type '"+t+"'."),defaultStyleMappers.itemStyle)}function getDefaultColorKey(e,t){var n=e.visualDrawType||defaultColorKey[t];return n||(console.warn("Unkown style type '"+t+"'."),"fill")}var seriesStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),a=getStyleMapper(e,i)(r),o=r.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=getDefaultColorKey(e,i),l=a[s],u=isFunction(l)?l:null;if(a[s]&&!u||(a[s]=e.getColorFromPalette(e.name,null,t.getSeriesCount()),n.setVisual("colorFromPalette",!0)),n.setVisual("style",a),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),r=extend({},a);r[s]=u(i),t.setItemVisual(n,"style",r)}}}},sharedModel=new Model,dataStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=getStyleMapper(e,i),a=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){sharedModel.option=n[i];var o=r(sharedModel);extend(e.ensureUniqueItemVisual(t,"style"),o),sharedModel.option.decal&&(e.setItemVisual(t,"decal",sharedModel.option.decal),sharedModel.option.decal.dirty=!0),a in o&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},dataColorPaletteTask={performRawSeries:!0,overallReset:function(e){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$3(e).scope=n}})),e.eachSeries((function(t){if(t.useColorPaletteOnData&&!e.isSeriesFiltered(t)){var n=t.getRawData(),i={},r=t.getData(),a=inner$3(t).scope,o=t.visualStyleAccessPath||"itemStyle",s=getDefaultColorKey(t,o);r.each((function(e){var t=r.getRawIndex(e);i[t]=e})),n.each((function(e){var o=i[e];if(r.getItemVisual(o,"colorFromPalette")){var l=r.ensureUniqueItemVisual(o,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,a,c)}}))}}))}},PI$5=Math.PI;function defaultLoading(e,t){defaults(t=t||{},{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Group,i=new Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(i);var r,a=t.fontSize+" sans-serif",o=new Rect({style:{fill:"none"},textContent:new ZRText({style:{text:t.text,fill:t.textColor,font:a}}),textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(o),t.showSpinner&&((r=new Arc({shape:{startAngle:-PI$5/2,endAngle:-PI$5/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*PI$5/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*PI$5/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=getWidth(t.text,a),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner?0:n/2),u=e.getHeight()/2;t.showSpinner&&r.setShape({cx:l,cy:u}),o.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var Scheduler=function(){function e(e,t,n,i){this._stageTaskMap=createHashMap(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,r=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=i&&i.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),r=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,a=e.get("large")&&i>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:r,modDataCount:o,large:a}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=createHashMap();e.eachSeries((function(e){var i=e.getProgressive(),r=e.uid;n.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;each(this._allHandlers,(function(i){var r=e.get(i.uid)||e.set(i.uid,{}),a="";assert(!(i.reset&&i.overallReset),a),i.reset&&this._createSeriesStageTask(i,r,t,n),i.overallReset&&this._createOverallStageTask(i,r,t,n)}),this)},e.prototype.prepareView=function(e,t,n,i){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=n,a.api=i,r.__block=!e.incrementalPrepareRender,this._pipe(t,r)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var r=!1,a=this;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}each(e,(function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=a._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,p=c.agentStubMap;p.each((function(e){o(i,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),a.updatePayload(c,n);var d=a.getPerformArgs(c,i.block);p.each((function(e){e.perform(d)})),c.perform(d)&&(r=!0)}else u&&u.each((function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var r=this,a=t.seriesTaskMap,o=t.seriesTaskMap=createHashMap(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=o.set(s,a&&a.get(s)||createTask({plan:seriesTaskPlan,reset:seriesTaskReset,count:seriesTaskCount}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:r},r._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},e.prototype._createOverallStageTask=function(e,t,n,i){var r=this,a=t.overallTask=t.overallTask||createTask({reset:overallTaskReset});a.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var o=a.agentStubMap,s=a.agentStubMap=createHashMap(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,p="";function d(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(h=!0,createTask({reset:stubReset,onDirty:stubOnDirty})));n.context={model:e,overallProgress:c},n.agent=a,n.__block=c,r._pipe(e,n)}assert(!e.createOnAllSeries,p),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,each(n.getSeries(),d)),h&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return isFunction(e)&&(e={overallReset:e,seriesType:detectSeriseType(e)}),e.uid=getUID("stageHandler"),t&&(e.visualType=t),e},e}();function overallTaskReset(e){e.overallReset(e.ecModel,e.api,e.payload)}function stubReset(e){return e.overallProgress&&stubProgress}function stubProgress(){this.agent.dirty(),this.getDownstream().dirty()}function stubOnDirty(){this.agent&&this.agent.dirty()}function seriesTaskPlan(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function seriesTaskReset(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=normalizeToArray(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?map(t,(function(e,t){return makeSeriesTaskProgress(t)})):singleSeriesTaskProgress}var singleSeriesTaskProgress=makeSeriesTaskProgress(0);function makeSeriesTaskProgress(e){return function(t,n){var i=n.data,r=n.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(r)&&(n[r]=e,s=!0),s||(i[r]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,a,"mainType")&&u(s,a,"subType")&&u(s,a,"index","componentIndex")&&u(s,a,"name")&&u(s,a,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,r));function u(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),seriesSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendSymbol&&n.setVisual("legendSymbol",e.legendSymbol),e.hasSymbolVisual){var i=e.get("symbol"),r=e.get("symbolSize"),a=e.get("symbolKeepAspect"),o=e.get("symbolRotate"),s=isFunction(i),l=isFunction(r),u=isFunction(o),c=s||l||u,h=!s&&i?i:e.defaultSymbol,p=l?null:r,d=u?null:o;if(n.setVisual({legendSymbol:e.legendSymbol||h,symbol:h,symbolSize:p,symbolKeepAspect:a,symbolRotate:d}),!t.isSeriesFiltered(e))return{dataEach:c?function(t,n){var a=e.getRawValue(n),c=e.getDataParams(n);s&&t.setItemVisual(n,"symbol",i(a,c)),l&&t.setItemVisual(n,"symbolSize",r(a,c)),u&&t.setItemVisual(n,"symbolRotate",o(a,c))}:null}}}},dataSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){var n=e.getItemModel(t),i=n.getShallow("symbol",!0),r=n.getShallow("symbolSize",!0),a=n.getShallow("symbolRotate",!0),o=n.getShallow("symbolKeepAspect",!0);null!=i&&e.setItemVisual(t,"symbol",i),null!=r&&e.setItemVisual(t,"symbolSize",r),null!=a&&e.setItemVisual(t,"symbolRotate",a),null!=o&&e.setItemVisual(t,"symbolKeepAspect",o)}:null}}};function getItemVisualFromData(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:0}}function getVisualFromData(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:0}}function setItemVisualFromData(e,t,n,i){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=i,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,i);break;default:0}}var PI2$7=2*Math.PI,CMD$4=PathProxy.CMD,DEFAULT_SEARCH_SPACE=["top","right","bottom","left"];function getCandidateAnchor(e,t,n,i,r){var a=n.width,o=n.height;switch(e){case"top":i.set(n.x+a/2,n.y-t),r.set(0,-1);break;case"bottom":i.set(n.x+a/2,n.y+o+t),r.set(0,1);break;case"left":i.set(n.x-t,n.y+o/2),r.set(-1,0);break;case"right":i.set(n.x+a+t,n.y+o/2),r.set(1,0)}}function projectPointToArc(e,t,n,i,r,a,o,s,l){o-=e,s-=t;var u=Math.sqrt(o*o+s*s),c=(o/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(i-r)%PI2$7<1e-4)return l[0]=c,l[1]=h,u-n;if(a){var p=i;i=normalizeRadian(r),r=normalizeRadian(p)}else i=normalizeRadian(i),r=normalizeRadian(r);i>r&&(r+=PI2$7);var d=Math.atan2(s,o);if(d<0&&(d+=PI2$7),d>=i&&d<=r||d+PI2$7>=i&&d+PI2$7<=r)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(i)+e,g=n*Math.sin(i)+t,m=n*Math.cos(r)+e,y=n*Math.sin(r)+t,v=(f-o)*(f-o)+(g-s)*(g-s),_=(m-o)*(m-o)+(y-s)*(y-s);return v<_?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=m,l[1]=y,Math.sqrt(_))}function projectPointToLine(e,t,n,i,r,a,o,s){var l=r-e,u=a-t,c=n-e,h=i-t,p=Math.sqrt(c*c+h*h),d=(l*(c/=p)+u*(h/=p))/p;s&&(d=Math.min(Math.max(d,0),1)),d*=p;var f=o[0]=e+d*c,g=o[1]=t+d*h;return Math.sqrt((f-r)*(f-r)+(g-a)*(g-a))}function projectPointToRect(e,t,n,i,r,a,o){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i);var s=e+n,l=t+i,u=o[0]=Math.min(Math.max(r,e),s),c=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-r)*(u-r)+(c-a)*(c-a))}var tmpPt=[];function nearestPointOnRect(e,t,n){var i=projectPointToRect(t.x,t.y,t.width,t.height,e.x,e.y,tmpPt);return n.set(tmpPt[0],tmpPt[1]),i}function nearestPointOnPath(e,t,n){for(var i,r,a=0,o=0,s=0,l=0,u=1/0,c=t.data,h=e.x,p=e.y,d=0;d0){t=t/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt0,pt1),Point.sub(dir2,pt2,pt1);var n=dir.len(),i=dir2.len();if(!(n<.001||i<.001)){dir.scale(1/n),dir2.scale(1/i);var r=dir.dot(dir2);if(Math.cos(t)1&&Point.copy(tmpProjPoint,pt2),tmpProjPoint.toArray(e[1])}}}}function limitSurfaceAngle(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt1,pt0),Point.sub(dir2,pt2,pt1);var i=dir.len(),r=dir2.len();if(!(i<.001||r<.001))if(dir.scale(1/i),dir2.scale(1/r),dir.dot(t)=o)Point.copy(tmpProjPoint,pt2);else{tmpProjPoint.scaleAndAdd(dir2,a/Math.tan(Math.PI/2-s));var l=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(l))return;l<0?Point.copy(tmpProjPoint,pt1):l>1&&Point.copy(tmpProjPoint,pt2)}tmpProjPoint.toArray(e[1])}}}function setLabelLineState(e,t,n,i){var r="normal"===n,a=r?e:e.ensureState(n);a.ignore=t;var o=i.get("smooth");o&&!0===o&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();r?e.useStyle(s):a.style=s}function buildLabelLinePath(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=dist(i[0],i[1]),a=dist(i[1],i[2]);if(!r||!a)return e.lineTo(i[1][0],i[1][1]),void e.lineTo(i[2][0],i[2][1]);var o=Math.min(r,a)*n,s=lerp([],i[1],i[0],o/r),l=lerp([],i[1],i[2],o/a),u=lerp([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&a&&x(-c/o,0,o);var f,g,m=e[0],y=e[o-1];return v(),f<0&&S(-f,.8),g<0&&S(g,.8),v(),_(f,g,1),_(g,f,-1),v(),f<0&&b(-f),g<0&&b(g),u}function v(){f=m.rect[t]-i,g=r-y.rect[t]-y.rect[n]}function _(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){x(i*n,0,o);var r=i+e;r<0&&S(-r*n,1)}else S(-e*n,1)}}function x(n,i,r){0!==n&&(u=!0);for(var a=i;a0)for(l=0;l0;l--){x(-(a[l-1]*h),l,o)}}}function b(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),i=0;i0?x(n,0,i+1):x(-n,o-i-1,o),(e-=n)<=0)return}}function shiftLayoutOnX(e,t,n,i){return shiftLayout(e,"x","width",t,n,i)}function shiftLayoutOnY(e,t,n,i){return shiftLayout(e,"y","height",t,n,i)}function hideOverlap(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new BoundingRect(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var r=0;r=0&&n.attr(d.oldLayoutSelect),indexOf(u,"emphasis")>=0&&n.attr(d.oldLayoutEmphasis)),updateProps(n,s,t,o)}else if(n.attr(s),!labelInner(n).valueAnimation){var c=retrieve2(n.style.opacity,1);n.style.opacity=0,initProps(n,{style:{opacity:c}},t,o)}if(d.oldLayout=s,n.states.select){var h=d.oldLayoutSelect={};extendWithKeys(h,s,LABEL_LAYOUT_PROPS),extendWithKeys(h,n.states.select,LABEL_LAYOUT_PROPS)}if(n.states.emphasis){var p=d.oldLayoutEmphasis={};extendWithKeys(p,s,LABEL_LAYOUT_PROPS),extendWithKeys(p,n.states.emphasis,LABEL_LAYOUT_PROPS)}animateLabelValue(n,o,l,t)}if(i&&!i.ignore&&!i.invisible){r=(d=labelLineAnimationStore(i)).oldLayout;var d,f={points:i.shape.points};r?(i.attr({shape:r}),updateProps(i,{shape:f},t)):(i.setShape(f),i.style.strokePercent=0,initProps(i,{style:{strokePercent:1}},t)),d.oldLayout=f}},e}();function createLegacyDataSelectAction(e,t){function n(t,n){var i=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){i.push(e.seriesIndex)})),i}each([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,i,r){t=extend({},t),r.dispatchAction(extend(t,{type:e[1],seriesIndex:n(i,t)}))}))}))}function handleSeriesLegacySelectEvents(e,t,n,i,r){var a=e+t;n.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,i=r.selected,o=0;o0?(t=t||1,"dashed"===e?[4*t,2*t]:"dotted"===e?[t]:isNumber(e)?[e]:isArray(e)?e:null):null}var pathProxyForDraw=new PathProxy(!0);function styleHasStroke(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function styleHasFill(e){var t=e.fill;return null!=t&&"none"!==t}function doFillPath(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function doStrokePath(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function createCanvasPattern(e,t,n){var i=createOrUpdateImage(t.image,t.__image,n);if(isImageReady(i)){var r=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix){var a=new DOMMatrix;a.rotateSelf(0,0,(t.rotation||0)/Math.PI*180),a.scaleSelf(t.scaleX||1,t.scaleY||1),a.translateSelf(t.x||0,t.y||0),r.setTransform(a)}return r}}function brushPath(e,t,n,i){var r=styleHasStroke(n),a=styleHasFill(n),o=n.strokePercent,s=o<1,l=!t.path;t.silent&&!s||!l||t.createPathProxy();var u=t.path||pathProxyForDraw;if(!i){var c=n.fill,h=n.stroke,p=a&&!!c.colorStops,d=r&&!!h.colorStops,f=a&&!!c.image,g=r&&!!h.image,m=void 0,y=void 0,v=void 0,_=void 0,x=void 0;(p||d)&&(x=t.getBoundingRect()),p&&(m=t.__dirty?getCanvasGradient(e,c,x):t.__canvasFillGradient,t.__canvasFillGradient=m),d&&(y=t.__dirty?getCanvasGradient(e,h,x):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),f&&(v=t.__dirty||!t.__canvasFillPattern?createCanvasPattern(e,c,t):t.__canvasFillPattern,t.__canvasFillPattern=v),g&&(_=t.__dirty||!t.__canvasStrokePattern?createCanvasPattern(e,h,t):t.__canvasStrokePattern,t.__canvasStrokePattern=v),p?e.fillStyle=m:f&&(v?e.fillStyle=v:a=!1),d?e.strokeStyle=y:g&&(_?e.strokeStyle=_:r=!1)}var S=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),b=n.lineDashOffset,T=!!e.setLineDash,M=t.getGlobalScale();if(u.setScale(M[0],M[1],t.segmentIgnoreThreshold),S){var A=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;A&&1!==A&&(S=map(S,(function(e){return e/A})),b/=A)}var I=!0;(l||t.__dirty&Path.SHAPE_CHANGED_BIT||S&&!T&&r)&&(u.setDPR(e.dpr),s?u.setContext(null):(u.setContext(e),I=!1),u.reset(),S&&!T&&(u.setLineDash(S),u.setLineDashOffset(b)),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),I&&u.rebuildPath(e,s?o:1),S&&T&&(e.setLineDash(S),e.lineDashOffset=b),i||(n.strokeFirst?(r&&doStrokePath(e,n),a&&doFillPath(e,n)):(a&&doFillPath(e,n),r&&doStrokePath(e,n))),S&&T&&e.setLineDash([])}function brushImage(e,t,n){var i=t.__image=createOrUpdateImage(n.image,t.__image,t,t.onload);if(i&&isImageReady(i)){var r=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(null==o&&null!=s?o=s*l:null==s&&null!=o?s=o/l:null==o&&null==s&&(o=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(i,u,c,n.sWidth,n.sHeight,r,a,o,s)}else if(n.sx&&n.sy){var h=o-(u=n.sx),p=s-(c=n.sy);e.drawImage(i,u,c,h,p,r,a,o,s)}else e.drawImage(i,r,a,o,s)}}function brushText(e,t,n){var i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||DEFAULT_FONT,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var r=void 0;if(e.setLineDash){var a=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),o=n.lineDashOffset;if(a){var s=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;s&&1!==s&&(a=map(a,(function(e){return e/s})),o/=s),e.setLineDash(a),e.lineDashOffset=o,r=!0}}n.strokeFirst?(styleHasStroke(n)&&e.strokeText(i,n.x,n.y),styleHasFill(n)&&e.fillText(i,n.x,n.y)):(styleHasFill(n)&&e.fillText(i,n.x,n.y),styleHasStroke(n)&&e.strokeText(i,n.x,n.y)),r&&e.setLineDash([])}}var SHADOW_NUMBER_PROPS=["shadowBlur","shadowOffsetX","shadowOffsetY"],STROKE_PROPS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function bindCommonProps(e,t,n,i,r){var a=!1;if(!i&&t===(n=n||{}))return!1;(i||t.opacity!==n.opacity)&&(a||(flushPathDrawn(e,r),a=!0),e.globalAlpha=null==t.opacity?DEFAULT_COMMON_STYLE.opacity:t.opacity),(i||t.blend!==n.blend)&&(a||(flushPathDrawn(e,r),a=!0),e.globalCompositeOperation=t.blend||DEFAULT_COMMON_STYLE.blend);for(var o=0;o=o)}}for(var c=this.__startIndex;c15)break}n.prevElClipPaths&&l.restore()};if(h)if(0===h.length)d=s.__endIndex;else for(var x=p.dpr,S=0;S0&&e>i[0]){for(s=0;se);s++);o=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var l=o.dom;l.nextSibling?a.insertBefore(t.dom,l.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.__painter=this}else logError("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?EL_AFTER_INCREMENTAL_INC:0),this._needsManuallyCompositing),u.__builtin__||logError("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,t(r),a=u),s.__dirty&Element.REDARAW_BIT&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}t(r),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,each(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?merge(n[e],t,!0):n[e]=t;for(var i=0;i0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.setOption=function(e,t,n){if(this._disposed)disposedWarning(this.id);else{var i,r,a;if(isObject$2(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,a=t.transition,t=t.notMerge),this[IN_MAIN_PROCESS_KEY]=!0,!this._model||t){var o=new OptionManager(this._api),s=this._theme,l=this._model=new GlobalModel;l.scheduler=this._scheduler,l.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:r},optionPreprocessorFuncs),setTransitionOpt(this,a),n?(this[OPTION_UPDATED_KEY]={silent:i},this[IN_MAIN_PROCESS_KEY]=!1,this.getZr().wakeUp()):(prepare(this),updateMethods.update.call(this),this._zr.flush(),this[OPTION_UPDATED_KEY]=!1,this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i))}},t.prototype.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){if(env.canvasSupported)return(e=extend({},e||{})).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},t.prototype.getSvgDataURL=function(){if(env.svgSupported){var e=this._zr;return each(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,i=[],r=this;each$3(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return each$3(i,(function(e){e.group.ignore=!1})),a}disposedWarning(this.id)},t.prototype.getConnectedDataURL=function(e){if(this._disposed)disposedWarning(this.id);else if(env.canvasSupported){var t="svg"===e.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(connectedGroups[n]){var o=a,s=a,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||1;each(instances$1,(function(a,h){if(a.group===n){var p=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(clone(e)),d=a.getDom().getBoundingClientRect();o=i(d.left,o),s=i(d.top,s),l=r(d.right,l),u=r(d.bottom,u),c.push({dom:p,left:d.left,top:d.top})}}));var p=(l*=h)-(o*=h),d=(u*=h)-(s*=h),f=createCanvas(),g=init(f,{renderer:t?"svg":"canvas"});if(g.resize({width:p,height:d}),t){var m="";return each$3(c,(function(e){var t=e.left-o,n=e.top-s;m+=''+e.dom+""})),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new Rect({shape:{x:0,y:0,width:p,height:d},style:{fill:e.connectedBackgroundColor}})),each$3(c,(function(e){var t=new ZRImage({style:{x:e.left*h-o,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},t.prototype.convertToPixel=function(e,t){return doConvertPixel(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return doConvertPixel(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return each(parseFinder(this._model,e),(function(e,i){i.indexOf("Models")>=0&&each(e,(function(e){var r=e.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(t);else if("seriesModels"===i){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n=n||a.containPoint(t,e))}else 0}),this)}),this),!!n;disposedWarning(this.id)},t.prototype.getVisual=function(e,t){var n=parseFinder(this._model,e,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),a=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=a?getItemVisualFromData(r,a,t):getVisualFromData(r,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;each$3(MOUSE_EVENT_NAMES,(function(t){var n=function(n){var i,r=e.getModel(),a=n.target,o="globalout"===t;if(o?i={}:a&&findEventDispatcher(a,(function(e){var t=getECData(e);if(t&&null!=t.dataIndex){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return i=n&&n.getDataParams(t.dataIndex,t.dataType)||{},!0}if(t.eventData)return i=extend({},t.eventData),!0}),!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),c=u&&e["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,i.event=n,i.type=t,e._$eventProcessor.eventInfo={targetEl:a,packedEvent:i,model:u,view:c},e.trigger(t,i)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)})),each$3(eventActionMap,(function(t,n){e._messageCenter.on(n,(function(e){this.trigger(n,e)}),e)})),each$3(["selectchanged"],(function(t){e._messageCenter.on(t,(function(e){this.trigger(t,e)}),e)})),handleLegacySelectEvents(this._messageCenter,this,this._model)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?disposedWarning(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)disposedWarning(this.id);else{this._disposed=!0,setAttribute(this.getDom(),DOM_ATTRIBUTE_KEY,"");var e=this._api,t=this._model;each$3(this._componentsViews,(function(n){n.dispose(t,e)})),each$3(this._chartsViews,(function(n){n.dispose(t,e)})),this._zr.dispose(),delete instances$1[this.id]}},t.prototype.resize=function(e){if(this._disposed)disposedWarning(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[IN_MAIN_PROCESS_KEY]=!0,n&&prepare(this),updateMethods.update.call(this,{type:"resize",animation:{duration:0}}),this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),loadingEffects[e]){var n=loadingEffects[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?disposedWarning(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=extend({},e);return t.type=eventActionMap[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(t)||(t={silent:!!t}),actions[e.type]&&this._model)if(this[IN_MAIN_PROCESS_KEY])this._pendingActions.push(e);else{var n=t.silent;doDispatchAction.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&env.browser.weChat&&this._throttledZrFlush(),flushPendingActions.call(this,n),triggerUpdatedEvent.call(this,n)}},t.prototype.updateLabelLayout=function(){var e=this._labelManager;e.updateLayoutConfig(this._api),e.layout(this._api),e.processLabelsOverall()},t.prototype.appendData=function(e){if(this._disposed)disposedWarning(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);0,n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){for(var t=[],n=e.currentStates,i=0;i0?{duration:a,delay:i.get("delay"),easing:i.get("easing")}:null;n.group.traverse((function(t){if(t.states&&t.states.emphasis){if(isElementRemoved(t))return;if(t instanceof Path&&savePathStates(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=o;var i=t.getTextContent(),a=t.getTextGuideLine();i&&(i.stateTransition=o),a&&(a.stateTransition=o)}t.__dirty&&e(t)}}))}prepare=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),prepareView(e,!0),prepareView(e,!1),t.plan()},prepareView=function(e,t){for(var n=e._model,i=e._scheduler,r=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,l=0;lt.get("hoverLayerThreshold")&&!env.node&&!env.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.group.traverse((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,r)},performPostUpdateFuncs=function(e,t){each$3(postUpdateFuncs,(function(n){n(e,t)}))},markStatusToUpdate=function(e){e[STATUS_NEEDS_UPDATE_KEY]=!0,e.getZr().wakeUp()},applyChangedStates=function(t){t[STATUS_NEEDS_UPDATE_KEY]&&(t.getZr().storage.traverse((function(t){isElementRemoved(t)||e(t)})),t[STATUS_NEEDS_UPDATE_KEY]=!1)},createExtensionAPI=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){enterEmphasis(t,n),markStatusToUpdate(e)},n.prototype.leaveEmphasis=function(t,n){leaveEmphasis(t,n),markStatusToUpdate(e)},n.prototype.enterBlur=function(t){enterBlur(t),markStatusToUpdate(e)},n.prototype.leaveBlur=function(t){leaveBlur(t),markStatusToUpdate(e)},n.prototype.enterSelect=function(t){enterSelect(t),markStatusToUpdate(e)},n.prototype.leaveSelect=function(t){leaveSelect(t),markStatusToUpdate(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(ExtensionAPI))(e)},enableConnect=function(e){function t(e,t){for(var n=0;n1){var u=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(u,a)}else 1===l?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(r,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},r=[],a=[];this._initIndexMap(e,n,r,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),i[s]=null;else if(c>1)for(var p=0;p1)for(var o=0;oy[1]&&(y[1]=m)}t&&(this._nameList[d]=t[f],this._dontMakeIdFromName||makeIdFromName(this,d))}this._rawCount=this._count=s,this._extent={},prepareInvertedIndex(this)},e.prototype._initDataFromProvider=function(e,t,n){if(!(e>=t)){for(var i=this._rawData,r=this._storage,a=this.dimensions,o=a.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,c=this._rawExtent,h=i.getSource().sourceFormat===SOURCE_FORMAT_ORIGINAL,p=0;pS[1]&&(S[1]=x)}if(h&&!i.pure&&m){var b=m.name;null==l[y]&&null!=b&&(l[y]=convertOptionIdName(b,null));var T=m.id;null==u[y]&&null!=T&&(u[y]=convertOptionIdName(T,null))}this._dontMakeIdFromName||makeIdFromName(this,y)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent={},prepareInvertedIndex(this)}},e.prototype.count=function(){return this._count},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var r=0;r=0&&t=0&&t=0&&to&&(o=l)}return i=[a,o],this._extent[e]=i,i},e.prototype.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){isObject$3(e)?extend(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getSum=function(e){var t=0;if(this._storage[e])for(var n=0,i=this.count();n=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&ne))return a;r=a-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._storage[e],r=[];if(!i)return r;null==n&&(n=1/0);for(var a=1/0,o=-1,s=0,l=0,u=this.count();l=0&&o<0)&&(a=h,o=c,s=0),c===o&&(r[s++]=l))}return r.length=s,r},e.prototype.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],n=0;n=h&&S<=p||isNaN(S))&&(s[l++]=g),g++}f=!0}else if(2===a){m=d[c[0]];var v=d[c[1]],_=e[i[1]][0],x=e[i[1]][1];for(y=0;y=h&&S<=p||isNaN(S))&&(b>=_&&b<=x||isNaN(b))&&(s[l++]=g),g++}f=!0}}if(!f)if(1===a)for(y=0;y=h&&S<=p||isNaN(S))&&(s[l++]=T)}else for(y=0;ye[I][1])&&(M=!1)}M&&(s[l++]=this.getRawIndex(y))}return lx[1]&&(x[1]=_)}}}return o},e.prototype.downSample=function(e,t,n,i){for(var r=cloneListForMapAndSample(this,[e]),a=r._storage,o=[],s=mathFloor(1/t),l=a[e],u=this.count(),c=r._rawExtent[e],h=new(getIndicesCtor(this))(u),p=0,d=0;du-d&&(s=u-d,o.length=s);for(var f=0;fc[1]&&(c[1]=m),h[p++]=y}return r._count=p,r._indices=h,r.getRawIndex=getRawIndexWithIndices,r},e.prototype.lttbDownSample=function(e,t){var n,i,r,a=cloneListForMapAndSample(this,[]),o=a._storage[e],s=this.count(),l=new(getIndicesCtor(this))(s),u=0,c=mathFloor(1/t),h=this.getRawIndex(0);l[u++]=h;for(var p=1;pn&&(n=i,r=T)}l[u++]=r,h=r}return l[u++]=this.getRawIndex(s-1),a._count=u,a._indices=l,a.getRawIndex=getRawIndexWithIndices,a},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new Model(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new DataDiffer(e?e.getIndices():[],this.getIndices(),(function(t){return getId(e,t)}),(function(e){return getId(t,e)}))},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},isObject$3(e)?extend(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],i=n&&n[t];return null==i?this.getVisual(t):i},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var r=i[t];return null==r&&(isArray(r=this.getVisual(t))?r=r.slice():isObject$3(r)&&(r=extend({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,isObject$3(t)?extend(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){if(isObject$3(e))for(var n in e)e.hasOwnProperty(n)&&this.setLayout(n,e[n]);else this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?extend(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel;if(t){var i=getECData(t);i.dataIndex=e,i.dataType=this.dataType,i.seriesIndex=n&&n.seriesIndex,"group"===t.type&&t.traverse(setItemDataAndSeriesIndex,t)}this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){each(this._graphicEls,(function(n,i){n&&e&&e.call(t,n,i)}))},e.prototype.cloneShallow=function(t){t||(t=new e(map$1(this.dimensions,this.getDimensionInfo,this),this.hostModel));if(t._storage=this._storage,t._storageArr=this._storageArr,transferProperties(t,this),this._indices){var n=this._indices.constructor;if(n===Array){var i=this._indices.length;t._indices=new n(i);for(var r=0;r65535?CtorUint32Array:CtorUint16Array},prepareStorage=function(e,t,n,i){var r=dataCtors[t.type],a=t.name;if(i){var o=e[a],s=o&&o.length;if(s!==n){for(var l=new r(n),u=0;u=0?this._indices[e]:-1},getId=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=getIdNameFromStore(e,e._idDimIdx,e._idOrdinalMeta,t)),null==n&&(n=ID_PREFIX+t),n},normalizeDimensions=function(e){return isArray(e)||(e=null!=e?[e]:[]),e},validateDimensions=function(e,t){for(var n=0;n=0?(s[h]=(a=l[h],o=void 0,(o=a.constructor)===Array?a.slice():new o(a)),r._rawExtent[h]=getInitialExtent(),r._extent[h]=null):s[h]=l[h],u.push(s[h]))}return r},getInitialExtent=function(){return[1/0,-1/0]},setItemDataAndSeriesIndex=function(e){var t=getECData(e),n=getECData(this);t.seriesIndex=n.seriesIndex,t.dataIndex=n.dataIndex,t.dataType=n.dataType},transferProperties=function(e,t){each(TRANSFERABLE_PROPERTIES.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,each(CLONE_PROPERTIES,(function(n){e[n]=clone(t[n])})),e._calculationInfo=extend({},t._calculationInfo)},makeIdFromName=function(e,t){var n=e._nameList,i=e._idList,r=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=i[t];if(null==o&&null!=r&&(n[t]=o=getIdNameFromStore(e,r,e._nameOrdinalMeta,t)),null==s&&null!=a&&(i[t]=s=getIdNameFromStore(e,a,e._idOrdinalMeta,t)),null==s&&null!=o){var l=e._nameRepeatCount,u=l[o]=(l[o]||0)+1;s=o,u>1&&(s+="__ec__"+u),i[t]=s}}}(),e}();function completeDimensions(e,t,n){isSourceInstance(t)||(t=createSourceFromSeriesDataOption(t)),n=n||{},e=(e||[]).slice();for(var i=(n.dimsDef||[]).slice(),r=createHashMap(),a=createHashMap(),o=[],s=getDimCount(t,e,i,n.dimCount),l=0;lt[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();enableClassManagement(Scale,{registerWhenExtend:!0});var OrdinalMeta=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&map(i,getName);return new e({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if("string"!=typeof e&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=createHashMap(this.categories))},e}();function getName(e){return isObject(e)&&null!=e.value?e.value:e+""}var roundNumber=round$1;function intervalScaleNiceTicks(e,t,n,i){var r={},a=e[1]-e[0],o=r.interval=nice(a/t,!0);null!=n&&oi&&(o=r.interval=i);var s=r.intervalPrecision=getIntervalPrecision(o);return fixExtent(r.niceTickExtent=[roundNumber(Math.ceil(e[0]/o)*o,s),roundNumber(Math.floor(e[1]/o)*o,s)],e),r}function getIntervalPrecision(e){return getPrecisionSafe(e)+2}function clamp(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function fixExtent(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),clamp(e,0,t),clamp(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function contain$1(e,t){return e>=t[0]&&e<=t[1]}function normalize$1(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function scale$2(e,t){return e*(t[1]-t[0])+t[0]}var OrdinalScale=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new OrdinalMeta({})),isArray(i)&&(i=new OrdinalMeta({categories:map(i,(function(e){return isObject(e)?e.value:e}))})),n._ordinalMeta=i,n._categorySortInfo=[],n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return __extends(t,e),t.prototype.parse=function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return contain$1(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return normalize$1(e=this.getCategoryIndex(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=this.getCategoryIndex(e),Math.round(scale$2(e,this._extent))},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:this.getCategoryIndex(n)}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setCategorySortInfo=function(e){this._categorySortInfo=e},t.prototype.getCategorySortInfo=function(){return this._categorySortInfo},t.prototype.getCategoryIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].beforeSortIndex:e},t.prototype.getRawIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].ordinalNumber:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawIndex(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this.getCategoryIndex(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.niceTicks=function(){},t.prototype.niceExtent=function(){},t.type="ordinal",t}(Scale);Scale.registerClass(OrdinalScale);var roundNumber$1=round$1,IntervalScale=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return __extends(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e,this._extent)},t.prototype.normalize=function(e){return normalize$1(e,this._extent)},t.prototype.scale=function(e){return scale$2(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=getIntervalPrecision(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;n[0]1e4)return[];var s=a.length?a[a.length-1].value:i[1];return n[1]>s&&(e?a.push({value:roundNumber$1(s+t,r)}):a.push({value:n[1]})),a},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&c0&&(a=null===a?s:Math.min(a,s))}n[i]=a}}return n}function makeColumnLayout(e){var t=getValueAxesMinGaps(e),n=[];return each(e,(function(e){var i,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),c=Math.abs(u[1]-u[0]);i=s?l/c*s:l}else{var h=e.getData();i=Math.abs(a[1]-a[0])/h.count()}var p=parsePercent$2(e.get("barWidth"),i),d=parsePercent$2(e.get("barMaxWidth"),i),f=parsePercent$2(e.get("barMinWidth")||1,i),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:getAxisKey(r),stackId:getSeriesStackId(e)})})),doCalBarWidthAndOffset(n)}function doCalBarWidthAndOffset(e){var t={};each(e,(function(e,n){var i=e.axisKey,r=e.bandWidth,a=t[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=a.stacks;t[i]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var c=e.barMinWidth;c&&(o[s].minWidth=c);var h=e.barGap;null!=h&&(a.gap=h);var p=e.barCategoryGap;null!=p&&(a.categoryGap=p)}));var n={};return each(t,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=e.categoryGap;if(null==a){var o=keys(i).length;a=Math.max(35-4*o,15)+"%"}var s=parsePercent$2(a,r),l=parsePercent$2(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),each(i,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,u-=i+l*i,c--}else{var i=h;t&&ti&&(i=n),i!==h&&(e.width=i,u-=i+l*i,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var p,d=0;each(i,(function(e,t){e.width||(e.width=h),p=e,d+=e.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;each(i,(function(e,i){n[t][i]=n[t][i]||{bandWidth:r,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function retrieveColumnLayout(e,t,n){if(e&&t){var i=e[getAxisKey(t)];return null!=i&&null!=n?i[getSeriesStackId(n)]:i}}function layout(e,t){var n=prepareLayoutBarSeries(e,t),i=makeColumnLayout(n),r={};each(n,(function(e){var t=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),o=getSeriesStackId(e),s=i[getAxisKey(a)][o],l=s.offset,u=s.width,c=n.getOtherAxis(a),h=e.get("barMinHeight")||0;r[o]=r[o]||[],t.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var p=t.mapDimension(c.dim),d=t.mapDimension(a.dim),f=isDimensionStacked(t,p),g=c.isHorizontal(),m=getValueAxisStart(a,c),y=0,v=t.count();y=0?"p":"n",b=m;f&&(r[o][x]||(r[o][x]={p:m,n:m}),b=r[o][x][S]);var T,M=void 0,A=void 0,I=void 0,C=void 0;if(g)M=b,A=(T=n.dataToPoint([_,x]))[1]+l,I=T[0]-m,C=u,Math.abs(I)LARGE_BAR_MIN_WIDTH||(c=LARGE_BAR_MIN_WIDTH),{progress:function(e,t){for(var h,p=e.count,d=new LargeArr(2*p),f=new LargeArr(2*p),g=new LargeArr(p),m=[],y=[],v=0,_=0;null!=(h=e.next());)y[u]=t.get(o,h),y[1-u]=t.get(s,h),m=n.dataToPoint(y,null,m),f[v]=l?i.x+i.width:m[0],d[v++]=m[0],f[v]=l?m[1]:i.y+i.height,d[v++]=m[1],g[_++]=h;t.setLayout({largePoints:d,largeDataIndices:g,largeBackgroundPoints:f,barWidth:c,valueAxisStart:getValueAxisStart(r,a),backgroundStart:l?i.x:i.y,valueAxisHorizontal:l})}}}}};function isOnCartesian(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function isInLargeMode(e){return e.pipelineContext&&e.pipelineContext.large}function getValueAxisStart(e,t,n){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var bisect=function(e,t,n,i){for(;n>>1;e[r][1]n&&(this._approxInterval=n);var a=scaleIntervals.length,o=Math.min(bisect(scaleIntervals,this._approxInterval,0,a),a-1);this._interval=scaleIntervals[o][1],this._minLevelUnit=scaleIntervals[Math.max(o-1,0)][0]},t.prototype.parse=function(e){return"number"==typeof e?e:+parseDate(e)},t.prototype.contain=function(e){return contain$1(this.parse(e),this._extent)},t.prototype.normalize=function(e){return normalize$1(this.parse(e),this._extent)},t.prototype.scale=function(e){return scale$2(e,this._extent)},t.type="time",t}(IntervalScale),scaleIntervals=[["second",ONE_SECOND],["minute",ONE_MINUTE],["hour",ONE_HOUR],["quarter-day",6*ONE_HOUR],["half-day",12*ONE_HOUR],["day",1.2*ONE_DAY],["half-week",3.5*ONE_DAY],["week",7*ONE_DAY],["month",31*ONE_DAY],["quarter",95*ONE_DAY],["half-year",ONE_YEAR/2],["year",ONE_YEAR]];function isUnitValueSame(e,t,n,i){var r=parseDate(t),a=parseDate(n),o=function(e){return getUnitValue(r,e,i)===getUnitValue(a,e,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},h=function(){return c()&&o("minute")},p=function(){return h()&&o("second")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return p();case"millisecond":return p()&&o("millisecond")}}function getDateInterval(e,t){return(e/=ONE_DAY)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function getMonthInterval(e){return(e/=30*ONE_DAY)>6?6:e>3?3:e>2?2:1}function getHourInterval(e){return(e/=ONE_HOUR)>12?12:e>6?6:e>3.5?4:e>2?2:1}function getMinutesAndSecondsInterval(e,t){return(e/=t?ONE_MINUTE:ONE_SECOND)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function getMillisecondsInterval(e){return nice(e,!0)}function getFirstTimestampOfUnit(e,t,n){var i=new Date(e);switch(getPrimaryTimeUnit(t)){case"year":case"month":i[monthSetterName(n)](0);case"day":i[dateSetterName(n)](1);case"hour":i[hoursSetterName(n)](0);case"minute":i[minutesSetterName(n)](0);case"second":i[secondsSetterName(n)](0),i[millisecondsSetterName(n)](0)}return i.getTime()}function getIntervalTicks(e,t,n,i){var r=timeUnits,a=0;function o(e,t,n,r,a,o,s){for(var l=new Date(t),u=t,c=l[r]();u1&&0===u&&a.unshift({value:a[0].value-p})}}for(u=0;u=i[0]&&m<=i[1]&&c++)}var y=(i[1]-i[0])/t;if(c>1.5*y&&h>y/1.5)break;if(l.push(f),c>y||e===r[p])break}u=[]}}var v=filter(map(l,(function(e){return filter(e,(function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd}))})),(function(e){return e.length>0})),_=[],x=v.length-1;for(p=0;p0;)i*=10;var r=[round$1(mathCeil(t[0]/i)*i),round$1(mathFloor$1(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.niceExtent=function(e){intervalScaleProto.niceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.normalize=function(e){return normalize$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.scale=function(e){return e=scale$2(e,this._extent),mathPow$1(this.base,e)},t.type="log",t}(Scale),proto=LogScale.prototype;function fixRoundingError(e,t){return roundingErrorFix(e,getPrecisionSafe$1(t))}proto.getMinorTicks=intervalScaleProto.getMinorTicks,proto.getLabel=intervalScaleProto.getLabel,Scale.registerClass(LogScale);var ScaleRawExtentInfo=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]s&&(o=NaN,s=NaN);var c=eqNaN(o)||eqNaN(s)||e&&!i;this._needCrossZero&&(o>0&&s>0&&!l&&(o=0),o<0&&s<0&&!u&&(s=0));var h=this._determinedMin,p=this._determinedMax;return null!=h&&(o=h,l=!0),null!=p&&(s=p,u=!0),{min:o,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[DATA_MIN_MAX_ATTR[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=DETERMINED_MIN_MAX_ATTR[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),DETERMINED_MIN_MAX_ATTR={min:"_determinedMin",max:"_determinedMax"},DATA_MIN_MAX_ATTR={min:"_dataMin",max:"_dataMax"};function ensureScaleRawExtentInfo(e,t,n){var i=e.rawExtentInfo;return i||(i=new ScaleRawExtentInfo(e,t,n),e.rawExtentInfo=i,i)}function parseAxisModelMinMax(e,t){return null==t?null:eqNaN(t)?NaN:e.parse(t)}function getScaleExtent(e,t){var n=e.type,i=ensureScaleRawExtentInfo(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var r=i.min,a=i.max,o=t.ecModel;if(o&&"time"===n){var s=prepareLayoutBarSeries("bar",o),l=!1;if(each(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=makeColumnLayout(s),c=adjustScaleForOverflow(r,a,t,u);r=c.min,a=c.max}}return{extent:[r,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function adjustScaleForOverflow(e,t,n,i){var r=n.axis.getExtent(),a=r[1]-r[0],o=retrieveColumnLayout(i,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=c/(1-(s+l)/a)-c;return{min:e-=h*(s/u),max:t+=h*(l/u)}}function niceScaleExtent(e,t){var n=getScaleExtent(e,t),i=n.extent,r=t.get("splitNumber");e instanceof LogScale&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(i[0],i[1]),e.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)}function createScaleByModel(e,t){if(t=t||e.get("type"))switch(t){case"category":return new OrdinalScale({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new TimeScale({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Scale.getClass(t)||IntervalScale)}}function ifAxisCrossZero(e){var t=e.scale.getExtent(),n=t[0],i=t[1];return!(n>0&&i>0||n<0&&i<0)}function makeLabelFormatter(e){var t,n,i=e.getLabelModel().get("formatter"),r="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=i,function(t,i){return e.scale.getFormattedLabel(t,i,n)}):"string"==typeof i?function(t){return function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(i):"function"==typeof i?(t=i,function(n,i){return null!=r&&(i=n.value-r),t(getAxisRawValue(e,n),i,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function getAxisRawValue(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function estimateLabelUnionRect(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var i,r,a=n.getExtent();r=n instanceof OrdinalScale?n.count():(i=n.getTicks()).length;var o,s=e.getLabelModel(),l=makeLabelFormatter(e),u=1;r>40&&(u=Math.ceil(r/40));for(var c=0;ce[1]&&(e[1]=i[1])}))}var AxisModelCommonMixin=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function createList(e){return createListFromArray(e.getSource(),e)}var dataStack$1={isDimensionStacked:isDimensionStacked,enableDataStack:enableDataStack,getStackedDimension:getStackedDimension};function createScale(e,t){var n=t;t instanceof Model||(n=new Model(t));var i=createScaleByModel(n);return i.setExtent(e[0],e[1]),niceScaleExtent(i,n),i}function mixinAxisModelCommonMethods(e){mixin(e,AxisModelCommonMixin)}var helper=Object.freeze({__proto__:null,createList:createList,getLayoutRect:getLayoutRect,dataStack:dataStack$1,createScale:createScale,mixinAxisModelCommonMethods:mixinAxisModelCommonMethods,getECData:getECData,createDimensions:createDimensions,createSymbol:createSymbol}),EPSILON$3=1e-8;function isAroundEqual$1(e,t){return Math.abs(e-t)>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,i.push([s/n,l/n])}return i}function parseGeoJSON(e,t){return map(filter((e=decode(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,i=e.geometry,r=[];if("Polygon"===i.type){var a=i.coordinates;r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)})}"MultiPolygon"===i.type&&each(a=i.coordinates,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new Region(n[t||"name"],r,n.cp);return o.properties=n,o}))}var inner$4=makeInner();function createAxisLabels(e){return"category"===e.type?makeCategoryLabels(e):makeRealNumberLabels(e)}function createAxisTicks(e,t){return"category"===e.type?makeCategoryTicks(e,t):{ticks:map(e.scale.getTicks(),(function(e){return e.value}))}}function makeCategoryLabels(e){var t=e.getLabelModel(),n=makeCategoryLabelsActually(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function makeCategoryLabelsActually(e,t){var n,i=getListCache(e,"labels"),r=getOptionCategoryInterval(t),a=listCacheGet(i,r);return a||listCacheSet(i,r,{labels:isFunction(r)?makeLabelsByCustomizedCategoryInterval(e,r):makeLabelsByNumericCategoryInterval(e,n="auto"===r?makeAutoCategoryInterval(e):r),labelCategoryInterval:n})}function makeCategoryTicks(e,t){var n,i,r=getListCache(e,"ticks"),a=getOptionCategoryInterval(t),o=listCacheGet(r,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(n=[]),isFunction(a))n=makeLabelsByCustomizedCategoryInterval(e,a,!0);else if("auto"===a){var s=makeCategoryLabelsActually(e,e.getLabelModel());i=s.labelCategoryInterval,n=map(s.labels,(function(e){return e.tickValue}))}else n=makeLabelsByNumericCategoryInterval(e,i=a,!0);return listCacheSet(r,a,{ticks:n,tickCategoryInterval:i})}function makeRealNumberLabels(e){var t=e.scale.getTicks(),n=makeLabelFormatter(e);return{labels:map(t,(function(t,i){return{formattedLabel:n(t,i),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}function getListCache(e,t){return inner$4(e)[t]||(inner$4(e)[t]=[])}function listCacheGet(e,t){for(var n=0;n40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),p=0,d=0;l<=a[1];l+=s){var f,g,m=getBoundingRect(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var y=p/c,v=d/h;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var _=Math.max(0,Math.floor(Math.min(y,v))),x=inner$4(e.model),S=e.getExtent(),b=x.lastAutoInterval,T=x.lastTickCount;return null!=b&&null!=T&&Math.abs(b-_)<=1&&Math.abs(T-o)<=1&&b>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=b:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function fetchAutoCategoryIntervalCalculationParams(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function makeLabelsByNumericCategoryInterval(e,t,n){var i=makeLabelFormatter(e),r=e.scale,a=r.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=r.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=shouldShowAllLabels(e),p=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;p&&u!==a[0]&&g(a[0]);for(var f=u;f<=a[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:r.getLabel(t),tickValue:e})}return d&&f-l!==a[1]&&g(a[1]),s}function makeLabelsByCustomizedCategoryInterval(e,t,n){var i=e.scale,r=makeLabelFormatter(e),a=[];return each(i.getTicks(),(function(e){var o=i.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:r(e),rawLabel:o,tickValue:s})})),a}var NORMALIZED_EXTENT=[0,1],Axis=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return getPixelPrecision(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count()),linearMap(e,NORMALIZED_EXTENT,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count());var r=linearMap(e,n,NORMALIZED_EXTENT,t);return this.scale.scale(r)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=map(createAxisTicks(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawIndex(e):e),tickValue:e}}),this);return fixOnBandTicksCoords(this,n,t.get("alignWithLabel"),e.clamp),n},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),map(this.scale.getMinorTicks(e),(function(e){return map(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return createAxisLabels(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(){return calculateCategoryInterval(this)},e}();function fixExtentWithBands(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}function fixOnBandTicksCoords(e,t,n,i){var r=t.length;if(e.onBand&&!n&&r){var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;each(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift()),i&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]}),h(s[1],a.coord)&&(i?a.coord=s[1]:t.pop()),i&&h(a.coord,s[1])&&t.push({coord:s[1]})}function h(e,t){return e=round$1(e),t=round$1(t),c?e>t:e":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},RegExpEvaluator=function(){function e(e){if(null==(this._condVal=isString(e)?new RegExp(e):isRegExp(e)?e:null)){var t="";0,throwError(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return"string"===t?this._condVal.test(e):"number"===t&&this._condVal.test(e+"")},e}(),ConstConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),AndConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t0?n=i[0]:i[1]<0&&(n=i[1]),n}function getStackedOnPoint(e,t,n,i){var r=NaN;e.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,i),o[1-a]=r,t.dataToPoint(o)}var supportFloat32Array="undefined"!=typeof Float32Array,Float32ArrayCtor=supportFloat32Array?Float32Array:Array;function createFloat32Array(e){return isArray(e)?supportFloat32Array?new Float32Array(e):e:new Float32ArrayCtor(e)}function diffData(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}function lineAnimationDiff(e,t,n,i,r,a,o,s){for(var l=diffData(e,t),u=[],c=[],h=[],p=[],d=[],f=[],g=[],m=prepareDataCoordInfo(r,t,o),y=prepareDataCoordInfo(a,e,s),v=e.getLayout("points")||[],_=t.getLayout("points")||[],x=0;x=r||g<0)break;if(isPointNull(y,v)){if(l){g+=a;continue}break}if(g===n)e[a>0?"moveTo":"lineTo"](y,v),h=y,p=v;else{var _=y-u,x=v-c;if(_*_+x*x<.5){g+=a;continue}if(o>0){var S=g+a,b=t[2*S],T=t[2*S+1],M=m+1;if(l)for(;isPointNull(b,T)&&M=i||isPointNull(b,T))d=y,f=v;else{I=b-u,C=T-c;var L=y-u,E=b-y,D=v-c,R=T-v,O=void 0,k=void 0;"x"===s?(O=Math.abs(L),k=Math.abs(E),d=y-O*o,f=v,w=y+O*o,P=v):"y"===s?(O=Math.abs(D),k=Math.abs(R),d=y,f=v-O*o,w=y,P=v+O*o):(O=Math.sqrt(L*L+D*D),d=y-I*o*(1-(A=(k=Math.sqrt(E*E+R*R))/(k+O))),f=v-C*o*(1-A),P=v+C*o*A,w=mathMin$5(w=y+I*o*A,mathMax$5(b,y)),P=mathMin$5(P,mathMax$5(T,v)),w=mathMax$5(w,mathMin$5(b,y)),f=v-(C=(P=mathMax$5(P,mathMin$5(T,v)))-v)*O/k,d=mathMin$5(d=y-(I=w-y)*O/k,mathMax$5(u,y)),f=mathMin$5(f,mathMax$5(c,v)),w=y+(I=y-(d=mathMax$5(d,mathMin$5(u,y))))*k/O,P=v+(C=v-(f=mathMax$5(f,mathMin$5(c,v))))*k/O)}e.bezierCurveTo(h,p,d,f,y,v),h=w,p=P}else e.lineTo(y,v)}u=y,c=v,g+=a}return m}var ECPolylineShape=function(){this.smooth=0,this.smoothConstraint=!0},ECPolyline=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ECPolylineShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&isPointNull(n[2*r-2],n[2*r-1]);r--);for(;i=0){var m=o?(c-i)*g+i:(u-n)*g+n;return o?[e,m]:[m,e]}n=u,i=c;break;case a.C:u=r[l++],c=r[l++],h=r[l++],p=r[l++],d=r[l++],f=r[l++];var y=o?cubicRootAt(n,u,h,d,e,s):cubicRootAt(i,c,p,f,e,s);if(y>0)for(var v=0;v=0){m=o?cubicAt(i,c,p,f,_):cubicAt(n,u,h,d,_);return o?[e,m]:[m,e]}}n=d,i=f}}},t}(Path),ECPolygonShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(ECPolylineShape),ECPolygon=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new ECPolygonShape},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,r=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&isPointNull(n[2*a-2],n[2*a-1]);a--);for(;r=0;a--){var o=n[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(i=l&&l.coordDim)||"y"===i){r=n[a];break}}if(r){var u=t.getAxis(i),c=map(r.stops,(function(e){return{offset:0,coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),h=c.length,p=r.outerColors.slice();h&&c[0].coord>c[h-1].coord&&(c.reverse(),p.reverse());var d=c[0].coord-10,f=c[h-1].coord+10,g=f-d;if(g<.001)return"transparent";each(c,(function(e){e.offset=(e.coord-d)/g})),c.push({offset:h?c[h-1].offset:.5,color:p[1]||"transparent"}),c.unshift({offset:h?c[0].offset:.5,color:p[0]||"transparent"});var m=new LinearGradient(0,0,0,0,c,!0);return m[i]=d,m[i+"2"]=f,m}}}function getIsIgnoreFunc(e,t,n){var i=e.get("showAllSymbol"),r="auto"===i;if(!i||r){var a=n.getAxesByScale("ordinal")[0];if(a&&(!r||!canShowAllSymbolForCategory(a,t))){var o=t.mapDimension(a.dim),s={};return each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function canShowAllSymbolForCategory(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var r=t.count(),a=Math.max(1,Math.round(r/5)),o=0;oi)return!1;return!0}function isPointNull$1(e,t){return isNaN(e)||isNaN(t)}function getLastIndexNotNull(e){for(var t=e.length/2;t>0&&isPointNull$1(e[2*t-2],e[2*t-1]);t--);return t-1}function getPointAtIndex(e,t){return[e[2*t],e[2*t+1]]}function getIndexRange(e,t,n){for(var i,r,a=e.length/2,o="x"===n?0:1,s=0,l=-1,u=0;u=t||i>=t&&r<=t){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(t-i)/(r-i)}}function createLineClipPath(e,t,n,i){if(isCoordinateSystemType(t,"cartesian2d")){var r=i.getModel("endLabel"),a=r.get("show"),o=r.get("valueAnimation"),s=i.getData(),l={lastFrameIndex:0},u=a?function(n,i){e._endLabelOnDuring(n,i,s,l,o,r,t)}:null,c=t.getBaseAxis().isHorizontal(),h=createGridClipPath(t,n,i,(function(){var t=e._endLabel;t&&n&&null!=l.originalX&&t.attr({x:l.originalX,y:l.originalY})}),u);if(!i.get("clip",!0)){var p=h.shape,d=Math.max(p.width,p.height);c?(p.y-=d,p.height+=2*d):(p.x-=d,p.width+=2*d)}return u&&u(1,h),h}return createPolarClipPath(t,n,i)}function getEndLabelStateSpecified(e,t){var n=t.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,a=i?r?"right":"left":"center",o=i?"middle":r?"top":"bottom";return{normal:{align:e.get("align")||a,verticalAlign:e.get("verticalAlign")||o,padding:e.get("distance")||0}}}var LineView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(){var e=new Group,t=new SymbolDraw;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem,a=this.group,o=e.getData(),s=e.getModel("lineStyle"),l=e.getModel("areaStyle"),u=o.getLayout("points")||[],c="polar"===r.type,h=this._coordSys,p=this._symbolDraw,d=this._polyline,f=this._polygon,g=this._lineGroup,m=e.get("animation"),y=!l.isEmpty(),v=l.get("origin"),_=prepareDataCoordInfo(r,o,v),x=y&&getStackedOnPoints(r,o,_),S=e.get("showSymbol"),b=S&&!c&&getIsIgnoreFunc(e,o,r),T=this._data;T&&T.eachItemGraphicEl((function(e,t){e.__temp&&(a.remove(e),T.setItemGraphicEl(t,null))})),S||p.remove(),a.add(g);var M,A=!c&&e.get("step");r&&r.getArea&&e.get("clip",!0)&&(null!=(M=r.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M,d&&h.type===r.type&&A===this._step?(y&&!f?f=this._newPolygon(u,x):f&&!y&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!1,e)),S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),isPointsSame(this._stackedOnPoints,x)&&isPointsSame(this._points,u)||(m?this._doUpdateAnimation(o,x,r,n,A,v):(A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d.setShape({points:u}),f&&f.setShape({points:u,stackedOnPoints:x})))):(S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),m&&this._initSymbolLabelAnimation(o,r,M),A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d=this._newPolyline(u),y&&(f=this._newPolygon(u,x)),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!0,e)));var I=getVisualGradient(o,r)||o.getVisual("style")[o.getVisual("drawType")],C=e.get(["emphasis","focus"]),w=e.get(["emphasis","blurScope"]);(d.useStyle(defaults(s.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),setStatesStylesFromModel(d,e,"lineStyle"),d.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=d.style.lineWidth+1);getECData(d).seriesIndex=e.seriesIndex,enableHoverEmphasis(d,C,w);var P=getSmooth(e.get("smooth")),L=e.get("smoothMonotone"),E=e.get("connectNulls");if(d.setShape({smooth:P,smoothMonotone:L,connectNulls:E}),f){var D=o.getCalculationInfo("stackedOnSeries"),R=0;f.useStyle(defaults(l.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),D&&(R=getSmooth(D.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:R,smoothMonotone:L,connectNulls:E}),setStatesStylesFromModel(f,e,"areaStyle"),getECData(f).seriesIndex=e.seriesIndex,enableHoverEmphasis(f,C,w)}var O=function(e){i._changePolyState(e)};o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=O)})),this._polyline.onHoverStateChange=O,this._data=o,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=A,this._valueOrigin=v},t.prototype.dispose=function(){},t.prototype.highlight=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("emphasis"),!(a instanceof Array)&&null!=a&&a>=0){var o=r.getLayout("points"),s=r.getItemGraphicEl(a);if(!s){var l=o[2*a],u=o[2*a+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;(s=new Symbol(r,a)).x=l,s.y=u,s.setZ(e.get("zlevel"),e.get("z")),s.__temp=!0,r.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else ChartView.prototype.highlight.call(this,e,t,n,i)},t.prototype.downplay=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("normal"),null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else ChartView.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;setStatesFlag(this._polyline,e),t&&setStatesFlag(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new ECPolyline({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new ECPolygon({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,r,a=t.getBaseAxis(),o=a.inverse;"cartesian2d"===t.type?(i=a.isHorizontal(),r=!1):"polar"===t.type&&(i="angle"===a.dim,r=!0);var s=e.hostModel,l=s.get("animationDuration");"function"==typeof l&&(l=l(null));var u=s.get("animationDelay")||0,c="function"==typeof u?u(null):u;e.eachItemGraphicEl((function(e,a){var s=e;if(s){var h=[e.x,e.y],p=void 0,d=void 0,f=void 0;if(r){var g=n,m=t.pointToCoord(h);i?(p=g.startAngle,d=g.endAngle,f=-m[1]/180*Math.PI):(p=g.r0,d=g.r,f=m[0])}else{var y=n;i?(p=y.x,d=y.x+y.width,f=e.x):(p=y.y+y.height,d=y.y,f=e.y)}var v=d===p?0:(f-p)/(d-p);o&&(v=1-v);var _="function"==typeof u?u(a):l*v+c,x=s.getSymbolPath(),S=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,delay:_}),S&&S.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t){var n=e.getModel("endLabel");if(n.get("show")){var i=e.getData(),r=this._polyline,a=this._endLabel;a||((a=this._endLabel=new ZRText({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);var o=getLastIndexNotNull(i.getLayout("points"));o>=0&&setLabelStyle(a,getLabelStatesModels(e,"endLabel"),{labelFetcher:e,labelDataIndex:o,defaultText:function(e,t,n){return n?getDefaultInterpolatedLabel(i,n):getDefaultLabel(i,e)},enableTextSetter:!0},getEndLabelStateSpecified(n,t))}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,r,a,o){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),p=a.get("precision"),d=o.getBaseAxis(),f=d.isHorizontal(),g=d.inverse,m=t.shape,y=g?f?m.x:m.y+m.height:f?m.x+m.width:m.y,v=f?"x":"y",_=getIndexRange(u,y,v),x=_.range,S=x[1]-x[0],b=void 0;if(S>=1){if(S>1&&!h){var T=getPointAtIndex(u,x[0]);s.attr({x:T[0],y:T[1]}),r&&(b=c.getRawValue(x[0]))}else{(T=l.getPointOn(y,v))&&s.attr({x:T[0],y:T[1]});var M=c.getRawValue(x[0]),A=c.getRawValue(x[1]);r&&(b=interpolateRawValues(n,p,M,A,_.t))}i.lastFrameIndex=x[0]}else{var I=1===e||i.lastFrameIndex>0?x[0]:0;T=getPointAtIndex(u,I);r&&(b=c.getRawValue(I)),s.attr({x:T[0],y:T[1]})}r&&labelInner(s).setLabelText(b)}},t.prototype._doUpdateAnimation=function(e,t,n,i,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=lineAnimationDiff(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),c=u.current,h=u.stackedOnCurrent,p=u.next,d=u.stackedOnNext;if(r&&(c=turnPointsIntoStep(u.current,n,r),h=turnPointsIntoStep(u.stackedOnCurrent,n,r),p=turnPointsIntoStep(u.next,n,r),d=turnPointsIntoStep(u.stackedOnNext,n,r)),getBoundingDiff(c,p)>3e3||s&&getBoundingDiff(h,d)>3e3)return o.setShape({points:p}),void(s&&s.setShape({points:p,stackedOnPoints:d}));o.shape.__points=u.current,o.shape.points=c;var f={shape:{points:p}};u.current!==c&&(f.shape.__points=u.next),o.stopAnimation(),updateProps(o,f,l),s&&(s.setShape({points:c,stackedOnPoints:h}),s.stopAnimation(),updateProps(s,{shape:{stackedOnPoints:d}},l),o.shape.points!==s.shape.points&&(s.shape.points=o.shape.points));for(var g=[],m=u.status,y=0;yt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&"cartesian2d"===a.type&&r){var s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),p=Math.round(o/h);if(p>1){"lttb"===r&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var d=void 0;"string"==typeof r?d=samplers[r]:"function"==typeof r&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/p,d,indexSampler))}}}}}var defaultOption={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},categoryAxis=merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},defaultOption),valueAxis=merge({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},defaultOption),timeAxis=merge({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},valueAxis),logAxis=defaults({scale:!0,logBase:10},valueAxis),axisDefault={category:categoryAxis,value:valueAxis,time:timeAxis,log:logAxis},AXIS_TYPES={value:1,category:1,time:1,log:1};function axisModelCreator(e,t,n){each(AXIS_TYPES,(function(i,r){var a=merge(merge({},axisDefault[r],!0),n,!0),o=function(t){function n(){for(var n=[],i=0;i0?"top":"bottom",i="center"):isRadianAroundZero(a-PI$6)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=a>0&&a0?"right":"left":n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:r}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),builders={axisLine:function(e,t,n,i){var r=t.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0];o&&(applyTransform(s,s,o),applyTransform(l,l,o));var u=extend({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Line({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});c.anid="line",n.add(c);var h=t.get(["axisLine","symbol"]),p=t.get(["axisLine","symbolSize"]),d=t.get(["axisLine","symbolOffset"])||0;if("number"==typeof d&&(d=[d,d]),null!=h){"string"==typeof h&&(h=[h,h]),"string"!=typeof p&&"number"!=typeof p||(p=[p,p]);var f=p[0],g=p[1];each([{rotate:e.rotation+Math.PI/2,offset:d[0],r:0},{rotate:e.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,i){if("none"!==h[i]&&null!=h[i]){var r=createSymbol(h[i],-f/2,-g/2,f,g,u.stroke,!0),a=t.r+t.offset;r.attr({rotation:t.rotate,x:s[0]+a*Math.cos(e.rotation),y:s[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(e,t,n,i){var r=buildAxisMajorTicks(n,i,t,e);fixMinMaxLabelShow(t,buildAxisLabel(n,i,t,e),r),buildAxisMinorTicks(n,i,t,e.tickDirection)},axisName:function(e,t,n,i){var r=retrieve(e.axisName,t.get("name"));if(r){var a,o,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),p=h[0]>h[1]?-1:1,d=["start"===s?h[0]-p*c:"end"===s?h[1]+p*c:(h[0]+h[1])/2,isNameLocationCenter(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*PI$6/180),isNameLocationCenter(s)?a=AxisBuilder.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(a=endTextLayout(e.rotation,s,f||0,h),null!=(o=e.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(a.rotation)),!isFinite(o)&&(o=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},y=m.ellipsis,v=retrieve(e.nameTruncateMaxWidth,m.maxWidth,o),_=t.get("tooltip",!0),x=t.mainType,S={componentType:x,name:r,$vars:["name"]};S[x+"Index"]=t.componentIndex;var b=new ZRText({x:d[0],y:d[1],rotation:a.rotation,silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(u,{text:r,font:g,overflow:"truncate",width:v,ellipsis:y,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||a.textAlign,verticalAlign:u.get("verticalAlign")||a.textVerticalAlign}),z2:1});if(b.tooltip=_&&_.show?extend({content:r,formatter:function(){return r},formatterParams:S},_):null,b.__fullText=r,b.anid="name",t.get("triggerEvent")){var T=AxisBuilder.makeAxisEventDataBase(t);T.targetType="axisName",T.name=r,getECData(b).eventData=T}i.add(b),b.updateTransform(),n.add(b),b.decomposeTransform()}}};function endTextLayout(e,t,n,i){var r,a,o=remRadian(n-e),s=i[0]>i[1],l="start"===t&&!s||"start"!==t&&s;return isRadianAroundZero(o-PI$6/2)?(a=l?"bottom":"top",r="center"):isRadianAroundZero(o-1.5*PI$6)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*PI$6&&o>PI$6/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}function fixMinMaxLabelShow(e,t,n){if(!shouldShowAllLabels(e.axis)){var i=e.get(["axisLabel","showMinLabel"]),r=e.get(["axisLabel","showMaxLabel"]);n=n||[];var a=(t=t||[])[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],p=n[n.length-2];!1===i?(ignoreEl(a),ignoreEl(u)):isTwoLabelOverlapped(a,o)&&(i?(ignoreEl(o),ignoreEl(c)):(ignoreEl(a),ignoreEl(u))),!1===r?(ignoreEl(s),ignoreEl(h)):isTwoLabelOverlapped(l,s)&&(r?(ignoreEl(l),ignoreEl(p)):(ignoreEl(s),ignoreEl(h)))}}function ignoreEl(e){e&&(e.ignore=!0)}function isTwoLabelOverlapped(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=identity([]);return rotate(r,r,-e.rotation),n.applyTransform(mul$1([],r,e.getLocalTransform())),i.applyTransform(mul$1([],r,t.getLocalTransform())),n.intersect(i)}}function isNameLocationCenter(e){return"middle"===e||"center"===e}function createTicks(e,t,n,i,r){for(var a=[],o=[],s=[],l=0;l=0||e===t}function fixValue(e){var t=getAxisInfo(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,r=n.option,a=n.get("status"),o=n.get("value");null!=o&&(o=i.parse(o));var s=isHandleTrigger(n);null==a&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),on.min&&i.modifyDataMinMax("min",t[0]),!n.maxFixed&&t[1]e[1]&&(e[1]=t)}ComponentView.registerClass(CartesianXAxisView),ComponentView.registerClass(CartesianYAxisView),registerProcessor(PRIORITY.PROCESSOR.FILTER+10,{getTargetSeries:function(e){var t=createHashMap();return e.eachSeries((function(e){isCartesian2DSeries(e)&&t.set(e.uid,e)})),t},overallReset:function(e,t){var n=[],i=createHashMap();prepareDataExtentOnAxis(e,i,n),calculateFilteredExtent(i,n),shrinkAxisExtent(i)}});var GridModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(ComponentModel),GridView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return __extends(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new Rect({shape:e.coordinateSystem.getRect(),style:defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(ComponentView);ComponentView.registerClass(GridView),ComponentModel.registerClass(GridModel),registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),registerLayout(pointsLayout("line",!0)),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("line"));var Cartesian=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return map(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),filter(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),cartesian2DDimensions=["x","y"];function canCalculateAffineTransform(e){return"interval"===e.type||"time"===e.type}var Cartesian2D=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=cartesian2DDimensions,t}return __extends(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(canCalculateAffineTransform(e)&&canCalculateAffineTransform(t)){var n=e.getExtent(),i=t.getExtent(),r=this.dataToPoint([n[0],i[0]]),a=this.dataToPoint([n[1],i[1]]),o=n[1]-n[0],s=i[1]-i[0];if(o&&s){var l=(a[0]-r[0])/o,u=(a[1]-r[1])/s,c=r[0]-n[0]*l,h=r[1]-i[0]*u,p=this._transform=[l,0,0,u,c,h];this._invTransform=invert([],p)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],r=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return applyTransform(n,e,this._transform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.toGlobalCoord(a.dataToCoord(i)),n[1]=o.toGlobalCoord(o.dataToCoord(r)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),a=i.getExtent(),o=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),o),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t){if(t=t||[],this._invTransform)return applyTransform(t,e,this._invTransform);var n=this.getAxis("x"),i=this.getAxis("y");return t[0]=n.coordToData(n.toLocalCoord(e[0])),t[1]=i.coordToData(i.toLocalCoord(e[1])),t},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),n=Math.min(e[0],e[1]),i=Math.min(t[0],t[1]),r=Math.max(e[0],e[1])-n,a=Math.max(t[0],t[1])-i;return new BoundingRect(n,i,r,a)},t}(Cartesian),Axis2D=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.index=0,o.type=r||"value",o.position=a||"bottom",o}return __extends(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setCategorySortInfo(e)},t}(Axis),Grid=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=cartesian2DDimensions,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model),each(n.x,(function(e){niceScaleExtent(e.scale,e.model)})),each(n.y,(function(e){niceScaleExtent(e.scale,e.model)}));var i={};each(n.x,(function(e){fixAxisOnZero(n,"y",e,i)})),each(n.y,(function(e){fixAxisOnZero(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),r=!n&&e.get("containLabel"),a=getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});this._rect=a;var o=this._axesList;function s(){each(o,(function(e){var t=e.isHorizontal(),n=t?[0,a.width]:[0,a.height],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),updateAxisTransform(e,t?a.x:a.y)}))}s(),r&&(each(o,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=estimateLabelUnionRect(e);if(t){var n=e.isHorizontal()?"height":"width",i=e.model.get(["axisLabel","margin"]);a[n]-=t[n]+i,"top"===e.position?a.y+=t.height+i:"left"===e.position&&(a.x+=t.width+i)}}})),s()),each(this._coordsList,(function(e){e.calcAffineTransform()}))},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}isObject(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,r=this._coordsList;ie&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=inheritDefaultOption(BaseBarSeriesModel.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(BaseBarSeriesModel);SeriesModel.registerClass(BarSeriesModel);var SausageShape=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},SausagePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SausageShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=Math.cos(l),p=Math.sin(l),d=Math.cos(u),f=Math.sin(u);(c?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(h*r+n,p*r+i),e.arc(h*s+n,p*s+i,o,-Math.PI+l,l,!c)),e.arc(n,i,a,l,u,!c),e.moveTo(d*a+n,f*a+i),e.arc(d*s+n,f*s+i,o,u-2*Math.PI,u-Math.PI,!c),0!==r&&(e.arc(n,i,r,u,l,c),e.moveTo(h*r+n,f*r+i)),e.closePath()},t}(Path),BAR_BORDER_WIDTH_QUERY=["itemStyle","borderWidth"],BAR_BORDER_RADIUS_QUERY=["itemStyle","borderRadius"],_eventPos=[0,0],mathMax$6=Math.max,mathMin$6=Math.min;function getClipArea(e,t){var n=e.getArea&&e.getArea();if(isCoordinateSystemType(e,"cartesian2d")){var i=e.getBaseAxis();if("category"!==i.type||!i.onBand){var r=t.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}var BarView=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){this._model=e,this.removeOnRenderedListener(n),this._updateDrawMode(e);var r=e.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._incrementalRenderLarge(e,t)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,i){var r,a=this,o=this.group,s=e.getData(),l=this._data,u=e.coordinateSystem,c=u.getBaseAxis();"cartesian2d"===u.type?r=c.isHorizontal():"polar"===u.type&&(r="angle"===c.dim);var h=e.isAnimationEnabled()?e:null,p=c.model,d=e.get("realtimeSort");if(d&&s.count()){if(this._isFirstFrame)return this._initSort(s,r,c,n),void(this._isFirstFrame=!1);this._onRendered=function(){a._updateSort(s,(function(e){var t=s.getItemGraphicEl(e);if(t){var n=t.shape;return(r?n.y+n.height:n.x+n.width)||0}return 0}),c,n)},n.getZr().on("rendered",this._onRendered)}var f=e.get("clip",!0)||d,g=getClipArea(u,s);o.removeClipPath();var m=e.get("roundCap",!0),y=e.get("showBackground",!0),v=e.getModel("backgroundStyle"),_=v.get("borderRadius")||0,x=[],S=this._backgroundEls,b=i&&i.isInitSort,T=i&&"changeAxisOrder"===i.type;function M(e){var t=getLayout[u.type](s,e),n=createBackgroundEl(u,r,t);return n.useStyle(v.getItemStyle()),"cartesian2d"===u.type&&n.setShape("r",_),x[e]=n,n}s.diff(l).add((function(t){var n=s.getItemModel(t),i=getLayout[u.type](s,t,n);if(y&&M(t),s.hasValue(t)){var a=!1;f&&(a=clip[u.type](g,i));var l=elementCreator[u.type](e,s,t,i,r,h,c.model,!1,m);updateStyle(l,s,t,n,i,e,r,"polar"===u.type),b?l.attr({shape:i}):d?updateRealtimeAnimation(e,p,h,l,i,t,r,!1,!1):initProps(l,{shape:i},e,t),s.setItemGraphicEl(t,l),o.add(l),l.ignore=a}})).update((function(t,n){var i=s.getItemModel(t),a=getLayout[u.type](s,t,i);if(y){var A=void 0;0===S.length?A=M(n):((A=S[n]).useStyle(v.getItemStyle()),"cartesian2d"===u.type&&A.setShape("r",_),x[t]=A);var I=getLayout[u.type](s,t);updateProps(A,{shape:createBackgroundShape(r,I,u)},h,t)}var C=l.getItemGraphicEl(n);if(!s.hasValue(t))return o.remove(C),void(C=null);var w=!1;f&&(w=clip[u.type](g,a))&&o.remove(C),C||(C=elementCreator[u.type](e,s,t,a,r,h,c.model,!!C,m)),T||updateStyle(C,s,t,i,a,e,r,"polar"===u.type),b?C.attr({shape:a}):d?updateRealtimeAnimation(e,p,h,C,a,t,r,!0,T):updateProps(C,{shape:a},e,t,null),s.setItemGraphicEl(t,C),C.ignore=w,o.add(C)})).remove((function(t){var n=l.getItemGraphicEl(t);n&&removeElementWithFadeOut(n,e,t)})).execute();var A=this._backgroundGroup||(this._backgroundGroup=new Group);A.removeAll();for(var I=0;Ii)return!0;i=a}return!1},t.prototype._updateSort=function(e,t,n,i){var r=n.scale.getCategorySortInfo();if(this._isDataOrderChanged(e,t,r))for(var a=this._dataSort(e,t),o=n.scale.getExtent(),s=o[0];s0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*r/2,y:i.y+o*r/2,width:i.width-a*r,height:i.height-o*r}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle}}};function isZeroOnPolar(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function updateStyle(e,t,n,i,r,a,o,s){var l=t.getItemVisual(n,"style");s||e.setShape("r",i.get(BAR_BORDER_RADIUS_QUERY)||0),e.useStyle(l);var u=i.getShallow("cursor");if(u&&e.attr("cursor",u),!s){var c=o?r.height>0?"bottom":"top":r.width>0?"left":"right",h=getLabelStatesModels(i);setLabelStyle(e,h,{labelFetcher:a,labelDataIndex:n,defaultText:getDefaultLabel(a.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c}),setLabelValueAnimation(e.getTextContent(),h,a.getRawValue(n),(function(e){return getDefaultInterpolatedLabel(t,e)}))}var p=i.getModel(["emphasis"]);enableHoverEmphasis(e,p.get("focus"),p.get("blurScope")),setStatesStylesFromModel(e,i),isZeroOnPolar(r)&&(e.style.fill="none",e.style.stroke="none",each(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}function getLineWidth(e,t){var n=e.get(BAR_BORDER_WIDTH_QUERY)||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),r=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,r)}var LagePathShape=function(){},LargePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new LagePathShape},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.__startPoint,r=this.__baseDimIdx,a=0;a=0?t:null}),30,!1);function largePathFindDataIndex(e,t,n){var i=e.__baseDimIdx,r=1-i,a=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[r];_eventPos[0]=t,_eventPos[1]=n;for(var u=_eventPos[i],c=_eventPos[1-i],h=u-s,p=u+s,d=0,f=a.length/2;d=h&&m<=p&&(l<=y?c>=l&&c<=y:c>=y&&c<=l))return o[d]}return-1}function setLargeStyle(e,t,n){var i=n.getVisual("style");e.useStyle(extend({},i)),e.style.fill=null,e.style.stroke=i.fill,e.style.lineWidth=n.getLayout("barWidth")}function setLargeBackgroundStyle(e,t,n){var i=t.get("borderColor")||t.get("color"),r=t.getItemStyle();e.useStyle(r),e.style.fill=null,e.style.stroke=i,e.style.lineWidth=n.getLayout("barWidth")}function createBackgroundShape(e,t,n){if(isCoordinateSystemType(n,"cartesian2d")){var i=t,r=n.getArea();return{x:e?i.x:r.x,y:e?r.y:i.y,width:e?i.width:r.width,height:e?r.height:i.height}}var a=t;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:e?r.r0:a.r0,r:e?r.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:2*Math.PI}}function createBackgroundEl(e,t,n){return new("polar"===e.type?Sector:Rect)({shape:createBackgroundShape(t,n,e),silent:!0,z2:0})}function createListSimply(e,t,n){t=isArray(t)&&{coordDimensions:t}||extend({},t);var i=e.getSource(),r=createDimensions(i,t),a=new List(r,e);return a.initData(i,n),a}ChartView.registerClass(BarView),registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))})),registerLayout(PRIORITY.VISUAL.LAYOUT,curry(layout,"bar")),registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,largeLayout),registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}}),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("bar"));var LegendVisualProvider=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),PieSeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),r=[];return n.each(n.mapDimension("value"),(function(e){r.push(e)})),i.percent=getPercentWithPrecision(r,t,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},t.prototype._defaultLabelLine=function(e){defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(SeriesModel);SeriesModel.registerClass(PieSeriesModel);var RADIAN=Math.PI/180;function adjustSingleSide(e,t,n,i,r,a,o,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;hn?o:a,c=Math.abs(l.label.y-n);if(c>u.maxY){var h=l.label.x-t-l.len2*r,p=i+l.len,f=h0?"right":"left":L>0?"left":"right"}var F=m.get("rotate");if(D="number"==typeof F?F*(Math.PI/180):F?L<0?-P+Math.PI:-P:0,a=!!D,p.x=A,p.y=I,p.rotation=D,p.setStyle({verticalAlign:"middle"}),R){p.setStyle({align:w});var $=p.states.select;$&&($.x+=p.x,$.y+=p.y)}else{var z=p.getBoundingRect().clone();z.applyTransform(p.getComputedTransform());var G=(p.style.margin||0)+2.1;z.y-=G/2,z.height+=G,r.push({label:p,labelLine:f,position:y,len:T,len2:M,minTurnAngle:b.get("minTurnAngle"),maxSurfaceAngle:b.get("maxSurfaceAngle"),surfaceNormal:new Point(L,E),linePoints:C,textAlign:w,labelDistance:v,labelAlignTo:_,edgeDistance:x,bleedMargin:S,rect:z})}s.setTextConfig({inside:R})}})),!a&&e.get("avoidLabelOverlap")&&avoidOverlap(r,t,n,l,u,p,c,h);for(var f=0;f0){for(var l=a.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=n.r0}},t.type="pie",t}(ChartView);ChartView.registerClass(PieView);var PI2$8=2*Math.PI,RADIAN$1=Math.PI/180;function getViewRect(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function pieLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),i=t.mapDimension("value"),r=getViewRect(e,n),a=e.get("center"),o=e.get("radius");isArray(o)||(o=[0,o]),isArray(a)||(a=[a,a]);var s=parsePercent$2(r.width,n.getWidth()),l=parsePercent$2(r.height,n.getHeight()),u=Math.min(s,l),c=parsePercent$2(a[0],s)+r.x,h=parsePercent$2(a[1],l)+r.y,p=parsePercent$2(o[0],u/2),d=parsePercent$2(o[1],u/2),f=-e.get("startAngle")*RADIAN$1,g=e.get("minAngle")*RADIAN$1,m=0;t.each(i,(function(e){!isNaN(e)&&m++}));var y=t.getSum(i),v=Math.PI/(y||m)*2,_=e.get("clockwise"),x=e.get("roseType"),S=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var T=PI2$8,M=0,A=f,I=_?1:-1;if(t.setLayout({viewRect:r,r:d}),t.each(i,(function(e,n){var i;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:c,cy:h,r0:p,r:x?NaN:d});else{(i="area"!==x?0===y&&S?v:e*v:PI2$8/m)=0;s--){var l=2*s,u=i[l]-a/2,c=i[l+1]-o/2;if(e>=u&&t>=c&&e<=u+a&&t<=c+o)return s}return-1},t}(Path),LargeSymbolDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e,t){this.group.removeAll();var n=new LargeSymbolPath({rectHover:!0,cursor:"default"});n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,!1,t),this.group.add(n),this._incremental=null},e.prototype.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),i=4*e.startIndex*2;t=new Float32Array(t.buffer,i,n)}e.setShape("points",t)}))}},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t,n){var i;this._incremental?(i=new LargeSymbolPath,this._incremental.addDisplayable(i,!0)):((i=new LargeSymbolPath({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(i)),i.setShape({points:t.getLayout("points")}),this._setCommon(i,t,!!this._incremental,n)},e.prototype._setCommon=function(e,t,n,i){var r=t.hostModel;i=i||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=i.clipShape||null,e.symbolProxy=createSymbol(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]=0&&(u.dataIndex=n+(e.startIndex||0))}))}},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),ScatterView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=pointsLayout("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new LargeSymbolDraw:new SymbolDraw,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(ChartView);ChartView.registerClass(ScatterView),registerLayout(pointsLayout("scatter"));var IndicatorAxis=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.type="value",r.angle=0,r.name="",r}return __extends(t,e),t}(Axis),Radar=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=map(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,i=new IndicatorAxis(n,new IntervalScale);return i.name=e.get("name"),i.model=e,e.axis=i,this.dimensions.push(n),i}),this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=Math.sqrt(t*t+n*n);t/=i,n/=i;for(var r,a=Math.atan2(-n,t),o=1/0,s=-1,l=0;ln[0]&&isFinite(h)&&isFinite(n[0]))}else{o.getTicks().length-1>r&&(u=a(u));h=round$1((c=Math.ceil(n[1]/u)*u)-u*r);o.setExtent(h,c),o.setInterval(u)}}))},e.prototype.convertToPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.create=function(t,n){var i=[];return t.eachComponent("radar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},e.dimensions=[],e}();CoordinateSystemManager.register("radar",Radar);var valueAxisDefault=axisDefault.value;function defaultsShow(e,t){return defaults({show:t},e)}var RadarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),i=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisLabel"),o=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=map(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var p=o;null!=h.color&&(p=defaults({color:h.color},o));var d=merge(clone(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:i,axisTick:r,axisLabel:a,name:h.text,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:c},!1);if(s||(d.name=""),"string"==typeof l){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else"function"==typeof l&&(d.name=l(d.name,d));var g=new Model(d,null,this.ecModel);return mixin(g,AxisModelCommonMixin.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:merge({lineStyle:{color:"#bbb"}},valueAxisDefault.axisLine),axisLabel:defaultsShow(valueAxisDefault.axisLabel,!1),axisTick:defaultsShow(valueAxisDefault.axisTick,!1),splitLine:defaultsShow(valueAxisDefault.splitLine,!0),splitArea:defaultsShow(valueAxisDefault.splitArea,!0),indicator:[]},t}(ComponentModel);ComponentModel.registerClass(RadarModel);var axisBuilderAttrs$1=["axisLine","axisTickLabel","axisName"],RadarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;each(map(t.getIndicatorAxes(),(function(e){return new AxisBuilder(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){each(axisBuilderAttrs$1,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var i=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),c=o.get("color"),h=s.get("color"),p=isArray(c)?c:[c],d=isArray(h)?h:[h],f=[],g=[];if("circle"===i)for(var m=n[0].getTicksCoords(),y=t.cx,v=t.cy,_=0;_3?1.4:r>1?1.2:1.1;checkPointerAndTrigger(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(i);checkPointerAndTrigger(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){isTaken(this._zr,"globalPan")||checkPointerAndTrigger(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Eventful);function checkPointerAndTrigger(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(stop(i.event),trigger(e,t,n,i,r))}function trigger(e,t,n,i,r){r.isAvailableBehavior=bind(isAvailableBehavior,null,n,i),e.trigger(t,r)}function isAvailableBehavior(e,t,n){var i=n[e];return!e||i&&(!isString(i)||t.event[i+"Key"])}function updateViewOnPan(e,t,n){var i=e.target;i.x+=t,i.y+=n,i.dirty()}function updateViewOnZoom(e,t,n,i){var r=e.target,a=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/e.zoom;e.zoom=o,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var IRRELEVANT_EXCLUDES={axisPointer:1,tooltip:1,brush:1};function onIrrelevantElement(e,t,n){var i=t.getComponentByElement(e.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!IRRELEVANT_EXCLUDES.hasOwnProperty(i.mainType)&&r&&r.model!==n}function getFixedItemStyle(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}var MapDraw=function(){function e(e){var t=new Group;this.uid=getUID("ec_map_draw"),this._controller=new RoamController(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Group),t.add(this._backgroundGroup=new Group)}return e.prototype.draw=function(e,t,n,i,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u,c=this._regionsGroup,h=this.group,p=s.getTransformInfo(),d=!c.childAt(0)||r;if(d)h.transform=p.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new Transformable;f.transform=p.roamTransform,f.decomposeTransform();var g={scaleX:f.scaleX,scaleY:f.scaleY,x:f.x,y:f.y};l=f.scaleX,u=f.scaleY,updateProps(h,g,e)}c.removeAll();var m=createHashMap(),y=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0;each(s.regions,(function(t){var i=m.get(t.name)||m.set(t.name,new Group),r=new CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(r);var s,f=e.getRegionModel(t.name)||e,g=f.getModel("itemStyle"),v=f.getModel("emphasis"),_=v.getModel("itemStyle"),x=f.getModel(["blur","itemStyle"]),S=f.getModel(["select","itemStyle"]),b=getFixedItemStyle(g),T=getFixedItemStyle(_),M=getFixedItemStyle(x),A=getFixedItemStyle(S);if(o){s=o.indexOfName(t.name);var I=o.getItemVisual(s,"style"),C=o.getItemVisual(s,"decal");y&&I.fill&&(b.fill=I.fill),C&&(b.decal=createOrUpdatePatternFromDecal(C,n))}var w=p.rawScaleX,P=p.rawScaleY,L=p.rawX,E=p.rawY,D=function(e){return[e[0]*w+L,e[1]*P+E]};each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],n=0;n=0)&&(F=e);var $=D(t.center),z=new ZRText({x:$[0],y:$[1],scaleX:1/h.scaleX,scaleY:1/h.scaleY,z2:10,silent:!0});setLabelStyle(z,getLabelStatesModels(f),{labelFetcher:F,labelDataIndex:V,defaultText:t.name},{normal:{align:"center",verticalAlign:"middle"}}),r.setTextContent(z),r.setTextConfig({local:!0}),r.disableLabelAnimation=!0,d||updateProps(z,{scaleX:1/l,scaleY:1/u},e)}if(o)o.setItemGraphicEl(s,i);else{var G=e.getRegionModel(t.name);getECData(r).eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:G&&G.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),enableHoverEmphasis(i,v.get("focus"),v.get("blurScope")),c.add(i)})),this._updateController(e,t,n),this._updateMapSelectHandler(e,c,n,i)},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&geoSourceManager.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost=null},e.prototype._updateBackground=function(e){var t=e.map;this._mapName!==t&&each(geoSourceManager.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},e.prototype._updateController=function(e,t,n){var i=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=i.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,updateViewOnPan(a,e.dx,e.dy),n.dispatchAction(extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,updateViewOnZoom(a,e.scale,e.originX,e.originY),n.dispatchAction(extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY}));var t=this.group;this._regionsGroup.traverse((function(e){var n=e.getTextContent();n&&(n.scaleX=1/t.scaleX,n.scaleY=1/t.scaleY,n.markRedraw())}))}),this),r.setPointerChecker((function(t,r,a){return i.getViewRectAfterRoam().contain(r,a)&&!onIrrelevantElement(t,n,e)}))},e.prototype._updateMapSelectHandler=function(e,t,n,i){var r=this;t.off("mousedown"),e.get("selectedMode")&&(t.on("mousedown",(function(){r._mouseDownFlag=!0})),t.on("click",(function(e){r._mouseDownFlag&&(r._mouseDownFlag=!1)})))},e}(),MapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new MapDraw(n);r.add(a.group),a.draw(e,t,n,this,i),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var i=e.originalData,r=this.group;i.each(i.mapDimension("value"),(function(t,n){if(!isNaN(t)){var a=i.getItemLayout(n);if(a&&a.point){var o=a.point,s=a.offset,l=new Circle({style:{fill:e.getData().getVisual("style").fill},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),c=i.getName(n),h=u.indexOfName(c),p=i.getItemModel(n),d=p.getModel("label"),f=u.getItemGraphicEl(h);setLabelStyle(l,getLabelStatesModels(p),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}}}),l.disableLabelAnimation=!0,d.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){l.useState(e)}}r.add(l)}}}))},t.type="map",t}(ChartView);function updateCenterAndZoom(e,t,n){var i=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy&&(o[0]-=t.dx,o[1]-=t.dy,e.setCenter(e.pointToData(o))),null!=a){if(n){var s=n.min||0,l=n.max||1/0;a=Math.max(Math.min(i*a,l),s)/i}e.scaleX*=a,e.scaleY*=a;var u=(t.originX-e.x)*(a-1),c=(t.originY-e.y)*(a-1);e.x-=u,e.y-=c,e.updateTransform(),e.setCenter(e.pointToData(o)),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}ChartView.registerClass(MapView),registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var r=updateCenterAndZoom(i,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===n&&each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var v2ApplyTransform=applyTransform,View=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new Transformable,n._rawTransformable=new Transformable,n.name=t,n}return __extends(t,e),t.prototype.setBoundingRect=function(e,t,n,i){return this._rect=new BoundingRect(e,t,n,i),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,i){this.transformTo(e,t,n,i),this._viewRect=new BoundingRect(e,t,n,i)},t.prototype.transformTo=function(e,t,n,i){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new BoundingRect(e,t,n,i)),a.decomposeTransform(),this._updateTransform()},t.prototype.setCenter=function(e){e&&(this._center=e,this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),r=this.getZoom();i=applyTransform([],i,e),n=applyTransform([],n,e),t.originX=i[0],t.originY=i[1],t.x=n[0]-i[0],t.y=n[1]-i[1],t.scaleX=t.scaleY=r,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),copy$1(this.transform||(this.transform=[]),t.transform||create$1()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],invert(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?slice(e):create$1(),rawScaleX:t.scaleX,rawScaleY:t.scaleY,rawX:t.x,rawY:t.y}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var i=t?this._rawTransform:this.transform;return n=n||[],i?v2ApplyTransform(n,e,i):copy(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?v2ApplyTransform([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(Transformable);function getCoordSys(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var Geo=function(e){function t(t,n,i,r){var a=e.call(this,t)||this;a.dimensions=["lng","lat"],a.type="geo",a.map=n;var o=geoSourceManager.load(n,i);return a._nameCoordMap=o.nameCoordMap,a._regionsMap=o.regionsMap,a._invertLongitute=null==r||r,a.regions=o.regions,a._rect=o.boundingRect,a}return __extends(t,e),t.prototype.containCoord=function(e){for(var t=this.regions,n=0;n1?(s.width=o,s.height=o/d):(s.height=o,s.width=o*d),s.y=a[1]-s.height/2,s.x=a[0]-s.width/2;else{var g=e.getBoxLayoutParams();g.aspect=d,s=getLayoutRect(g,{width:h,height:p})}this.setViewRect(s.x,s.y,s.width,s.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function setGeoCoords(e,t){each(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}mixin(Geo,View);var GeoCreator=function(){function e(){this.dimensions=Geo.prototype.dimensions}return e.prototype.create=function(e,t){var n=[];e.eachComponent("geo",(function(e,i){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=mapDataStorage.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new Geo(r+i,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),n.push(l),e.coordinateSystem=l,l.model=e,l.resize=resizeGeo,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var i={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}})),each(i,(function(e,i){var r=map(e,(function(e){return e.get("nameMap")})),a=new Geo(i,i,mergeAll(r));a.zoomLimit=retrieve.apply(null,map(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=resizeGeo,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),each(e,(function(e){e.coordinateSystem=a,setGeoCoords(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n){for(var i=(e||[]).slice(),r=createHashMap(),a=0;at&&(t=i.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),Tree=function(){function e(e){this.type="tree",this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,i=t.length;na&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var i=this.getData().tree,r=i.root.children[0],a=i.getNodeByDataIndex(e),o=a.getValue(),s=a.name;a&&a!==r;)s=a.parentNode.name+"."+s,a=a.parentNode;return createTooltipMarkup("nameValue",{name:s,value:o,noValue:isNaN(o)||null==o})},t.type="series.tree",t.layoutMode="box",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(SeriesModel);function init$2(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,r=[t];n=r.pop();)if(i=n.children,n.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(o)}}function firstWalk(e,t){var n=e.isExpand?e.children:[],i=e.parentNode.children,r=e.hierNode.i?i[e.hierNode.i-1]:null;if(n.length){executeShifts(e);var a=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=apportion(e,r,e.parentNode.hierNode.defaultAncestor||i[0],t)}function secondWalk(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function separation(e){return arguments.length?e:defaultSeparation}function radialCoordinate(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function getViewRect$1(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function executeShifts(e){for(var t=e.children,n=t.length,i=0,r=0;--n>=0;){var a=t[n];a.hierNode.prelim+=i,a.hierNode.modifier+=i,r+=a.hierNode.change,i+=a.hierNode.shift+r}}function apportion(e,t,n,i){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=nextRight(s),a=nextLeft(a),s&&a;){r=nextRight(r),o=nextLeft(o),r.hierNode.ancestor=e;var p=s.hierNode.prelim+h-a.hierNode.prelim-u+i(s,a);p>0&&(moveSubtree(nextAncestor(s,e,n),e,p),u+=p,l+=p),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,c+=o.hierNode.modifier}s&&!nextRight(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=h-l),a&&!nextLeft(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,n=e)}return n}function nextRight(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function nextLeft(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function nextAncestor(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function moveSubtree(e,t,n){var i=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=i,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=i}function defaultSeparation(e,t){return e.parentNode===t.parentNode?1:2}SeriesModel.registerClass(TreeSeriesModel);var TreeEdgeShape=function(){this.parentPoint=[],this.childPoints=[]},TreePath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new TreeEdgeShape},t.prototype.buildPath=function(e,t){var n=t.childPoints,i=n.length,r=t.parentPoint,a=n[0],o=n[i-1];if(1===i)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=parsePercent$2(t.forkPosition,1),h=[];h[l]=r[l],h[u]=r[u]+(o[u]-r[u])*c,e.moveTo(r[0],r[1]),e.lineTo(h[0],h[1]),e.moveTo(a[0],a[1]),h[l]=a[l],e.lineTo(h[0],h[1]),h[l]=o[l],e.lineTo(h[0],h[1]),e.lineTo(o[0],o[1]);for(var p=1;pv.x)||(x-=Math.PI);var T=S?"left":"right",M=s.getModel("label"),A=M.get("rotate"),I=A*(Math.PI/180),C=m.getTextContent();C&&(m.setTextConfig({position:M.get("position")||T,rotation:null==A?-x:I,origin:"center"}),C.setStyle("verticalAlign","middle"))}var w=s.get(["emphasis","focus"]),P="ancestor"===w?o.getAncestorsIndices():"descendant"===w?o.getDescendantIndices():null;P&&(getECData(n).focus=P),drawEdge(r,o,c,n,f,d,g,i),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var i=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);i&&i.hoverState===HOVER_STATE_BLUR||setStatesFlag(n.__edge,t)}})}function drawEdge(e,t,n,i,r,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),p=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=i.__edge=new BezierCurve({shape:getEdgeShape(c,h,p,r,r)})),updateProps(g,{shape:getEdgeShape(c,h,p,a,o)},e));else if("polyline"===u)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var m=t.children,y=[],v=0;v=0;a--)i.push(r[a])}}function treeLayout(e,t){e.eachSeriesByType("tree",(function(e){commonLayout(e,t)}))}function commonLayout(e,t){var n=getViewRect$1(e,t);e.layoutInfo=n;var i=e.get("layout"),r=0,a=0,o=null;"radial"===i?(r=2*Math.PI,a=Math.min(n.height,n.width)/2,o=separation((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=n.width,a=n.height,o=separation());var s=e.getData().tree.root,l=s.children[0];if(l){init$2(s),eachAfter(l,firstWalk,o),s.hierNode.modifier=-l.hierNode.prelim,eachBefore(l,secondWalk);var u=l,c=l,h=l;eachBefore(l,(function(e){var t=e.getLayout().x;tc.getLayout().x&&(c=e),e.depth>h.depth&&(h=e)}));var p=u===c?1:o(u,c)/2,d=p-u.getLayout().x,f=0,g=0,m=0,y=0;if("radial"===i)f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y=(e.depth-1)*g;var t=radialCoordinate(m,y);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:y},!0)}));else{var v=e.getOrient();"RL"===v||"LR"===v?(g=a/(c.getLayout().x+p+d),f=r/(h.depth-1||1),eachBefore(l,(function(e){y=(e.getLayout().x+d)*g,m="LR"===v?(e.depth-1)*f:r-(e.depth-1)*f,e.setLayout({x:m,y:y},!0)}))):"TB"!==v&&"BT"!==v||(f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y="TB"===v?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:y},!0)})))}}}function treeVisual(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();extend(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}function retrieveTargetInfo(e,t,n){if(e&&indexOf(t,e.type)>=0){var i=n.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=i.getNodeById(a)))return{node:r}}}function getPathToRoot(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function aboveViewRoot(e,t){return indexOf(getPathToRoot(e),t)>=0}function wrapTreePathInfo(e,t){for(var n=[];e;){var i=e.dataIndex;n.push({name:e.name,dataIndex:i,value:t.getRawValue(i)}),e=e.parentNode}return n.reverse(),n}function enableAriaDecalForTree(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var i=t;i&&i.depth>1;)i=i.parentNode;var r=getDecalFromPalette(e.ecModel,i.name||i.dataIndex+"",n);t.setVisual("decal",r)}))}ChartView.registerClass(TreeView),registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,i=t.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=updateCenterAndZoom(t.coordinateSystem,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))})),registerLayout(treeLayout),registerVisual(treeVisual);var TreemapSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue(n);var i=e.levels||[],r=this.designatedVisualItemStyle={},a=new Model({itemStyle:r},this,t),o=map((i=e.levels=setDefault(i,t))||[],(function(e){return new Model(e,a,t)}),this),s=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),i=o[n.depth];return e.parentModel=i||a,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e);return createTooltipMarkup("nameValue",{name:i.getName(e),value:r})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},extend(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=createHashMap(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(SeriesModel);function completeTreeValue(e){var t=0;each(e.children,(function(e){completeTreeValue(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}function setDefault(e,t){var n=normalizeToArray(t.get("color")),i=normalizeToArray(t.get("decals"));if(n){var r,a;each(e=e||[],(function(e){var t=new Model(e),n=t.get("color"),i=t.get("decal");(t.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(t.get(["itemStyle","decal"])||i&&"none"!==i)&&(a=!0)}));var o=e[0]||(e[0]={});return r||(o.color=n.slice()),!a&&i&&(o.decal=i.slice()),e}}SeriesModel.registerClass(TreemapSeriesModel);var TEXT_PADDING=8,ITEM_GAP=8,ARRAY_LENGTH=5,Breadcrumb=function(){function e(e){this.group=new Group,e.add(this.group)}return e.prototype.render=function(e,t,n,i){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&n){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(e,l,o,s,i),positionElement(a,l.pos,l.box)}},e.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var r=convertOptionIdName(i.getModel().get("name"),""),a=n.getTextRect(r),o=Math.max(a.width+2*TEXT_PADDING,t.emptyItemWidth);t.totalWidth+=o+ITEM_GAP,t.renderList.push({node:i,text:r,width:o})}},e.prototype._renderContent=function(e,t,n,i,r){for(var a=0,o=t.emptyItemWidth,s=e.get(["breadcrumb","height"]),l=getAvailableSize(t.pos,t.box),u=t.totalWidth,c=t.renderList,h=c.length-1;h>=0;h--){var p=c[h],d=p.node,f=p.width,g=p.text;u>l.width&&(u-=f-o,f=o,g=null);var m=new Polygon({shape:{points:makeItemPoints(a,0,f,s,h===c.length-1,0===h)},style:defaults(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new ZRText({style:{text:g,fill:i.getTextColor(),font:i.getFont()}}),textConfig:{position:"inside"},z:10,onclick:curry(r,d)});m.disableLabelAnimation=!0,this.group.add(m),packEventData(m,e,d),a+=f+ITEM_GAP}},e.prototype.remove=function(){this.group.removeAll()},e}();function makeItemPoints(e,t,n,i,r,a){var o=[[r?e:e-ARRAY_LENGTH,t],[e+n,t],[e+n,t+i],[r?e:e-ARRAY_LENGTH,t+i]];return!a&&o.splice(2,0,[e+n+ARRAY_LENGTH,t+i/2]),!r&&o.push([e,t+i/2]),o}function packEventData(e,t,n){getECData(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&wrapTreePathInfo(n,t)}}var AnimationWrap=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,i,r){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:r}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,r=this._storage.length;iDRAG_THRESHOLD||Math.abs(e.dy)>DRAG_THRESHOLD)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var a=new BoundingRect(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,n-=o.y;var s=create$1();translate(s,s,[-t,-n]),scale$1(s,s,[e.scale,e.scale]),translate(s,s,[t,n]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var i=t.findTarget(e.offsetX,e.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)t._rootToNode(i);else if("zoomToNode"===n)t._zoomToNode(i);else if("link"===n){var a=r.hostTree.data.getItemModel(r.dataIndex),o=a.get("link",!0),s=a.get("target",!0)||"blank";o&&windowOpen(o,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var i=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new Breadcrumb(this.group))).render(e,t,n.node,(function(t){"animating"!==i._state&&(aboveViewRoot(e.getViewRoot(),t)?i._rootToNode({node:t}):i._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=createStorage(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;n={node:i,offsetX:a[0],offsetY:a[1]}}}),this),n},t.type="treemap",t}(ChartView);function createStorage(){return{nodeGroup:[],background:[],content:[]}}function renderNode(e,t,n,i,r,a,o,s,l,u){if(o){var c=o.getLayout(),h=e.getData(),p=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),c&&c.isInView){var d=c.width,f=c.height,g=c.borderWidth,m=c.invisible,y=o.getRawIndex(),v=s&&s.getRawIndex(),_=o.viewChildren,x=c.upperHeight,S=_&&_.length,b=p.getModel("itemStyle"),T=p.getModel(["emphasis","itemStyle"]),M=p.getModel(["blur","itemStyle"]),A=p.getModel(["select","itemStyle"]),I=b.get("borderRadius")||0,C=N("nodeGroup",Group$1);if(C){if(l.add(C),C.x=c.x||0,C.y=c.y||0,C.markRedraw(),inner$9(C).nodeWidth=d,inner$9(C).nodeHeight=f,c.isAboveViewRoot)return C;var w=N("background",Rect$1,u,Z_BG);w&&function(t,n,i){var r=getECData(n);if(r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:d,height:f,r:I}),m)R(n);else{n.invisible=!1;var a=o.getVisual("style"),s=a.stroke,l=getItemStyleNormal(b);l.fill=s;var u=getStateItemStyle(T);u.fill=T.get("borderColor");var c=getStateItemStyle(M);c.fill=M.get("borderColor");var h=getStateItemStyle(A);if(h.fill=A.get("borderColor"),i){var p=d-2*g;O(n,s,p,x,a.opacity,{x:g,y:0,width:p,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,setDefaultStateProxy(n)}t.add(n)}(C,w,S&&c.upperLabelHeight);var P=p.get(["emphasis","focus"]),L=p.get(["emphasis","blurScope"]),E="ancestor"===P?o.getAncestorsIndices():"descendant"===P?o.getDescendantIndices():null;if(S)isHighDownDispatcher(C)&&setAsHighDownDispatcher(C,!1),w&&(setAsHighDownDispatcher(w,!0),h.setItemGraphicEl(o.dataIndex,w),enableHoverFocus(w,E||P,L));else{var D=N("content",Rect$1,u,Z_CONTENT);D&&function(t,n){var i=getECData(n);i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var r=Math.max(d-2*g,0),a=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:a,r:I}),m)R(n);else{n.invisible=!1;var s=o.getVisual("style"),l=s.fill,u=getItemStyleNormal(b);u.fill=l,u.decal=s.decal;var c=getStateItemStyle(T),h=getStateItemStyle(M),p=getStateItemStyle(A);O(n,l,r,s.opacity),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=p,setDefaultStateProxy(n)}t.add(n)}(C,D),w&&isHighDownDispatcher(w)&&setAsHighDownDispatcher(w,!1),setAsHighDownDispatcher(C,!0),h.setItemGraphicEl(o.dataIndex,C),enableHoverFocus(C,E||P,L)}return C}}}function R(e){!e.invisible&&a.push(e)}function O(t,n,i,r,a,s){var l=p.getModel(s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),u=retrieve(e.getFormattedLabel(o.dataIndex,"normal",null,null,l.get("formatter")),convertOptionIdName(p.get("name"),null));if(!s&&c.isLeafRoot){var h=e.get("drillDownIcon",!0);u=h?h+" "+u:u}var d=l.getShallow("show");setLabelStyle(t,getLabelStatesModels(p,s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),{defaultText:d?u:null,inheritColor:n,defaultOpacity:i,labelFetcher:e,labelDataIndex:o.dataIndex});var f=t.getTextContent(),g=f.style,m=normalizeCssArray(g.padding||0);s&&(t.setTextConfig({layoutRect:s}),f.disableLabelLayout=!0),f.beforeUpdate=function(){var e=Math.max((s?s.width:t.shape.width)-m[1]-m[3],0),n=Math.max((s?s.height:t.shape.height)-m[0]-m[2],0);g.width===e&&g.height===n||f.setStyle({width:e,height:n})},g.truncateMinChar=2,g.lineOverflow="truncate",k(g,s,c);var y=f.getState("emphasis");k(y?y.style:null,s,c)}function k(t,n,i){var r=t?t.text:null;if(!n&&i.isLeafRoot&&null!=r){var a=e.get("drillDownIcon",!0);t.text=a?a+" "+r:r}}function N(e,a,s,l){var u=null!=v&&n[e][v],c=r[e];return u?(n[e][v]=null,function(e,t){var n=e[y]={};t instanceof Group$1?(n.oldX=t.x,n.oldY=t.y):n.oldShape=extend({},t.shape)}(c,u)):m||((u=new a)instanceof Displayable&&(u.z=calculateZ(s,l)),function(e,t){var n=e[y]={},a=o.parentNode,s=t instanceof Group;if(a&&(!i||"drillDown"===i.direction)){var l=0,u=0,c=r.background[a.getRawIndex()];!i&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}(c,u)),t[e][y]=u}}function calculateZ(e,t){var n=e*Z_BASE+t;return(n-1)/n}ChartView.registerClass(TreemapView);for(var noop$1=function(){},actionTypes=["treemapZoomToNode","treemapRender","treemapMove"],i$1=0;i$1=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}function normalizeVisualRange(e,t){var n=e.visual,i=[];isObject(n)?each$4(n,(function(e){i.push(e)})):null!=n&&i.push(n);t||1!==i.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(i[1]=i[0]),setVisualToOption(e,i)}function makePartialColorVisualHandler(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:createNormalizedToNumericVisual([0,1])}}function doMapToArray(e){var t=this.option.visual;return t[Math.round(linearMap(e,[0,1],[0,t.length-1],!0))]||{}}function makeApplyVisual(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function doMapCategory(e){var t=this.option.visual;return t[this.option.loop&&e!==CATEGORY_DEFAULT_VISUAL_INDEX?e%t.length:e]}function doMapFixed(){return this.option.visual[0]}function createNormalizedToNumericVisual(e){return{linear:function(t){return linearMap(t,e,this.option.visual,!0)},category:doMapCategory,piecewise:function(t,n){var i=getSpecifiedVisual.call(this,n);return null==i&&(i=linearMap(t,e,this.option.visual,!0)),i},fixed:doMapFixed}}function getSpecifiedVisual(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=n[VisualMapping.findPieceIndex(e,n)];if(i&&i.visual)return i.visual[this.type]}}function setVisualToOption(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=map(t,(function(e){return parse(e)}))),t}var normalizers={linear:function(e){return linearMap(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=VisualMapping.findPieceIndex(e,t,!0);if(null!=n)return linearMap(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?CATEGORY_DEFAULT_VISUAL_INDEX:t},fixed:noop};function littleThan(e,t,n){return e?t<=n:t=n.length||e===n[e.depth])&&travelTree(e,mapVisual(r,u,e,t,f,i),n,i)}))}else s=calculateColor(u),c.fill=s}}function buildVisuals(e,t,n){var i=extend({},t),r=n.designatedVisualItemStyle;return each(["color","colorAlpha","colorSaturation"],(function(n){r[n]=t[n];var a=e.get(n);r[n]=null,null!=a&&(i[n]=a)})),i}function calculateColor(e){var t=getValueVisualDefine(e,"color");if(t){var n=getValueVisualDefine(e,"colorAlpha"),i=getValueVisualDefine(e,"colorSaturation");return i&&(t=modifyHSL(t,null,null,i)),n&&(t=modifyAlpha(t,n)),t}}function calculateBorderColor(e,t){return null!=t?modifyHSL(t,null,null,e):null}function getValueVisualDefine(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function buildVisualMapping(e,t,n,i,r,a){if(a&&a.length){var o=getRangeVisual(t,"color")||null!=r.color&&"none"!==r.color&&(getRangeVisual(t,"colorAlpha")||getRangeVisual(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var p=new VisualMapping(h);return inner$a(p).drColorMappingBy=c,p}}}function getRangeVisual(e,t){var n=e.get(t);return isArray(n)&&n.length?{name:t,range:n}:null}function mapVisual(e,t,n,i,r,a){var o=extend({},t);if(r){var s=r.type,l="color"===s&&inner$a(r).drColorMappingBy,u="index"===l?i:"id"===l?a.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}var mathMax$7=Math.max,mathMin$7=Math.min,retrieveValue=retrieve,each$5=each,PATH_BORDER_WIDTH=["itemStyle","borderWidth"],PATH_GAP_WIDTH=["itemStyle","gapWidth"],PATH_UPPER_LABEL_SHOW=["upperLabel","show"],PATH_UPPER_LABEL_HEIGHT=["upperLabel","height"],treemapLayout={seriesType:"treemap",reset:function(e,t,n,i){var r=n.getWidth(),a=n.getHeight(),o=e.option,s=getLayoutRect(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=o.size||[],u=parsePercent$2(retrieveValue(s.width,l[0]),r),c=parsePercent$2(retrieveValue(s.height,l[1]),a),h=i&&i.type,p=retrieveTargetInfo(i,["treemapZoomToNode","treemapRootToNode"],e),d="treemapRender"===h||"treemapMove"===h?i.rootRect:null,f=e.getViewRoot(),g=getPathToRoot(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?estimateRootSize(e,p,f,u,c):d?[d.width,d.height]:[u,c],y=o.sort;y&&"asc"!==y&&"desc"!==y&&(y="desc");var v={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),squarify(f,v,!1,0),_=f.getLayout(),each$5(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(extend({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(calculateRootPosition(s,d,p),!0),e.setLayoutInfo(s),prunning(x,new BoundingRect(-s.x,-s.y,r,a),g,f,0)}};function squarify(e,t,n,i){var r,a;if(!e.isRemoved()){var o=e.getLayout();r=o.width,a=o.height;var s=e.getModel(),l=s.get(PATH_BORDER_WIDTH),u=s.get(PATH_GAP_WIDTH)/2,c=getUpperLabelHeight(s),h=Math.max(l,c),p=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(r=mathMax$7(r-2*p,0))*(a=mathMax$7(a-p-d,0)),g=initChildren(e,s,f,t,n,i);if(g.length){var m={x:p,y:d,width:r,height:a},y=mathMin$7(r,a),v=1/0,_=[];_.area=0;for(var x=0,S=g.length;x=0;l--){var u=r["asc"===i?o-l-1:l].getValue();u/n*to[1]&&(o[1]=t)}))):o=[NaN,NaN],{sum:i,dataExtent:o}}function worst(e,t,n){for(var i=0,r=1/0,a=0,o=void 0,s=e.length;ai&&(i=o));var l=e.area*e.area,u=t*t*n;return l?mathMax$7(u*i/l,l/(u*r)):1/0}function position(e,t,n,i,r){var a=t===n.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=n[s[a]],c=t?e.area/t:0;(r||c>n[l[o]])&&(c=n[l[o]]);for(var h=0,p=e.length;hMAX_SAFE_INTEGER&&(u=MAX_SAFE_INTEGER),o=a}u=0&&e.call(t,n[r],r)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&e.call(t,n[r],r)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof GraphNode||(t=this._nodesMap[generateNodeKey(t)]),t){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",a=0;a=0&&n.node2.dataIndex>=0}));for(r=0,a=i.length;r=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function createGraphFromNodeEdge(e,t,n,i,r){for(var a=new Graph(i),o=0;o "+p)),u++)}var d,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=createListFromArray(e,n);else{var g=CoordinateSystemManager.get(f),m=g&&g.dimensions||[];indexOf(m,"value")<0&&m.concat(["value"]);var y=createDimensions(e,{coordDimensions:m});(d=new List(y,n)).initData(e)}var v=new List(["value"],n);return v.initData(l,s),r&&r(d,v),linkList({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}mixin(GraphNode,createGraphDataProxyMixin("hostGraph","data")),mixin(GraphEdge,createGraphDataProxyMixin("hostGraph","edgeData"));var KEY_DELIMITER="--\x3e",getAutoCurvenessParams=function(e){return e.get("autoCurveness")||null},createCurveness=function(e,t){var n=getAutoCurvenessParams(e),i=20,r=[];if("number"==typeof n)i=n;else if(isArray(n))return void(e.__curvenessList=n);t>i&&(i=t);var a=i%2?i+2:i+3;r=[];for(var o=0;o "),value:r.value,noValue:null==r.value})}return defaultSeriesFormatTooltip({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=map(this.option.categories||[],(function(e){return null!=e.value?e:extend({value:0},e)})),t=new List(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);SeriesModel.registerClass(GraphSeriesModel);var straightLineProto=Line.prototype,bezierCurveProto=BezierCurve.prototype,StraightLineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},CurveShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(StraightLineShape);function isStraightLine(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ECLinePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new StraightLineShape},t.prototype.buildPath=function(e,t){isStraightLine(t)?straightLineProto.buildPath.call(this,e,t):bezierCurveProto.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return isStraightLine(this.shape)?straightLineProto.pointAt.call(this,e):bezierCurveProto.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=isStraightLine(t)?[t.x2-t.x1,t.y2-t.y1]:bezierCurveProto.tangentAt.call(this,e);return normalize(n,n)},t}(Path),SYMBOL_CATEGORIES=["fromSymbol","toSymbol"];function makeSymbolTypeKey(e){return"_"+e+"Type"}function createSymbol$1(e,t,n){var i=t.getItemVisual(n,e);if(i&&"none"!==i){var r=t.getItemVisual(n,e+"Size"),a=t.getItemVisual(n,e+"Rotate"),o=isArray(r)?r:[r,r],s=createSymbol(i,-o[0]/2,-o[1]/2,o[0],o[1]);return s.__specifiedRotation=null==a||isNaN(a)?void 0:+a*Math.PI/180||0,s.name=e,s}}function createLine(e){var t=new ECLinePath({name:"line",subPixelOptimize:!0});return setLinePoints(t.shape,e),t}function setLinePoints(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var Line$1=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return __extends(t,e),t.prototype._createLine=function(e,t,n){var i=e.hostModel,r=createLine(e.getItemLayout(t));r.shape.percent=0,initProps(r,{shape:{percent:1}},i,t),this.add(r),each(SYMBOL_CATEGORIES,(function(n){var i=createSymbol$1(n,e,t);this.add(i),this[makeSymbolTypeKey(n)]=e.getItemVisual(t,n)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};setLinePoints(o.shape,a),updateProps(r,o,i,t),each(SYMBOL_CATEGORIES,(function(n){var i=e.getItemVisual(t,n),r=makeSymbolTypeKey(n);if(this[r]!==i){this.remove(this.childOfName(n));var a=createSymbol$1(n,e,t);this.add(a)}this[r]=i}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels;if(!n||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel(["emphasis","lineStyle"]).getLineStyle(),o=u.getModel(["blur","lineStyle"]).getLineStyle(),s=u.getModel(["select","lineStyle"]).getLineStyle(),l=getLabelStatesModels(u)}var c=e.getItemVisual(t,"style"),h=c.stroke;r.useStyle(c),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=a,r.ensureState("blur").style=o,r.ensureState("select").style=s,each(SYMBOL_CATEGORIES,(function(e){var t=this.childOfName(e);if(t){t.setColor(h),t.style.opacity=c.opacity;for(var n=0;n0&&(v[0]=-v[0],v[1]=-v[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var S=-Math.atan2(y[1],y[0]);u[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+b,h=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+b,h="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+b,h=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-b}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||h})}}}function T(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(Group),LineDraw=function(){function e(e){this.group=new Group,this._LineCtor=e||Line$1}return e.prototype.isPersistent=function(){return!0},e.prototype.updateData=function(e){var t=this,n=this,i=n.group,r=n._lineData;n._lineData=e,r||i.removeAll();var a=makeSeriesScope$1(e);e.diff(r).add((function(n){t._doAdd(e,n,a)})).update((function(n,i){t._doUpdate(r,e,i,n,a)})).remove((function(e){i.remove(r.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=makeSeriesScope$1(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||isEffectObject(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function makeSeriesScope$1(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:getLabelStatesModels(t)}}function isPointNaN(e){return isNaN(e[0])||isNaN(e[1])}function lineNeedsDraw(e){return!isPointNaN(e[0])&&!isPointNaN(e[1])}function getNodeGlobalScale(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,i=t.scaleX;return((t.getZoom()-1)*n+1)/i}function getSymbolSize(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var v1=[],v2=[],v3=[],quadraticAt$1=quadraticAt,v2DistSquare=distSquare,mathAbs$2=Math.abs;function intersectCurveCircle(e,t,n){for(var i,r=e[0],a=e[1],o=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){v1[0]=quadraticAt$1(r[0],a[0],o[0],c),v1[1]=quadraticAt$1(r[1],a[1],o[1],c),(d=mathAbs$2(v2DistSquare(v1,t)-l))=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function adjustEdge(e,t){var n=[],i=quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[clone$1(l[0]),clone$1(l[1])],l[2]&&l.__original.push(clone$1(l[2])));var h=l.__original;if(null!=l[2]){if(copy(r[0],h[0]),copy(r[1],h[2]),copy(r[2],h[1]),u&&"none"!==u){var p=getSymbolSize(e.node1),d=intersectCurveCircle(r,h[0],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],d,n),r[0][1]=n[3],r[1][1]=n[4]}if(c&&"none"!==c){p=getSymbolSize(e.node2),d=intersectCurveCircle(r,h[1],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],d,n),r[1][1]=n[1],r[2][1]=n[2]}copy(l[0],r[0]),copy(l[1],r[2]),copy(l[2],r[1])}else{if(copy(a[0],h[0]),copy(a[1],h[1]),sub(o,a[1],a[0]),normalize(o,o),u&&"none"!==u){p=getSymbolSize(e.node1);scaleAndAdd(a[0],a[0],o,p*t)}if(c&&"none"!==c){p=getSymbolSize(e.node2);scaleAndAdd(a[1],a[1],o,-p*t)}copy(l[0],a[0]),copy(l[1],a[1])}}))}function isViewCoordSys(e){return"view"===e.type}var GraphView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new SymbolDraw,i=new LineDraw,r=this.group;this._controller=new RoamController(t.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if(isViewCoordSys(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):updateProps(s,l,e)}adjustEdge(e.getGraph(),getNodeGlobalScale(e));var u=e.getData();a.updateData(u);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,p=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p),u.graph.eachNode((function(e){var t=e.dataIndex,n=e.getGraphicEl(),r=e.getModel();n.off("drag").off("dragend");var a=r.get("draggable");a&&n.on("drag",(function(){h&&(h.warmUp(),!i._layouting&&i._startForceLayoutIteration(h,p),h.setFixed(t),u.setItemLayout(t,[n.x,n.y]))})).on("dragend",(function(){h&&h.setUnfixed(t)})),n.setDraggable(a&&!!h),"adjacency"===r.get(["emphasis","focus"])&&(getECData(n).focus=e.getAdjacentDataIndices())})),u.graph.eachEdge((function(e){var t=e.getGraphicEl();"adjacency"===e.getModel().get(["emphasis","focus"])&&(getECData(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var d="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var n=u.getItemModel(t).get(["label","rotate"])||0,i=e.getSymbolPath();if(d){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-f);a<0&&(a=2*Math.PI+a);var o=r[0]=r/3?1:2),l=t.y-i(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(o)*a,t.y+i(o)*a),e.lineTo(t.x+n(t.angle)*r,t.y+i(t.angle)*r),e.lineTo(t.x-n(o)*a,t.y-i(o)*a),e.lineTo(s,l)},t}(Path);function parsePosition(e,t){var n=e.get("center"),i=t.getWidth(),r=t.getHeight(),a=Math.min(i,r);return{cx:parsePercent$2(n[0],t.getWidth()),cy:parsePercent$2(n[1],t.getHeight()),r:parsePercent$2(e.get("radius"),a/2)}}function formatLabel(e,t){var n=null==e?"":e+"";return t&&("string"==typeof t?n=t.replace("{value}",n):"function"==typeof t&&(n=t(e))),n}var PI2$9=2*Math.PI,GaugeView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i=e.get(["axisLine","lineStyle","color"]),r=parsePosition(e,n);this._renderMain(e,t,n,i,r),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,r){for(var a=this.group,o=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?SausagePath:Sector,h=u.get("show"),p=u.getModel("lineStyle"),d=p.get("width"),f=(l-s)%PI2$9||l===s?(l-s)%PI2$9:PI2$9,g=s,m=0;h&&m=e&&(0===t?0:i[t-1][0]).8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0}))}if(v.get("show")&&L!==x){D=(D=v.get("distance"))?D+l:l;for(var k=0;k<=S;k++){u=Math.cos(M),c=Math.sin(M);var N=new Line({shape:{x1:u*(f-D)+p,y1:c*(f-D)+d,x2:u*(f-T-D)+p,y2:c*(f-T-D)+d},silent:!0,style:w});"auto"===w.stroke&&N.setStyle({stroke:i((L+k/S)/x)}),h.add(N),M+=I}M-=I}else M+=A}},t.prototype._renderPointer=function(e,t,n,i,r,a,o,s,l){var u=this.group,c=this._data,h=this._progressEls,p=[],d=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),y=m.mapDimension("value"),v=+e.get("min"),_=+e.get("max"),x=[v,_],S=[a,o];function b(t,n){var i,a=m.getItemModel(t).getModel("pointer"),o=parsePercent$2(a.get("width"),r.r),s=parsePercent$2(a.get("length"),r.r),l=e.get(["pointer","icon"]),u=a.get("offsetCenter"),c=a.get("keepAspect");return(i=l?createSymbol(l,parsePercent$2(u[0],r.r)-o/2,parsePercent$2(u[1],r.r)-s,o,s,null,c):new PointerPath({shape:{angle:-Math.PI/2,width:parsePercent$2(a.get("width"),r.r),r:parsePercent$2(a.get("length"),r.r)}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function T(e,t){var n=f.get("roundCap")?SausagePath:Sector,i=f.get("overlap"),o=i?f.get("width"):l/m.count(),u=i?r.r-o:r.r-(e+1)*o,c=i?r.r:r.r-e*o,h=new n({shape:{startAngle:a,endAngle:t,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:c}});return i&&(h.z2=_-m.get(y,e)%_),h}(g||d)&&(m.diff(c).add((function(t){if(d){var n=b(t,a);initProps(n,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(n),m.setItemGraphicEl(t,n)}if(g){var i=T(t,a),r=f.get("clip");initProps(i,{shape:{endAngle:linearMap(m.get(y,t),x,S,r)}},e),u.add(i),p[t]=i}})).update((function(t,n){if(d){var i=c.getItemGraphicEl(n),r=i?i.rotation:a,o=b(t,r);o.rotation=r,updateProps(o,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(o),m.setItemGraphicEl(t,o)}if(g){var s=h[n],l=T(t,s?s.shape.endAngle:a),v=f.get("clip");updateProps(l,{shape:{endAngle:linearMap(m.get(y,t),x,S,v)}},e),u.add(l),p[t]=l}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis");if(d){var r=m.getItemGraphicEl(e);r.useStyle(m.getItemVisual(e,"style")),r.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===r.style.fill&&r.setStyle("fill",i(linearMap(m.get(y,e),x,[0,1],!0))),r.z2EmphasisLift=0,setStatesStylesFromModel(r,t),enableHoverEmphasis(r,n.get("focus"),n.get("blurScope"))}if(g){var a=p[e];a.useStyle(m.getItemVisual(e,"style")),a.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),a.z2EmphasisLift=0,setStatesStylesFromModel(a,t),enableHoverEmphasis(a,n.get("focus"),n.get("blurScope"))}})),this._progressEls=p)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),a=n.get("offsetCenter"),o=n.get("keepAspect"),s=createSymbol(r,t.cx-i/2+parsePercent$2(a[0],t.r),t.cy-i/2+parsePercent$2(a[1],t.r),i,i,null,o);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,r){var a=this,o=e.getData(),s=o.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Group,h=[],p=[],d=e.isAnimationEnabled();o.diff(this._data).add((function(e){h[e]=new ZRText({silent:!0}),p[e]=new ZRText({silent:!0})})).update((function(e,t){h[e]=a._titleEls[t],p[e]=a._detailEls[t]})).execute(),o.each((function(t){var n=o.getItemModel(t),a=o.get(s,t),f=new Group,g=i(linearMap(a,[l,u],[0,1],!0)),m=n.getModel("title");if(m.get("show")){var y=m.get("offsetCenter"),v=r.cx+parsePercent$2(y[0],r.r),_=r.cy+parsePercent$2(y[1],r.r);(C=h[t]).attr({style:createTextStyle(m,{x:v,y:_,text:o.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:g})}),setLabelValueAnimation(C,{normal:m},e.getRawValue(t),(function(){return o.getName(t)})),d&&animateLabelValue(C,t,o,e),f.add(C)}var x=n.getModel("detail");if(x.get("show")){var S=x.get("offsetCenter"),b=r.cx+parsePercent$2(S[0],r.r),T=r.cy+parsePercent$2(S[1],r.r),M=parsePercent$2(x.get("width"),r.r),A=parsePercent$2(x.get("height"),r.r),I=e.get(["progress","show"])?o.getItemVisual(t,"style").fill:g,C=p[t],w=x.get("formatter");C.attr({style:createTextStyle(x,{x:b,y:T,text:formatLabel(a,w),width:isNaN(M)?null:M,height:isNaN(A)?null:A,align:"center",verticalAlign:"middle"},{inheritColor:I})}),setLabelValueAnimation(C,{normal:x},e.getRawValue(t),(function(e){return formatLabel(e,w)})),d&&animateLabelValue(C,t,o,e),f.add(C)}c.add(f)})),this.group.add(c),this._titleEls=h,this._detailEls=p},t.type="gauge",t}(ChartView);ChartView.registerClass(GaugeView);var FunnelSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype._defaultLabelLine=function(e){defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),r=n.mapDimension("value"),a=n.getSum(r);return i.percent=a?+(n.get(r,t)/a*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);ComponentModel.registerClass(FunnelSeriesModel);var opacityAccessPath=["itemStyle","opacity"],FunnelPiece=function(e){function t(t,n){var i=e.call(this)||this,r=i,a=new Polyline,o=new ZRText;return r.setTextContent(o),i.setTextGuideLine(a),i.updateData(t,n,!0),i}return __extends(t,e),t.prototype.updateData=function(e,t,n){var i=this,r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel("emphasis"),l=a.get(opacityAccessPath);l=null==l?1:l,i.useStyle(e.getItemVisual(t,"style")),i.style.lineJoin="round",n?(i.setShape({points:o.points}),i.style.opacity=0,initProps(i,{style:{opacity:l}},r,t)):updateProps(i,{style:{opacity:l},shape:{points:o.points}},r,t),setStatesStylesFromModel(i,a),this._updateLabel(e,t),enableHoverEmphasis(this,s.get("focus"),s.get("blurScope"))},t.prototype._updateLabel=function(e,t){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;setLabelStyle(r,getLabelStatesModels(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Point(c[0][0],c[0][1]):null},updateProps(r,{style:{x:s.x,y:s.y}},a,t),r.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),setLabelLineStyle(n,getLabelLineStatesModels(o),{stroke:u})},t}(Polygon),FunnelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this._data,a=this.group;i.diff(r).add((function(e){var t=new FunnelPiece(i,e);i.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var n=r.getItemGraphicEl(t);n.updateData(i,e),a.add(n),i.setItemGraphicEl(e,n)})).remove((function(t){removeElementWithFadeOut(r.getItemGraphicEl(t),e,t)})).execute(),this._data=i},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(ChartView);function getViewRect$3(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function getSortedIndices(e,t){for(var n=e.mapDimension("value"),i=e.mapArray(n,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();oa&&(t[1-i]=t[i]+u.sign*a),t}function getSpanSign(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function restrict(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var each$6=each,mathMin$8=Math.min,mathMax$8=Math.max,mathFloor$2=Math.floor,mathCeil$1=Math.ceil,round$2=round$1,PI$8=Math.PI,Parallel=function(){function e(e,t,n){this.type="parallel",this._axesMap=createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=e.dimensions,r=e.parallelAxisIndex;each$6(i,(function(e,n){var i=r[n],a=t.getComponent("parallelAxis",i),o=this._axesMap.set(e,new ParallelAxis(e,createScaleByModel(a),[0,0],a.get("type"),i)),s="category"===o.type;o.onBand=s&&a.get("boundaryGap"),o.inverse=a.get("inverse"),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,r=t.pixelDimIndex,a=e[1-r],o=e[r];return a>=n&&a<=n+t.axisLength&&o>=i&&o<=i+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var i=n.getData();each$6(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(i,i.mapDimension(e)),niceScaleExtent(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,i=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=n[r[o]],l=[0,s],u=this.dimensions.length,c=restrict$1(t.get("axisExpandWidth"),l),h=restrict$1(t.get("axisExpandCount")||0,[0,u]),p=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow");d?(e=restrict$1(d[1]-d[0],l),d[1]=d[0]+e):(e=restrict$1(c*(h-1),l),(d=[c*(t.get("axisExpandCenter")||mathFloor$2(u/2))-e/2])[1]=d[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[mathFloor$2(round$2(d[0]/c,1))+1,mathCeil$1(round$2(d[1]/c,1))-1],m=f/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:n[i[o]],layoutLength:s,axisBase:n[i[1-o]],axisLength:n[r[1-o]],axisExpandable:p,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:d,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;t.each((function(e){var t=[0,i.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),each$6(n,(function(t,n){var a=(i.axisExpandable?layoutAxisWithExpand:layoutAxisWithoutExpand)(n,i),o={horizontal:{x:a.position,y:i.axisLength},vertical:{x:0,y:a.position}},s={horizontal:PI$8/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],c=create$1();rotate(c,c,u),translate(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,i){null==n&&(n=0),null==i&&(i=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-c[0])?(l="jump",o=s-r*(1-c[2])):(o=s-r*c[1])>=0&&(o=s-r*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?sliderMove(o,i,a,"all"):l="none";else{var p=i[1]-i[0];(i=[mathMax$8(0,a[1]*s/p-p/2)])[1]=mathMin$8(a[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:l}},e}();function restrict$1(e,t){return mathMin$8(mathMax$8(e,t[0]),t[1])}function layoutAxisWithoutExpand(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function layoutAxisWithExpand(e,t){var n,i,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e=0;n--)asc(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var i=0,r=t.length;iUNSELECT_THRESHOLD}function getTrackEnds(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function createBaseRectCover(e,t,n,i){var r=new Group;return r.add(new Rect({name:"main",style:makeStyle(n),silent:!0,draggable:!0,cursor:"move",drift:curry(driftRect,e,t,r,["n","s","w","e"]),ondragend:curry(trigger$1,t,{isEnd:!0})})),each(i,(function(n){r.add(new Rect({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:curry(driftRect,e,t,r,n),ondragend:curry(trigger$1,t,{isEnd:!0})}))})),r}function updateBaseRect(e,t,n,i){var r=i.brushStyle.lineWidth||0,a=mathMax$9(r,MIN_RESIZE_LINE_WIDTH),o=n[0][0],s=n[1][0],l=o-r/2,u=s-r/2,c=n[0][1],h=n[1][1],p=c-a+r/2,d=h-a+r/2,f=c-o,g=h-s,m=f+r,y=g+r;updateRectShape(e,t,"main",o,s,f,g),i.transformable&&(updateRectShape(e,t,"w",l,u,a,y),updateRectShape(e,t,"e",p,u,a,y),updateRectShape(e,t,"n",l,u,m,a),updateRectShape(e,t,"s",l,d,m,a),updateRectShape(e,t,"nw",l,u,a,a),updateRectShape(e,t,"ne",p,u,a,a),updateRectShape(e,t,"sw",l,d,a,a),updateRectShape(e,t,"se",p,d,a,a))}function updateCommon(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(makeStyle(n)),r.attr({silent:!i,cursor:i?"move":"default"}),each([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=t.childOfName(n.join("")),a=1===n.length?getGlobalDirection1(e,n[0]):getGlobalDirection2(e,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?CURSOR_MAP[a]+"-resize":null})}))}function updateRectShape(e,t,n,i,r,a,o){var s=t.childOfName(n);s&&s.setShape(pointsToRect(clipByPanel(e,t,[[i,r],[i+a,r+o]])))}function makeStyle(e){return defaults({strokeNoScale:!0},e.brushStyle)}function formatRectRange(e,t,n,i){var r=[mathMin$9(e,n),mathMin$9(t,i)],a=[mathMax$9(e,n),mathMax$9(t,i)];return[[r[0],a[0]],[r[1],a[1]]]}function getTransform$1(e){return getTransform(e.group)}function getGlobalDirection1(e,t){return{left:"w",right:"e",top:"n",bottom:"s"}[transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],getTransform$1(e))]}function getGlobalDirection2(e,t){var n=[getGlobalDirection1(e,t[0]),getGlobalDirection1(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function driftRect(e,t,n,i,r,a){var o=n.__brushOption,s=e.toRectRange(o.range),l=toLocalDelta(t,r,a);each(i,(function(e){var t=DIRECTION_MAP[e];s[t[0]][t[1]]+=l[t[0]]})),o.range=e.fromRectRange(formatRectRange(s[0][0],s[1][0],s[0][1],s[1][1])),updateCoverAfterCreation(t,n),trigger$1(t,{isEnd:!1})}function driftPolygon(e,t,n,i){var r=t.__brushOption.range,a=toLocalDelta(e,n,i);each(r,(function(e){e[0]+=a[0],e[1]+=a[1]})),updateCoverAfterCreation(e,t),trigger$1(e,{isEnd:!1})}function toLocalDelta(e,t,n){var i=e.group,r=i.transformCoordToLocal(t,n),a=i.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function clipByPanel(e,t,n){var i=getPanelByCover(e,t);return i&&i!==BRUSH_PANEL_GLOBAL?i.clipPath(n,e._transform):clone(n)}function pointsToRect(e){var t=mathMin$9(e[0][0],e[1][0]),n=mathMin$9(e[0][1],e[1][1]);return{x:t,y:n,width:mathMax$9(e[0][0],e[1][0])-t,height:mathMax$9(e[0][1],e[1][1])-n}}function resetCursor(e,t,n){if(e._brushType&&!isOutsideZrArea(e,t.offsetX,t.offsetY)){var i=e._zr,r=e._covers,a=getPanelByPoint(e,t,n);if(!e._dragging)for(var o=0;oi.getWidth()||n<0||n>i.getHeight()}var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function(e,t){function n(e){return e}return createBaseRectCover({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=getTrackEnds(e);return formatRectRange(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){updateBaseRect(e,t,n,i)},updateCommon:updateCommon,contain:mainShapeContain},polygon:{createCover:function(e,t){var n=new Group;return n.add(new Polyline({name:"main",style:makeStyle(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Polygon({name:"main",draggable:!0,drift:curry(driftPolygon,e,t),ondragend:curry(trigger$1,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:clipByPanel(e,t,n)})},updateCommon:updateCommon,contain:mainShapeContain}};function getLineRenderer(e){return{createCover:function(t,n){return createBaseRectCover({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=getTrackEnds(t);return[mathMin$9(n[0][e],n[1][e]),mathMax$9(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var a,o=getPanelByCover(t,n);if(o!==BRUSH_PANEL_GLOBAL&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[i,a];e&&l.reverse(),updateBaseRect(t,n,l,r)},updateCommon:updateCommon,contain:mainShapeContain}}function makeRectPanelClipPath(e){return e=normalizeRect(e),function(t){return clipPointsByRect(t,e)}}function makeLinearBrushOtherExtent(e,t){return e=normalizeRect(e),function(n){var i=null!=t?t:n,r=i?e.width:e.height,a=i?e.x:e.y;return[a,a+(r||0)]}}function makeRectIsTargetByCursor(e,t,n){var i=normalizeRect(e);return function(e,r){return i.contain(r[0],r[1])&&!onIrrelevantElement(e,t,n)}}function normalizeRect(e){return BoundingRect.create(e)}var elementList=["axisLine","axisTickLabel","axisName"],ParallelAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new BrushController(n.getZr())).on("brush",bind(this._onBrush,this))},t.prototype.render=function(e,t,n,i){if(!fromAxisAreaSelect(e,t,i)){this.axisModel=e,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Group,this.group.add(this._axisGroup),e.get("show")){var a=getCoordSysModel(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=extend({strokeContainThreshold:l},o.getAxisLayout(u)),h=new AxisBuilder(e,c);each(elementList,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,a,l,n),groupTransition(r,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,i,r,a){var o=n.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=BoundingRect.create({x:o[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:makeRectPanelClipPath(u),isTargetByCursor:makeRectIsTargetByCursor(u,a,i),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(getCoverInfoList(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,i=n.axis,r=map(t,(function(e){return[i.coordToData(e.range[0],!0),i.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(ComponentView);function fromAxisAreaSelect(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}function getCoverInfoList(e){var t=e.axis;return map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}function getCoordSysModel(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}ComponentView.registerClass(ParallelAxisView);var CLICK_THRESHOLD=5,ParallelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},each(handlers,(function(e,t){n.getZr().on(t,this._handlers[t]=bind(e,this))}),this)),createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){each(this._handlers,(function(e,n){t.getZr().off(n,e)})),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(extend({type:"parallelAxisExpand"},e))},t.type="parallel",t}(ComponentView);ComponentView.registerClass(ParallelView);var handlers={mousedown:function(e){checkTrigger(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(checkTrigger(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>CLICK_THRESHOLD)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&checkTrigger(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function checkTrigger(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}registerPreprocessor(parallelPreprocessor);var ParallelSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:bind(makeDefaultEncode,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),i=[];return t.eachActiveState(n,(function(t,r){e===t&&i.push(n.getRawIndex(r))})),i},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},t}(SeriesModel);function makeDefaultEncode(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return each(t.dimensions,(function(e){var t=convertDimNameToNumber(e);n[e]=t})),n}}function convertDimNameToNumber(e){return+e.replace("dim","")}SeriesModel.registerClass(ParallelSeriesModel);var DEFAULT_SMOOTH=.3,ParallelView$1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Group,n._initialized=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,i){var r=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=makeSeriesScope$2(e);if(a.diff(o).add((function(e){updateElCommon(addEl(a,r,e,l,s),a,e,u)})).update((function(t,n){var i=o.getItemGraphicEl(n),r=createLinePoints(a,t,l,s);a.setItemGraphicEl(t,i),updateProps(i,{shape:{points:r}},e,t),updateElCommon(i,a,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);r.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=createGridClipShape(s,e,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(c)}this._data=a},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var i=t.getData(),r=t.coordinateSystem,a=r.dimensions,o=makeSeriesScope$2(t),s=e.start;s=0&&(a[r[o].depth]=new Model(r[o],this,t));if(i&&n)return createGraphFromNodeEdge(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getData().getItemLayout(t);if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e}))})).data},t.prototype.setNodePosition=function(e,t){var n=this.option.data[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function i(e){return isNaN(e)||null==e}if("edge"===n){var r=this.getDataParams(e,n),a=r.data,o=r.value;return createTooltipMarkup("nameValue",{name:a.source+" -- "+a.target,value:o,noValue:i(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value;return createTooltipMarkup("nameValue",{name:this.getDataParams(e,n).data.name,value:s,noValue:i(s)})},t.prototype.optionUpdated=function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},t.prototype.getDataParams=function(t,n){var i=e.prototype.getDataParams.call(this,t,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(t).getLayout().value;i.value=r}return i},t.type="series.sankey",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(SeriesModel);SeriesModel.registerClass(SankeySeriesModel);var SankeyPathShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},SankeyPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SankeyPathShape},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){enterEmphasis(this)},t.prototype.downplay=function(){leaveEmphasis(this)},t}(Path),SankeyView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,a.removeAll(),a.x=o.x,a.y=o.y,r.eachEdge((function(t){var n=new SankeyPath,i=getECData(n);i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var r,o,u,p,d,f,g,m,y=t.getModel(),v=y.getModel("lineStyle"),_=v.get("curveness"),x=t.node1.getLayout(),S=t.node1.getModel(),b=S.get("localX"),T=S.get("localY"),M=t.node2.getLayout(),A=t.node2.getModel(),I=A.get("localX"),C=A.get("localY"),w=t.getLayout();switch(n.shape.extent=Math.max(1,w.dy),n.shape.orient=h,"vertical"===h?(r=(null!=b?b*s:x.x)+w.sy,o=(null!=T?T*l:x.y)+x.dy,u=(null!=I?I*s:M.x)+w.ty,d=r,f=o*(1-_)+(p=null!=C?C*l:M.y)*_,g=u,m=o*_+p*(1-_)):(r=(null!=b?b*s:x.x)+x.dx,o=(null!=T?T*l:x.y)+w.sy,d=r*(1-_)+(u=null!=I?I*s:M.x)*_,f=o,g=r*_+u*(1-_),m=p=(null!=C?C*l:M.y)+w.ty),n.setShape({x1:r,y1:o,x2:u,y2:p,cpx1:d,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(v.getItemStyle()),n.style.fill){case"source":n.style.fill=t.node1.getVisual("color"),n.style.decal=t.node1.getVisual("style").decal;break;case"target":n.style.fill=t.node2.getVisual("color"),n.style.decal=t.node2.getVisual("style").decal;break;case"gradient":var P=t.node1.getVisual("color"),L=t.node2.getVisual("color");"string"==typeof P&&"string"==typeof L&&(n.style.fill=new LinearGradient(0,0,1,0,[{color:P,offset:0},{color:L,offset:1}]))}var E=y.getModel("emphasis");setStatesStylesFromModel(n,y,"lineStyle",(function(e){return e.getItemStyle()})),a.add(n),c.setItemGraphicEl(t.dataIndex,n);var D=E.get("focus");enableHoverEmphasis(n,"adjacency"===D?t.getAdjacentDataIndices():D,E.get("blurScope")),getECData(n).dataType="edge"})),r.eachNode((function(t){var n=t.getLayout(),i=t.getModel(),r=i.get("localX"),o=i.get("localY"),c=i.getModel("emphasis"),h=new Rect({shape:{x:null!=r?r*s:n.x,y:null!=o?o*l:n.y,width:n.dx,height:n.dy},style:i.getModel("itemStyle").getItemStyle()});setLabelStyle(h,getLabelStatesModels(i),{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id}),h.disableLabelAnimation=!0,h.setStyle("fill",t.getVisual("color")),h.setStyle("decal",t.getVisual("style").decal),setStatesStylesFromModel(h,i),a.add(h),u.setItemGraphicEl(t.dataIndex,h),getECData(h).dataType="node";var p=c.get("focus");enableHoverEmphasis(h,"adjacency"===p?t.getAdjacentDataIndices():p,c.get("blurScope"))})),u.eachItemGraphicEl((function(t,r){u.getItemModel(r).get("draggable")&&(t.drift=function(t,a){i._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){i._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&a.setClipPath(createGridClipShape$1(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(ChartView);function createGridClipShape$1(e,t,n){var i=new Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return initProps(i,{shape:{width:e.width+20}},t,n),i}function sankeyLayout(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),i=e.get("nodeGap"),r=getViewRect$4(e,t);e.layoutInfo=r;var a=r.width,o=r.height,s=e.getGraph(),l=s.nodes,u=s.edges;computeNodeValues(l),layoutSankey(l,u,n,i,a,o,0!==filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function getViewRect$4(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function layoutSankey(e,t,n,i,r,a,o,s,l){computeNodeBreadths(e,t,n,r,a,s,l),computeNodeDepths(e,t,a,r,i,o,s),computeEdgeDepths(e,s)}function computeNodeValues(e){each(e,(function(e){var t=sum(e.outEdges,getEdgeValue),n=sum(e.inEdges,getEdgeValue),i=e.getValue()||0,r=Math.max(t,n,i);e.setLayout({value:r},!0)}))}function computeNodeBreadths(e,t,n,i,r,a,o){for(var s=[],l=[],u=[],c=[],h=0,p=0;p=0;y&&m.depth>d&&(d=m.depth),g.setLayout({depth:y?m.depth:h},!0),"vertical"===a?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;vh-1?d:h-1;o&&"left"!==o&&adjustNodeWithNodeAlign(e,o,a,S),scaleNodeBreadths(e,"vertical"===a?(r-n)/S:(i-n)/S,a)}function isNodeDepth(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function adjustNodeWithNodeAlign(e,t,n,i){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s0;a--)relaxRightToLeft(s,l*=.99,o),resolveCollisions(s,r,n,i,o),relaxLeftToRight(s,l,o),resolveCollisions(s,r,n,i,o)}function prepareNodesByBreadth(e,t){var n=[],i="vertical"===t?"y":"x",r=groupData(e,(function(e){return e.getLayout()[i]}));return r.keys.sort((function(e,t){return e-t})),each(r.keys,(function(e){n.push(r.buckets.get(e))})),n}function initializeNodeDepth(e,t,n,i,r,a){var o=1/0;each(e,(function(e){var t=e.length,s=0;each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===a?(i-(t-1)*r)/s:(n-(t-1)*r)/s;l0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[h]+t;if((l=u-t-("vertical"===r?i:n))>0){o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o;for(p=c-2;p>=0;--p)(l=(s=e[p]).getLayout()[a]+s.getLayout()[h]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}}))}function relaxRightToLeft(e,t,n){each(e.slice().reverse(),(function(e){each(e,(function(e){if(e.outEdges.length){var i=sum(e.outEdges,weightedTarget,n)/sum(e.outEdges,getEdgeValue);if(isNaN(i)){var r=e.outEdges.length;i=r?sum(e.outEdges,centerTarget,n)/r:0}if("vertical"===n){var a=e.getLayout().x+(i-center$1(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(i-center$1(e,n))*t;e.setLayout({y:o},!0)}}}))}))}function weightedTarget(e,t){return center$1(e.node2,t)*e.getValue()}function centerTarget(e,t){return center$1(e.node2,t)}function weightedSource(e,t){return center$1(e.node1,t)*e.getValue()}function centerSource(e,t){return center$1(e.node1,t)}function center$1(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function getEdgeValue(e){return e.getValue()}function sum(e,t,n){for(var i=0,r=e.length,a=-1;++ai&&(i=t)})),each(t,(function(t){var r=new VisualMapping({type:"color",mappingMethod:"linear",dataExtent:[n,i],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get(["itemStyle","color"]);null!=a?(t.setVisual("color",a),t.setVisual("style",{fill:a})):(t.setVisual("color",r),t.setVisual("style",{fill:r}))}))}}))}ChartView.registerClass(SankeyView),registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))})),registerLayout(sankeyLayout),registerVisual(sankeyVisual);var WhiskerBoxCommonMixin=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,i,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(e.layout="vertical",n=a.getOrdinalMeta(),i=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],p=[r,a],d=p[u].get("type"),f=p[1-u].get("type"),g=e.data;if(g&&i){var m=[];each(g,(function(e,t){var n;isArray(e)?(n=e.slice(),e.unshift(t)):isArray(e.value)?(n=e.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var y=this.defaultValueDimensions,v=[{name:c,type:getDimensionTypeByAxis(d),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:getDimensionTypeByAxis(f),dimsDef:y.slice()}];return createListSimply(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:curry(makeSeriesEncodeForAxisCoordSys,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),BoxplotSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return __extends(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(SeriesModel);mixin(BoxplotSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(BoxplotSeriesModel);var BoxplotView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;i.diff(a).add((function(e){if(i.hasValue(e)){var t=createNormalBox(i.getItemLayout(e),i,e,o,!0);i.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(i.hasValue(e)){var s=i.getItemLayout(e);n?updateNormalBoxData(s,n,i,e):n=createNormalBox(s,i,e,o),r.add(n),i.setItemGraphicEl(e,n)}else r.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=i},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot",t}(ChartView),BoxPathShape=function(){},BoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new BoxPathShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0;for(e.moveTo(n[i][0],n[i][1]),i++;i<4;i++)e.lineTo(n[i][0],n[i][1]);for(e.closePath();ig){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}var boxplotTransform={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==SOURCE_FORMAT_ARRAY_ROWS){var n="";0,throwError(n)}var i=prepareBoxplotData(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};registerVisual(boxplotVisual),registerLayout(boxplotLayout),registerTransform(boxplotTransform);var CandlestickSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return __extends(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var i=t.getItemLayout(e);return i&&n.rect(i.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(SeriesModel);mixin(CandlestickSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(CandlestickSeriesModel);var SKIP_PROPS=["color","borderColor"],CandlestickView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,i){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,i=this.group,r=t.getLayout("isSimpleBox"),a=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||i.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var o=t.getItemLayout(n);if(a&&isNormalBoxClipped(s,o))return;var l=createNormalBox$1(o,n,!0);initProps(l,{shape:{points:o.ends}},e,n),setBoxCommon(l,t,n,r),i.add(l),t.setItemGraphicEl(n,l)}})).update((function(o,l){var u=n.getItemGraphicEl(l);if(t.hasValue(o)){var c=t.getItemLayout(o);a&&isNormalBoxClipped(s,c)?i.remove(u):(u?updateProps(u,{shape:{points:c.ends}},e,o):u=createNormalBox$1(c),setBoxCommon(u,t,o,r),i.add(u),t.setItemGraphicEl(o,u))}else i.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),createLarge$1(e,this.group);var t=e.get("clip",!0)?createClipPath(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,i=t.getData(),r=i.getLayout("isSimpleBox");null!=(n=e.next());){var a=createNormalBox$1(i.getItemLayout(n));setBoxCommon(a,i,n,r),a.incremental=!0,this.group.add(a)}},t.prototype._incrementalRenderLarge=function(e,t){createLarge$1(t,this.group,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(ChartView);ChartView.registerClass(CandlestickView);var NormalBoxPathShape=function(){},NormalBoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new NormalBoxPathShape},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Path);function createNormalBox$1(e,t,n){var i=e.ends;return new NormalBoxPath({shape:{points:n?transInit$1(i,e):i},z2:100})}function isNormalBoxClipped(e,t){for(var n=!0,i=0;i0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]),a=n.getModel("itemStyle").getItemStyle(SKIP_PROPS);t.useStyle(a),t.style.fill=null,t.style.stroke=r}function candlestickPreprocessor(e){e&&isArray(e.series)&&each(e.series,(function(e){isObject(e)&&"k"===e.type&&(e.type="candlestick")}))}var positiveBorderColorQuery=["itemStyle","borderColor"],negativeBorderColorQuery=["itemStyle","borderColor0"],positiveColorQuery=["itemStyle","color"],negativeColorQuery=["itemStyle","color0"],candlestickVisual={seriesType:"candlestick",plan:createRenderPlanner(),performRawSeries:!0,reset:function(e,t){function n(e,t){return t.get(e>0?positiveColorQuery:negativeColorQuery)}function i(e,t){return t.get(e>0?positiveBorderColorQuery:negativeBorderColorQuery)}if(e.getData().setVisual("legendSymbol","roundRect"),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var r;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign,s=a.getItemStyle();s.fill=n(o,a),s.stroke=i(o,a)||s.fill,extend(t.ensureUniqueItemVisual(r,"style"),s)}}}}},LargeArr$1="undefined"!=typeof Float32Array?Float32Array:Array,candlestickLayout={seriesType:"candlestick",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),i=calculateCandleWidth(e,n),r=["x","y"],a=n.mapDimension(r[0]),o=n.mapDimensionsAll(r[1]),s=o[0],l=o[1],u=o[2],c=o[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,n){var i,r,o=new LargeArr$1(4*e.count),h=0,p=[],d=[];for(;null!=(r=e.next());){var f=n.get(a,r),g=n.get(s,r),m=n.get(l,r),y=n.get(u,r),v=n.get(c,r);isNaN(f)||isNaN(y)||isNaN(v)?(o[h++]=NaN,h+=3):(o[h++]=getSign(n,r,g,m,l),p[0]=f,p[1]=y,i=t.dataToPoint(p,null,d),o[h++]=i?i[0]:NaN,o[h++]=i?i[1]:NaN,p[1]=v,i=t.dataToPoint(p,null,d),o[h++]=i?i[1]:NaN)}n.setLayout("largePoints",o)}:function(e,n){var r;for(;null!=(r=e.next());){var o=n.get(a,r),h=n.get(s,r),p=n.get(l,r),d=n.get(u,r),f=n.get(c,r),g=Math.min(h,p),m=Math.max(h,p),y=b(g,o),v=b(m,o),_=b(d,o),x=b(f,o),S=[];T(S,v,0),T(S,y,1),S.push(A(x),A(v),A(_),A(y)),n.setItemLayout(r,{sign:getSign(n,r,h,p,l),initBaseline:h>p?v[1]:y[1],ends:S,brushRect:M(d,f,o)})}function b(e,n){var i=[];return i[0]=n,i[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(i)}function T(e,t,n){var r=t.slice(),a=t.slice();r[0]=subPixelOptimize$1(r[0]+i/2,1,!1),a[0]=subPixelOptimize$1(a[0]-i/2,1,!0),n?e.push(r,a):e.push(a,r)}function M(e,t,n){var r=b(e,n),a=b(t,n);return r[0]-=i/2,a[0]-=i/2,{x:r[0],y:r[1],width:i,height:a[1]-r[1]}}function A(e){return e[0]=subPixelOptimize$1(e[0],1),e}}}}};function getSign(e,t,n,i,r){return n>i?-1:n0?e.get(r,t-1)<=i?1:-1:1}function calculateCandleWidth(e,t){var n,i=e.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=parsePercent$2(retrieve2(e.get("barMaxWidth"),r),r),o=parsePercent$2(retrieve2(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?parsePercent$2(s,r):Math.max(Math.min(r/2,a),o)}registerPreprocessor(candlestickPreprocessor),registerVisual(candlestickVisual),registerLayout(candlestickLayout);var EffectScatterSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type="series.effectScatter",t.dependencies=["grid","polar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10},t}(SeriesModel);SeriesModel.registerClass(EffectScatterSeriesModel);var EFFECT_RIPPLE_NUMBER=3;function normalizeSymbolSize$1(e){return isArray(e)||(e=[+e,+e]),e}function updateRipplePath(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var EffectSymbol=function(e){function t(t,n){var i=e.call(this)||this,r=new Symbol(t,n),a=new Group;return i.add(r),i.add(a),i.updateData(t,n),i}return __extends(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,i=this.childAt(1),r=0;r ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(SeriesModel);SeriesModel.registerClass(LinesSeriesModel);var EffectLine=function(e){function t(t,n,i){var r=e.call(this)||this;return r.add(r.createLine(t,n,i)),r._updateEffectSymbol(t,n),r}return __extends(t,e),t.prototype.createLine=function(e,t,n){return new Line$1(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),i=n.get("symbolSize"),r=n.get("symbol");isArray(i)||(i=[i,i]);var a=e.getItemVisual(t,"style"),o=n.get("color")||a&&a.stroke,s=this.childAt(1);this._symbolType!==r&&(this.remove(s),(s=createSymbol(r,-.5,-.5,1,1,o)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",o),s.setStyle(n.getItemStyle(["color"])),s.scaleX=i[0],s.scaleY=i[1],s.setColor(o),this._symbolType=r,this._symbolScale=i,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var i=this.childAt(1);if(i){var r=this,a=e.getItemLayout(n),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=retrieve(t.get("delay"),(function(t){return t/e.count()*o/3}));if(i.ignore=!0,this._updateAnimationPoints(i,a),l>0&&(o=this._getLineLength(i)/l*1e3),(o!==this._period||s!==this._loop)&&(i.stopAnimation(),o>0)){var c=void 0;c="function"==typeof u?u(n):u,i.__t>0&&(c=-o*i.__t),i.__t=0;var h=i.animate("",s).when(o,{__t:1}).delay(c).during((function(){r._updateSymbolPosition(i)}));s||h.done((function(){r.remove(i)})),h.start()}this._period=o,this._loop=s}},t.prototype._getLineLength=function(e){return dist(e.__p1,e.__cp1)+dist(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,i=e.__cp1,r=e.__t,a=[e.x,e.y],o=a.slice(),s=quadraticAt,l=quadraticDerivativeAt;a[0]=s(t[0],i[0],n[0],r),a[1]=s(t[1],i[1],n[1],r);var u=l(t[0],i[0],n[0],r),c=l(t[1],i[1],n[1],r);e.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT=0&&!(i[a]<=t);a--);a=Math.min(a,r-2)}else{for(a=o;at);a++);a=Math.min(a-1,r-2)}var s=(t-i[a])/(i[a+1]-i[a]),l=n[a],u=n[a+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=u[0]-l[0],h=u[1]-l[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=t,e.ignore=!1}},t}(EffectLine),LargeLinesPathShape=function(){this.polyline=!1,this.curveness=0,this.segs=[]},LargeLinesPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LargeLinesPathShape},t.prototype.buildPath=function(e,t){var n=t.segs,i=t.curveness;if(t.polyline)for(var r=0;r0){e.moveTo(n[r++],n[r++]);for(var o=1;o0){var h=(s+u)/2-(l-c)*i,p=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,p,u,c)}else e.lineTo(u,c)}},t.prototype.findDataIndex=function(e,t){var n=this.shape,i=n.segs,r=n.curveness,a=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s0)for(var u=i[s++],c=i[s++],h=1;h0){if(containStroke$2(u,c,(u+p)/2-(c-d)*r,(c+d)/2-(p-u)*r,p,d,a,e,t))return o}else if(containStroke(u,c,p,d,a,e,t))return o;o++}return-1},t}(Path),LargeLineDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e){this.group.removeAll();var t=new LargeLinesPath({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t){var n=new LargeLinesPath;n.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(n,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=e.start,this.group.add(n))},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._setCommon=function(e,t,n){var i=t.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("style");if(r&&r.stroke&&e.setStyle("stroke",r.stroke),e.setStyle("fill",null),!n){var a=getECData(e);a.seriesIndex=i.seriesIndex,e.on("mousemove",(function(t){a.dataIndex=null;var n=e.findDataIndex(t.offsetX,t.offsetY);n>0&&(a.dataIndex=n+e.__startIndex)}))}},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),linesLayout={seriesType:"lines",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.get("polyline"),i=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,c=r.start;c0){var A=a(y)?s:l;y>0&&(y=y*T+b),_[x++]=A[M],_[x++]=A[M+1],_[x++]=A[M+2],_[x++]=A[M+3]*y*256}else x+=4}return h.putImageData(v,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),r=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,r),i[a++]=r[0],i[a++]=r[1],i[a++]=r[2],i[a++]=r[3];return i},e}();function getIsInPiecewiseRange(e,t,n){var i=e[1]-e[0],r=(t=map(t,(function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}}))).length,a=0;return function(e){var i;for(i=a;i=0;i--){var o;if((o=t[i].interval)[0]<=e&&e<=o[1]){a=i;break}}return i>=0&&i=t[0]&&e<=t[1]}}function isGeoCoordSys(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var HeatmapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(i=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):isGeoCoordSys(r)&&this._renderOnGeo(r,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var a,o,s,l,u=e.coordinateSystem;if(isCoordinateSystemType(u,"cartesian2d")){var c=u.getAxis("x"),h=u.getAxis("y");0,a=c.getBandWidth(),o=h.getBandWidth(),s=c.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,d=e.getData(),f=e.getModel(["emphasis","itemStyle"]).getItemStyle(),g=e.getModel(["blur","itemStyle"]).getItemStyle(),m=e.getModel(["select","itemStyle"]).getItemStyle(),y=getLabelStatesModels(e),v=e.get(["emphasis","focus"]),_=e.get(["emphasis","blurScope"]),x=isCoordinateSystemType(u,"cartesian2d")?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],S=n;Ss[1]||Al[1])continue;var I=u.dataToPoint([M,A]);b=new Rect({shape:{x:Math.floor(Math.round(I[0])-a/2),y:Math.floor(Math.round(I[1])-o/2),width:Math.ceil(a),height:Math.ceil(o)},style:T})}else{if(isNaN(d.get(x[1],S)))continue;b=new Rect({z2:1,shape:u.dataToRect([d.get(x[0],S)]).contentShape,style:T})}var C=d.getItemModel(S);if(d.hasItemOption){var w=C.getModel("emphasis");f=w.getModel("itemStyle").getItemStyle(),g=C.getModel(["blur","itemStyle"]).getItemStyle(),m=C.getModel(["select","itemStyle"]).getItemStyle(),v=w.get("focus"),_=w.get("blurScope"),y=getLabelStatesModels(C)}var P=e.getRawValue(S),L="-";P&&null!=P[2]&&(L=P[2]+""),setLabelStyle(b,y,{labelFetcher:e,labelDataIndex:S,defaultOpacity:T.opacity,defaultText:L}),b.ensureState("emphasis").style=f,b.ensureState("blur").style=g,b.ensureState("select").style=m,enableHoverEmphasis(b,v,_),b.incremental=r,r&&(b.states.emphasis.hoverLayer=!0),p.add(b),d.setItemGraphicEl(S,b)}},t.prototype._renderOnGeo=function(e,t,n,i){var r=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new HeatmapLayer;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),p=Math.min(l.width+l.x,i.getWidth()),d=Math.min(l.height+l.y,i.getHeight()),f=p-c,g=d-h,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],y=o.mapArray(m,(function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=c,r[1]-=h,r.push(i),r})),v=n.getExtent(),_="visualMap.continuous"===n.type?getIsInContinuousRange(v,n.option.range):getIsInPiecewiseRange(v,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var x=new ZRImage({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(ChartView);ChartView.registerClass(HeatmapView);var PictorialBarSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return __extends(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=inheritDefaultOption(BaseBarSeriesModel.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(BaseBarSeriesModel);SeriesModel.registerClass(PictorialBarSeriesModel);var BAR_BORDER_WIDTH_QUERY$1=["itemStyle","borderWidth"],LAYOUT_ATTRS=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pathForLineWidth=new Circle,PictorialBarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=o.getBaseAxis().isHorizontal(),l=o.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:LAYOUT_ATTRS[+s],categoryDim:LAYOUT_ATTRS[1-+s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=getItemModel(r,e),n=getSymbolMeta(r,e,t,u),a=createBar(r,u,n);r.setItemGraphicEl(e,a),i.add(a),updateCommon$1(a,u,n)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=getItemModel(r,e),s=getSymbolMeta(r,e,o,u),l=getShapeStr(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(e,null),n=null),n?updateBar(n,u,s):n=createBar(r,u,s,!0),r.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,i.add(n),updateCommon$1(n,u,s)}else i.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&removeBar(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},t.prototype.remove=function(e,t){var n=this.group,i=this._data;e.get("animation")?i&&i.eachItemGraphicEl((function(t){removeBar(i,getECData(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(ChartView);function getSymbolMeta(e,t,n,i){var r=e.getItemLayout(t),a=n.get("symbolRepeat"),o=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:t,layout:r,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};prepareBarLength(n,a,r,i,h),prepareSymbolSize(e,t,r,a,o,h.boundingLength,h.pxSign,u,i,h),prepareLineWidth(n,h.symbolScale,l,i,h);var p=h.symbolSize,d=n.get("symbolOffset");return isArray(d)&&(d=[parsePercent$2(d[0],p[0]),parsePercent$2(d[1],p[1])]),prepareLayoutInfo(n,p,r,a,o,d,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function prepareBarLength(e,t,n,i,r){var a,o=i.valueDim,s=e.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[o.wh]<=0);if(isArray(s)){var h=[convertToCoordOnAxis(l,s[0])-u,convertToCoordOnAxis(l,s[1])-u];h[1]0?1:a<0?-1:0}function convertToCoordOnAxis(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function prepareSymbolSize(e,t,n,i,r,a,o,s,l,u){var c,h=l.valueDim,p=l.categoryDim,d=Math.abs(n[p.wh]),f=e.getItemVisual(t,"symbolSize");(c=isArray(f)?f.slice():null==f?["100%","100%"]:[f,f])[p.index]=parsePercent$2(c[p.index],d),c[h.index]=parsePercent$2(c[h.index],i?d:Math.abs(a)),u.symbolSize=c,(u.symbolScale=[c[0]/s,c[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}function prepareLineWidth(e,t,n,i,r){var a=e.get(BAR_BORDER_WIDTH_QUERY$1)||0;a&&(pathForLineWidth.attr({scaleX:t[0],scaleY:t[1],rotation:n}),pathForLineWidth.updateTransform(),a/=pathForLineWidth.getLineScale(),a*=t[i.valueDim.index]),r.valueLineWidth=a}function prepareLayoutInfo(e,t,n,i,r,a,o,s,l,u,c,h){var p=c.categoryDim,d=c.valueDim,f=h.pxSign,g=Math.max(t[d.index]+s,0),m=g;if(i){var y=Math.abs(l),v=retrieve(e.get("symbolMargin"),"15%")+"",_=!1;v.lastIndexOf("!")===v.length-1&&(_=!0,v=v.slice(0,v.length-1));var x=parsePercent$2(v,t[d.index]),S=Math.max(g+2*x,0),b=_?0:2*x,T=isNumeric(i),M=T?i:toIntTimes((y+b)/S);S=g+2*(x=(y-M*g)/2/(_?M:M-1)),b=_?0:2*x,T||"fixed"===i||(M=u?toIntTimes((Math.abs(u)+b)/S):0),m=M*S-b,h.repeatTimes=M,h.symbolMargin=x}var A=f*(m/2),I=h.pathPosition=[];I[p.index]=n[p.wh]/2,I[d.index]="start"===o?A:"end"===o?l-A:l/2,a&&(I[0]+=a[0],I[1]+=a[1]);var C=h.bundlePosition=[];C[p.index]=n[p.xy],C[d.index]=n[d.xy];var w=h.barRectShape=extend({},n);w[d.wh]=f*Math.max(Math.abs(n[d.wh]),Math.abs(I[d.index]+A)),w[p.wh]=n[p.wh];var P=h.clipShape={};P[p.xy]=-n[p.xy],P[p.wh]=c.ecSize[p.wh],P[d.xy]=0,P[d.wh]=n[d.wh]}function createPath(e){var t=e.symbolPatternSize,n=createSymbol(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function createOrUpdateRepeatSymbols(e,t,n,i){var r=e.__pictorialBundle,a=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=a[t.valueDim.index]+o+2*n.symbolMargin;for(eachPath(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c0:i<0)&&(r=u-1-e),t[l.index]=h*(r-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function createOrUpdateSingleSymbol(e,t,n,i){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?updateAttr(a,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(a=e.__pictorialMainPath=createPath(n),r.add(a),updateAttr(a,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function createOrUpdateBarRect(e,t,n){var i=extend({},t.barRectShape),r=e.__pictorialBarRect;r?updateAttr(r,null,{shape:i},t,n):(r=e.__pictorialBarRect=new Rect({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function createOrUpdateClip(e,t,n,i){if(n.symbolClip){var r=e.__pictorialClipPath,a=extend({},n.clipShape),o=t.valueDim,s=n.animationModel,l=n.dataIndex;if(r)updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=n.clipShape[o.wh],graphic[i?"updateProps":"initProps"](r,{shape:u},s,l)}}}function getItemModel(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=getAnimationDelayParams,n.isAnimationEnabled=isAnimationEnabled,n}function getAnimationDelayParams(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function isAnimationEnabled(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function createBar(e,t,n,i){var r=new Group,a=new Group;return r.add(a),r.__pictorialBundle=a,a.x=n.bundlePosition[0],a.y=n.bundlePosition[1],n.symbolRepeat?createOrUpdateRepeatSymbols(r,t,n):createOrUpdateSingleSymbol(r,t,n),createOrUpdateBarRect(r,n,i),createOrUpdateClip(r,t,n,i),r.__pictorialShapeStr=getShapeStr(e,n),r.__pictorialSymbolMeta=n,r}function updateBar(e,t,n){var i=n.animationModel,r=n.dataIndex;updateProps(e.__pictorialBundle,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?createOrUpdateRepeatSymbols(e,t,n,!0):createOrUpdateSingleSymbol(e,t,n,!0),createOrUpdateBarRect(e,n,!0),createOrUpdateClip(e,t,n,!0)}function removeBar(e,t,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var a=[];eachPath(i,(function(e){a.push(e)})),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),each(a,(function(e){removeElement(e,{scaleX:0,scaleY:0},n,t,(function(){i.parent&&i.parent.remove(i)}))})),e.setItemGraphicEl(t,null)}function getShapeStr(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function eachPath(e,t,n){each(e.__pictorialBundle.children(),(function(i){i!==e.__pictorialBarRect&&t.call(n,i)}))}function updateAttr(e,t,n,i,r,a){t&&e.attr(t),i.symbolClip&&!r?n&&e.attr(n):n&&graphic[r?"updateProps":"initProps"](e,n,i.animationModel,i.dataIndex,a)}function updateCommon$1(e,t,n){var i=n.dataIndex,r=n.itemModel,a=r.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),p=a.get("scale");eachPath(e,(function(e){if(e instanceof ZRImage){var t=e.style;e.useStyle(extend({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var i=e.ensureState("emphasis");i.style=o,p&&(i.scaleX=1.1*e.scaleX,i.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var d=t.valueDim.posDesc[+(n.boundingLength>0)];setLabelStyle(e.__pictorialBarRect,getLabelStatesModels(r),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:getDefaultLabel(t.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:d}),enableHoverEmphasis(e,c,h)}function toIntTimes(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}ChartView.registerClass(PictorialBarView),registerLayout(curry(layout,"pictorialBar"));var SingleAxis=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.type=r||"value",o.position=a||"bottom",o}return __extends(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(Axis),Single=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=["single"],this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=this.dimension,r=new SingleAxis(i,createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();each(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),i=n?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(i[r],i[1-r]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),i=n[0]+n[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return i-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),i[r]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$2(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$2(t)===this?this.pointToData(n):null},e}();function getCoordSys$2(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function create$3(e,t){var n=[];return e.eachComponent("singleAxis",(function(i,r){var a=new Single(i,e,t);a.name="single_"+r,a.resize(i,t),i.coordinateSystem=a,n.push(a)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n}function layout$2(e,t){t=t||{};var n=e.coordinateSystem,i=e.axis,r={},a=i.position,o=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]];r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o];r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),retrieve(t.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),r.labelRotation="top"===a?-c:c,r.z2=1,r}CoordinateSystemManager.register("single",{create:create$3,dimensions:Single.prototype.dimensions});var axisBuilderAttrs$2=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs$1=["splitArea","splitLine"],SingleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return __extends(t,e),t.prototype.render=function(t,n,i,r){var a=this.group;a.removeAll();var o=this._axisGroup;this._axisGroup=new Group;var s=layout$2(t),l=new AxisBuilder(t,s);each(axisBuilderAttrs$2,l.add,l),a.add(this._axisGroup),a.add(l.getGroup()),each(selfBuilderAttrs$1,(function(e){t.get([e,"show"])&&axisElementBuilders$1[e](this,this.group,this._axisGroup,t)}),this),groupTransition(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)},t.prototype.remove=function(){rectCoordAxisHandleRemove(this)},t.type="singleAxis",t}(AxisView),axisElementBuilders$1={splitLine:function(e,t,n,i){var r=i.axis;if(!r.scale.isBlank()){var a=i.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=[],h=0,p=r.getTicksCoords({tickModel:a}),d=[],f=[],g=0;g=0&&s<0)&&(o=f,s=d,r=u,a.length=0),each(c,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}function showPointer(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function showTooltip(e,t,n,i){var r=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=makeKey(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function updateModelActually(e,t,n){var i=n.axesInfo=[];each(t,(function(t,n){var r=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}function dispatchTooltipActually(e,t,n,i){if(!illegalPoint(t)&&e.list.length){var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}else i({type:"hideTip"})}function dispatchHighDownActually(e,t,n){var i=n.getZr(),r="axisPointerLastHighlights",a=inner$b(i)[r]||{},o=inner$b(i)[r]={};each(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&each(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];each(a,(function(e,t){!o[t]&&l.push(e)})),each(o,(function(e,t){!a[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function findInputAxisInfo(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function makeMapperParam(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function illegalPoint(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var inner$c=makeInner(),each$8=each;function register(e,t,n){if(!env.node){var i=t.getZr();inner$c(i).records||(inner$c(i).records={}),initGlobalListeners(i,t),(inner$c(i).records[e]||(inner$c(i).records[e]={})).handler=n}}function initGlobalListeners(e,t){function n(n,i){e.on(n,(function(n){var r=makeDispatchAction(t);each$8(inner$c(e).records,(function(e){e&&i(e,n,r.dispatchAction)})),dispatchTooltipFinally(r.pendings,t)}))}inner$c(e).initialized||(inner$c(e).initialized=!0,n("click",curry(doEnter,"click")),n("mousemove",curry(doEnter,"mousemove")),n("globalout",onLeave))}function dispatchTooltipFinally(e,t){var n,i=e.showTip.length,r=e.hideTip.length;i?n=e.showTip[i-1]:r&&(n=e.hideTip[r-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function onLeave(e,t,n){e.handler("leave",null,n)}function doEnter(e,t,n,i){t.handler(e,n,i)}function makeDispatchAction(e){var t={showTip:[],hideTip:[]},n=function(i){var r=t[i.type];r?r.push(i):(i.dispatchAction=n,e.dispatchAction(i))};return{dispatchAction:n,pendings:t}}function unregister(e,t){if(!env.node){var n=t.getZr();(inner$c(n).records||{})[e]&&(inner$c(n).records[e]=null)}}var AxisPointerView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";register("axisPointer",n,(function(e,t,n){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){unregister("axisPointer",t)},t.prototype.dispose=function(e,t){unregister("axisPointer",t)},t.type="axisPointer",t}(ComponentView);ComponentView.registerClass(AxisPointerView);var inner$d=makeInner(),clone$3=clone,bind$1=bind,BaseAxisPointer=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(o){var h=curry(updateProps$1,t,c);this.updatePointerEl(o,l,h),this.updateLabelEl(o,l,h,t)}else o=this._group=new Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),n.getZr().add(o);updateMandatoryProps(o,t,!0),this._renderHandle(r)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,r="category"===i.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===n||null==n){var o=this.animationThreshold;if(r&&i.getBandWidth()>o)return!0;if(a){var s=getAxisInfo(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,r){},e.prototype.createPointerEl=function(e,t,n,i){var r=t.pointer;if(r){var a=inner$d(e).pointerEl=new graphic[r.type](clone$3(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=inner$d(e).labelEl=new ZRText(clone$3(t.label));e.add(r),updateLabelShowHide(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=inner$d(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var r=inner$d(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),updateLabelShowHide(r,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,a=n.getModel("handle"),o=n.get("status");if(!a.get("show")||!o||"hide"===o)return r&&i.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){stop(e.event)},onmousedown:bind$1(this._onHandleDragMove,this,0,0),drift:bind$1(this._onHandleDragMove,this),ondragend:bind$1(this._onHandleDragEnd,this)}),i.add(r)),updateMandatoryProps(r,n,!1),r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");isArray(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){updateProps$1(this._axisPointerModel,!t&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(getHandleTransProps(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(getHandleTransProps(i)),inner$d(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function updateProps$1(e,t,n,i){propsEqual(inner$d(n).lastProp,i)||(inner$d(n).lastProp=i,t?updateProps(n,i,e):(n.stopAnimation(),n.attr(i)))}function propsEqual(e,t){if(isObject(e)&&isObject(t)){var n=!0;return each(t,(function(t,i){n=n&&propsEqual(e[i],t)})),!!n}return e===t}function updateLabelShowHide(e,t){e[t.get(["label","show"])?"show":"hide"]()}function getHandleTransProps(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function updateMandatoryProps(e,t,n){var i=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r),e.silent=n)}))}function buildElStyle(e){var t,n=e.get("type"),i=e.getModel(n+"Style");return"line"===n?(t=i.getLineStyle()).fill=null:"shadow"===n&&((t=i.getAreaStyle()).stroke=null),t}function buildLabelElOption(e,t,n,i,r){var a=getValueLabel(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),o=n.getModel("label"),s=normalizeCssArray$1(o.get("padding")||0),l=o.getFont(),u=getBoundingRect(a,l),c=r.position,h=u.width+s[1]+s[3],p=u.height+s[0]+s[2],d=r.align;"right"===d&&(c[0]-=h),"center"===d&&(c[0]-=h/2);var f=r.verticalAlign;"bottom"===f&&(c[1]-=p),"middle"===f&&(c[1]-=p/2),confineInContainer(c,h,p,i);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:createTextStyle(o,{text:a,font:l,fill:o.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function confineInContainer(e,t,n,i){var r=i.getWidth(),a=i.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function getValueLabel(e,t,n,i,r){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:r.precision}),o=r.formatter;if(o){var s={value:getAxisRawValue(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};each(i,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)})),isString(o)?a=o.replace("{value}",a):isFunction(o)&&(a=o(s))}return a}function getTransformedPosition(e,t,n){var i=create$1();return rotate(i,i,n.rotation),translate(i,i,n.position),applyTransform$1([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function buildCartesianSingleLabelElOption(e,t,n,i,r,a){var o=AxisBuilder.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),buildLabelElOption(t,i,r,a,{position:getTransformedPosition(i.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function makeLineShape(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function makeRectShape(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function makeSectorShape(e,t,n,i,r,a){return{cx:e,cy:t,r0:n,r:i,startAngle:r,endAngle:a,clockwise:!0}}var CartesianAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.grid,s=i.get("type"),l=getCartesian(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var c=buildElStyle(i),h=pointerShapeBuilder[s](a,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$1(o.model,n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$1(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.grid,o=r.getGlobalExtent(!0),s=getCartesian(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];return{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(BaseAxisPointer);function getCartesian(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var pointerShapeBuilder={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getAxisDimIndex(e))}},shadow:function(e,t,n){var i=Math.max(1,e.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getAxisDimIndex(e))}}};function getAxisDimIndex(e){return"x"===e.dim?0:1}AxisView.registerAxisPointerClass("CartesianAxisPointer",CartesianAxisPointer);var AxisPointerModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="axisPointer",t.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(ComponentModel);ComponentModel.registerClass(AxisPointerModel),registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!isArray(t)&&(e.axisPointer.link=[t])}})),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=collect(e,t)})),registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},axisTrigger);var XY=["x","y"],WH=["width","height"],SingleAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.coordinateSystem,s=getGlobalExtent(o,1-getPointDimIndex(a)),l=o.dataToPoint(t)[0],u=i.get("type");if(u&&"none"!==u){var c=buildElStyle(i),h=pointerShapeBuilder$1[u](a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$2(n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$2(t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.coordinateSystem,o=getPointDimIndex(r),s=getGlobalExtent(a,o),l=[e.x,e.y];l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=getGlobalExtent(a,1-o),c=(u[1]+u[0])/2,h=[c,c];return h[o]=l[o],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(BaseAxisPointer),pointerShapeBuilder$1={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getPointDimIndex(e))}},shadow:function(e,t,n){var i=e.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getPointDimIndex(e))}}};function getPointDimIndex(e){return e.isHorizontal()?0:1}function getGlobalExtent(e,t){var n=e.getRect();return[n[XY[t]],n[XY[t]]+n[WH[t]]]}AxisView.registerAxisPointerClass("SingleAxisPointer",SingleAxisPointer),extendComponentView({type:"single"});var DATA_NAME_INDEX=2,ThemeRiverSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},i=groupData(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),r=[];i.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;oa&&(a=s),i.push(s)}for(var u=0;ua&&(a=h)}return{y0:r,max:a}}ChartView.registerClass(ThemeRiverView),registerLayout(themeRiverLayout),registerProcessor(dataFilter("themeRiver"));var SunburstSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue$1(n);var i=map(e.levels||[],(function(e){return new Model(e,this,t)}),this),r=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=r.getNodeByDataIndex(t),a=i[n.depth];return a&&(e.parentModel=a),e}))}));return r.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},t.type="series.sunburst",t.defaultOption={zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],levels:[],sort:"desc"},t}(SeriesModel);function completeTreeValue$1(e){var t=0;each(e.children,(function(e){completeTreeValue$1(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}SeriesModel.registerClass(SunburstSeriesModel);var DEFAULT_SECTOR_Z=2,DEFAULT_TEXT_Z=4,SunburstPiece=function(e){function t(t,n,i,r){var a=e.call(this)||this;a.z2=DEFAULT_SECTOR_Z,a.textConfig={inside:!0},getECData(a).seriesIndex=n.seriesIndex;var o=new ZRText({z2:DEFAULT_TEXT_Z,silent:t.getModel().get(["label","silent"])});return a.setTextContent(o),a.updateData(!0,t,n,i,r),a}return __extends(t,e),t.prototype.updateData=function(e,t,n,i,r){this.node=t,t.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var a=this;getECData(a).dataIndex=t.dataIndex;var o=t.getModel(),s=o.getModel("emphasis"),l=t.getLayout(),u=extend({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=createOrUpdatePatternFromDecal(h,r));var p=getSectorCornerRadius(o.getModel("itemStyle"),u);extend(u,p),each(SPECIAL_STATES,(function(e){var t=a.ensureState(e),n=o.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var i=getSectorCornerRadius(n,u);i&&(t.shape=i)})),e?(a.setShape(u),a.shape.r=l.r0,updateProps(a,{shape:{r:l.r}},n,t.dataIndex)):updateProps(a,{shape:u},n),a.useStyle(c),this._updateLabel(n);var d=o.getShallow("cursor");d&&a.attr("cursor",d),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus");enableHoverEmphasis(this,("ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():null)||f,s.get("blurScope"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),a=r.endAngle-r.startAngle,o=(r.startAngle+r.endAngle)/2,s=Math.cos(o),l=Math.sin(o),u=this,c=u.getTextContent(),h=this.node.dataIndex,p=i.get("minAngle")/180*Math.PI,d=i.get("show")&&!(null!=p&&Math.abs(a)Math.PI/2?"right":"left"):b&&"center"!==b?"left"===b?(y=r.r0+S,o>Math.PI/2&&(b="right")):"right"===b&&(y=r.r-S,o>Math.PI/2&&(b="left")):(y=(r.r+r.r0)/2,b="center"),d.style.align=b,d.style.verticalAlign=f(a,"verticalAlign")||"middle",d.x=y*s+r.cx,d.y=y*l+r.cy;var T=f(a,"rotate"),M=0;"radial"===T?(M=-o)<-Math.PI/2&&(M+=Math.PI):"tangential"===T?(M=Math.PI/2-o)>Math.PI/2?M-=Math.PI:M<-Math.PI/2&&(M+=Math.PI):"number"==typeof T&&(M=T*Math.PI/180),d.rotation=M})),c.dirtyStyle()},t}(Sector),ROOT_TO_NODE_ACTION="sunburstRootToNode";registerAction({type:ROOT_TO_NODE_ACTION,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var i=retrieveTargetInfo(e,[ROOT_TO_NODE_ACTION],t);if(i){var r=t.getViewRoot();r&&(e.direction=aboveViewRoot(r,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}}))}));var HIGHLIGHT_ACTION="sunburstHighlight";registerAction({type:HIGHLIGHT_ACTION,update:"none"},(function(e,t,n){e=extend({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=retrieveTargetInfo(e,[HIGHLIGHT_ACTION],t);n&&(e.dataIndex=n.node.dataIndex)})),n.dispatchAction(extend(e,{type:"highlight"}))}));var UNHIGHLIGHT_ACTION="sunburstUnhighlight";registerAction({type:UNHIGHLIGHT_ACTION,update:"updateView"},(function(e,t,n){e=extend({},e),n.dispatchAction(extend(e,{type:"downplay"}))}));var SunburstView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this;this.seriesModel=e,this.api=n,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),c=[];s.eachNode((function(e){c.push(e)}));var h=this._oldChildren||[];!function(i,r){if(0===i.length&&0===r.length)return;function s(e){return e.getId()}function c(s,c){!function(i,r){u||!i||i.getValue()||(i=null);if(i!==o&&r!==o)if(r&&r.piece)i?(r.piece.updateData(!1,i,e,t,n),a.setItemGraphicEl(i.dataIndex,r.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(r);else if(i){var s=new SunburstPiece(i,e,t,n);l.add(s),a.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==c?null:r[c])}new DataDiffer(r,i,s,s).add(c).update(c).remove(curry(c,null)).execute()}(c,h),function(i,a){a.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,e,t,n):(r.virtualPiece=new SunburstPiece(i,e,t,n),l.add(r.virtualPiece)),a.piece.off("click"),r.virtualPiece.on("click",(function(e){r._rootToNode(a.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===t.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(i);else if("link"===r){var a=i.getModel(),o=a.get("link");if(o)windowOpen(o,a.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:ROOT_TO_NODE_ACTION,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,a=Math.sqrt(i*i+r*r);return a<=n.r&&a>=n.r0}},t.type="sunburst",t}(ChartView);ChartView.registerClass(SunburstView);var RADIAN$2=Math.PI/180;function sunburstLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),i=e.get("radius");isArray(i)||(i=[0,i]),isArray(t)||(t=[t,t]);var r=n.getWidth(),a=n.getHeight(),o=Math.min(r,a),s=parsePercent$2(t[0],r),l=parsePercent$2(t[1],a),u=parsePercent$2(i[0],o/2),c=parsePercent$2(i[1],o/2),h=-e.get("startAngle")*RADIAN$2,p=e.get("minAngle")*RADIAN$2,d=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&initChildren$1(f,m);var y=0;each(f.children,(function(e){!isNaN(e.getValue())&&y++}));var v=f.getValue(),_=Math.PI/(v||y)*2,x=f.depth>0,S=f.height-(x?-1:1),b=(c-u)/(S||1),T=e.get("clockwise"),M=e.get("stillShowZeroSum"),A=T?1:-1,I=function(e,t){if(e){var n=t;if(e!==d){var i=e.getValue(),r=0===v&&M?_:i*_;r1;)r=r.parentNode;var a=n.getColorFromPalette(r.name||r.dataIndex+"",t);return e.depth>1&&"string"==typeof a&&(a=lift(a,(e.depth-1)/(i-1)*.5)),a}(r,e,i.root.height)),extend(n.ensureUniqueItemVisual(r.dataIndex,"style"),a)}))}))}function dataToCoordSize(e,t){return t=t||[0,0],map(["x","y"],(function(n,i){var r=this.getAxis(n),a=t[i],o=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o))}),this)}function cartesianPrepareCustom(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize,e)}}}function dataToCoordSize$1(e,t){return t=t||[0,0],map([0,1],(function(n){var i=t[n],r=e[n]/2,a=[],o=[];return a[n]=i-r,o[n]=i+r,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])}),this)}function geoPrepareCustom(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize$1,e)}}}function dataToCoordSize$2(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function singlePrepareCustom(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize$2,e)}}}function dataToCoordSize$3(e,t){return t=t||[0,0],map(["Radius","Angle"],(function(n,i){var r=this["get"+n+"Axis"](),a=t[i],o=e[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function polarPrepareCustom(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),a=n.dataToAngle(i[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o},size:bind(dataToCoordSize$3,e)}}}function calendarPrepareCustom(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}registerLayout(curry(sunburstLayout,"sunburst")),registerProcessor(curry(dataFilter,"sunburst")),registerVisual(sunburstVisual);var deprecatedLogs={};function isEC4CompatibleStyle(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||hasOwn(e,"text")))}function convertFromEC4CompatibleStyle(e,t,n){var i,r,a,o=e;if("text"===t)a=o;else{a={},hasOwn(o,"text")&&(a.text=o.text),hasOwn(o,"rich")&&(a.rich=o.rich),hasOwn(o,"textFill")&&(a.fill=o.textFill),hasOwn(o,"textStroke")&&(a.stroke=o.textStroke),r={type:"text",style:a,silent:!0},i={};var s=hasOwn(o,"textPosition");n?i.position=s?o.textPosition:"inside":s&&(i.position=o.textPosition),hasOwn(o,"textPosition")&&(i.position=o.textPosition),hasOwn(o,"textOffset")&&(i.offset=o.textOffset),hasOwn(o,"textRotation")&&(i.rotation=o.textRotation),hasOwn(o,"textDistance")&&(i.distance=o.textDistance)}return convertEC4CompatibleRichItem(a,e),each(a.rich,(function(e){convertEC4CompatibleRichItem(e,e)})),{textConfig:i,textContent:r}}function convertEC4CompatibleRichItem(e,t){t&&(t.font=t.textFont||t.font,hasOwn(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),hasOwn(t,"textAlign")&&(e.align=t.textAlign),hasOwn(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),hasOwn(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),hasOwn(t,"textWidth")&&(e.width=t.textWidth),hasOwn(t,"textHeight")&&(e.height=t.textHeight),hasOwn(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),hasOwn(t,"textPadding")&&(e.padding=t.textPadding),hasOwn(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),hasOwn(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),hasOwn(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),hasOwn(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),hasOwn(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),hasOwn(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),hasOwn(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function convertToEC4StyleForCustomSerise(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,a=e.fill||"#000";convertToEC4RichItem(i,t);var o=null==i.textFill;return r?o&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=a),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(o&&(i.textFill=n.outsideFill||a),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,each(t.rich,(function(e){convertToEC4RichItem(e,e)})),i}function convertToEC4RichItem(e,t){t&&(hasOwn(t,"fill")&&(e.textFill=t.fill),hasOwn(t,"stroke")&&(e.textStroke=t.fill),hasOwn(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),hasOwn(t,"font")&&(e.font=t.font),hasOwn(t,"fontStyle")&&(e.fontStyle=t.fontStyle),hasOwn(t,"fontWeight")&&(e.fontWeight=t.fontWeight),hasOwn(t,"fontSize")&&(e.fontSize=t.fontSize),hasOwn(t,"fontFamily")&&(e.fontFamily=t.fontFamily),hasOwn(t,"align")&&(e.textAlign=t.align),hasOwn(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),hasOwn(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),hasOwn(t,"width")&&(e.textWidth=t.width),hasOwn(t,"height")&&(e.textHeight=t.height),hasOwn(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),hasOwn(t,"padding")&&(e.textPadding=t.padding),hasOwn(t,"borderColor")&&(e.textBorderColor=t.borderColor),hasOwn(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),hasOwn(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),hasOwn(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),hasOwn(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),hasOwn(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),hasOwn(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),hasOwn(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),hasOwn(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),hasOwn(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),hasOwn(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function warnDeprecated(e,t){}var inner$e=makeInner(),TRANSFORM_PROPS={x:1,y:1,scaleX:1,scaleY:1,originX:1,originY:1,rotation:1},transformPropNamesStr=keys(TRANSFORM_PROPS).join(", "),STYLE_VISUAL_TYPE={color:"fill",borderColor:"stroke"},NON_STYLE_VISUAL_PROPS={symbol:1,symbolSize:1,symbolKeepAspect:1,legendSymbol:1,visualMeta:1,liftZ:1,decal:1},EMPHASIS="emphasis",NORMAL="normal",BLUR="blur",SELECT="select",STATES=[NORMAL,EMPHASIS,BLUR,SELECT],PATH_ITEM_STYLE={normal:["itemStyle"],emphasis:[EMPHASIS,"itemStyle"],blur:[BLUR,"itemStyle"],select:[SELECT,"itemStyle"]},PATH_LABEL={normal:["label"],emphasis:[EMPHASIS,"label"],blur:[BLUR,"label"],select:[SELECT,"label"]},GROUP_DIFF_PREFIX="e\0\0",attachedTxInfoTmp={normal:{},emphasis:{},blur:{},select:{}},LEGACY_TRANSFORM_PROPS={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},tmpTransformable=new Transformable,prepareCustoms={cartesian2d:cartesianPrepareCustom,geo:geoPrepareCustom,singleAxis:singlePrepareCustom,polar:polarPrepareCustom,calendar:calendarPrepareCustom},CustomSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=inner$e(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},t}(SeriesModel);ComponentModel.registerClass(CustomSeriesModel);var checkNonStyleTansitionRefer,checkTransformPropRefer,CustomSeriesView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this._data,a=e.getData(),o=this.group,s=makeRenderItem(e,a,t,n),l=e.__transientTransitionOpt;if(!l||null!=l.from&&null!=l.to){var u=new MorphPreparation(e,l),c=l?"multiple":"oneToOne";new DataDiffer(r?r.getIndices():[],a.getIndices(),createGetKey(r,c,l&&l.from),createGetKey(a,c,l&&l.to),null,c).add((function(t){createOrUpdateItem(n,null,t,s(t,i),e,o,a,null)})).remove((function(t){doRemoveEl(r.getItemGraphicEl(t),e,o)})).update((function(t,l){u.reset("oneToOne");var c=r.getItemGraphicEl(l);u.findAndAddFrom(c),u.hasFrom()&&(removeElementDirectly(c,o),c=null),createOrUpdateItem(n,c,t,s(t,i),e,o,a,u),u.applyMorphing()})).updateManyToOne((function(t,l){u.reset("manyToOne");for(var c=0;c=0){!s&&(s=r[e]={});var f=keys(l);for(h=0;h=0){var d=e.getAnimationStyleProps(),f=d?d.style:null;if(f){!o&&(o=r.style={});var g=keys(i);for(c=0;c=0?a.replaceAt(t,l):a.add(t),t}function doesElNeedRecreate(e,t){var n=inner$e(e),i=t.type,r=t.shape,a=t.style;return null!=i&&i!==n.customGraphicType||"path"===i&&hasOwnPathData(r)&&getPathData(r)!==n.customPathData||"image"===i&&hasOwn(a,"image")&&a.image!==n.customImagePath}function doCreateOrUpdateClipPath(e,t,n,i,r){var a=n.clipPath;if(!1===a)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&doesElNeedRecreate(o,a)&&(o=null),o||(o=createEl(a),e.setClipPath(o)),updateElNormal(null,o,null,t,a,null,null,i,r,!1)}}function doCreateOrUpdateAttachedTx(e,t,n,i,r,a){if(!e.isGroup){processTxInfo(n,null,a),processTxInfo(n,EMPHASIS,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(null!=o||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===o)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=createEl(o),e.setTextContent(c));var h=o&&o.style;updateElNormal(null,c,null,t,o,h,null,i,r,!0);for(var p=0;p=h;p--)doRemoveEl(t.childAt(p),r,t)}}function diffGroupChildren(e){new DataDiffer(e.oldChildren,e.newChildren,getKey,getKey,e).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute()}function getKey(e,t){var n=e&&e.name;return null!=n?n:GROUP_DIFF_PREFIX+t}function processAddUpdate(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;doCreateOrUpdateEl(n.api,r,n.dataIndex,i,n.seriesModel,n.group,!1,n.morphPreparation)}function processRemove(e){var t=this.context;doRemoveEl(t.oldChildren[e],t.seriesModel,t.group)}function doRemoveEl(e,t,n){if(e){var i=inner$e(e).leaveToProps;i?updateProps(e,i,t,{cb:function(){n.remove(e)}}):n.remove(e)}}function getPathData(e){return e&&(e.pathData||e.d)}function hasOwnPathData(e){return e&&(hasOwn(e,"pathData")||hasOwn(e,"d"))}function isPath$1(e){return e&&e instanceof Path}function removeElementDirectly(e,t){e&&t.remove(e)}var MorphPreparation=function(){function e(e,t){this._fromList=[],this._toList=[],this._toElOptionList=[],this._allPropsFinalList=[],this._toDataIndices=[],this._morphConfigList=[],this._seriesModel=e,this._transOpt=t}return e.prototype.hasFrom=function(){return!!this._fromList.length},e.prototype.findAndAddFrom=function(e){if(e&&(inner$e(e).canMorph&&this._fromList.push(e),e.isGroup))for(var t=e.childrenRef(),n=0;n=n?i-o:a;this._manyToOneForSingleTo(r,o>=i?null:o,s)}else if("oneToMany"===e)for(var l=Math.max(1,Math.floor(n/i)),u=0,c=0;u=n?n-u:l;this._oneToManyForSingleFrom(u,h,c>=i?null:c)}},e.prototype._oneToOneForSingleTo=function(e,t){var n=this._toList[e],i=this._toElOptionList[e],r=this._toDataIndices[e],a=this._allPropsFinalList[e],o=this._fromList[t],s=this._getOrCreateMorphConfig(r),l=s.duration;if(o&&isCombiningPath(o)){if(applyPropsFinal(n,a,i.style),l){var u=combine([o],n,s,copyPropsWhenDivided);this._processResultIndividuals(u,e,null)}}else{var c=l&&o&&(o!==n||isInAnyMorphing(o))?o:null,h={};prepareShapeOrExtraTransitionFrom("shape",n,c,i,h,!1),prepareShapeOrExtraTransitionFrom("extra",n,c,i,h,!1),prepareTransformTransitionFrom(n,c,i,h,!1),prepareStyleTransitionFrom(n,c,i,i.style,h,!1),applyPropsFinal(n,a,i.style),c&&morphPath(c,n,s),applyTransitionFrom(n,r,i,this._seriesModel,h,!1)}},e.prototype._manyToOneForSingleTo=function(e,t,n){var i=this._toList[e],r=this._toElOptionList[e];applyPropsFinal(i,this._allPropsFinalList[e],r.style);var a=this._getOrCreateMorphConfig(this._toDataIndices[e]);if(a.duration&&null!=t){for(var o=[],s=t;s=0?"p":"n",I=x;v&&(i[s][M]||(i[s][M]={p:x,n:x}),I=i[s][M][A]);var C=void 0,w=void 0,P=void 0,L=void 0;if("radius"===h.dim){var E=h.dataToCoord(T)-x,D=a.dataToCoord(M);Math.abs(E)c?c=p:(h.lastTickCount=r,h.lastAutoInterval=c),c},t}(Axis);AngleAxis.prototype.dataToAngle=Axis.prototype.dataToCoord,AngleAxis.prototype.angleToData=Axis.prototype.coordToData;var Polar=function(){function e(e){this.dimensions=["radius","angle"],this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new RadiusAxis,this._angleAxis=new AngleAxis,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);i.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,u=lo;)l+=360*u;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,i=t-this.cy,r=n*n+i*i,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$3(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$3(t)===this?this.pointToData(n):null},e}();function getCoordSys$3(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function resizePolar(e,t,n){var i=t.get("center"),r=n.getWidth(),a=n.getHeight();e.cx=parsePercent$2(i[0],r),e.cy=parsePercent$2(i[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:isArray(l)||(l=[0,l]);var u=[parsePercent$2(l[0],s),parsePercent$2(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function updatePolarScale(e,t){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();each(getDataDimensionsOnAxis(t,"radius"),(function(e){r.scale.unionExtentFromData(t,e)})),each(getDataDimensionsOnAxis(t,"angle"),(function(e){i.scale.unionExtentFromData(t,e)}))}})),niceScaleExtent(i.scale,i.model),niceScaleExtent(r.scale,r.model),"category"===i.type&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function isAngleAxisModel(e){return"angleAxis"===e.mainType}function setAxis(e,t){if(e.type=t.get("type"),e.scale=createScaleByModel(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),isAngleAxisModel(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle");e.setExtent(n,n+(e.inverse?-360:360))}t.axis=e,e.model=t}var polarCreator={dimensions:Polar.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,i){var r=new Polar(i+"");r.update=updatePolarScale;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");setAxis(a,s),setAxis(o,l),resizePolar(r,e,t),n.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",SINGLE_REFERRING).models[0];0,e.coordinateSystem=t.coordinateSystem}})),n}};CoordinateSystemManager.register("polar",polarCreator);var elementList$1=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function getAxisLineShape(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var i=e.coordToPoint([t[0],n]),r=e.coordToPoint([t[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function getRadiusIdx(e){return e.getRadiusAxis().inverse?0:1}function fixAngleOverlap(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var AngleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return __extends(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),a=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=map(n.getViewLabels(),(function(e){return(e=clone(e)).coord=n.dataToCoord(e.tickValue),e}));fixAngleOverlap(s),fixAngleOverlap(a),each(elementList$1,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||angelAxisElementsBuilders[t](this.group,e,i,a,o,r,s)}),this)}},t.type="angleAxis",t}(AxisView),angelAxisElementsBuilders={axisLine:function(e,t,n,i,r,a){var o,s=t.getModel(["axisLine","lineStyle"]),l=getRadiusIdx(n),u=l?0:1;(o=0===a[u]?new Circle({shape:{cx:n.cx,cy:n.cy,r:a[l]},style:s.getLineStyle(),z2:1,silent:!0}):new Ring({shape:{cx:n.cx,cy:n.cy,r:a[l],r0:a[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(o)},axisTick:function(e,t,n,i,r,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[getRadiusIdx(n)],u=map(i,(function(e){return new Line({shape:getAxisLineShape(n,[l,l+s],e.coord)})}));e.add(mergePath$1(u,{style:defaults(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,i,r,a){if(r.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[getRadiusIdx(n)],c=[],h=0;hf?"left":"right",y=Math.abs(d[1]-g)/p<.3?"middle":d[1]>g?"top":"bottom";if(s&&s[h]){var v=s[h];isObject(v)&&v.textStyle&&(o=new Model(v.textStyle,l,l.ecModel))}var _=new ZRText({silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(o,{x:d[0],y:d[1],fill:o.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:y})});if(e.add(_),c){var x=AxisBuilder.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=i.rawLabel,getECData(_).eventData=x}}),this)},splitLine:function(e,t,n,i,r,a){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;cm?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}var pointerShapeBuilder$2={line:function(e,t,n,i){return"angle"===e.dim?{type:"Line",shape:makeLineShape(t.coordToPoint([i[0],n]),t.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,i){var r=Math.max(1,e.getBandWidth()),a=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:makeSectorShape(t.cx,t.cy,i[0],i[1],(-n-r/2)*a,(r/2-n)*a)}:{type:"Sector",shape:makeSectorShape(t.cx,t.cy,n-r/2,n+r/2,0,2*Math.PI)}}};AxisView.registerAxisPointerClass("PolarAxisPointer",PolarAxisPointer),registerLayout(curry(barLayoutPolar,"bar")),extendComponentView({type:"polar"});var GeoView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new MapDraw(t);this._mapDraw=n,this.group.add(n.group),this._api=t},t.prototype.render=function(e,t,n,i){var r=this._mapDraw;e.get("show")?r.draw(e,t,n,this,i):this._mapDraw.group.removeAll(),r.group.on("click",this._handleRegionClick,this),r.group.silent=e.get("silent"),this._model=e,this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){for(var t,n=e.target;null==(t=getECData(n).eventData);)n=n.__hostTarget||n.parent;t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var i=this;this._mapDraw.group.traverse((function(e){var t=getECData(e).eventData;if(t)return i._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(ComponentView);ComponentView.registerClass(GeoView);var GeoModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),defaultEmphasis(t,"label",["show"])},t.prototype.optionUpdated=function(){var e=this.option,t=this;e.regions=geoCreator.getFilledRegions(e.regions,e.map,e.nameMap);var n={};this._optionModelMap=reduce(e.regions||[],(function(e,i){var r=i.name;return r&&(e.set(r,new Model(i,t)),i.selected&&(n[r]=!0)),e}),createHashMap()),e.selectedMap||(e.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new Model(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),i="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),r={name:e};return"function"==typeof i?(r.status=t,i(r)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;n&&("multiple"!==n&&(t.selectedMap=null),(t.selectedMap||(t.selectedMap={}))[e]=!0)},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?"unSelect":"select"](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!(!t||!t[e])},t.prototype._initSelectedMapFromData=function(){},t.type="geo",t.layoutMode="box",t.defaultOption={zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},t}(ComponentModel);function makeAction(e,t){t.update="geo:updateSelectStatus",registerAction(t,(function(t,n){var i={};return n.eachComponent({mainType:"geo",query:t},(function(n){n[e](t.name),each(n.coordinateSystem.regions,(function(e){i[e.name]=n.isSelected(e.name)||!1}))})),{selected:i,name:t.name}}))}ComponentModel.registerClass(GeoModel),makeAction("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),makeAction("select",{type:"geoSelect",event:"geoselected"}),makeAction("unSelect",{type:"geoUnSelect",event:"geounselected"});var PROXIMATE_ONE_DAY=864e5,Calendar=function(){function e(t,n,i){this.type="calendar",this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t}return e.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){var t=(e=parseDate(e)).getFullYear(),n=e.getMonth()+1,i=n<10?"0"+n:""+n,r=e.getDate(),a=r<10?"0"+r:""+r,o=e.getDay();return{y:t+"",m:i,d:a,day:o=Math.abs((o+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+a,date:e}},e.prototype.getNextNDay=function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},e.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,i=["width","height"],r=this._model.getCellSize().slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[n,7]:[7,n];each([0,1],(function(e){u(r,e)&&(a[i[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}each([0,1],(function(e){u(r,e)||(r[e]=l[i[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},e.prototype.dataToPoint=function(e,t){isArray(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),i=this._rangeInfo,r=n.formatedDate;if(t&&!(n.time>=i.start.time&&n.timeo.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var i=Math.floor(n[1].time/PROXIMATE_ONE_DAY)-Math.floor(n[0].time/PROXIMATE_ONE_DAY)+1,r=new Date(n[0].time),a=r.getDate(),o=n[1].date.getDate();r.setDate(a+i-1);var s=r.getDate();if(s!==o)for(var l=r.getTime()-n[1].time>0?1:-1;(s=r.getDate())!==o&&(r.getTime()-n[1].time)*l>0;)i-=l,r.setDate(s-l);var u=Math.floor((i+n[0].day+6)/7),c=t?1-u:u-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||0===e&&ti.lweek)return null;var r=7*(e-1)-i.fweek+t,a=new Date(i.start.time);return a.setDate(+i.start.d+r),this.getDateInfo(a)},e.create=function(t,n){var i=[];return t.eachComponent("calendar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},e.dimensions=["time","value"],e}();function getCoordSys$4(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}CoordinateSystemManager.register("calendar",Calendar);var CalendarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){var r=getLayoutParams(t);e.prototype.init.apply(this,arguments),mergeAndNormalizeLayoutParams(t,r)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),mergeAndNormalizeLayoutParams(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(ComponentModel);function mergeAndNormalizeLayoutParams(e,t){var n,i=e.cellSize;1===(n=isArray(i)?i:e.cellSize=[i,i]).length&&(n[1]=n[0]);var r=map([0,1],(function(e){return sizeCalculable(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));mergeLayoutParam(e,t,{type:"box",ignoreSize:r})}ComponentModel.registerClass(CalendarModel);var MONTH_TEXT={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},WEEK_TEXT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]},CalendarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group;i.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,i),this._renderLines(e,a,o,i),this._renderYearText(e,a,o,i),this._renderMonthText(e,o,i),this._renderWeekText(e,a,o,i)},t.prototype._renderDayRect=function(e,t,n){for(var i=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=i.getCellWidth(),o=i.getCellHeight(),s=t.start.time;s<=t.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});n.add(u)}},t.prototype._renderLines=function(e,t,n,i){var r=this,a=e.coordinateSystem,o=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){p(u.formatedDate),0===c&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=a.getDateInfo(h)}function p(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,i)}p(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),o,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),o,i)},t.prototype._getEdgesPoints=function(e,t,n){var i=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-t/2,i[1][r]=i[1][r]+t/2,i},t.prototype._drawSplitline=function(e,t,n){var i=new Polyline({z2:20,shape:{points:e},style:t});n.add(i)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var i=e.coordinateSystem,r=i.getDateInfo(t),a=[],o=0;o<7;o++){var s=i.getNextNDay(r.time,o),l=i.dataToRect([s.time],!1);a[2*s.day]=l.tl,a[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return a},t.prototype._formatterLabel=function(e,t){return"string"==typeof e&&e?formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,i,r){var a=t[0],o=t[1],s=["center","bottom"];"bottom"===i?(o+=r,s=["center","top"]):"left"===i?a-=r:"right"===i?(a+=r,s=["center","top"]):o-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,i){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},p=t.start.y;+t.end.y>+t.start.y&&(p=p+"-"+t.end.y);var d=r.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:p},g=this._formatterLabel(d,f),m=new ZRText({z2:30,style:createTextStyle(r,{text:g})});m.attr(this._yearTextPositionControl(m,h[o],n,o,a)),i.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,i,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===n?(l+=r,t&&(a="center"),"start"===i&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===i&&(a="right")),{x:s,y:l,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n){var i=e.getModel("monthLabel");if(i.get("show")){var r=i.get("nameMap"),a=i.get("margin"),o=i.get("position"),s=i.get("align"),l=[this._tlpoints,this._blpoints];isString(r)&&(r=MONTH_TEXT[r.toUpperCase()]||[]);var u="start"===o?0:1,c="horizontal"===t?0:1;a="start"===o?-a:a;for(var h="center"===s,p=0;p=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},t.prototype._flatten=function(e,t,n){each(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var i=e.children;"group"===e.type&&i&&this._flatten(i,t,e),delete e.children}}),this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type="graphic",t.defaultOption={elements:[]},t}(ComponentModel);ComponentModel.registerClass(GraphicComponentModel);var GraphicComponentView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){this._elMap=createHashMap()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,i=this.group;each(t,(function(t){var r=convertOptionIdName(t.id,null),a=null!=r?n.get(r):null,o=convertOptionIdName(t.parentId,null),s=null!=o?n.get(o):i,l=t.type,u=t.style;"text"===l&&u&&t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=u.verticalAlign=u.align=null);var c=t.textContent,h=t.textConfig;if(u&&isEC4CompatibleStyle(u,l,!!h,!!c)){var p=convertFromEC4CompatibleStyle(u,l,!0);!h&&p.textConfig&&(h=t.textConfig=p.textConfig),!c&&p.textContent&&(c=p.textContent)}var d=getCleanedElOption(t);var f=t.$action||"merge";"merge"===f?a?a.attr(d):createEl$1(r,s,d,n):"replace"===f?(removeEl(a,n),createEl$1(r,s,d,n)):"remove"===f&&removeEl(a,n);var g=n.get(r);if(g&&c)if("merge"===f){var m=g.getTextContent();m?m.attr(c):g.setTextContent(new ZRText(c))}else"replace"===f&&g.setTextContent(new ZRText(c));if(g){var y=inner$g(g);y.__ecGraphicWidthOption=t.width,y.__ecGraphicHeightOption=t.height,setEventData(g,e,t)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,i=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s=0;s--){var h,p,d;if(d=null!=(p=convertOptionIdName((h=n[s]).id,null))?r.get(p):null){var f=d.parent;c=inner$g(f);positionElement(d,h,f===i?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight},null,{hv:h.hv,boundingMode:h.bounding})}}},t.prototype._clear=function(){var e=this._elMap;e.each((function(t){removeEl(t,e)})),this._elMap=createHashMap()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(ComponentView);function createEl$1(e,t,n,i){var r=n.type;var a=hasOwn(_nonShapeGraphicElements,r)?_nonShapeGraphicElements[r]:getShapeClass(r);var o=new a(n);t.add(o),i.set(e,o),inner$g(o).__ecGraphicId=e}function removeEl(e,t){var n=e&&e.parent;n&&("group"===e.type&&e.traverse((function(e){removeEl(e,t)})),t.removeKey(inner$g(e).__ecGraphicId),n.remove(e))}function getCleanedElOption(e){return e=extend({},e),each(["id","parentId","$action","hv","bounding","textContent"].concat(LOCATION_PARAMS),(function(t){delete e[t]})),e}function isSetLoc(e,t){var n;return each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}function setKeyInfoToNewElOption(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var i=t.parentOption;i?t.parentId=i.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function mergeNewElOptionToExist(e,t,n){var i=extend({},n),r=e[t],a=n.$action||"merge";"merge"===a?r?(merge(r,i,!0),mergeLayoutParam(r,i,{ignoreSize:!0}),copyLayoutParams(n,r)):e[t]=i:"replace"===a?e[t]=i:"remove"===a&&r&&(e[t]=null)}function setLayoutInfoToExist(e,t){if(e&&(e.hv=t.hv=[isSetLoc(t,["left","right"]),isSetLoc(t,["top","bottom"])],"group"===e.type)){var n=e,i=t;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}function setEventData(e,t,n){var i=getECData(e).eventData;e.silent||e.ignore||i||(i=getECData(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),i&&(i.info=n.info)}ComponentView.registerClass(GraphicComponentView);var ToolboxFeature=function(){},features={};function registerFeature(e,t){features[e]=t}function getFeature(e){return features[e]}var ToolboxModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;each(this.option.feature,(function(e,n){var i=getFeature(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),merge(e,i.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}},t}(ComponentModel);function layout$3(e,t,n){var i=t.getBoxLayoutParams(),r=t.get("padding"),a={width:n.getWidth(),height:n.getHeight()},o=getLayoutRect(i,a,r);box(t.get("orient"),e,t.get("itemGap"),o.width,o.height),positionElement(e,i,a,r)}function makeBackground(e,t){var n=normalizeCssArray$1(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Rect({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}ComponentModel.registerClass(ToolboxModel);var ToolboxView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];each(o,(function(e,t){l.push(t)})),new DataDiffer(this._featureNames||[],l).add(u).update(u).remove(curry(u,null)).execute(),this._featureNames=l,layout$3(r,e,n),r.add(makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=e.getTextContent(),l=s&&s.states.emphasis;if(l&&!isFunction(l)&&t){var u=l.style||(l.style={}),c=getBoundingRect(t,ZRText.makeFont(u)),h=e.x+r.x,p=!1;e.y+r.y+a+c.height>n.getHeight()&&(o.position="top",p=!0);var d=p?-5-c.height:a+8;h+c.width/2>n.getWidth()?(o.position=["100%",d],u.align="right"):h-c.width/2<0&&(o.position=[0,d],u.align="left")}}))}function u(u,c){var h,p=l[u],d=l[c],f=o[p],g=new Model(f,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===p&&(f.title=i.newTitle),p&&!d){if(isUserFeatureName(p))h={onclick:g.option.onclick,featureName:p};else{var m=getFeature(p);if(!m)return;h=new m}s[p]=h}else if(!(h=s[d]))return;if(h.uid=getUID("toolbox-feature"),h.model=g,h.ecModel=t,h.api=n,h instanceof ToolboxFeature){if(!p&&d)return void(h.dispose&&h.dispose(t,n));if(!g.get("show")||h.unusable)return void(h.remove&&h.remove(t,n))}!function(i,o,s){var l,u,c=i.getModel("iconStyle"),h=i.getModel(["emphasis","iconStyle"]),p=o instanceof ToolboxFeature&&o.getIcons?o.getIcons():i.get("icon"),d=i.get("title")||{};"string"==typeof p?(l={})[s]=p:l=p;"string"==typeof d?(u={})[s]=d:u=d;var f=i.iconPaths={};each(l,(function(s,l){var p=createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});p.setStyle(c.getItemStyle()),p.ensureState("emphasis").style=h.getItemStyle();var d=new ZRText({style:{text:u[l],align:h.get("textAlign"),borderRadius:h.get("textBorderRadius"),padding:h.get("textPadding"),fill:null},ignore:!0});p.setTextContent(d);var g=e.getModel("tooltip");g&&g.get("show")&&(p.tooltip=extend({content:u[l],formatter:g.get("formatter",!0)||function(){return u[l]},formatterParams:{componentType:"toolbox",name:l,title:u[l],$vars:["name","title"]},position:g.get("position",!0)||"bottom"},g.option)),p.__title=u[l],p.on("mouseover",(function(){var t=h.getItemStyle(),n="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({fill:h.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:h.get("textBackgroundColor")}),p.setTextConfig({position:h.get("textPosition")||n}),d.ignore=!e.get("showTitle"),enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",l])&&leaveEmphasis(this),d.hide()})),("emphasis"===i.get(["iconStatus",l])?enterEmphasis:leaveEmphasis)(p),r.add(p),p.on("click",bind(o.onclick,o,t,n,l)),f[l]=p}))}(g,h,p),g.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?enterEmphasis:leaveEmphasis)(i[e])},h instanceof ToolboxFeature&&h.render&&h.render(g,t,n,i)}},t.prototype.updateView=function(e,t,n,i){each(this._features,(function(e){e instanceof ToolboxFeature&&e.updateView&&e.updateView(e.model,t,n,i)}))},t.prototype.remove=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(ComponentView);function isUserFeatureName(e){return 0===e.indexOf("my")}ComponentView.registerClass(ToolboxView);var SaveAsImage=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||env.browser.ie||env.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,i+"."+r)}else{var c=n.get("lang"),h='';window.open().document.write(h)}else{var p=document.createElement("a");p.download=i+"."+r,p.target="_blank",p.href=a;var d=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});p.dispatchEvent(d)}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:e.getLocale(["toolbox","saveAsImage","lang"])}},t}(ToolboxFeature);SaveAsImage.prototype.unusable=!env.canvasSupported,registerFeature("saveAsImage",SaveAsImage);var INNER_STACK_KEYWORD="__ec_magicType_stack__",radioTypes=[["line","bar"],["stack"]],MagicType=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return each(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i=this.model,r=i.get(["seriesIndex",n]);if(seriesOptGenreator[n]){var a,o={series:[]};each(radioTypes,(function(e){indexOf(e,n)>=0&&each(e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(e){var t=e.subType,r=e.id,a=seriesOptGenreator[n](t,r,e,i);a&&(defaults(a,e.option),o.series.push(a));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,SINGLE_REFERRING).models[0].componentIndex;o[u]=o[u]||[];for(var h=0;h<=c;h++)o[u][c]=o[u][c]||{};o[u][c].boundaryGap="bar"===n}}})),"stack"===n&&(a=merge({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title)),t.dispatchAction({type:"changeMagicType",currentType:n,newOption:o,newTitle:a,featureName:"magicType"})}},t}(ToolboxFeature),seriesOptGenreator={line:function(e,t,n,i){if("bar"===e)return merge({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return merge({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===INNER_STACK_KEYWORD;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),merge({id:t,stack:r?"":INNER_STACK_KEYWORD},i.get(["option","stack"])||{},!0)}};registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),registerFeature("magicType",MagicType);var BLOCK_SPLITER=new Array(60).join("-"),ITEM_SPLITER="\t";function groupSeries(e){var t={},n=[],i=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(e);else{var a=r.getBaseAxis();if("category"===a.type){var o=a.dim+"_"+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:r.getOtherAxis(a),series:[]},i.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:i}}function assembleSeriesWithCategoryAxis(e){var t=[];return each(e,(function(e,n){var i=e.categoryAxis,r=e.valueAxis.dim,a=[" "].concat(map(e.series,(function(e){return e.name}))),o=[i.model.getCategories()];each(e.series,(function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),(function(e){return e})))}));for(var s=[a.join(ITEM_SPLITER)],l=0;l=0)return!0}var itemSplitRegex=new RegExp("["+ITEM_SPLITER+"]+","g");function parseTSVContents(e){for(var t=e.split(/\n+/g),n=[],i=map(trim$1(t.shift()).split(itemSplitRegex),(function(e){return{name:e,data:[]}})),r=0;r=0)&&e(r,i._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=coordConvert[e.brushType](0,n,t);e.__rangeOffset={offset:diffProcessor[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){each(e,(function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&each(i.coordSyses,(function(i){var r=coordConvert[e.brushType](1,i,e.range);n(e,r.values,i,t)}))}),this)},e.prototype.setInputRanges=function(e,t){each(e,(function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var i=coordConvert[e.brushType](0,n.coordSys,e.coordRange),r=e.__rangeOffset;e.range=r?diffProcessor[e.brushType](i.values,r.offset,getScales(i.xyMinMax,r.xyMinMax)):i.values}}),this)},e.prototype.makePanelOpts=function(e,t){return map(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:makeRectPanelClipPath(i),isTargetByCursor:makeRectIsTargetByCursor(i,e,n.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(i)}}))},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&indexOf(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=parseFinder$1(t,e),r=0;re[1]&&e.reverse(),e}function parseFinder$1(e,t){return parseFinder(e,t,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES})}var targetInfoBuilders={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,a=createHashMap(),o={},s={};(n||i||r)&&(each(n,(function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0})),each(i,(function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0})),each(r,(function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),a.each((function(e){var r=e.coordinateSystem,a=[];each(r.getCartesians(),(function(e,t){(indexOf(n,e.getAxis("x").model)>=0||indexOf(i,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:panelRectBuilders.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){each(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:panelRectBuilders.geo})}))}},targetInfoMatchers=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,r=e.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],panelRectBuilders={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(getTransform(e)),t}},coordConvert={lineX:curry(axisConvert,0),lineY:curry(axisConvert,1),rect:function(e,t,n){var i=t[COORD_CONVERTS[e]]([n[0][0],n[1][0]]),r=t[COORD_CONVERTS[e]]([n[0][1],n[1][1]]),a=[formatMinMax([i[0],r[0]]),formatMinMax([i[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:map(n,(function(n){var r=t[COORD_CONVERTS[e]](n);return i[0][0]=Math.min(i[0][0],r[0]),i[1][0]=Math.min(i[1][0],r[1]),i[0][1]=Math.max(i[0][1],r[0]),i[1][1]=Math.max(i[1][1],r[1]),r})),xyMinMax:i}}};function axisConvert(e,t,n,i){var r=n.getAxis(["x","y"][e]),a=formatMinMax(map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(i[e])):r.toGlobalCoord(r.dataToCoord(i[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var diffProcessor={lineX:curry(axisDiffProcessor,0),lineY:curry(axisDiffProcessor,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return map(e,(function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]}))}};function axisDiffProcessor(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function getScales(e,t){var n=getSize(e),i=getSize(t),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function getSize(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var each$9=each,inner$h=makeInner();function push(e,t){var n=getStoreSnapshots(e);each$9(t,(function(t,i){for(var r=n.length-1;r>=0;r--){if(n[r][i])break}if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(a){var o=a.getPercentRange();n[0][i]={dataZoomId:i,start:o[0],end:o[1]}}}})),n.push(t)}function pop(e){var t=getStoreSnapshots(e),n=t[t.length-1];t.length>1&&t.pop();var i={};return each$9(n,(function(e,n){for(var r=t.length-1;r>=0;r--)if(e=t[r][n]){i[n]=e;break}})),i}function clear$1(e){inner$h(e).snapshots=null}function count(e){return getStoreSnapshots(e).length}function getStoreSnapshots(e){var t=inner$h(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}ComponentModel.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var DATA_ZOOM_AXIS_DIMENSIONS=["x","y","radius","angle","single"],SERIES_COORDS=["cartesian2d","polar","singleAxis"];function isCoordSupported(e){var t=e.get("coordinateSystem");return indexOf(SERIES_COORDS,t)>=0}function getAxisMainType(e){return e+"Axis"}function findEffectedDataZooms(e,t){var n,i=createHashMap(),r=[],a=createHashMap();e.eachComponent({mainType:"dataZoom",query:t},(function(e){a.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",o)}while(n);function o(e){!a.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var r=i.get(e);r&&r[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){a.set(e.uid,!0),r.push(e),e.eachTargetAxis((function(e,t){(i.get(e)||i.set(e,[]))[t]=!0}))}return r}function collectReferCoordSysModelInfo(e){var t=e.ecModel,n={infoList:[],infoMap:createHashMap()};return e.eachTargetAxis((function(e,i){var r=t.getComponent(getAxisMainType(e),i);if(r){var a=r.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(r)}}})),n}var DataZoomAxisInfo=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),DataZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return __extends(t,e),t.prototype.init=function(e,t,n){var i=retrieveRawOption(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=retrieveRawOption(e);merge(this.option,e,!0),merge(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;each([["start","startValue"],["end","endValue"]],(function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=createHashMap();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return each(DATA_ZOOM_AXIS_DIMENSIONS,(function(n){var i=this.getReferringComponents(getAxisMainType(n),MULTIPLE_REFERRING);if(i.specified){t=!0;var r=new DataZoomAxisInfo;each(i.models,(function(e){r.add(e.componentIndex)})),e.set(n,r)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0;if(i){var r="vertical"===t?"y":"x";a(n.findComponents({mainType:r+"Axis"}),r)}i&&a(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function a(t,n){var r=t[0];if(r){var a=new DataZoomAxisInfo;if(a.add(r.componentIndex),e.set(n,a),i=!1,"x"===n||"y"===n){var o=r.getReferringComponents("grid",SINGLE_REFERRING).models[0];o&&each(t,(function(e){r.componentIndex!==e.componentIndex&&o===e.getReferringComponents("grid",SINGLE_REFERRING).models[0]&&a.add(e.componentIndex)}))}}}i&&each(DATA_ZOOM_AXIS_DIMENSIONS,(function(t){if(i){var r=n.findComponents({mainType:getAxisMainType(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var a=new DataZoomAxisInfo;a.add(r[0].componentIndex),e.set(t,a),i=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");each([["start","startValue"],["end","endValue"]],(function(i,r){var a=null!=e[i[0]],o=null!=e[i[1]];a&&!o?t[r]="percent":!a&&o?t[r]="value":n?t[r]=n[r]:a&&(t[r]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(getAxisMainType(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,i){each(n.indexList,(function(n){e.call(t,i,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(getAxisMainType(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;each([["start","startValue"],["end","endValue"]],(function(i){null==e[i[0]]&&null==e[i[1]]||(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;each(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;ia[1];if(u&&!c&&!h)return!0;u&&(o=!0),c&&(n=!0),h&&(r=!0)}return o&&n&&r})):each$a(i,(function(n){if("empty"===r)e.setData(t=t.map(n,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var i={};i[n]=a,t.selectRange(i)}})),each$a(i,(function(e){t.setApproximateExtent(a,e)})))}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;each$a(["min","max"],(function(i){var r=t.get(i+"Span"),a=t.get(i+"ValueSpan");null!=a&&(a=this.getAxisModel().axis.scale.parse(a)),null!=a?r=linearMap(n[0]+a,n,[0,100],!0):null!=r&&(a=linearMap(r,[0,100],n,!0)-n[0]),e[i+"Span"]=r,e[i+"ValueSpan"]=a}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=getPixelPrecision(n,[0,500]);i=Math.min(i,20);var r=e.axis.scale.rawExtentInfo;0!==t[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},e}();function calculateDataExtent(e,t,n){var i=[1/0,-1/0];each$a(n,(function(e){unionAxisExtentFromData(i,e.getData(),t)}));var r=e.getAxisModel(),a=ensureScaleRawExtentInfo(r.axis.scale,r,i).calculate();return[a.min,a.max]}registerProcessor(PRIORITY.PROCESSOR.FILTER,{getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var a=e.getComponent(getAxisMainType(i),r);t(i,r,a,n)}))}))}t((function(e,t,n,i){n.__dzAxisProxy=null}));var n=[];t((function(t,i,r,a){r.__dzAxisProxy||(r.__dzAxisProxy=new AxisProxy(t,i,a,e),n.push(r.__dzAxisProxy))}));var i=createHashMap();return each(n,(function(e){each(e.getTargetSeriesModels(),(function(e){i.set(e.uid,e)}))})),i},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,i){e.getAxisProxy(n,i).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}}),registerAction("dataZoom",(function(e,t){each(findEffectedDataZooms(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var each$b=each,DATA_ZOOM_ID_BASE=makeInternalComponentId("toolbox-dataZoom_"),DataZoomFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){this.brushController||(this.brushController=new BrushController(n.getZr()),this.brushController.on("brush",bind(this._onBrush,this)).mount()),updateZoomBtnStatus(e,t,this,i,n),updateBackBtnStatus(e,t)},t.prototype.onclick=function(e,t,n){handlers$1[n].call(this)},t.prototype.remove=function(e,t){this.brushController.unmount()},t.prototype.dispose=function(e,t){this.brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},i=this.ecModel;this.brushController.updateCovers([]),new BrushTargetManager(makeAxisFinder(this.model),i,{include:["grid"]}).matchOutputRanges(t,i,(function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(r("x",n,t[0]),r("y",n,t[1])):r({lineX:"x",lineY:"y"}[i],n,t)}})),push(i,n),this._dispatchZoomAction(n)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(i=n)})),i}(e,o,i),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=sliderMove(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];each$b(e,(function(e,n){t.push(clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocale(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(ToolboxFeature),handlers$1={zoom:function(){var e=!this.isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(pop(this.ecModel))}};function makeAxisFinder(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}function updateBackBtnStatus(e,t){e.setIconStatus("back",count(t)>1?"emphasis":"normal")}function updateZoomBtnStatus(e,t,n,i,r){var a=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(a="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n.isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new BrushTargetManager(makeAxisFinder(e),t,{include:["grid"]}).makePanelOpts(r,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n.brushController.setPanels(o).enableBrush(!(!a||!o.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}registerFeature("dataZoom",DataZoomFeature),registerInternalOptionCreator("dataZoom",(function(e){var t=e.getComponent("toolbox",0);if(t){var n=t.getModel(["feature","dataZoom"]),i=[],r=parseFinder(e,makeAxisFinder(n));return each$b(r.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),each$b(r.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,r){var a=e.componentIndex,o={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:DATA_ZOOM_ID_BASE+t+a};o[r]=a,i.push(o)}}));var RestoreOption=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){clear$1(e),t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocale(["toolbox","restore","title"])}},t}(ToolboxFeature);registerFeature("restore",RestoreOption),registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var TooltipModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderColor:"#333",borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(ComponentModel);function shouldTooltipConfine(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}ComponentModel.registerClass(TooltipModel);var vendors=["-ms-","-moz-","-o-","-webkit-",""],gCssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";function mirrorPos(e){return e="left"===e?"right":"right"===e?"left":"top"===e?"bottom":"top"}function assembleArrow(e,t,n){if(!isString(n)||"inside"===n)return"";t=convertToColorString(t);var i=mirrorPos(n),r="",a="";return indexOf(["left","right"],i)>-1?(r=i+":-6px;top:50%;",a="translateY(-50%) rotate("+("left"===i?-225:-45)+"deg)"):(r=i+":-6px;left:50%;",a="translateX(-50%) rotate("+("top"===i?225:45)+"deg)"),'
'}function assembleTransition(e,t){var n="cubic-bezier(0.23, 1, 0.32, 1)",i="opacity "+e/2+"s "+n+",visibility "+e/2+"s "+n;return t||(i+=",left "+e+"s "+n+",top "+e+"s "+n),map(vendors,(function(e){return e+"transition:"+i})).join(";")}function assembleFont(e){var t=[],n=e.get("fontSize"),i=e.getTextColor();i&&t.push("color:"+i),t.push("font:"+e.getFont()),n&&t.push("line-height:"+Math.round(3*n/2)+"px");var r=e.get("textShadowColor"),a=e.get("textShadowBlur")||0,o=e.get("textShadowOffsetX")||0,s=e.get("textShadowOffsetY")||0;return r&&a&&t.push("text-shadow:"+o+"px "+s+"px "+a+"px "+r),each(["decoration","align"],(function(n){var i=e.get(n);i&&t.push("text-"+n+":"+i)})),t.join(";")}function assembleCssText(e,t,n){var i=[],r=e.get("transitionDuration"),a=e.get("backgroundColor"),o=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=getPaddingFromTooltipModel(e,"html"),p=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+p),t&&r&&i.push(assembleTransition(r,n)),a&&(env.canvasSupported?i.push("background-Color:"+a):(i.push("background-Color:#"+toHex(a)),i.push("filter:alpha(opacity=70)"))),each(["width","color","radius"],(function(t){var n="border-"+t,r=toCamelCase(n),a=e.get(r);null!=a&&i.push(n+":"+a+("color"===t?"":"px"))})),i.push(assembleFont(c)),null!=h&&i.push("padding:"+normalizeCssArray$1(h).join("px ")+"px"),i.join(";")+";"}function makeStyleCoord(e,t,n,i,r){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&transformLocalCoord(e,o,document.body,i,r)}else{e[0]=i,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var TooltipHTMLContent=function(){function e(e,t,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,env.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=t.getZr(),a=this._appendToBody=n&&n.appendToBody;makeStyleCoord(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(i):e.appendChild(i),this._container=e;var o=this;i.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},i.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler;normalizeEvent(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},i.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){var t=this._container,n=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==n.position&&(i.position="relative"),e.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=this._styleCoord,r=n.offsetHeight/2;t=convertToColorString(t),n.style.cssText=gCssText+assembleCssText(e,!this._firstShow,this._longHide)+";left:"+i[0]+"px;top:"+(i[1]-r)+"px;border-color: "+t+";"+(e.get("extraCssText")||""),n.style.display=n.innerHTML?"block":"none",n.style.pointerEvents=this._enterable?"auto":"none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,i,r){if(null!=e){var a=this.el;if(isString(r)&&"item"===n.get("trigger")&&!shouldTooltipConfine(n)&&(e+=assembleArrow(n.get("backgroundColor"),i,r)),isString(e))a.innerHTML=e;else if(e){a.innerHTML="",isArray(e)||(e=[e]);for(var o=0;o=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!env.node){var r=makeDispatchAction$1(i,n);this._ticket="";var a=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var o=proxyRect;o.x=i.x,o.y=i.y,o.update(),o.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:o},r)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:a,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var s=findPointFromSeries(i,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:i.position,target:s.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},t.prototype.manuallyHideTip=function(e,t,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(makeDispatchAction$1(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var r=i.seriesIndex,a=i.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s)if("axis"===buildTooltipModel([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e]).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i=e.dataByCoordSys;i&&i.length?this._showAxisTooltip(i,e):n&&findEventDispatcher(n,(function(e){return null!=getECData(e).dataIndex}))?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,n,t)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,n,t)):(this._lastDataByCoordSys=null,this._hide(t))}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=bind(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,r=[t.offsetX,t.offsetY],a=buildTooltipModel([t.tooltipOption,i]),o=this._renderMode,s=[],l=createTooltipMarkup("section",{blocks:[],noHeader:!0}),u=[],c=new TooltipMarkupStyleCreator;each$c(e,(function(e){each$c(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var r=getValueLabel(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),a=createTooltipMarkup("section",{header:r,noHeader:!trim(r),sortBlocks:!0,blocks:[]});l.blocks.push(a),each(e.seriesDataIndices,(function(l){var h=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,d=h.getDataParams(p);d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=getAxisRawValue(t.axis,{value:i}),d.axisValueLabel=r,d.marker=c.makeTooltipMarker("item",convertToColorString(d.color),o);var f=normalizeTooltipFormatResult(h.formatTooltip(p,!0,null));f.markupFragment&&a.blocks.push(f.markupFragment),f.markupText&&u.push(f.markupText),s.push(d)}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,p=a.get("order"),d=buildTooltipMarkup(l,c,o,p,n.get("useUTC"));d&&u.unshift(d);var f="richText"===o?"\n\n":"
",g=u.join(f);this._showOrMove(a,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(a,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(a,g,s,Math.random()+"",r[0],r[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=findEventDispatcher(t,(function(e){return null!=getECData(e).dataIndex})),r=this._ecModel,a=getECData(i),o=a.seriesIndex,s=r.getSeriesByIndex(o),l=a.dataModel||s,u=a.dataIndex,c=a.dataType,h=l.getData(c),p=this._renderMode,d=buildTooltipModel([h.getItemModel(u),l,s&&(s.coordinateSystem||{}).model,this._tooltipModel]),f=d.get("trigger");if(null==f||"item"===f){var g=l.getDataParams(u,c),m=new TooltipMarkupStyleCreator;g.marker=m.makeTooltipMarker("item",convertToColorString(g.color),p);var y=normalizeTooltipFormatResult(l.formatTooltip(u,!1,c)),v=d.get("order"),_=y.markupFragment?buildTooltipMarkup(y.markupFragment,m,p,v,r.get("useUTC")):y.markupText,x="item_"+l.name+"_"+u;this._showOrMove(d,(function(){this._showTooltipContent(d,_,g,x,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=t.tooltip;if(isString(i)){i={content:i,formatter:i}}var r=new Model(i,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random()+"",s=new TooltipMarkupStyleCreator;this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t,s)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,c=e.get("formatter");o=o||e.get("position");var h=t,p=this._getNearestPoint([r,a],n,e.get("trigger"));if(c&&isString(c)){var d=e.ecModel.get("useUTC"),f=isArray(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=format(f.axisValue,h,d)),h=formatTpl(h,n,!0)}else if(isFunction(c)){var g=bind$2((function(t,i){t===this._ticket&&(u.setContent(i,l,e,p.color,o),this._updatePosition(e,o,r,a,u,n,s))}),this);this._ticket=i,h=c(n,i,g)}u.setContent(h,l,e,p.color,o),u.show(e,p.color),this._updatePosition(e,o,r,a,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n){return"axis"===n||isArray(t)?{color:"html"===this._renderMode?"#fff":"none"}:isArray(t)?void 0:{color:t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),c=e.get("align"),h=e.get("verticalAlign"),p=o&&o.getBoundingRect().clone();if(o&&p.applyTransform(o.transform),isFunction(t)&&(t=t([n,i],a,r.el,p,{viewSize:[s,l],contentSize:u.slice()})),isArray(t))n=parsePercent$3(t[0],s),i=parsePercent$3(t[1],l);else if(isObject(t)){var d=t;d.width=u[0],d.height=u[1];var f=getLayoutRect(d,{width:s,height:l});n=f.x,i=f.y,c=null,h=null}else if(isString(t)&&o){n=(g=calcTooltipPosition(t,p,u))[0],i=g[1]}else{var g;n=(g=refixTooltipPosition(n,i,r,s,l,c?null:20,h?null:20))[0],i=g[1]}(c&&(n-=isCenterAlign(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=isCenterAlign(h)?u[1]/2:"bottom"===h?u[1]:0),shouldTooltipConfine(e))&&(n=(g=confineTooltipPosition(n,i,r,s,l))[0],i=g[1]);r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e){var t=this._lastDataByCoordSys,n=!!t&&t.length===e.length;return n&&each$c(t,(function(t,i){var r=t.dataByAxis||[],a=(e[i]||{}).dataByAxis||[];(n=n&&r.length===a.length)&&each$c(r,(function(e,t){var i=a[t]||{},r=e.seriesDataIndices||[],o=i.seriesDataIndices||[];(n=n&&e.value===i.value&&e.axisType===i.axisType&&e.axisId===i.axisId&&r.length===o.length)&&each$c(r,(function(e,t){var i=o[t];n=n&&e.seriesIndex===i.seriesIndex&&e.dataIndex===i.dataIndex}))}))})),this._lastDataByCoordSys=e,!!n},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){env.node||(this._tooltipContent.dispose(),unregister("itemTooltip",t))},t.type="tooltip",t}(ComponentView);function buildTooltipModel(e){for(var t=e.pop();e.length;){var n=e.pop();n&&(n instanceof Model&&(n=n.get("tooltip",!0)),isString(n)&&(n={formatter:n}),t=new Model(n,t,t.ecModel))}return t}function makeDispatchAction$1(e,t){return e.dispatchAction||bind(t.dispatchAction,t)}function refixTooltipPosition(e,t,n,i,r,a,o){var s=n.getOuterSize(),l=s.width,u=s.height;return null!=a&&(e+l+a+2>i?e-=l+a:e+=a),null!=o&&(t+u+o>r?t-=u+o:t+=o),[e,t]}function confineTooltipPosition(e,t,n,i,r){var a=n.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,i)-o,t=Math.min(t+s,r)-s,[e=Math.max(e,0),t=Math.max(t,0)]}function calcTooltipPosition(e,t,n){var i=n[0],r=n[1],a=0,o=0,s=t.width,l=t.height;switch(e){case"inside":a=t.x+s/2-i/2,o=t.y+l/2-r/2;break;case"top":a=t.x+s/2-i/2,o=t.y-r-10;break;case"bottom":a=t.x+s/2-i/2,o=t.y+l+10;break;case"left":a=t.x-i-10-5,o=t.y+l/2-r/2;break;case"right":a=t.x+s+10+5,o=t.y+l/2-r/2}return[a,o]}function isCenterAlign(e){return"center"===e||"middle"===e}ComponentView.registerClass(TooltipView),registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var DEFAULT_TOOLBOX_BTNS=["rect","polygon","keep","clear"];function brushPreprocessor(e,t){var n=normalizeToArray(e?e.brush:[]);if(n.length){var i=[];each(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(i=i.concat(t))}));var r=e&&e.toolbox;isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a=r.feature||(r.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),removeDuplicate(s),t&&!s.length&&s.push.apply(s,DEFAULT_TOOLBOX_BTNS)}}function removeDuplicate(e){var t={};each(e,(function(e){t[e]=1})),e.length=0,each(t,(function(t,n){e.push(n)}))}var each$d=each;function hasKeys(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function createVisualMappings(e,t,n){var i={};return each$d(t,(function(t){var r,a=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);each$d(e[t],(function(e,i){if(VisualMapping.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),a[i]=new VisualMapping(r),"opacity"===i&&((r=clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new VisualMapping(r))}}))})),i}function replaceVisualOption(e,t,n){var i;each(n,(function(e){t.hasOwnProperty(e)&&hasKeys(t[e])&&(i=!0)})),i&&each(n,(function(n){t.hasOwnProperty(n)&&hasKeys(t[n])?e[n]=clone(t[n]):delete e[n]}))}function applyVisual(e,t,n,i,r,a){var o,s={};function l(e){return getItemVisualFromData(n,o,e)}function u(e,t){setItemVisualFromData(n,o,e,t)}function c(e,c){o=null==a?e:c;var h=n.getRawDataItem(o);if(!h||!1!==h.visualMap)for(var p=i.call(r,e),d=t[p],f=s[p],g=0,m=f.length;gt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&getBoundingRectFromMinMax(t)}};function getBoundingRectFromMinMax(e){return new BoundingRect(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var DEFAULT_OUT_OF_BRUSH_COLOR="#ddd",BrushModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return __extends(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&replaceVisualOption(n,e,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:DEFAULT_OUT_OF_BRUSH_COLOR},i.hasOwnProperty("liftZ")||(i.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=map(e,(function(e){return generateBrushOption(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=generateBrushOption(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}(ComponentModel);function generateBrushOption(e,t){return merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Model(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}ComponentModel.registerClass(BrushModel);var BrushView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new BrushController(t.getZr())).on("brush",bind(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,i){this.model=e,this._updateController(e,t,n,i)},t.prototype.updateTransform=function(e,t,n,i){layoutCovers(t),this._updateController(e,t,n,i)},t.prototype.updateVisual=function(e,t,n,i){this.updateTransform(e,t,n,i)},t.prototype.updateView=function(e,t,n,i){this._updateController(e,t,n,i)},t.prototype._updateController=function(e,t,n,i){(!i||i.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:t,areas:clone(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:clone(n),$from:t})},t.type="brush",t}(ComponentView);ComponentView.registerClass(BrushView),registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var ICON_TYPES=["rect","polygon","lineX","lineY","keep","clear"],BrushFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n){var i,r,a;t.eachComponent({mainType:"brush"},(function(e){i=e.brushType,r=e.brushOption.brushMode||"single",a=a||!!e.areas.length})),this._brushType=i,this._brushMode=r,each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===i)?"emphasis":"normal")}))},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get("icon",!0),n={};return each(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var i=this._brushType,r=this._brushMode;"clear"===n?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},t.getDefaultOption=function(e){return{show:!0,type:ICON_TYPES.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocale(["toolbox","brush","title"])}},t}(ToolboxFeature);registerFeature("brush",BrushFeature),registerPreprocessor(brushPreprocessor);var TitleModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return __extends(t,e),t.type="title",t.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(ComponentModel);ComponentModel.registerClass(TitleModel);var TitleView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var i=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new ZRText({style:createTextStyle(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new ZRText({style:createTextStyle(a,{text:c,fill:a.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=e.get("link"),d=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!p&&!f,h.silent=!d&&!f,p&&l.on("click",(function(){windowOpen(p,"_"+e.get("target"))})),d&&h.on("click",(function(){windowOpen(d,"_"+e.get("subtarget"))})),getECData(l).eventData=getECData(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(l),c&&i.add(h);var g=i.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=getLayoutRect(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?y.x+=y.width:"center"===o&&(y.x+=y.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:o,verticalAlign:s};l.setStyle(v),h.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var S=new Rect({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(S)}},t.type="title",t}(ComponentView);function timelinePreprocessor(e){var t=e&&e.timeline;isArray(t)||(t=t?[t]:[]),each(t,(function(e){e&&compatibleEC2(e)}))}function compatibleEC2(e){var t=e.type,n={number:"value",time:"time"};if(n[t]&&(e.axisType=n[t],delete e.type),transferItem(e),has(e,"controlPosition")){var i=e.controlStyle||(e.controlStyle={});has(i,"position")||(i.position=e.controlPosition),"none"!==i.position||has(i,"show")||(i.show=!1,delete i.position),delete e.controlPosition}each(e.data||[],(function(e){isObject(e)&&!isArray(e)&&(!has(e,"value")&&has(e,"name")&&(e.value=e.name),transferItem(e))}))}function transferItem(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),i=e.label||e.label||{},r=i.normal||(i.normal={}),a={normal:1,emphasis:1};each(i,(function(e,t){a[t]||has(r,t)||(r[t]=e)})),n.label&&!has(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function has(e,t){return e.hasOwnProperty(t)}ComponentView.registerClass(TitleView),ComponentModel.registerSubTypeDefaulter("timeline",(function(){return"slider"})),registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var n=t.getComponent("timeline");return n&&null!=e.currentIndex&&(n.setCurrentIndex(e.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),t.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),defaults({currentIndex:n.option.currentIndex},e)})),registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}));var TimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],i=t.axisType,r=this._names=[];"category"===i?(e=[],each(n,(function(t,n){var i,a=convertOptionIdName(getDataItemValue(t),"");isObject(t)?(i=clone(t)).value=n:i=n,e.push(i),r.push(a)}))):e=n;var a={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new List([{name:"value",type:a}],this)).initData(e,r)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(ComponentModel);ComponentModel.registerClass(TimelineModel);var SliderTimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline.slider",t.defaultOption=inheritDefaultOption(TimelineModel.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(TimelineModel);mixin(SliderTimelineModel,DataFormatMixin.prototype),ComponentModel.registerClass(SliderTimelineModel);var TimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline",t}(ComponentView),TimelineAxis=function(e){function t(t,n,i,r){var a=e.call(this,t,n,i)||this;return a.type=r||"value",a}return __extends(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(Axis),PI$9=Math.PI,labelDataIndexStore=makeInner(),SliderTimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var i=this._layout(e,n),r=this._createGroup("_mainGroup"),a=this._createGroup("_labelGroup"),o=this._axis=this._createAxis(i,e);e.formatTooltip=function(e){return createTooltipMarkup("nameValue",{noName:!0,value:o.scale.getLabel({value:e})})},each(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](i,r,o,e)}),this),this._renderAxisLabel(i,a,o,e),this._position(i,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,i,r,a,o=e.get(["label","position"]),s=e.get("orient"),l=getViewRect$5(e,t),u={horizontal:"center",vertical:(n=null==o||"auto"===o?"horizontal"===s?l.y+l.height/2=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:PI$9/2},p="vertical"===s?l.height:l.width,d=e.getModel("controlStyle"),f=d.get("show",!0),g=f?d.get("itemSize"):0,m=f?d.get("itemGap"):0,y=g+m,v=e.get(["label","rotate"])||0;v=v*PI$9/180;var _=d.get("position",!0),x=f&&d.get("showPlayBtn",!0),S=f&&d.get("showPrevBtn",!0),b=f&&d.get("showNextBtn",!0),T=0,M=p;"left"===_||"bottom"===_?(x&&(i=[0,0],T+=y),S&&(r=[T,0],T+=y),b&&(a=[M-g,0],M-=y)):(x&&(i=[M-g,0],M-=y),S&&(r=[0,0],T+=y),b&&(a=[M-g,0],M-=y));var A=[T,M];return e.get("inverse")&&A.reverse(),{viewRect:l,mainLength:p,orient:s,rotation:h[s],labelRotation:v,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:i,prevBtnPosition:r,nextBtnPosition:a,axisExtent:A,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,i=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=create$1(),o=r.x,s=r.y+r.height;translate(a,a,[-o,-s]),rotate(a,a,-PI$9/2),translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(n.getBoundingRect()),c=m(i.getBoundingRect()),h=[n.x,n.y],p=[i.x,i.y];p[0]=h[0]=l[0][0];var d,f=e.labelPosOpt;null==f||isString(f)?(y(h,u,l,1,d="+"===f?0:1),y(p,c,l,1,1-d)):(y(h,u,l,1,d=f>=0?0:1),p[1]=h[1]+f);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function y(e,t,n,i,r){e[i]+=n[i][r]-t[i][r]}n.setPosition(h),i.setPosition(p),n.rotation=i.rotation=e.rotation,g(n),g(i)},t.prototype._createAxis=function(e,t){var n=t.getData(),i=t.get("axisType"),r=createScaleByModel$1(t,i);r.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var a=n.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new TimelineAxis("value",r,e.axisExtent,i);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Group;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var a=new Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:extend({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(a);var o=this._progressLine=new Line({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:defaults({lineCap:"round",lineWidth:a.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,i){var r=this,a=i.getData(),o=n.scale.getTicks();this._tickSymbols=[],each(o,(function(e){var o=n.dataToCoord(e.value),s=a.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:o,y:0,onclick:bind(r._changeTimeline,r,e.value)},p=giveSymbol(s,l,t,h);p.ensureState("emphasis").style=u.getItemStyle(),p.ensureState("progress").style=c.getItemStyle(),enableHoverEmphasis(p);var d=getECData(p);s.get("tooltip")?(d.dataIndex=e.value,d.dataModel=i):d.dataIndex=d.dataModel=null,r._tickSymbols.push(p)}))},t.prototype._renderAxisLabel=function(e,t,n,i){var r=this;if(n.getLabelModel().get("show")){var a=i.getData(),o=n.getViewLabels();this._tickLabels=[],each(o,(function(i){var o=i.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(i.tickValue),p=new ZRText({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:bind(r._changeTimeline,r,o),silent:!1,style:createTextStyle(l,{text:i.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});p.ensureState("emphasis").style=createTextStyle(u),p.ensureState("progress").style=createTextStyle(c),t.add(p),enableHoverEmphasis(p),labelDataIndexStore(p).dataIndex=o,r._tickLabels.push(p)}))}},t.prototype._renderControl=function(e,t,n,i){var r=e.controlSize,a=e.rotation,o=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function c(e,n,l,u){if(e){var c=parsePercent(retrieve2(i.get(["controlStyle",n+"BtnSize"]),r),r),h=makeControlIcon(i,n+"Icon",[0,-c/2,c,c],{position:e,origin:[r/2,0],rotation:u?-a:0,rectHover:!0,style:o,onclick:l});h.ensureState("emphasis").style=s,t.add(h),enableHoverEmphasis(h)}}c(e.nextBtnPosition,"next",bind(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",bind(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",bind(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,i){var r=i.getData(),a=i.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=bind(s._handlePointerDrag,s),e.ondragend=bind(s._handlePointerDragend,s),pointerMoveTo(e,s._progressLine,a,n,i,!0)},onUpdate:function(e){pointerMoveTo(e,s._progressLine,a,n,i)}};this._currentPointer=giveSymbol(o,o,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],i=asc(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(o[a]=+o[a].toFixed(h)),[o,c]}ComponentModel.registerClass(MarkPointModel);var markerTypeCalculator={min:curry(markerTypeCalculatorWithExtent,"min"),max:curry(markerTypeCalculatorWithExtent,"max"),average:curry(markerTypeCalculatorWithExtent,"average"),median:curry(markerTypeCalculatorWithExtent,"median")};function dataTransform(e,t){var n=e.getData(),i=e.coordinateSystem;if(t&&!hasXAndY(t)&&!isArray(t.coord)&&i){var r=i.dimensions,a=getAxisInfo$1(t,n,i,e);if((t=clone(t)).type&&markerTypeCalculator[t.type]&&a.baseAxis&&a.valueAxis){var o=indexOf(r,a.baseAxis.dim),s=indexOf(r,a.valueAxis.dim),l=markerTypeCalculator[t.type](n,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],c=0;c<2;c++)markerTypeCalculator[u[c]]&&(u[c]=numCalculate(n,n.mapDimension(r[c]),u[c]));t.coord=u}}return t}function getAxisInfo$1(e,t,n,i){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=n.getAxis(dataDimToCoordDim(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim),r.valueDataDim=t.mapDimension(r.valueAxis.dim)),r}function dataDimToCoordDim(e,t){var n=e.getData(),i=n.dimensions;t=n.getDimension(t);for(var r=0;r=0&&"number"==typeof l&&(l=+l.toFixed(Math.min(f,20))),p.coord[c]=d.coord[c]=l,r=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[dataTransform(e,r[0]),dataTransform(e,r[1]),extend({},r[2])];return g[2].type=g[2].type||null,merge(g[2],g[0]),merge(g[2],g[1]),g};function isInifinity(e){return!isNaN(e)&&!isFinite(e)}function ifMarkLineHasOnlyDim(e,t,n,i){var r=1-e,a=i.dimensions[e];return isInifinity(t[r])&&isInifinity(n[r])&&t[e]===n[e]&&i.getAxis(a).containData(t[e])}function markLineFilter(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(ifMarkLineHasOnlyDim(1,n,i,e)||ifMarkLineHasOnlyDim(0,n,i,e)))return!0}return dataFilter$1(e,t[0])&&dataFilter$1(e,t[1])}function updateSingleMarkerEndLayout(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get("x"),r.getWidth()),u=parsePercent$2(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=o.dimensions,h=e.get(c[0],t),p=e.get(c[1],t);a=o.dataToPoint([h,p])}if(isCoordinateSystemType(o,"cartesian2d")){var d=o.getAxis("x"),f=o.getAxis("y");c=o.dimensions;isInifinity(e.get(c[0],t))?a[0]=d.toGlobalCoord(d.getExtent()[n?0:1]):isInifinity(e.get(c[1],t))&&(a[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}var MarkLineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=inner$k(t).from,a=inner$k(t).to;r.each((function(t){updateSingleMarkerEndLayout(r,t,!0,e,n),updateSingleMarkerEndLayout(a,t,!1,e,n)})),i.each((function(e){i.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new LineDraw);this.group.add(l.group);var u=createList$2(r,e,t),c=u.from,h=u.to,p=u.line;inner$k(t).from=c,inner$k(t).to=h,t.setData(p);var d=t.get("symbol"),f=t.get("symbolSize");function g(t,n,r){var a=t.getItemModel(n);updateSingleMarkerEndLayout(t,n,r,e,i);var s=a.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=getVisualFromData(o,"color")),t.setItemVisual(n,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||f[r?0:1],symbol:a.get("symbol",!0)||d[r?0:1],style:s})}isArray(d)||(d=[d,d]),isArray(f)||(f=[f,f]),u.from.each((function(e){g(c,e,!0),g(h,e,!1)})),p.each((function(e){var t=p.getItemModel(e).getModel("lineStyle").getLineStyle();p.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),p.setItemVisual(e,{fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(p),u.line.eachItemGraphicEl((function(e,n){e.traverse((function(e){getECData(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(MarkerView);function createList$2(e,t,n){var i;i=e?map(e&&e.dimensions,(function(e){return defaults({name:e},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{})})):[{name:"value",type:"float"}];var r=new List(i,n),a=new List(i,n),o=new List([],n),s=map(n.get("data"),curry(markLineTransform,t,e,n));e&&(s=filter(s,curry(markLineFilter,e)));var l=e?dimValueGetter:function(e){return e.value};return r.initData(map(s,(function(e){return e[0]})),null,l),a.initData(map(s,(function(e){return e[1]})),null,l),o.initData(map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}ComponentView.registerClass(MarkLineView),registerPreprocessor((function(e){e.markLine=e.markLine||{}}));var MarkAreaModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(MarkerModel);ComponentModel.registerClass(MarkAreaModel);var inner$l=makeInner(),markAreaTransform=function(e,t,n,i){var r=dataTransform(e,i[0]),a=dataTransform(e,i[1]),o=r.coord,s=a.coord;o[0]=retrieve(o[0],-1/0),o[1]=retrieve(o[1],-1/0),s[0]=retrieve(s[0],1/0),s[1]=retrieve(s[1],1/0);var l=mergeAll([{},r,a]);return l.coord=[r.coord,a.coord],l.x0=r.x,l.y0=r.y,l.x1=a.x,l.y1=a.y,l};function isInifinity$1(e){return!isNaN(e)&&!isFinite(e)}function ifMarkAreaHasOnlyDim(e,t,n,i){var r=1-e;return isInifinity$1(t[r])&&isInifinity$1(n[r])}function markAreaFilter(e,t){var n=t.coord[0],i=t.coord[1];return!!(isCoordinateSystemType(e,"cartesian2d")&&n&&i&&(ifMarkAreaHasOnlyDim(1,n,i)||ifMarkAreaHasOnlyDim(0,n,i)))||(dataFilter$1(e,{coord:n,x:t.x0,y:t.y0})||dataFilter$1(e,{coord:i,x:t.x1,y:t.y1}))}function getSingleMarkerEndPoint(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get(n[0]),r.getWidth()),u=parsePercent$2(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(n,t));else{var c=[d=e.get(n[0],t),f=e.get(n[1],t)];o.clampData&&o.clampData(c,c),a=o.dataToPoint(c,!0)}if(isCoordinateSystemType(o,"cartesian2d")){var h=o.getAxis("x"),p=o.getAxis("y"),d=e.get(n[0],t),f=e.get(n[1],t);isInifinity$1(d)?a[0]=h.toGlobalCoord(h.getExtent()["x0"===n[0]?0:1]):isInifinity$1(f)&&(a[1]=p.toGlobalCoord(p.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var dimPermutations=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MarkAreaView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each((function(t){var r=map(dimPermutations,(function(r){return getSingleMarkerEndPoint(i,t,r,e,n)}));i.setItemLayout(t,r),i.getItemGraphicEl(t).setShape("points",r)}))}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new Group});this.group.add(l.group),this.markKeep(l);var u=createList$3(r,e,t);t.setData(u),u.each((function(t){var n=map(dimPermutations,(function(n){return getSingleMarkerEndPoint(u,t,n,e,i)})),a=!0;each(dimPermutations,(function(e){if(a){var n=u.get(e[0],t),i=u.get(e[1],t);(isInifinity$1(n)||r.getAxis("x").containData(n))&&(isInifinity$1(i)||r.getAxis("y").containData(i))&&(a=!1)}})),u.setItemLayout(t,{points:n,allClipped:a});var s=u.getItemModel(t).getModel("itemStyle").getItemStyle(),l=getVisualFromData(o,"color");s.fill||(s.fill=l,"string"==typeof s.fill&&(s.fill=modifyAlpha(s.fill,.4))),s.stroke||(s.stroke=l),u.setItemVisual(t,"style",s)})),u.diff(inner$l(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var i=inner$l(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?updateProps(i,{shape:{points:r.points}},t,e):i=new Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))})).remove((function(e){var t=inner$l(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var i=u.getItemModel(n),r=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),setLabelStyle(e,getLabelStatesModels(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:"string"==typeof r.fill?modifyAlpha(r.fill,1):"#000"}),setStatesStylesFromModel(e,i),enableHoverEmphasis(e),getECData(e).dataModel=t})),inner$l(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(MarkerView);function createList$3(e,t,n){var i,r;e?(i=map(e&&e.dimensions,(function(e){var n=t.getData();return defaults({name:e},n.getDimensionInfo(n.mapDimension(e))||{})})),r=new List(map(["x0","y0","x1","y1"],(function(e,t){return{name:e,type:i[t%2].type}})),n)):r=new List(i=[{name:"value",type:"float"}],n);var a=map(n.get("data"),curry(markAreaTransform,t,e,n));e&&(a=filter(a,curry(markAreaFilter,e)));var o=e?function(e,t,n,i){return e.coord[Math.floor(i/2)][i%2]}:function(e){return e.value};return r.initData(a,null,o),r.hasItemOption=!0,r}ComponentView.registerClass(MarkAreaView),registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var getDefaultSelectorOptions=function(e,t){return"all"===t?{type:"all",title:e.getLocale(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocale(["legend","selector","inverse"])}:void 0},LegendModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),isArray(t)&&each(t,(function(e,i){isString(e)&&(e={type:e}),t[i]=merge(e,getDefaultSelectorOptions(n,e.type))}))},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(ComponentModel);function legendSelectActionHandler(e,t,n){var i,r={},a="toggleSelected"===e;return n.eachComponent("legend",(function(n){a&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name)),each(n.getData(),(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&i:r[t]=i}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}ComponentModel.registerClass(LegendModel),registerAction("legendToggleSelect","legendselectchanged",curry(legendSelectActionHandler,"toggleSelected")),registerAction("legendAllSelect","legendselectall",curry(legendSelectActionHandler,"allSelect")),registerAction("legendInverseSelect","legendinverseselect",curry(legendSelectActionHandler,"inverseSelect")),registerAction("legendSelect","legendselected",curry(legendSelectActionHandler,"select")),registerAction("legendUnSelect","legendunselected",curry(legendSelectActionHandler,"unSelect"));var curry$1=curry,each$e=each,Group$2=Group,LegendView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Group$2),this.group.add(this._selectorGroup=new Group$2),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,n,o,a,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=getLayoutRect(l,u,c),p=this.layoutInner(e,r,h,i,o,s),d=getLayoutRect(defaults({width:p.width,height:p.height},l),u,c);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(p,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,r,a,o){var s=this.getContentGroup(),l=createHashMap(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),each$e(t.getData(),(function(r,a){var o=r.get("name");if(!this.newlineDisabled&&(""===o||"\n"===o)){var h=new Group$2;return h.newline=!0,void s.add(h)}var p=n.getSeriesByName(o)[0];if(!l.get(o)){if(p){var d=p.getData(),f=d.getVisual("style"),g=f[d.getVisual("drawType")]||f.fill,m=f.stroke,y=f.decal,v=d.getVisual("legendSymbol")||"roundRect",_=d.getVisual("symbol");this._createItem(o,a,r,t,v,_,e,g,m,y,u).on("click",curry$1(dispatchSelectAction,o,null,i,c)).on("mouseover",curry$1(dispatchHighlightAction,p.name,null,i,c)).on("mouseout",curry$1(dispatchDownplayAction,p.name,null,i,c)),l.set(o,!0)}else n.eachRawSeries((function(n){if(!l.get(o)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(o))return;var h=s.indexOfName(o),p=s.getItemVisual(h,"style"),d=p.stroke,f=p.decal,g=p.fill,m=parse(p.fill);m&&0===m[3]&&(m[3]=.2,g=stringify(m,"rgba"));this._createItem(o,a,r,t,"roundRect",null,e,g,d,f,u).on("click",curry$1(dispatchSelectAction,null,o,i,c)).on("mouseover",curry$1(dispatchHighlightAction,null,o,i,c)).on("mouseout",curry$1(dispatchDownplayAction,null,o,i,c)),l.set(o,!0)}}),this);0}}),this),r&&this._createSelector(r,t,i,a,o)},t.prototype._createSelector=function(e,t,n,i,r){var a=this.getSelectorGroup();each$e(e,(function(e){var i=e.type,r=new ZRText({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});a.add(r),setLabelStyle(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),enableHoverEmphasis(r)}))},t.prototype._createItem=function(e,t,n,i,r,a,o,s,l,u,c){var h=i.get("itemWidth"),p=i.get("itemHeight"),d=i.get("inactiveColor"),f=i.get("inactiveBorderColor"),g=i.get("symbolKeepAspect"),m=i.getModel("itemStyle"),y=i.isSelected(e),v=new Group$2,_=n.getModel("textStyle"),x=n.get("icon"),S=n.getModel("tooltip"),b=S.parentModel,T=createSymbol(r=x||r,0,0,h,p,y?s:d,null==g||g);if(v.add(setSymbolStyle(T,r,m,l,f,u,y)),!x&&a&&(a!==r||"none"===a)){var M=.8*p;"none"===a&&(a="circle");var A=createSymbol(a,(h-M)/2,(p-M)/2,M,M,y?s:d,null==g||g);v.add(setSymbolStyle(A,a,m,l,f,u,y))}var I="left"===o?h+5:-5,C=o,w=i.get("formatter"),P=e;"string"==typeof w&&w?P=w.replace("{name}",null!=e?e:""):"function"==typeof w&&(P=w(e)),v.add(new ZRText({style:createTextStyle(_,{text:P,x:I,y:p/2,fill:y?_.getTextColor():d,align:C,verticalAlign:"middle"})}));var L=new Rect({shape:v.getBoundingRect(),invisible:!0});if(S.get("show")){var E={componentType:"legend",legendIndex:i.componentIndex,name:e,$vars:["name"]};L.tooltip=extend({content:e,formatter:b.get("formatter",!0)||function(e){return e.name},formatterParams:E},S.option)}return v.add(L),v.eachChild((function(e){e.silent=!0})),L.silent=!c,this.getContentGroup().add(v),enableHoverEmphasis(v),v.__legendDataIndex=t,v},t.prototype.layoutInner=function(e,t,n,i,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();box(e.get("orient"),o,e.get("itemGap"),n.width,n.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),o.markRedraw(),r){box("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],p=e.get("selectorButtonGap",!0),d=e.getOrient().index,f=0===d?"width":"height",g=0===d?"height":"width",m=0===d?"y":"x";"end"===a?h[d]+=l[f]+p:u[d]+=c[f]+p,h[1-d]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],o.x=u[0],o.y=u[1];var y={x:0,y:0};return y[f]=l[f]+p+c[f],y[g]=Math.max(l[g],c[g]),y[m]=Math.min(0,c[m]+h[1-d]),y}return o.x=u[0],o.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ComponentView);function setSymbolStyle(e,t,n,i,r,a,o){var s;return"line"!==t&&t.indexOf("empty")<0?(s=n.getItemStyle(),e.style.stroke=i,e.style.decal=a,o||(s.stroke=r)):s=n.getItemStyle(["borderWidth","borderColor"]),e.setStyle(s),e}function dispatchSelectAction(e,t,n,i){dispatchDownplayAction(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),dispatchHighlightAction(e,t,n,i)}function isUseHoverLayer(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;in[r],f=[-h.x,-h.y];t||(f[i]=l[s]);var g=[0,0],m=[-p.x,-p.y],y=retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?m[i]+=n[r]-p[r]:g[i]+=p[r]+y);m[1-i]+=h[a]/2-p[a]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var v={x:0,y:0};if(v[r]=d?n[r]:h[r],v[a]=Math.max(h[a],p[a]),v[o]=Math.min(0,p[o]+m[1-i]),u.__rectSize=n[r],d){var _={x:0,y:0};_[r]=Math.max(n[r]-p[r]-y,0),_[a]=v[a],u.setClipPath(new Rect({shape:_})),u.__rectSize=_[r]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&updateProps(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?e:null),this._updatePageInfoView(e,x),v},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;each(["pagePrev","pageNext"],(function(i){var r=null!=t[i+"DataIndex"],a=n.childOfName(i);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;i&&r&&i.setStyle("text",isString(r)?r.replace("{current}",null==o?"":o+"").replace("{total}",null==s?"":s+""):r({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,a=WH$1[r],o=XY$1[r],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,p={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var d=v(u);p.contentPosition[r]=-d.s;for(var f=s+1,g=d,m=d,y=null;f<=c;++f)(!(y=v(l[f]))&&m.e>g.s+i||y&&!_(y,g.s))&&(g=m.i>g.i?m:y)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount),m=y;for(f=s-1,g=d,m=d,y=null;f>=-1;--f)(y=v(l[f]))&&_(m,y.s)||!(g.i=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(i,r){var a=i.__legendDataIndex;null==n&&null!=a&&(n=r),a===e&&(t=r)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(LegendView);ComponentView.registerClass(ScrollableLegendView),registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}));var SliderZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=inheritDefaultOption(DataZoomModel.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(DataZoomModel);ComponentModel.registerClass(SliderZoomModel);var Rect$2=Rect,DEFAULT_LOCATION_EDGE_GAP=7,DEFAULT_FRAME_BORDER_WIDTH=1,DEFAULT_FILLER_SIZE=30,DEFAULT_MOVE_HANDLE_SIZE=7,HORIZONTAL="horizontal",VERTICAL="vertical",LABEL_GAP=5,SHOW_DATA_SHADOW_SERIES_TYPE=["line","bar","candlestick","scatter"],REALTIME_ANIMATION_CONFIG={easing:"cubicOut",duration:100},SliderZoomView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return __extends(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=bind(this._onBrush,this),this._onBrushEnd=bind(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),createOrUpdate(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){clear(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?DEFAULT_MOVE_HANDLE_SIZE:0,i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},a=this._orient===HORIZONTAL?{right:r.width-i.x-i.width,top:r.height-DEFAULT_FILLER_SIZE-DEFAULT_LOCATION_EDGE_GAP-n,width:i.width,height:DEFAULT_FILLER_SIZE}:{right:DEFAULT_LOCATION_EDGE_GAP,top:i.y,width:DEFAULT_FILLER_SIZE,height:i.height},o=getLayoutParams(e.option);each(["right","top","width","height"],(function(e){"ph"===o[e]&&(o[e]=a[e])}));var s=getLayoutRect(o,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===VERTICAL&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n!==HORIZONTAL||r?n===HORIZONTAL&&r?{scaleY:o?1:-1,scaleX:-1}:n!==VERTICAL||r?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new Rect$2({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new Rect$2({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:bind(this._onClickPanel,this)}),a=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",a.on("mousemove",this._onBrush),a.on("mouseup",this._onBrushEnd)):(a.off("mousemove",this._onBrush),a.off("mouseup",this._onBrushEnd)),n.add(r)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=e.series,i=n.getRawData(),r=n.getShadowDim?n.getShadowDim():e.otherDim;if(null!=r){var a=i.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],c=[[t[0],0],[0,0]],h=[],p=u[1]/(i.count()-1),d=0,f=Math.round(i.count()/t[0]);i.each([r],(function(e,t){if(f>0&&t%f)d+=p;else{var n=null==e||isNaN(e)||""===e,i=n?0:linearMap(e,a,l,!0);n&&!s&&t?(c.push([c[c.length-1][0],0]),h.push([h[h.length-1][0],0])):!n&&s&&(c.push([d,0]),h.push([d,0])),c.push([d,i]),h.push([d,i]),d+=p,s=n}}));for(var g=this.dataZoomModel,m=0;m<3;m++){var y=v(1===m);this._displayables.sliderGroup.add(y),this._displayables.dataShadowSegs.push(y)}}}function v(e){var t=g.getModel(e?"selectedDataBackground":"dataBackground"),n=new Group,i=new Polygon({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Polyline({shape:{points:h},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,i=this.ecModel;return e.eachTargetAxis((function(r,a){each(e.getAxisProxy(r,a).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,e.get("type"))<0)){var o,s=i.getComponent(getAxisMainType(r),a).axis,l=getOtherDim(r),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:r,otherDim:l,otherAxisInverse:o}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],r=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,l=o.get("borderRadius")||0,u=o.get("brushSelect"),c=t.filler=new Rect$2({silent:u,style:{fill:o.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new Rect$2({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:l},style:{stroke:o.get("dataBackgroundColor")||o.get("borderColor"),lineWidth:DEFAULT_FRAME_BORDER_WIDTH,fill:"rgba(0,0,0,0)"}})),each([0,1],(function(t){var a=o.get("handleIcon");!symbolBuildProxies[a]&&a.indexOf("path://")<0&&(a="path://"+a);var s=createSymbol(a,-1,0,2,2,null,!0);s.attr({cursor:getCursor(this._orient),draggable:!0,drift:bind(this._onDragMove,this,t),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=o.get("handleSize");this._handleHeight=parsePercent$2(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(o.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=o.getModel(["emphasis","handleStyle"]).getItemStyle(),enableHoverEmphasis(s);var c=o.get("handleColor");null!=c&&(s.style.fill=c),r.add(n[t]=s);var h=o.getModel("textStyle");e.add(i[t]=new ZRText({silent:!0,invisible:!0,style:{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()},z2:10}))}),this);var h=c;if(u){var p=parsePercent$2(o.get("moveHandleSize"),a[1]),d=t.moveHandle=new Rect({style:o.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:p}}),f=.8*p,g=t.moveHandleIcon=createSymbol(o.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=a[1]+p/2-.5,d.ensureState("emphasis").style=o.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(a[1]/2,Math.max(p,10));(h=t.moveZone=new Rect({invisible:!0,shape:{y:a[1]-m,height:p+m}})).on("mouseover",(function(){s.enterEmphasis(d)})).on("mouseout",(function(){s.leaveEmphasis(d)})),r.add(d),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:getCursor(this._orient),drift:bind(this._onDragMove,this,"all"),ondragstart:bind(this._showDataInfo,this,!0),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[linearMap(e[0],[0,100],t,!0),linearMap(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];sliderMove(t,i,r,n.get("zoomLock")?"all":e,null!=a.minSpan?linearMap(a.minSpan,o,r,!0):null,null!=a.maxSpan?linearMap(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=asc([linearMap(i[0],r,o,!0),linearMap(i[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=asc(n.slice()),r=this._size;each([0,1],(function(e){var i=t.handles[e],a=this._handleHeight;i.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:r[1]/2-a/2})}),this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var a={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;lt[0]||n[1]<0||n[1]>t[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,a=this._updateInterval("all",n[0]-r);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Point(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=asc([linearMap(n.x,i,r,!0),linearMap(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(stop(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new Rect$2({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),l=o.transformCoordToLocal(a.x,a.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?REALTIME_ANIMATION_CONFIG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=collectReferCoordSysModelInfo(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),r=this.api.getHeight();e={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return e},t.type="dataZoom.slider",t}(DataZoomView);function getOtherDim(e){return{x:"y",y:"x",radius:"angle",angle:"radius"}[e]}function getCursor(e){return"vertical"===e?"ns-resize":"ew-resize"}ComponentView.registerClass(SliderZoomView);var InsideZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.inside",t.defaultOption=inheritDefaultOption(DataZoomModel.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(DataZoomModel);ComponentModel.registerClass(InsideZoomModel);var inner$m=makeInner();function setViewInfoToCoordSysRecord(e,t,n){inner$m(e).coordSysRecordMap.each((function(e){var i=e.dataZoomInfoMap.get(t.uid);i&&(i.getRange=n)}))}function disposeCoordSysRecordIfNeeded(e,t){for(var n=inner$m(e).coordSysRecordMap,i=n.keys(),r=0;ri[n+t]&&(t=o),r=r&&a.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}registerProcessor(PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=inner$m(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=createHashMap());i.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){each(collectReferCoordSysModelInfo(e).infoList,(function(n){var r=n.model.uid,a=i.get(r)||i.set(r,createCoordSysRecord(t,n.model));(a.dataZoomInfoMap||(a.dataZoomInfoMap=createHashMap())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),i.each((function(e){var t,n=e.controller,r=e.dataZoomInfoMap;if(r){var a=r.keys()[0];null!=a&&(t=r.get(a))}if(t){var o=mergeControllerParams(r);n.enable(o.controlType,o.opt),n.setPointerChecker(e.containsPoint),createOrUpdate(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else disposeCoordSysRecord(i,e)}))}));var InsideZoomView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return __extends(t,e),t.prototype.render=function(t,n,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),setViewInfoToCoordSysRecord(i,t,{pan:bind(getRangeHandlers.pan,this),zoom:bind(getRangeHandlers.zoom,this),scrollMove:bind(getRangeHandlers.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){disposeCoordSysRecordIfNeeded(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(DataZoomView),getRangeHandlers={zoom:function(e,t,n,i){var r=this.range,a=r.slice(),o=e.axisModels[0];if(o){var s=getDirectionInfo[t](null,[i.originX,i.originY],o,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return sliderMove(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:makeMover((function(e,t,n,i,r,a){var o=getDirectionInfo[i]([a.oldX,a.oldY],[a.newX,a.newY],t,r,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:makeMover((function(e,t,n,i,r,a){return getDirectionInfo[i]([0,0],[a.scrollDelta,a.scrollDelta],t,r,n).signal*(e[1]-e[0])*a.scrollDelta}))};function makeMover(e){return function(t,n,i,r){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s)return sliderMove(e(o,s,t,n,i,r),o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}var getDirectionInfo={grid:function(e,t,n,i,r){var a=n.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,i,r){var a=n.axis,o={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,i,r){var a=n.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};ComponentView.registerClass(InsideZoomView);var each$f=each;function visualMapPreprocessor(e){var t=e&&e.visualMap;isArray(t)||(t=t?[t]:[]),each$f(t,(function(e){if(e){has$1(e,"splitList")&&!has$1(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&isArray(t)&&each$f(t,(function(e){isObject(e)&&(has$1(e,"start")&&!has$1(e,"min")&&(e.min=e.start),has$1(e,"end")&&!has$1(e,"max")&&(e.max=e.end))}))}}))}function has$1(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}ComponentModel.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var VISUAL_PRIORITY=PRIORITY.VISUAL.COMPONENT;function getColorVisual(e,t,n,i){for(var r=t.targetVisuals[i],a=VisualMapping.prepareVisualTypes(r),o={color:getVisualFromData(e.getData(),"color")},s=0,l=a.length;s"],isArray(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);return isString(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):isFunction(s)?i?s(e[0],e[1]):s(e):i?e[0]===o[0]?n[0]+" "+l[1]:e[1]===o[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===o[0]?"min":e===o[1]?"max":(+e).toFixed(Math.min(a,20))}},t.prototype.resetExtent=function(){var e=this.option,t=asc$2([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimension=function(e){var t=this.option.dimension,n=e.dimensions;if(null!=t||n.length){if(null!=t)return e.getDimension(t);for(var i=e.dimensions,r=i.length-1;r>=0;r--){var a=i[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),r=t.controller||(t.controller={});merge(i,n),merge(r,n);var a=this.isCategory();function o(n){isArray$1(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,r),function(e,t,n){var i=e[t],r=e[n];i&&!r&&(r=e[n]={},each$g(i,(function(e,t){if(VisualMapping.isValidType(t)){var n=visualDefault.get(t,"inactive",a);null!=n&&(r[t]=n,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor");each$g(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?i:[i]}),null==s.symbol&&(s.symbol=t&&clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&clone(n)||(a?o[0]:[o[0],o[0]])),s.symbol=mapVisual$1(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;eachVisual(l,(function(e){e>u&&(u=e)})),s.symbolSize=mapVisual$1(l,(function(e){return linearMap$1(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(ComponentModel),DEFAULT_BAR_BOUND=[20,140],ContinuousModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=DEFAULT_BAR_BOUND[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=DEFAULT_BAR_BOUND[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=asc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var i=[],r=n.getData();r.each(this.getDataDimension(r),(function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)}),this),t.push({seriesId:n.id,dataIndex:i})}),this),t},t.prototype.getVisualMeta=function(e){var t=getColorStopValues(this,"outOfRange",this.getExtent()),n=getColorStopValues(this,"inRange",this.option.range.slice()),i=[];function r(t,n){i.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,l=t.length;oe[1])break;n.push({color:this.getControllerVisual(a,"color",t),offset:r/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Group("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,a=n.handleLabels,o=i.itemSize,s=i.getExtent();each$h([0,1],(function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=linearMap$2(e[l],[0,o[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/o[0],u.x=o[0]-h/2;var p=applyTransform$1(n.handleLabelPoints[l],getTransform(u,this.group));a[l].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,i){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),p=linearMap$2(e,a,s,!0),d=o[0]-h/2,f={x:u.x,y:u.y};u.y=p,u.x=d;var g=applyTransform$1(l.indicatorLabelPoint,getTransform(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(t),verticalAlign:v?y:"middle",align:v?"center":y});var _={x:d,y:p,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,S),m.animateTo(x,S)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var T=0;Tr[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,h=[];(t||useHoverLinkOnHandle(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var p=compressBatches(c,h);this._dispatchHighDown("downplay",makeHighDownBatch(p[0],n)),this._dispatchHighDown("highlight",makeHighDownBatch(p[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t=e.target,n=this.visualMapModel;if(t&&null!=getECData(t).dataIndex){var i=getECData(t),r=this.ecModel.getSeriesByIndex(i.seriesIndex);if(n.isTargetSeries(r)){var a=r.getData(i.dataType),o=a.get(n.getDataDimension(a),i.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=clone(e)},t.prototype.getValueState=function(e){var t=VisualMapping.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(i){var r=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){VisualMapping.findPieceIndex(t,n)===e&&r.push(i)}),this),t.push({seriesId:i.id,dataIndex:r})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:n}}function s(r,a){var o=i.getRepresentValue({interval:r});a||(a=i.getValueState(o));var s=e(o,a);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=inheritDefaultOption(VisualMapModel.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(VisualMapModel),resetMethods={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;r=Math.max(parseInt(r,10),1),t.splitNumber=r;for(var a=(i[1]-i[0])/r;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function normalizeReverse(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}ComponentModel.registerClass(PiecewiseModel);var PiecewiseVisualMapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,r=i.getFont(),a=i.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,o),each(l.viewPieceList,(function(i){var l=i.piece,u=new Group;u.onclick=bind(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var p=this.visualMapModel.getValueState(h);u.add(new ZRText({style:{x:"right"===o?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:o,font:r,fill:a,opacity:"outOfRange"===p?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,o),box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:makeHighDownBatch(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return getItemAlign(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,r){if(t){var a=new Group,o=this.visualMapModel.textStyleModel;a.add(new ZRText({style:{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:t,font:o.getFont(),fill:o.getTextColor()}})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),i=e.get("orient"),r=e.get("inverse");return("horizontal"===i?r:!r)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(createSymbol(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=clone(n.selected),r=t.getSelectedMapKey(e);"single"===n.selectedMode?(i[r]=!0,each(i,(function(e,t){i[t]=t===r}))):i[r]=!i[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})},t.type="visualMap.piecewise",t}(VisualMapView);ComponentView.registerClass(PiecewiseVisualMapView),registerPreprocessor(visualMapPreprocessor);var DEFAULT_OPTION={label:{enabled:!0},decal:{show:!1}},inner$n=makeInner(),decalPaletteScope={};function ariaVisual(e,t){var n=e.getModel("aria");if(n.get("enabled")){var i=clone(DEFAULT_OPTION);merge(i.label,e.getLocaleModel().get("aria"),!1),merge(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$n(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if("function"!=typeof t.enableAriaDecal){var n=t.getData();if(t.useColorPaletteOnData){var i=t.getRawData(),r={},a=inner$n(t).scope;n.each((function(e){var t=n.getRawIndex(e);r[t]=e}));var o=i.count();i.each((function(e){var s=r[e],l=i.getName(e)||e+"",c=getDecalFromPalette(t.ecModel,l,a,o),h=n.getItemVisual(s,"decal");n.setItemVisual(s,"decal",u(h,c))}))}else{var s=getDecalFromPalette(t.ecModel,t.name,decalPaletteScope,e.getSeriesCount()),l=n.getVisual("decal");n.setVisual("decal",u(l,s))}}else t.enableAriaDecal();function u(e,t){var n=e?extend(extend({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var i=e.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=defaults(a.option,i),!a.get("enabled"))return;var o=t.getZr().dom;if(a.get("description"))return void o.setAttribute("aria-label",a.get("description"));var s,l=e.getSeriesCount(),u=a.get(["data","maxCount"])||10,c=a.get(["series","maxCount"])||10,h=Math.min(l,c);if(l<1)return;var p=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();if(p){var d=a.get(["general","withTitle"]);s=r(d,{title:p})}else s=a.get(["general","withoutTitle"]);var f=[],g=l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]);s+=r(g,{seriesCount:l}),e.eachSeries((function(t,n){if(n1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(_=t.subType,e.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var s=t.getData();if(s.count()>u)i+=r(a.get(["data","partialData"]),{displayCnt:u});else i+=a.get(["data","allData"]);for(var c=[],p=0;p-EPSILON$4}function pathHasFill(e){var t=e.fill;return null!=t&&t!==NONE}function pathHasStroke(e){var t=e.stroke;return null!=t&&t!==NONE}function setTransform(e,t){t&&attr(e,"transform","matrix("+round3(t[0])+","+round3(t[1])+","+round3(t[2])+","+round3(t[3])+","+round4(t[4])+","+round4(t[5])+")")}function attr(e,t,n){(!n||"linear"!==n.type&&"radial"!==n.type)&&e.setAttribute(t,n)}function attrXLink(e,t,n){e.setAttributeNS("http://www.w3.org/1999/xlink",t,n)}function attrXML(e,t,n){e.setAttributeNS("http://www.w3.org/XML/1998/namespace",t,n)}function bindStyle(e,t,n){var i=null==t.opacity?1:t.opacity;if(pathHasFill(t)){var r=t.fill;attr(e,"fill",r="transparent"===r?NONE:r),attr(e,"fill-opacity",(null!=t.fillOpacity?t.fillOpacity*i:i)+"")}else attr(e,"fill",NONE);if(pathHasStroke(t)){var a=t.stroke;attr(e,"stroke",a="transparent"===a?NONE:a);var o=t.lineWidth,s=t.strokeNoScale?n.getLineScale():1;attr(e,"stroke-width",(s?o/s:0)+""),attr(e,"paint-order",t.strokeFirst?"stroke":"fill"),attr(e,"stroke-opacity",(null!=t.strokeOpacity?t.strokeOpacity*i:i)+"");var l=t.lineDash&&o>0&&normalizeLineDash(t.lineDash,o);if(l){var u=t.lineDashOffset;s&&1!==s&&(l=map(l,(function(e){return e/s})),u&&(u=mathRound(u/=s))),attr(e,"stroke-dasharray",l.join(",")),attr(e,"stroke-dashoffset",(u||0)+"")}else attr(e,"stroke-dasharray","");t.lineCap&&attr(e,"stroke-linecap",t.lineCap),t.lineJoin&&attr(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&attr(e,"stroke-miterlimit",t.miterLimit+"")}else attr(e,"stroke",NONE)}var SVGPathRebuilder=function(){function e(){}return e.prototype.reset=function(){this._d=[],this._str=""},e.prototype.moveTo=function(e,t){this._add("M",e,t)},e.prototype.lineTo=function(e,t){this._add("L",e,t)},e.prototype.bezierCurveTo=function(e,t,n,i,r,a){this._add("C",e,t,n,i,r,a)},e.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},e.prototype.arc=function(e,t,n,i,r,a){this.ellipse(e,t,n,n,0,i,r,a)},e.prototype.ellipse=function(e,t,n,i,r,a,o,s){var l=0===this._d.length,u=o-a,c=!s,h=Math.abs(u),p=isAroundZero$1(h-PI2$a)||(c?u>=PI2$a:-u>=PI2$a),d=u>0?u%PI2$a:u%PI2$a+PI2$a,f=!1;f=!!p||!isAroundZero$1(h)&&d>=PI$a==!!c;var g=round4(e+n*mathCos$4(a)),m=round4(t+i*mathSin$4(a));p&&(u=c?PI2$a-1e-4:1e-4-PI2$a,f=!0,l&&this._d.push("M",g,m));var y=round4(e+n*mathCos$4(a+u)),v=round4(t+i*mathSin$4(a+u));if(isNaN(g)||isNaN(m)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(degree)||isNaN(y)||isNaN(v))return"";this._d.push("A",round4(n),round4(i),mathRound(r*degree),+f,+c,y,v)},e.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("L",e+n,t),this._add("L",e+n,t+i),this._add("L",e,t+i),this._add("L",e,t)},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,i,r,a,o,s,l){this._d.push(e);for(var u=1;u=i&&l+1>=r){for(var u=[],c=0;c=i&&h+1>=r)return buildValues(l.components);s[o]=l}else s[o]=void 0}a++}for(;a<=o;){var p=h();if(p)return p}}function extractCommon(e,t,n,i,r){for(var a=t.length,o=n.length,s=e.newPos,l=s-i,u=0;s+1=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.doUpdate=function(e,t){if(e){var n=this.getDefs(!1);if(e[this._domName]&&n.contains(e[this._domName]))"function"==typeof t&&t(e);else{var i=this.add(e);i&&(e[this._domName]=i)}}},e.prototype.add=function(e){return null},e.prototype.addDom=function(e){var t=this.getDefs(!0);e.parentNode!==t&&t.appendChild(e)},e.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},e.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return each(this._tagNames,(function(n){for(var i=e.getElementsByTagName(n),r=0;r-1){var s=parse(o)[3],l=toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s+"")}else a.setAttribute("stop-color",n[i].color);t.appendChild(a)}e.__dom=t},t.prototype.markUsed=function(t){if(t.style){var n=t.style.fill;n&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom),(n=t.style.stroke)&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom)}},t}(Definable);function isPattern(e){return e&&(!!e.image||!!e.svgElement)}var patternDomMap=new WeakMap,PatternManager=function(e){function t(t,n){return e.call(this,t,n,["pattern"],"__pattern_in_use__")||this}return __extends(t,e),t.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var n=this;each(["fill","stroke"],(function(i){var r=t.style[i];if(isPattern(r)){var a=n.getDefs(!0),o=patternDomMap.get(r);o?a.contains(o)||n.addDom(o):o=n.add(r),n.markUsed(t);var s=o.getAttribute("id");e.setAttribute(i,"url(#"+s+")")}}))}},t.prototype.add=function(e){if(isPattern(e)){var t=this.createElement("pattern");return e.id=null==e.id?this.nextId++:e.id,t.setAttribute("id","zr"+this._zrId+"-pattern-"+e.id),t.setAttribute("x","0"),t.setAttribute("y","0"),t.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(e,t),this.addDom(t),t}},t.prototype.update=function(e){if(isPattern(e)){var t=this;this.doUpdate(e,(function(){var n=patternDomMap.get(e);t.updateDom(e,n)}))}},t.prototype.updateDom=function(e,t){var n=e.svgElement;if(n instanceof SVGElement)n.parentNode!==t&&(t.innerHTML="",t.appendChild(n),t.setAttribute("width",e.svgWidth+""),t.setAttribute("height",e.svgHeight+""));else{var i=void 0,r=t.getElementsByTagName("image");if(r.length){if(!e.image)return void t.removeChild(r[0]);i=r[0]}else e.image&&(i=this.createElement("image"));if(i){var a=void 0;if("string"==typeof e.image?a=e.image:e.image instanceof HTMLImageElement?a=e.image.src:e.image instanceof HTMLCanvasElement&&(a=e.image.toDataURL()),a){i.setAttribute("href",a),i.setAttribute("x","0"),i.setAttribute("y","0");var o=createOrUpdateImage(a,i,{dirty:function(){}},(function(e){t.setAttribute("width",e.width+""),t.setAttribute("height",e.height+"")}));o&&o.width&&o.height&&(t.setAttribute("width",o.width+""),t.setAttribute("height",o.height+"")),t.appendChild(i)}}}var s="translate("+(e.x||0)+", "+(e.y||0)+") rotate("+(e.rotation||0)/Math.PI*180+") scale("+(e.scaleX||1)+", "+(e.scaleY||1)+")";t.setAttribute("patternTransform",s),patternDomMap.set(e,t)},t.prototype.markUsed=function(t){t.style&&(isPattern(t.style.fill)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.fill)),isPattern(t.style.stroke)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.fill)))},t}(Definable);function generateClipPathsKey(e){var t=[];if(e)for(var n=0;n0}var ClippathManager=function(e){function t(t,n){var i=e.call(this,t,n,"clipPath","__clippath_in_use__")||this;return i._refGroups={},i._keyDuplicateCount={},i}return __extends(t,e),t.prototype.markAllUnused=function(){for(var t in e.prototype.markAllUnused.call(this),this._refGroups)this.markDomUnused(this._refGroups[t]);this._keyDuplicateCount={}},t.prototype._getClipPathGroup=function(e,t){if(hasClipPath(e)){var n=e.__clipPaths,i=this._keyDuplicateCount,r=generateClipPathsKey(n);return isClipPathChanged(n,t&&t.__clipPaths)&&(i[r]=i[r]||0,i[r]&&(r+="-"+i[r]),i[r]++),this._refGroups[r]||(this._refGroups[r]=this.createElement("g"))}},t.prototype.update=function(e,t){var n=this._getClipPathGroup(e,t);return n&&(this.markDomUsed(n),this.updateDom(n,e.__clipPaths)),n},t.prototype.updateDom=function(e,t){if(t&&t.length>0){var n=this.getDefs(!0),i=t[0],r=void 0,a=void 0;i._dom?(a=i._dom.getAttribute("id"),r=i._dom,n.contains(r)||n.appendChild(r)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(r=this.createElement("clipPath")).setAttribute("id",a),n.appendChild(r),i._dom=r),this.getSvgProxy(i).brush(i);var o=this.getSvgElement(i);r.innerHTML="",r.appendChild(o),e.setAttribute("clip-path","url(#"+a+")"),t.length>1&&this.updateDom(r,t.slice(1))}else e&&e.setAttribute("clip-path","none")},t.prototype.markUsed=function(t){var n=this;t.__clipPaths&&each(t.__clipPaths,(function(t){t._dom&&e.prototype.markDomUsed.call(n,t._dom)}))},t.prototype.removeUnused=function(){e.prototype.removeUnused.call(this);var t={};for(var n in this._refGroups){var i=this._refGroups[n];this.isDomUnused(i)?i.parentNode&&i.parentNode.removeChild(i):t[n]=i}this._refGroups=t},t}(Definable),ShadowManager=function(e){function t(t,n){var i=e.call(this,t,n,["filter"],"__filter_in_use__","_shadowDom")||this;return i._shadowDomMap={},i._shadowDomPool=[],i}return __extends(t,e),t.prototype._getFromPool=function(){var e=this._shadowDomPool.pop();if(!e){(e=this.createElement("filter")).setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++);var t=this.createElement("feDropShadow");e.appendChild(t),this.addDom(e)}return e},t.prototype.update=function(e,t){if(hasShadow(t.style)){var n=getShadowKey(t),i=t._shadowDom=this._shadowDomMap[n];i||(i=this._getFromPool(),this._shadowDomMap[n]=i),this.updateDom(e,t,i)}else this.remove(e,t)},t.prototype.remove=function(e,t){null!=t._shadowDom&&(t._shadowDom=null,e.style.filter="")},t.prototype.updateDom=function(e,t,n){var i=n.children[0],r=t.style,a=t.getGlobalScale(),o=a[0],s=a[1];if(o&&s){var l=r.shadowOffsetX||0,u=r.shadowOffsetY||0,c=r.shadowBlur,h=r.shadowColor;i.setAttribute("dx",l/o+""),i.setAttribute("dy",u/s+""),i.setAttribute("flood-color",h);var p=c/2/o+" "+c/2/s;i.setAttribute("stdDeviation",p),n.setAttribute("x","-100%"),n.setAttribute("y","-100%"),n.setAttribute("width","300%"),n.setAttribute("height","300%"),t._shadowDom=n;var d=n.getAttribute("id");e.style.filter="url(#"+d+")"}},t.prototype.removeUnused=function(){if(this.getDefs(!1)){var e=this._shadowDomPool;for(var t in this._shadowDomMap){var n=this._shadowDomMap[t];e.push(n)}this._shadowDomMap={}}},t}(Definable);function hasShadow(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function getShadowKey(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}function parseInt10$1(e){return parseInt(e,10)}function getSvgProxy(e){return e instanceof Path?svgPath:e instanceof ZRImage?svgImage:e instanceof TSpan?svgText:svgPath}function checkParentAvailable(e,t){return t&&e&&t.parentNode!==e}function insertAfter(e,t,n){if(checkParentAvailable(e,t)&&n){var i=n.nextSibling;i?e.insertBefore(t,i):e.appendChild(t)}}function prepend(e,t){if(checkParentAvailable(e,t)){var n=e.firstChild;n?e.insertBefore(t,n):e.appendChild(t)}}function remove(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function removeFromMyParent(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function getSvgElement(e){return e.__svgEl}var SVGPainter=function(){function e(e,t,n,i){this.type="svg",this.refreshHover=createMethodNotSupport("refreshHover"),this.pathToImage=createMethodNotSupport("pathToImage"),this.configLayer=createMethodNotSupport("configLayer"),this.root=e,this.storage=t,this._opts=n=extend({},n||{});var r=createElement("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=createElement("g");r.appendChild(a);var o=createElement("g");r.appendChild(o),this._gradientManager=new GradientManager(i,o),this._patternManager=new PatternManager(i,o),this._clipPathManager=new ClippathManager(i,o),this._shadowManager=new ShadowManager(i,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(n.width,n.height),this._visibleList=[]}return e.prototype.getType=function(){return"svg"},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.getSvgRoot=function(){return this._svgRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},e.prototype.setBackgroundColor=function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=createElement("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},e.prototype.createSVGElement=function(e){return createElement(e)},e.prototype.paintOne=function(e){var t=getSvgProxy(e);return t&&t.brush(e),getSvgElement(e)},e.prototype._paintList=function(e){var t=this._gradientManager,n=this._patternManager,i=this._clipPathManager,r=this._shadowManager;t.markAllUnused(),n.markAllUnused(),i.markAllUnused(),r.markAllUnused();for(var a=this._svgRoot,o=this._visibleList,s=e.length,l=[],u=0;u=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.resize=function(e,t){var n=this._viewport;n.style.display="none";var i=this._opts;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=this._getSize(0),t=this._getSize(1),n.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=n.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e+""),a.setAttribute("height",t+"")}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype._getSize=function(e){var t=this._opts,n=["width","height"][e],i=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[n]&&"auto"!==t[n])return parseFloat(t[n]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[i]||parseInt10$1(s[n])||parseInt10$1(o.style[n]))-(parseInt10$1(s[r])||0)-(parseInt10$1(s[a])||0)|0},e.prototype.dispose=function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},e.prototype.clear=function(){var e=this._viewport;e&&e.parentNode&&e.parentNode.removeChild(e)},e.prototype.toDataURL=function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/>\n\r<"))},e}();function createMethodNotSupport(e){return function(){logError('In SVG mode painter not support method "'+e+'"')}}registerPainter("svg",SVGPainter);export{Axis,List,Model,PRIORITY,color,connect,dataTool,dependencies,disConnect,disconnect,dispose$1 as dispose,env,extendChartView,extendComponentModel,extendComponentView,extendSeriesModel,format$1 as format,getCoordinateSystemDimensions,getInstanceByDom,getInstanceById,getMap,graphic$1 as graphic,helper,init$1 as init,brushSingle as innerDrawElementOnCanvas,matrix,number,parseGeoJSON,parseGeoJson,registerAction,registerCoordinateSystem,registerLayout,registerLoading,registerLocale,registerMap,registerPostInit,registerPostUpdate,registerPreprocessor,registerProcessor,registerTheme,registerTransform,registerVisual,setCanvasCreator,throttle,time,ecUtil as util,vector,version$1 as version,zrender}; \ No newline at end of file +var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=11),t.domSupported="undefined"!=typeof document}"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(env.wxa=!0,env.canvasSupported=!0,env.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(env.worker=!0,env.canvasSupported=!0):"undefined"==typeof navigator?(env.node=!0,env.canvasSupported=!0,env.svgSupported=!0):detect(navigator.userAgent,env);var BUILTIN_OBJECT={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},TYPED_ARRAY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},objToString=Object.prototype.toString,arrayProto=Array.prototype,nativeForEach=arrayProto.forEach,nativeFilter=arrayProto.filter,nativeSlice=arrayProto.slice,nativeMap=arrayProto.map,ctorFunction=function(){}.constructor,protoFunction=ctorFunction?ctorFunction.prototype:null,methods={};function $override(e,t){methods[e]=t}var idStart=2311;function guid(){return idStart++}function logError(){for(var e=[],t=0;t>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return n}function preparePointerTransformer(e,t,n){for(var i=n?"invTrans":"trans",r=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,p=c.left,d=c.top;o.push(p,d),l=l&&a&&p===a[h]&&d===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&r?r:(t.srcCoords=o,t[i]=n?buildTransformer(s,o):buildTransformer(o,s))}function isCanvasEl(e){return"CANVAS"===e.nodeName.toUpperCase()}var isDomLevel2="undefined"!=typeof window&&!!window.addEventListener,MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_calcOut$1=[];function clientToLocal(e,t,n,i){return n=n||{},i||!env.canvasSupported?calculateZrXY(e,t,n):env.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):calculateZrXY(e,t,n),n}function calculateZrXY(e,t,n){if(env.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(isCanvasEl(e)){var a=e.getBoundingClientRect();return n.zrX=i-a.left,void(n.zrY=r-a.top)}if(transformCoordWithViewport(_calcOut$1,e,i,r))return n.zrX=_calcOut$1[0],void(n.zrY=_calcOut$1[1])}n.zrX=n.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(e,t,n){if(null!=(t=getNativeEvent(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];r&&clientToLocal(e,r,t,n)}else{clientToLocal(e,t,t,n);var a=getWheelDeltaMayPolyfill(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return null==t.which&&void 0!==o&&MOUSE_EVENT_REG.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function getWheelDeltaMayPolyfill(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;return null==n||null==i?t:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}function addEventListener(e,t,n,i){isDomLevel2?e.addEventListener(t,n,i):e.attachEvent("on"+t,n)}function removeEventListener(e,t,n,i){isDomLevel2?e.removeEventListener(t,n,i):e.detachEvent("on"+t,n)}var stop=isDomLevel2?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(e){return 2===e.which||3===e.which}var GestureMgr=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var r={points:[],touches:[],target:t,event:e},a=0,o=i.length;a1&&i&&i.length>1){var a=dist$1(i)/dist$1(r);!isFinite(a)&&(a=1),t.pinchScale=a;var o=center(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}},SILENT="silent";function makeEventPacket(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:stopEvent}}function stopEvent(){stop(this.event)}var EmptyProxy=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return __extends(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Eventful),HoveredResult=function(e,t){this.x=e,this.y=t},handlerNames=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Handler=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a._hovered=new HoveredResult(0,0),a.storage=t,a.painter=n,a.painterRoot=r,i=i||new EmptyProxy,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Draggable(a),a}return __extends(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(each(handlerNames,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=isOutsideBoundary(this,t,n),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=i?new HoveredResult(t,n):this.findHover(t,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl,n=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!n&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new HoveredResult(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var r="on"+t,a=makeEventPacket(t,e,n);i&&(i[r]&&(a.cancelBubble=!!i[r].call(i,a)),i.trigger(t,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},t.prototype.findHover=function(e,t,n){for(var i=this.storage.getDisplayList(),r=new HoveredResult(e,t),a=i.length-1;a>=0;a--){var o=void 0;if(i[a]!==n&&!i[a].ignore&&(o=isHover(i[a],e,t))&&(!r.topTarget&&(r.topTarget=i[a]),o!==SILENT)){r.target=i[a];break}}return r},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new GestureMgr);var n=this._gestureMgr;"start"===t&&n.clear();var i=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),i){var r=i.type;e.gestureEvent=r;var a=new HoveredResult;a.target=i.target,this.dispatchToElement(a,r,i.event)}},t}(Eventful);function isHover(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var i=e,r=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,n))return!1;i.silent&&(r=!0)}var s=i.__hostTarget;i=s||i.parent}return!r||SILENT}return!1}function isOutsideBoundary(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function create$1(){return[1,0,0,1,0,0]}function identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function copy$1(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function mul$1(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function translate(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function rotate(e,t,n){var i=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=i*c+o*u,e[1]=-i*u+o*c,e[2]=r*c+s*u,e[3]=-r*u+c*s,e[4]=c*a+u*l,e[5]=c*l-u*a,e}function scale$1(e,t,n){var i=n[0],r=n[1];return e[0]=t[0]*i,e[1]=t[1]*r,e[2]=t[2]*i,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*r,e}function invert(e,t){var n=t[0],i=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=n*o-a*i;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*r)*l,e[5]=(a*r-n*s)*l,e):null}function clone$2(e){var t=create$1();return copy$1(t,e),t}each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Handler.prototype[e]=function(t){var n,i,r=t.zrX,a=t.zrY,o=isOutsideBoundary(this,r,a);if("mouseup"===e&&o||(i=(n=this.findHover(r,a)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));var matrix=Object.freeze({__proto__:null,create:create$1,identity:identity,copy:copy$1,mul:mul$1,translate:translate,rotate:rotate,scale:scale$1,invert:invert,clone:clone$2}),mIdentity=identity,EPSILON=5e-5;function isNotAroundZero(e){return e>EPSILON||e<-EPSILON}var scaleTmp=[],tmpTransform=[],originTransform=create$1(),abs=Math.abs,Transformable=function(){function e(){}return e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)},e.prototype.updateTransform=function(){var e=this.parent,t=e&&e.transform,n=this.needLocalTransform(),i=this.transform;n||t?(i=i||create$1(),n?this.getLocalTransform(i):mIdentity(i),t&&(n?mul$1(i,e.transform,i):copy$1(i,e.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&mIdentity(i)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(scaleTmp);var n=scaleTmp[0]<0?-1:1,i=scaleTmp[1]<0?-1:1,r=((scaleTmp[0]-n)*t+n)/scaleTmp[0]||0,a=((scaleTmp[1]-i)*t+i)/scaleTmp[1]||0;e[0]*=r,e[1]*=r,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||create$1(),invert(this.invTransform,e)},e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3];isNotAroundZero(t-1)&&(t=Math.sqrt(t)),isNotAroundZero(n-1)&&(n=Math.sqrt(n)),e[0]<0&&(t=-t),e[3]<0&&(n=-n),this.rotation=Math.atan2(-e[1]/n,e[0]/t),t<0&&n<0&&(this.rotation+=Math.PI,t=-t,n=-n),this.x=e[4],this.y=e[5],this.scaleX=t,this.scaleY=n}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(mul$1(tmpTransform,e.invTransform,t),t=tmpTransform);var n=this.originX,i=this.originY;(n||i)&&(originTransform[4]=n,originTransform[5]=i,mul$1(tmpTransform,t,originTransform),tmpTransform[4]-=n,tmpTransform[5]-=i,t=tmpTransform),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&applyTransform(n,n,i),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&applyTransform(n,n,i),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&abs(e[0]-1)>1e-10&&abs(e[3]-1)>1e-10?Math.sqrt(abs(e[0]*e[3]-e[2]*e[1])):1},e.getLocalTransform=function(e,t){mIdentity(t=t||[]);var n=e.originX||0,i=e.originY||0,r=e.scaleX,a=e.scaleY,o=e.rotation||0,s=e.x,l=e.y;return t[4]-=n,t[5]-=i,t[0]*=r,t[1]*=a,t[2]*=r,t[3]*=a,t[4]*=r,t[5]*=a,o&&rotate(t,t,o),t[4]+=n,t[5]+=i,t[4]+=s,t[5]+=l,t},e.initDefaultProps=function(){var t=e.prototype;t.x=0,t.y=0,t.scaleX=1,t.scaleY=1,t.originX=0,t.originY=0,t.rotation=0,t.globalScaleRatio=1}(),e}(),easing={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-easing.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*easing.bounceIn(2*e):.5*easing.bounceOut(2*e-1)+.5}},Clip=function(){function e(e){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}return e.prototype.step=function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),!this._paused){var n=(e-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var i=this.easing,r="string"==typeof i?easing[i]:i,a="function"==typeof r?r(n):n;if(this.onframe&&this.onframe(a),1===n){if(!this.loop)return!0;this._restart(e),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=t},e.prototype._restart=function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e}(),Entry=function(e){this.value=e},LinkedList=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Entry(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),LRU=function(){function e(e){this._list=new LinkedList,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,r=null;if(null==i[e]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Entry(t),o.key=e,n.insertEntry(o),i[e]=o}return r},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function clampCssByte(e){return(e=Math.round(e))<0?0:e>255?255:e}function clampCssAngle(e){return(e=Math.round(e))<0?0:e>360?360:e}function clampCssFloat(e){return e<0?0:e>1?1:e}function parseCssInt(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssByte(parseFloat(t)/100*255):clampCssByte(parseInt(t,10))}function parseCssFloat(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?clampCssFloat(parseFloat(t)/100):clampCssFloat(parseFloat(t))}function cssHueToRgb(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function lerpNumber(e,t,n){return e+(t-e)*n}function setRgba(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function copyRgba(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var colorCache=new LRU(20),lastRemovedArr=null;function putToCache(e,t){lastRemovedArr&©Rgba(lastRemovedArr,t),lastRemovedArr=colorCache.put(e,lastRemovedArr||t.slice())}function parse(e,t){if(e){t=t||[];var n=colorCache.get(e);if(n)return copyRgba(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in kCSSColorTable)return copyRgba(t,kCSSColorTable[i]),putToCache(e,t),t;var r,a=i.length;if("#"===i.charAt(0))return 4===a||5===a?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(setRgba(t,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===a?parseInt(i.slice(4),16)/15:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):7===a||9===a?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(setRgba(t,(16711680&r)>>16,(65280&r)>>8,255&r,9===a?parseInt(i.slice(7),16)/255:1),putToCache(e,t),t):void setRgba(t,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===a){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?setRgba(t,+u[0],+u[1],+u[2],1):setRgba(t,0,0,0,1);c=parseCssFloat(u.pop());case"rgb":return 3!==u.length?void setRgba(t,0,0,0,1):(setRgba(t,parseCssInt(u[0]),parseCssInt(u[1]),parseCssInt(u[2]),c),putToCache(e,t),t);case"hsla":return 4!==u.length?void setRgba(t,0,0,0,1):(u[3]=parseCssFloat(u[3]),hsla2rgba(u,t),putToCache(e,t),t);case"hsl":return 3!==u.length?void setRgba(t,0,0,0,1):(hsla2rgba(u,t),putToCache(e,t),t);default:return}}setRgba(t,0,0,0,1)}}function hsla2rgba(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=parseCssFloat(e[1]),r=parseCssFloat(e[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return setRgba(t=t||[],clampCssByte(255*cssHueToRgb(o,a,n+1/3)),clampCssByte(255*cssHueToRgb(o,a,n)),clampCssByte(255*cssHueToRgb(o,a,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function rgba2hsla(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,p=((s-a)/6+l/2)/l;i===s?t=p-h:r===s?t=1/3+c-p:a===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var d=[360*t,n,u];return null!=e[3]&&d.push(e[3]),d}}function lift(e,t){var n=parse(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return stringify(n,4===n.length?"rgba":"rgb")}}function toHex(e){var t=parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function fastLerp(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=t[r],s=t[a],l=i-r;return n[0]=clampCssByte(lerpNumber(o[0],s[0],l)),n[1]=clampCssByte(lerpNumber(o[1],s[1],l)),n[2]=clampCssByte(lerpNumber(o[2],s[2],l)),n[3]=clampCssFloat(lerpNumber(o[3],s[3],l)),n}}var fastMapToColor=fastLerp;function lerp$1(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),o=parse(t[r]),s=parse(t[a]),l=i-r,u=stringify([clampCssByte(lerpNumber(o[0],s[0],l)),clampCssByte(lerpNumber(o[1],s[1],l)),clampCssByte(lerpNumber(o[2],s[2],l)),clampCssFloat(lerpNumber(o[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:a,value:i}:u}}var mapToColor=lerp$1;function modifyHSL(e,t,n,i){var r=parse(e);if(e)return r=rgba2hsla(r),null!=t&&(r[0]=clampCssAngle(t)),null!=n&&(r[1]=parseCssFloat(n)),null!=i&&(r[2]=parseCssFloat(i)),stringify(hsla2rgba(r),"rgba")}function modifyAlpha(e,t){var n=parse(e);if(n&&null!=t)return n[3]=clampCssFloat(t),stringify(n,"rgba")}function stringify(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function lum(e,t){var n=parse(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}function random(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}var color=Object.freeze({__proto__:null,parse:parse,lift:lift,toHex:toHex,fastLerp:fastLerp,fastMapToColor:fastMapToColor,lerp:lerp$1,mapToColor:mapToColor,modifyHSL:modifyHSL,modifyAlpha:modifyAlpha,stringify:stringify,lum:lum,random:random}),arraySlice=Array.prototype.slice;function interpolateNumber(e,t,n){return(t-e)*n+e}function step(e,t,n){return n>.5?t:e}function interpolate1DArray(e,t,n,i){for(var r=t.length,a=0;ao)i.length=o;else for(var s=a;s=2&&this.interpolable},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t){e>=this.maxTime?this.maxTime=e:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(isArrayLike(t)){var r=guessArrayDim(t);if(i>0&&this.arrDim!==r)return void(this.interpolable=!1);if(1===r&&"number"!=typeof t[0]||2===r&&"number"!=typeof t[0][0])return void(this.interpolable=!1);if(i>0){var a=n[i-1];this._isAllValueEqual&&(1===r&&is1DArraySame(t,a.value)||(this._isAllValueEqual=!1))}this.arrDim=r}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"==typeof t){var o=parse(t);o?(t=o,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof t)return void(this.interpolable=!1);if(this._isAllValueEqual&&i>0){a=n[i-1];(this.isValueColor&&!is1DArraySame(a.value,t)||a.value!==t)&&(this._isAllValueEqual=!1)}}var s={time:e,value:t,percent:0};return this.keyframes.push(s),s},e.prototype.prepare=function(e){var t=this.keyframes;this._needsSort&&t.sort((function(e,t){return e.time-t.time}));for(var n=this.arrDim,i=t.length,r=t[i-1],a=0;a0&&a!==i-1&&fillArray(t[a].value,r.value,n);if(e&&this.needsAnimate()&&e.needsAnimate()&&n===e.arrDim&&this.isValueColor===e.isValueColor&&!e._finished){this._additiveTrack=e;var o=t[0].value;for(a=0;a=0&&!(a[n].percent<=t);n--);n=Math.min(n,o-2)}else{for(n=this._lastFrame;nt);n++);n=Math.min(n-1,o-2)}var c=a[n+1],h=a[n];if(h&&c){this._lastFrame=n,this._lastFramePercent=t;var p=c.percent-h.percent;if(0!==p){var d=(t-h.percent)/p,f=i?this._additiveValue:u?tmpRgba:e[s];if((l>0||u)&&!f&&(f=this._additiveValue=[]),this.useSpline){var g=a[n][r],m=a[0===n?n:n-1][r],y=a[n>o-2?o-1:n+1][r],v=a[n>o-3?o-1:n+2][r];if(l>0)1===l?catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d):catmullRomInterpolate2DArray(f,m,g,y,v,d,d*d,d*d*d);else if(u)catmullRomInterpolate1DArray(f,m,g,y,v,d,d*d,d*d*d),i||(e[s]=rgba2String(f));else{var _=void 0;_=this.interpolable?catmullRomInterpolate(m,g,y,v,d,d*d,d*d*d):y,i?this._additiveValue=_:e[s]=_}}else if(l>0)1===l?interpolate1DArray(f,h[r],c[r],d):interpolate2DArray(f,h[r],c[r],d);else if(u)interpolate1DArray(f,h[r],c[r],d),i||(e[s]=rgba2String(f));else{_=void 0;_=this.interpolable?interpolateNumber(h[r],c[r],d):step(h[r],c[r],d),i?this._additiveValue=_:e[s]=_}i&&this._addToTarget(e)}}}},e.prototype._addToTarget=function(e){var t=this.arrDim,n=this.propName,i=this._additiveValue;0===t?this.isValueColor?(parse(e[n],tmpRgba),add1DArray(tmpRgba,tmpRgba,i,1),e[n]=rgba2String(tmpRgba)):e[n]=e[n]+i:1===t?add1DArray(e[n],e[n],i,1):2===t&&add2DArray(e[n],e[n],i,1)},e}(),Animator=function(){function e(e,t,n){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n?logError("Can' use additive animation on looped animation."):this._additiveAnimators=n}return e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t){return this.whenWithKeys(e,t,keys(t))},e.prototype.whenWithKeys=function(e,t,n){for(var i=this._tracks,r=0;r0)){this._started=1;for(var n=this,i=[],r=0;r1){var o=a.pop();r.addKeyframe(o.time,e[i]),r.prepare(r.getAdditiveTrack())}}}},e}(),Point=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var r=1-i;e.x=r*t.x+i*n.x,e.y=r*t.y+i*n.y},e}(),mathMin=Math.min,mathMax=Math.max,lt=new Point,rb=new Point,lb=new Point,rt=new Point,minTv=new Point,maxTv=new Point,BoundingRect=function(){function e(e,t,n,i){n<0&&isFinite(n)&&(e+=n,n=-n),i<0&&isFinite(i)&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=mathMin(e.x,this.x),n=mathMin(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=mathMax(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=mathMax(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,r=create$1();return translate(r,r,[-t.x,-t.y]),scale$1(r,r,[n,i]),translate(r,r,[e.x,e.y]),r},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,r=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,c=t.y,h=t.y+t.height,p=!(af&&(f=_,gf&&(f=x,y=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],a=i[3],o=i[4],s=i[5];return t.x=n.x*r+o,t.y=n.y*a+s,t.width=n.width*r,t.height=n.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}lt.x=lb.x=n.x,lt.y=rt.y=n.y,rb.x=rt.x=n.x+n.width,rb.y=lb.y=n.y+n.height,lt.transform(i),rt.transform(i),rb.transform(i),lb.transform(i),t.x=mathMin(lt.x,rb.x,lb.x,rt.x),t.y=mathMin(lt.y,rb.y,lb.y,rt.y);var l=mathMax(lt.x,rb.x,lb.x,rt.x),u=mathMax(lt.y,rb.y,lb.y,rt.y);t.width=l-t.x,t.height=u-t.y}else t!==n&&e.copy(t,n)},e}(),textWidthCache={},DEFAULT_FONT="12px sans-serif";function defaultMeasureText(e,t){return _ctx||(_ctx=createCanvas().getContext("2d")),_cachedFont!==t&&(_cachedFont=_ctx.font=t||DEFAULT_FONT),_ctx.measureText(e)}var methods$1={measureText:defaultMeasureText};function getWidth(e,t){var n=textWidthCache[t=t||DEFAULT_FONT];n||(n=textWidthCache[t]=new LRU(500));var i=n.get(e);return null==i&&(i=methods$1.measureText(e,t).width,n.put(e,i)),i}function innerGetBoundingRect(e,t,n,i){var r=getWidth(e,t),a=getLineHeight(t),o=adjustTextX(0,r,n),s=adjustTextY(0,a,i);return new BoundingRect(o,s,r,a)}function getBoundingRect(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return innerGetBoundingRect(r[0],t,n,i);for(var a=new BoundingRect(0,0,0,0),o=0;o=0?parseFloat(e)/100*t:parseFloat(e):e}function calculateTextPosition(e,t,n){var i=t.position||"inside",r=null!=t.distance?t.distance:5,a=n.height,o=n.width,s=a/2,l=n.x,u=n.y,c="left",h="top";if(i instanceof Array)l+=parsePercent(i[0],n.width),u+=parsePercent(i[1],n.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+o,u+=s,h="middle";break;case"top":l+=o/2,u-=r,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+r,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=o-r,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=r,c="center";break;case"insideBottom":l+=o/2,u+=a-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=o-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=a-r,h="bottom";break;case"insideBottomRight":l+=o-r,u+=a-r,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var dpr=1;"undefined"!=typeof window&&(dpr=Math.max(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var devicePixelRatio=dpr,DARK_MODE_THRESHOLD=.4,DARK_LABEL_COLOR="#333",LIGHT_LABEL_COLOR="#ccc",LIGHTER_LABEL_COLOR="#eee",PRESERVED_NORMAL_STATE="__zr_normal__",PRIMARY_STATES_KEYS=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],DEFAULT_ANIMATABLE_MAP={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},tmpTextPosCalcRes={},tmpBoundingRect=new BoundingRect(0,0,0,0),Element=function(){function e(e){this.id=guid(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=t.attachedTransform,a=void 0,o=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.x=t.x,r.y=t.y,r.originX=t.originX,r.originY=t.originY,r.rotation=t.rotation,r.scaleX=t.scaleX,r.scaleY=t.scaleY,null!=n.position){var u=tmpBoundingRect;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(tmpTextPosCalcRes,n,u):calculateTextPosition(tmpTextPosCalcRes,n,u),r.x=tmpTextPosCalcRes.x,r.y=tmpTextPosCalcRes.y,a=tmpTextPosCalcRes.align,o=tmpTextPosCalcRes.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,p=void 0;"center"===c?(h=.5*u.width,p=.5*u.height):(h=parsePercent(c[0],u.width),p=parsePercent(c[1],u.height)),l=!0,r.originX=-r.x+h+(i?0:u.x),r.originY=-r.y+p+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,v=void 0;f&&this.canBeInsideText()?(m=n.insideFill,y=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(m),v=!0)):(m=n.outsideFill,y=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(m),v=!0)),(m=m||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&a===g.align&&o===g.verticalAlign||(s=!0,g.fill=m,g.stroke=y,g.autoStroke=v,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),s&&t.dirtyStyle(),t.markRedraw()}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?LIGHT_LABEL_COLOR:DARK_LABEL_COLOR},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&parse(t);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*i+(r?0:255)*(1-i);return n[3]=1,stringify(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},extend(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(isObject(e))for(var n=keys(e),i=0;i0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(PRESERVED_NORMAL_STATE,!1,e)},e.prototype.useState=function(t,n,i){var r=t===PRESERVED_NORMAL_STATE;if(this.hasState()||!r){var a=this.currentStates,o=this.stateTransition;if(!(indexOf(a,t)>=0)||!n&&1!==a.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!(!s||!s.hoverLayer);return l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,n,!i&&!this.__inHover&&o&&o.duration>0,o),this._textContent&&this._textContent.useState(t,n),this._textGuide&&this._textGuide.useState(t,n),r?(this.currentStates=[],this._normalState={}):n?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT),s}logError("State "+t+" not exists.")}}},e.prototype.useStates=function(t,n){if(t.length){var i=[],r=this.currentStates,a=t.length,o=a===r.length;if(o)for(var s=0;s0,p),this._textContent&&this._textContent.useStates(t),this._textGuide&&this._textGuide.useStates(t),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~e.REDARAW_BIT)}else this.clearStates()},e.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),r=indexOf(i,e),a=indexOf(i,t)>=0;r>=0?a?i.splice(r,1):i[r]=t:n&&!a&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,r=[],a=0;a8)&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),e}();function animateTo(e,t,n,i,r){var a=[];animateToShallow(e,"",e,t,n=n||{},i,a,r);var o=a.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--o<=0&&(s?l&&l():u&&u())},h=function(){--o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&n.during&&a[0].during((function(e,t){n.during(t)}));for(var p=0;p0||r.force&&!o.length){for(var v=e.animators,_=[],x=0;x=DEFAULT_MIN_MERGE;)t|=1&e,e>>=1;return e+t}function makeAscendingRun(e,t,n,i){var r=t+1;if(r===n)return 1;if(i(e[r++],e[t])<0){for(;r=0;)r++;return r-t}function reverseRun(e,t,n){for(n--;t>>1])<0?l=a:s=a+1;var u=i-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=o}}function gallopLeft(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])>0){for(s=i-r;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o>>1);a(e,t[n+c])>0?o=c+1:l=c}return l}function gallopRight(e,t,n,i,r,a){var o=0,s=0,l=1;if(a(e,t[n+r])<0){for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=i-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o>>1);a(e,t[n+c])<0?l=c:o=c+1}return l}function TimSort(e,t){var n,i,r=DEFAULT_MIN_GALLOPING,a=0;e.length;var o=[];function s(s){var l=n[s],u=i[s],c=n[s+1],h=i[s+1];i[s]=u+h,s===a-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),a--;var p=gallopRight(e[c],e,l,u,0,t);l+=p,0!==(u-=p)&&0!==(h=gallopLeft(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,i,a,s){var l=0;for(l=0;l=DEFAULT_MIN_GALLOPING||d>=DEFAULT_MIN_GALLOPING);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l=0;l--)e[d+l]=e[p+l];return void(e[h]=o[c])}var f=r;for(;;){var g=0,m=0,y=!1;do{if(t(o[c],e[u])<0){if(e[h--]=e[u--],g++,m=0,0==--i){y=!0;break}}else if(e[h--]=o[c--],m++,g=0,1==--s){y=!0;break}}while((g|m)=0;l--)e[d+l]=e[p+l];if(0===i){y=!0;break}}if(e[h--]=o[c--],1==--s){y=!0;break}if(0!==(m=s-gallopLeft(e[u],o,0,s,s-1,t))){for(s-=m,d=(h-=m)+1,p=(c-=m)+1,l=0;l=DEFAULT_MIN_GALLOPING||m>=DEFAULT_MIN_GALLOPING);if(y)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===s){for(d=(h-=i)+1,p=(u-=i)+1,l=i-1;l>=0;l--)e[d+l]=e[p+l];e[h]=o[c]}else{if(0===s)throw new Error;for(p=h-(s-1),l=0;l1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;s(e)}},forceMergeRuns:function(){for(;a>1;){var e=a-2;e>0&&i[e-1]s&&(l=s),binaryInsertionSort(e,n,n+l,n+a,t),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}}var invalidZErrorLogged=!1;function logInvalidZError(){invalidZErrorLogged||(invalidZErrorLogged=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function shapeCompareFunc(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var requestAnimationFrame,Storage=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}return e.prototype.traverse=function(e,t){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(logInvalidZError(),u.z=0),isNaN(u.z2)&&(logInvalidZError(),u.z2=0),isNaN(u.zlevel)&&(logInvalidZError(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var p=e.getTextContent();p&&this._updateAndAddDisplayable(p,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),requestAnimationFrame$1=requestAnimationFrame="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},Animation=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n.onframe=t.onframe||function(){},n}return __extends(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._clipsHead?(this._clipsTail.next=e,e.prev=this._clipsTail,e.next=null,this._clipsTail=e):this._clipsHead=this._clipsTail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._clipsHead=n,n?n.prev=t:this._clipsTail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=(new Date).getTime()-this._pausedTime,n=t-this._time,i=this._clipsHead;i;){var r=i.next;i.step(t,n)?(i.ondestroy&&i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=t,e||(this.onframe(n),this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,requestAnimationFrame$1((function t(){e._running&&(requestAnimationFrame$1(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._clipsHead;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._clipsHead=this._clipsTail=null},t.prototype.isFinished=function(){return null==this._clipsHead},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Animator(e,t.loop);return this.addAnimator(n),n},t}(Eventful),TOUCH_CLICK_DELAY=300,globalEventSupported=env.domSupported,localNativeListenerNames=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:["touchstart","touchend","touchmove"],pointer:map(e,(function(e){var n=e.replace("mouse","pointer");return t.hasOwnProperty(n)?n:e}))}}(),globalNativeListenerNames={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wheelEventSupported=!1;function isPointerFromTouch(e){var t=e.pointerType;return"pen"===t||"touch"===t}function setTouchTimer(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}function markTouch(e){e&&(e.zrByTouch=!0)}function normalizeGlobalEvent(e,t){return normalizeEvent(e.dom,new FakeGlobalEvent(e,t),!0)}function isLocalEl(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var FakeGlobalEvent=function(e,t){this.stopPropagation=noop,this.stopImmediatePropagation=noop,this.preventDefault=noop,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},localDOMHandlers={mousedown:function(e){e=normalizeEvent(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=normalizeEvent(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=normalizeEvent(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){if(e.target===this.dom){e=normalizeEvent(this.dom,e),this.__pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=isLocalEl(this,t),this.trigger("mouseout",e)}},wheel:function(e){wheelEventSupported=!0,e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){wheelEventSupported||(e=normalizeEvent(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),localDOMHandlers.mousemove.call(this,e),localDOMHandlers.mousedown.call(this,e)},touchmove:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"change"),localDOMHandlers.mousemove.call(this,e)},touchend:function(e){markTouch(e=normalizeEvent(this.dom,e)),this.handler.processGesture(e,"end"),localDOMHandlers.mouseup.call(this,e),+new Date-+this.__lastTouchMoment-EPSILON$1&&eEPSILON$1||e<-EPSILON$1}function cubicAt(e,t,n,i,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*i+3*a*n)}function cubicDerivativeAt(e,t,n,i,r){var a=1-r;return 3*(((t-e)*a+2*(n-t)*r)*a+(i-n)*r*r)}function cubicRootAt(e,t,n,i,r,a){var o=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-r,c=s*s-3*o*l,h=s*l-9*o*u,p=l*l-3*s*u,d=0;if(isAroundZero(c)&&isAroundZero(h)){if(isAroundZero(s))a[0]=0;else(M=-l/s)>=0&&M<=1&&(a[d++]=M)}else{var f=h*h-4*c*p;if(isAroundZero(f)){var g=h/c,m=-g/2;(M=-s/o+g)>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m)}else if(f>0){var y=mathSqrt(f),v=c*s+1.5*o*(-h+y),_=c*s+1.5*o*(-h-y);(M=(-s-((v=v<0?-mathPow(-v,ONE_THIRD):mathPow(v,ONE_THIRD))+(_=_<0?-mathPow(-_,ONE_THIRD):mathPow(_,ONE_THIRD))))/(3*o))>=0&&M<=1&&(a[d++]=M)}else{var x=(2*c*s-3*o*h)/(2*mathSqrt(c*c*c)),S=Math.acos(x)/3,b=mathSqrt(c),T=Math.cos(S),M=(-s-2*b*T)/(3*o),A=(m=(-s+b*(T+THREE_SQRT*Math.sin(S)))/(3*o),(-s+b*(T-THREE_SQRT*Math.sin(S)))/(3*o));M>=0&&M<=1&&(a[d++]=M),m>=0&&m<=1&&(a[d++]=m),A>=0&&A<=1&&(a[d++]=A)}}return d}function cubicExtrema(e,t,n,i,r){var a=6*n-12*t+6*e,o=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(isAroundZero(o)){if(isNotAroundZero$1(a))(c=-s/a)>=0&&c<=1&&(r[l++]=c)}else{var u=a*a-4*o*s;if(isAroundZero(u))r[0]=-a/(2*o);else if(u>0){var c,h=mathSqrt(u),p=(-a-h)/(2*o);(c=(-a+h)/(2*o))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function cubicSubdivide(e,t,n,i,r,a){var o=(t-e)*r+e,s=(n-t)*r+t,l=(i-n)*r+n,u=(s-o)*r+o,c=(l-s)*r+s,h=(c-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=i}function cubicProjectPoint(e,t,n,i,r,a,o,s,l,u,c){var h,p,d,f,g,m=.005,y=1/0;_v0[0]=l,_v0[1]=u;for(var v=0;v<1;v+=.05)_v1[0]=cubicAt(e,n,r,o,v),_v1[1]=cubicAt(t,i,a,s,v),(f=distSquare(_v0,_v1))=0&&f=0&&c<=1&&(r[l++]=c)}else{var u=o*o-4*a*s;if(isAroundZero(u))(c=-o/(2*a))>=0&&c<=1&&(r[l++]=c);else if(u>0){var c,h=mathSqrt(u),p=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(r[l++]=c),p>=0&&p<=1&&(r[l++]=p)}}return l}function quadraticExtremum(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function quadraticSubdivide(e,t,n,i,r){var a=(t-e)*i+e,o=(n-t)*i+t,s=(o-a)*i+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=n}function quadraticProjectPoint(e,t,n,i,r,a,o,s,l){var u,c=.005,h=1/0;_v0[0]=o,_v0[1]=s;for(var p=0;p<1;p+=.05){_v1[0]=quadraticAt(e,n,r,p),_v1[1]=quadraticAt(t,i,a,p),(m=distSquare(_v0,_v1))=0&&m1e-4)return s[0]=e-n,s[1]=t-i,l[0]=e+n,void(l[1]=t+i);if(start[0]=mathCos(r)*n+e,start[1]=mathSin(r)*i+t,end[0]=mathCos(a)*n+e,end[1]=mathSin(a)*i+t,u(s,start,end),c(l,start,end),(r%=PI2)<0&&(r+=PI2),(a%=PI2)<0&&(a+=PI2),r>a&&!o?a+=PI2:rr&&(extremity[0]=mathCos(d)*n+e,extremity[1]=mathSin(d)*i+t,u(s,extremity,s),c(l,extremity,l))}var CMD={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tmpOutX=[],tmpOutY=[],min$1=[],max$1=[],min2=[],max2=[],mathMin$2=Math.min,mathMax$2=Math.max,mathCos$1=Math.cos,mathSin$1=Math.sin,mathSqrt$1=Math.sqrt,mathAbs=Math.abs,PI=Math.PI,PI2$1=2*PI,hasTypedArray="undefined"!=typeof Float32Array,tmpAngles=[];function modPI2(e){return Math.round(e/PI*1e8)/1e8%2*PI}function normalizeArcAngles(e,t){var n=modPI2(e[0]);n<0&&(n+=PI2$1);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=PI2$1?r=n+PI2$1:t&&n-r>=PI2$1?r=n-PI2$1:!t&&n>r?r=n+(PI2$1-modPI2(n-r)):t&&n0&&(this._ux=mathAbs(n/devicePixelRatio/e)||0,this._uy=mathAbs(n/devicePixelRatio/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this.addData(CMD.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=mathAbs(e-this._xi)>this._ux||mathAbs(t-this._yi)>this._uy||this._len<5;return this.addData(CMD.L,e,t),this._ctx&&n&&(this._needsDash?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),n&&(this._xi=e,this._yi=t),this},e.prototype.bezierCurveTo=function(e,t,n,i,r,a){return this.addData(CMD.C,e,t,n,i,r,a),this._ctx&&(this._needsDash?this._dashedBezierTo(e,t,n,i,r,a):this._ctx.bezierCurveTo(e,t,n,i,r,a)),this._xi=r,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,i){return this.addData(CMD.Q,e,t,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(e,t,n,i):this._ctx.quadraticCurveTo(e,t,n,i)),this._xi=n,this._yi=i,this},e.prototype.arc=function(e,t,n,i,r,a){tmpAngles[0]=i,tmpAngles[1]=r,normalizeArcAngles(tmpAngles,a),i=tmpAngles[0];var o=(r=tmpAngles[1])-i;return this.addData(CMD.A,e,t,n,n,i,o,0,a?0:1),this._ctx&&this._ctx.arc(e,t,n,i,r,a),this._xi=mathCos$1(r)*n+e,this._yi=mathSin$1(r)*n+t,this},e.prototype.arcTo=function(e,t,n,i,r){return this._ctx&&this._ctx.arcTo(e,t,n,i,r),this},e.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this.addData(CMD.R,e,t,n,i),this},e.prototype.closePath=function(){this.addData(CMD.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&(this._needsDash&&this._dashedLineTo(t,n),e.closePath()),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.setLineDash=function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var c=0;c0&&d<=e||c<0&&d>=e||0===c&&(h>0&&f<=t||h<0&&f>=t);)d+=c*(n=a[i=this._dashIdx]),f+=h*n,this._dashIdx=(i+1)%g,c>0&&dl||h>0&&fu||o[i%2?"moveTo":"lineTo"](c>=0?mathMin$2(d,e):mathMax$2(d,e),h>=0?mathMin$2(f,t):mathMax$2(f,t));c=d-e,h=f-t,this._dashOffset=-mathSqrt$1(c*c+h*h)},e.prototype._dashedBezierTo=function(e,t,n,i,r,a){var o,s,l,u,c,h=this._ctx,p=this._dashSum,d=this._dashOffset,f=this._lineDash,g=this._xi,m=this._yi,y=0,v=this._dashIdx,_=f.length,x=0;for(d<0&&(d=p+d),d%=p,o=0;o<1;o+=.1)s=cubicAt(g,e,n,r,o+.1)-cubicAt(g,e,n,r,o),l=cubicAt(m,t,i,a,o+.1)-cubicAt(m,t,i,a,o),y+=mathSqrt$1(s*s+l*l);for(;v<_&&!((x+=f[v])>d);v++);for(o=(x-d)/y;o<=1;)u=cubicAt(g,e,n,r,o),c=cubicAt(m,t,i,a,o),v%2?h.moveTo(u,c):h.lineTo(u,c),o+=f[v]/y,v=(v+1)%_;v%2!=0&&h.lineTo(r,a),s=r-u,l=a-c,this._dashOffset=-mathSqrt$1(s*s+l*l)},e.prototype._dashedQuadraticTo=function(e,t,n,i){var r=n,a=i;n=(n+2*e)/3,i=(i+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,n,i,r,a)},e.prototype.toStatic=function(){if(this._saveData){var e=this.data;e instanceof Array&&(e.length=this._len,hasTypedArray&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){min$1[0]=min$1[1]=min2[0]=min2[1]=Number.MAX_VALUE,max$1[0]=max$1[1]=max2[0]=max2[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,r=0,a=0;for(e=0;en||mathAbs(m)>i||h===t-1)&&(f=Math.sqrt(P*P+m*m),r=g,a=_);break;case CMD.C:var y=e[h++],v=e[h++],_=(g=e[h++],e[h++]),x=e[h++],S=e[h++];f=cubicLength(r,a,y,v,g,_,x,S,10),r=x,a=S;break;case CMD.Q:f=quadraticLength(r,a,y=e[h++],v=e[h++],g=e[h++],_=e[h++],10),r=g,a=_;break;case CMD.A:var b=e[h++],T=e[h++],M=e[h++],A=e[h++],I=e[h++],C=e[h++],w=C+I;h+=1;e[h++];d&&(o=mathCos$1(I)*M+b,s=mathSin$1(I)*A+T),f=mathMax$2(M,A)*mathMin$2(PI2$1,Math.abs(C)),r=mathCos$1(w)*M+b,a=mathSin$1(w)*A+T;break;case CMD.R:o=r=e[h++],s=a=e[h++],f=2*e[h++]+2*e[h++];break;case CMD.Z:var P=o-r;m=s-a;f=Math.sqrt(P*P+m*m),r=o,a=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},e.prototype.rebuildPath=function(e,t){var n,i,r,a,o,s,l,u,c=this.data,h=this._ux,p=this._uy,d=this._len,f=t<1,g=0,m=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))e:for(var y=0;yh||mathAbs(s-a)>p||y===d-1){if(f){if(g+(G=l[m++])>u){var x=(u-g)/G;e.lineTo(r*(1-x)+o*x,a*(1-x)+s*x);break e}g+=G}e.lineTo(o,s),r=o,a=s}break;case CMD.C:var S=c[y++],b=c[y++],T=c[y++],M=c[y++],A=c[y++],I=c[y++];if(f){if(g+(G=l[m++])>u){cubicSubdivide(r,S,T,A,x=(u-g)/G,tmpOutX),cubicSubdivide(a,b,M,I,x,tmpOutY),e.bezierCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2],tmpOutX[3],tmpOutY[3]);break e}g+=G}e.bezierCurveTo(S,b,T,M,A,I),r=A,a=I;break;case CMD.Q:S=c[y++],b=c[y++],T=c[y++],M=c[y++];if(f){if(g+(G=l[m++])>u){quadraticSubdivide(r,S,T,x=(u-g)/G,tmpOutX),quadraticSubdivide(a,b,M,x,tmpOutY),e.quadraticCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2]);break e}g+=G}e.quadraticCurveTo(S,b,T,M),r=T,a=M;break;case CMD.A:var C=c[y++],w=c[y++],P=c[y++],L=c[y++],E=c[y++],D=c[y++],R=c[y++],O=!c[y++],k=P>L?P:L,N=mathAbs(P-L)>.001,B=E+D,V=!1;if(f)g+(G=l[m++])>u&&(B=E+D*(u-g)/G,V=!0),g+=G;if(N&&e.ellipse?e.ellipse(C,w,P,L,R,E,B,O):e.arc(C,w,k,E,B,O),V)break e;_&&(n=mathCos$1(E)*P+C,i=mathSin$1(E)*L+w),r=mathCos$1(B)*P+C,a=mathSin$1(B)*L+w;break;case CMD.R:n=r=c[y],i=a=c[y+1],o=c[y++],s=c[y++];var F=c[y++],$=c[y++];if(f){if(g+(G=l[m++])>u){var z=u-g;e.moveTo(o,s),e.lineTo(o+mathMin$2(z,F),s),(z-=F)>0&&e.lineTo(o+F,s+mathMin$2(z,$)),(z-=$)>0&&e.lineTo(o+mathMax$2(F-z,0),s+$),(z-=F)>0&&e.lineTo(o,s+mathMax$2($-z,0));break e}g+=G}e.rect(o,s,F,$);break;case CMD.Z:if(f){var G;if(g+(G=l[m++])>u){x=(u-g)/G;e.lineTo(r*(1-x)+n*x,a*(1-x)+i*x);break e}g+=G}e.closePath(),r=n,a=i}}},e.CMD=CMD,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._needsDash=!1,t._dashOffset=0,t._dashIdx=0,t._dashSum=0,t._ux=0,t._uy=0}(),e}();function containStroke(e,t,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>i+s||oe+s&&a>n+s||at+h&&c>i+h&&c>a+h&&c>s+h||ce+h&&u>n+h&&u>r+h&&u>o+h||ut+u&&l>i+u&&l>a+u||le+u&&s>n+u&&s>r+u||sn||c+ur&&(r+=PI2$3);var p=Math.atan2(l,s);return p<0&&(p+=PI2$3),p>=i&&p<=r||p+PI2$3>=i&&p+PI2$3<=r}function windingLine(e,t,n,i,r,a){if(a>t&&a>i||ar?s:0}var CMD$1=PathProxy.CMD,PI2$4=2*Math.PI,EPSILON$2=1e-4;function isAroundEqual(e,t){return Math.abs(e-t)t&&u>i&&u>a&&u>s||u1&&swapExtrema(),d=cubicAt(t,i,a,s,extrema[0]),p>1&&(f=cubicAt(t,i,a,s,extrema[1]))),2===p?mt&&s>i&&s>a||s=0&&u<=1){for(var c=0,h=quadraticAt(t,i,a,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);roots[0]=-l,roots[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=PI2$4-1e-4){i=0,r=PI2$4;var c=a?1:-1;return o>=roots[0]+e&&o<=roots[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=PI2$4,r+=PI2$4);for(var p=0,d=0;d<2;d++){var f=roots[d];if(f+e>o){var g=Math.atan2(s,f);c=a?1:-1;g<0&&(g=PI2$4+g),(g>=i&&g<=r||g+PI2$4>=i&&g+PI2$4<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),p+=c)}}return p}function containPath(e,t,n,i,r){for(var a,o,s=e.data,l=e.len(),u=0,c=0,h=0,p=0,d=0,f=0;f1&&(n||(u+=windingLine(c,h,p,d,i,r))),m&&(p=c=s[f],d=h=s[f+1]),g){case CMD$1.M:c=p=s[f++],h=d=s[f++];break;case CMD$1.L:if(n){if(containStroke(c,h,s[f],s[f+1],t,i,r))return!0}else u+=windingLine(c,h,s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.C:if(n){if(containStroke$1(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingCubic(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.Q:if(n){if(containStroke$2(c,h,s[f++],s[f++],s[f],s[f+1],t,i,r))return!0}else u+=windingQuadratic(c,h,s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case CMD$1.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],S=s[f++],b=s[f++];f+=1;var T=!!(1-s[f++]);a=Math.cos(S)*_+y,o=Math.sin(S)*x+v,m?(p=a,d=o):u+=windingLine(c,h,a,o,i,r);var M=(i-y)*x/_+y;if(n){if(containStroke$3(y,v,x,S,S+b,T,t,M,r))return!0}else u+=windingArc(y,v,x,S,S+b,T,M,r);c=Math.cos(S+b)*_+y,h=Math.sin(S+b)*x+v;break;case CMD$1.R:if(p=c=s[f++],d=h=s[f++],a=p+s[f++],o=d+s[f++],n){if(containStroke(p,d,a,d,t,i,r)||containStroke(a,d,a,o,t,i,r)||containStroke(a,o,p,o,t,i,r)||containStroke(p,o,p,d,t,i,r))return!0}else u+=windingLine(a,d,a,o,i,r),u+=windingLine(p,o,p,d,i,r);break;case CMD$1.Z:if(n){if(containStroke(c,h,p,d,t,i,r))return!0}else u+=windingLine(c,h,p,d,i,r);c=p,h=d}}return n||isAroundEqual(h,d)||(u+=windingLine(c,h,p,d,i,r)||0),0!==u}function contain(e,t,n){return containPath(e,0,!1,t,n)}function containStroke$4(e,t,n,i){return containPath(e,t,!0,n,i)}var DEFAULT_PATH_STYLE=defaults({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},DEFAULT_COMMON_STYLE),DEFAULT_PATH_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},pathCopyParams=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],Path=function(e){function t(t){return e.call(this,t)||this}var n;return __extends(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new t;r.buildPath===t.prototype.buildPath&&(r.buildPath=function(e){n.buildPath(e,n.shape)}),r.silent=!0;var a=r.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?DARK_LABEL_COLOR:t>.2?LIGHTER_LABEL_COLOR:LIGHT_LABEL_COLOR}if(e)return LIGHT_LABEL_COLOR}return DARK_LABEL_COLOR},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(isString(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===lum(e,0)0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,n=this.style,i=!e;if(i){var r=!1;this.path||(r=!0,this.createPathProxy());var a=this.path;(r||this.__dirty&t.SHAPE_CHANGED_BIT)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),e=a.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){o.copy(e);var s=n.strokeNoScale?this.getLineScale():1,l=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;l=Math.max(l,null==u?4:u)}s>1e-10&&(o.width+=l/s,o.height+=l/s,o.x-=l/s/2,o.y-=l/s/2)}return o}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),r=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),containStroke$4(a,o/s,e,t)))return!0}if(this.hasFill())return contain(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=t.SHAPE_CHANGED_BIT,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:extend(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&t.SHAPE_CHANGED_BIT)},t.prototype.createStyle=function(e){return createObject(DEFAULT_PATH_STYLE,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=extend({},this.shape))},t.prototype._applyStateObj=function(t,n,i,r,a,o){e.prototype._applyStateObj.call(this,t,n,i,r,a,o);var s,l=!(n&&r);if(n&&n.shape?a?r?s=n.shape:(s=extend({},i.shape),extend(s,n.shape)):(s=extend({},r?this.shape:i.shape),extend(s,n.shape)):l&&(s=i.shape),s)if(a){this.shape=extend({},this.shape);for(var u={},c=keys(s),h=0;h1&&(o*=mathSqrt$3(f),s*=mathSqrt$3(f));var g=(r===a?-1:1)*mathSqrt$3((o*o*(s*s)-o*o*(d*d)-s*s*(p*p))/(o*o*(d*d)+s*s*(p*p)))||0,m=g*o*d/s,y=g*-s*p/o,v=(e+n)/2+mathCos$2(h)*m-mathSin$2(h)*y,_=(t+i)/2+mathSin$2(h)*m+mathCos$2(h)*y,x=vAngle([1,0],[(p-m)/o,(d-y)/s]),S=[(p-m)/o,(d-y)/s],b=[(-1*p-m)/o,(-1*d-y)/s],T=vAngle(S,b);if(vRatio(S,b)<=-1&&(T=PI$1),vRatio(S,b)>=1&&(T=0),T<0){var M=Math.round(T/PI$1*1e6)/1e6;T=2*PI$1+M%2*PI$1}c.addData(u,v,_,o,s,x,T,h,a)}var commandReg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,numberReg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function createPathProxyFromString(e){if(!e)return new PathProxy;for(var t,n=0,i=0,r=n,a=i,o=new PathProxy,s=PathProxy.CMD,l=e.match(commandReg),u=0;u=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=indexOf(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nu&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),i+r>c&&(i*=c/(o=i+r),r*=c/o),n+a>c&&(n*=c/(o=n+a),a*=c/o),e.moveTo(s+n,l),e.lineTo(s+u-i,l),0!==i&&e.arc(s+u-i,l+i,i,-Math.PI/2,0),e.lineTo(s+u,l+c-r),0!==r&&e.arc(s+u-r,l+c-r,r,0,Math.PI/2),e.lineTo(s+a,l+c),0!==a&&e.arc(s+a,l+c-a,a,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}Circle.prototype.type="circle";var round=Math.round;function subPixelOptimizeLine(e,t,n){if(t){var i=t.x1,r=t.x2,a=t.y1,o=t.y2;e.x1=i,e.x2=r,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(round(2*i)===round(2*r)&&(e.x1=e.x2=subPixelOptimize(i,s,!0)),round(2*a)===round(2*o)&&(e.y1=e.y2=subPixelOptimize(a,s,!0)),e):e}}function subPixelOptimizeRect(e,t,n){if(t){var i=t.x,r=t.y,a=t.width,o=t.height;e.x=i,e.y=r,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=subPixelOptimize(i,s,!0),e.y=subPixelOptimize(r,s,!0),e.width=Math.max(subPixelOptimize(i+a,s,!1)-e.x,0===a?0:1),e.height=Math.max(subPixelOptimize(r+o,s,!1)-e.y,0===o?0:1),e):e}}function subPixelOptimize(e,t,n){if(!t)return e;var i=round(2*e);return(i+round(t))%2==0?i/2:(i+(n?1:-1))/2}var RectShape=function(){this.x=0,this.y=0,this.width=0,this.height=0},subPixelOptimizeOutputShape={},Rect=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new RectShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeRect(subPixelOptimizeOutputShape,t,this.style);n=o.x,i=o.y,r=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,i=t.y,r=t.width,a=t.height;t.r?buildPath(e,t):e.rect(n,i,r,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Path);Rect.prototype.type="rect";var EllipseShape=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Ellipse=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new EllipseShape},t.prototype.buildPath=function(e,t){var n=.5522848,i=t.cx,r=t.cy,a=t.rx,o=t.ry,s=a*n,l=o*n;e.moveTo(i-a,r),e.bezierCurveTo(i-a,r-l,i-s,r-o,i,r-o),e.bezierCurveTo(i+s,r-o,i+a,r-l,i+a,r),e.bezierCurveTo(i+a,r+l,i+s,r+o,i,r+o),e.bezierCurveTo(i-s,r+o,i-a,r+l,i-a,r),e.closePath()},t}(Path);Ellipse.prototype.type="ellipse";var subPixelOptimizeOutputShape$1={},LineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Line=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LineShape},t.prototype.buildPath=function(e,t){var n,i,r,a;if(this.subPixelOptimize){var o=subPixelOptimizeLine(subPixelOptimizeOutputShape$1,t,this.style);n=o.x1,i=o.y1,r=o.x2,a=o.y2}else n=t.x1,i=t.y1,r=t.x2,a=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,a=i*(1-s)+a*s),e.lineTo(r,a))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(Path);function interpolate(e,t,n,i,r,a,o){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*o+(-3*(t-n)-2*s-l)*a+s*r+t}function smoothSpline(e,t){for(var n=e.length,i=[],r=0,a=1;an-2?n-1:l+1],d=e[l>n-3?n-1:l+2]);var f=u*u,g=u*f;i.push([interpolate(c[0],h[0],p[0],d[0],u,f,g),interpolate(c[1],h[1],p[1],d[1],u,f,g)])}return i}function smoothBezier(e,t,n,i){var r,a,o,s,l=[],u=[],c=[],h=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=e.length;p=2){if(i&&"spline"!==i){var a=smoothBezier(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var o=r.length,s=0;s<(n?o:o-1);s++){var l=a[2*s],u=a[2*s+1],c=r[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{"spline"===i&&(r=smoothSpline(r,n)),e.moveTo(r[0][0],r[0][1]);s=1;for(var h=r.length;s0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return createObject(DEFAULT_TSPAN_STYLE,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=getBoundingRect(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(Displayable);TSpan.prototype.type="tspan";var nodeParsers,DILIMITER_REG=/[\s,]+/;function parseXML(e){isString(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var SVGParser=function(){function e(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}return e.prototype.parse=function(e,t){t=t||{};var n=parseXML(e);if(!n)throw new Error("Illegal svg");var i=new Group;this._root=i;var r=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||t.width),o=parseFloat(n.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),parseAttributes(n,i,null,!0);for(var s,l,u=n.firstChild;u;)this._parseNode(u,i),u=u.nextSibling;if(r){var c=trim(r).split(DILIMITER_REG);c.length>=4&&(s={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(s&&null!=a&&null!=o&&(l=makeViewBoxTransform(s,a,o),!t.ignoreViewBox)){var h=i;(i=new Group).add(h),h.scaleX=h.scaleY=l.scale,h.x=l.x,h.y=l.y}return t.ignoreRootClip||null==a||null==o||i.setClipPath(new Rect({shape:{x:0,y:0,width:a,height:o}})),{root:i,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},e.prototype._parseNode=function(e,t){var n,i,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(i=defineParsers[r]){var a=i.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(i=nodeParsers[r])&&(n=i.call(this,e,t),t.add(n));if(n)for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,n),3===s.nodeType&&this._isText&&this._parseText(s,n),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},e.prototype._parseText=function(e,t){if(1===e.nodeType){var n=e.getAttribute("dx")||0,i=e.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new TSpan({style:{text:e.textContent},x:this._textX||0,y:this._textY||0});inheritStyle(t,r),parseAttributes(e,r,this._defs);var a=r.style,o=a.fontSize;o&&o<9&&(a.fontSize=9,r.scaleX*=o/9,r.scaleY*=o/9);var s=(a.fontSize||a.fontFamily)&&[a.fontStyle,a.fontWeight,(a.fontSize||12)+"px",a.fontFamily||"sans-serif"].join(" ");a.font=s;var l=r.getBoundingRect();return this._textX+=l.width,t.add(r),r},e.internalField=void(nodeParsers={g:function(e,t){var n=new Group;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n},rect:function(e,t){var n=new Rect;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n},circle:function(e,t){var n=new Circle;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n},line:function(e,t){var n=new Line;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n},ellipse:function(e,t){var n=new Ellipse;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n},polygon:function(e,t){var n,i=e.getAttribute("points");i&&(n=parsePoints(i));var r=new Polygon({shape:{points:n||[]}});return inheritStyle(t,r),parseAttributes(e,r,this._defs),r},polyline:function(e,t){var n=new Path;inheritStyle(t,n),parseAttributes(e,n,this._defs);var i,r=e.getAttribute("points");return r&&(i=parsePoints(r)),new Polyline({shape:{points:i||[]}})},image:function(e,t){var n=new ZRImage;return inheritStyle(t,n),parseAttributes(e,n,this._defs),n.setStyle({image:e.getAttribute("xlink:href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",r=e.getAttribute("dx")||"0",a=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(a);var o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),o},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new Group;return inheritStyle(t,o),parseAttributes(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var n=createFromString(e.getAttribute("d")||"");return inheritStyle(t,n),parseAttributes(e,n,this._defs),n}}),e}(),defineParsers={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),r=parseInt(e.getAttribute("y2")||"0",10),a=new LinearGradient(t,n,i,r);return _parseGradientColorStops(e,a),a}};function _parseGradientColorStops(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType){var i=n.getAttribute("offset"),r=void 0;r=i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var a=n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function inheritStyle(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),defaults(t.__inheritedStyle,e.__inheritedStyle))}function parsePoints(e){for(var t=trim(e).split(DILIMITER_REG),n=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=void 0;switch(r=r||create$1(),s){case"translate":l=trim(o).split(DILIMITER_REG),translate(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":l=trim(o).split(DILIMITER_REG),scale$1(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":l=trim(o).split(DILIMITER_REG),rotate(r,r,parseFloat(l[0]));break;case"skew":l=trim(o).split(DILIMITER_REG),console.warn("Skew transform is not supported yet");break;case"matrix":l=trim(o).split(DILIMITER_REG),r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}t.setLocalTransform(r)}}var styleRegex=/([^\s:;]+)\s*:\s*([^:;]+)/g;function parseStyleAttribute(e){var t=e.getAttribute("style"),n={};if(!t)return n;var i,r={};for(styleRegex.lastIndex=0;null!=(i=styleRegex.exec(t));)r[i[1]]=i[2];for(var a in attributesMap)attributesMap.hasOwnProperty(a)&&null!=r[a]&&(n[attributesMap[a]]=r[a]);return n}function makeViewBoxTransform(e,t,n){var i=t/e.width,r=n/e.height,a=Math.min(i,r);return{scale:a,x:-(e.x+e.width/2)*a+t/2,y:-(e.y+e.height/2)*a+n/2}}function parseSVG(e,t){return(new SVGParser).parse(e,t)}var PI$2=Math.PI,PI2$5=2*PI$2,mathSin$3=Math.sin,mathCos$3=Math.cos,mathACos=Math.acos,mathATan2=Math.atan2,mathAbs$1=Math.abs,mathSqrt$4=Math.sqrt,mathMax$3=Math.max,mathMin$3=Math.min,e=1e-4;function intersect(t,n,i,r,a,o,s,l){var u=i-t,c=r-n,h=s-a,p=l-o,d=p*u-h*c;if(!(d*dL*L+E*E&&(M=I,A=C),{cx:M,cy:A,x01:-c,y01:-h,x11:M*(r/S-1),y11:A*(r/S-1)}}function buildPath$2(t,n){var i=mathMax$3(n.r,0),r=mathMax$3(n.r0||0,0),a=i>0;if(a||r>0){if(a||(i=r,r=0),r>i){var o=i;i=r,r=o}var s=!!n.clockwise,l=n.startAngle,u=n.endAngle,c=[l,u];normalizeArcAngles(c,!s);var h=mathAbs$1(c[0]-c[1]),p=n.cx,d=n.cy,f=n.cornerRadius||0,g=n.innerCornerRadius||0;if(i>e)if(h>PI2$5-e)t.moveTo(p+i*mathCos$3(l),d+i*mathSin$3(l)),t.arc(p,d,i,l,u,!s),r>e&&(t.moveTo(p+r*mathCos$3(u),d+r*mathSin$3(u)),t.arc(p,d,r,u,l,s));else{var m=mathAbs$1(i-r)/2,y=mathMin$3(m,f),v=mathMin$3(m,g),_=v,x=y,S=i*mathCos$3(l),b=i*mathSin$3(l),T=r*mathCos$3(u),M=r*mathSin$3(u),A=void 0,I=void 0,C=void 0,w=void 0;if((y>e||v>e)&&(A=i*mathCos$3(u),I=i*mathSin$3(u),C=r*mathCos$3(l),w=r*mathSin$3(l),he)if(x>e){var N=computeCornerTangents(C,w,S,b,i,x,s),B=computeCornerTangents(A,I,T,M,i,x,s);t.moveTo(p+N.cx+N.x01,d+N.cy+N.y01),xe&&h>e)if(_>e){N=computeCornerTangents(T,M,A,I,r,-_,s),B=computeCornerTangents(S,b,C,w,r,-_,s);t.lineTo(p+N.cx+N.x01,d+N.cy+N.y01),_2&&l.push(t),t=[e,n]}function f(e,n,i,r){aroundEqual(e,i)&&aroundEqual(n,r)||t.push(e,n,i,r,i,r)}function g(e,n,i,r,a,o){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=nM:C2&&l.push(t),l}function alignSubpath(e,t){var n=e.length,i=t.length;if(n===i)return[e,t];for(var r=n0)for(var S=i/n,b=-i/2;b<=i/2;b+=S){var T=Math.sin(b),M=Math.cos(b),A=0;for(_=0;_h.width?1:0,r=PROP_WH[i],a=PROP_XY[i],o=h[r]/t,s=h[a],l=0;l=o;l++)s-=o;var u=getWidth(n,t);return u>s&&(n="",u=0),s=e-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=e,r}function truncateSingleLine(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var a=getWidth(e,i);if(a<=n)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?estimateLength(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=getWidth(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}function estimateLength(e,t,n,i){for(var r=0,a=0,o=e.length;ap&&u){var d=Math.floor(p/l);n=n.slice(0,d)}var f=p,g=c;if(r&&(f+=r[0]+r[2],null!=g&&(g+=r[1]+r[3])),e&&o&&null!=g)for(var m=prepareTruncateOptions(c,a,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),y=0;yl&&pushTokens(n,e.substring(l,u),t,s),pushTokens(n,i[2],t,s,i[1]),l=STYLE_REG.lastIndex}la){S>0?(v.tokens=v.tokens.slice(0,S),m(v,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break e}var C=b.width,w=null==C||"auto"===C;if("string"==typeof C&&"%"===C.charAt(C.length-1))D.percentWidth=C,c.push(D),D.contentWidth=getWidth(D.text,A);else{if(w){var P=b.backgroundColor,L=P&&P.image;L&&isImageReady(L=findExistImage(L))&&(D.width=Math.max(D.width,L.width*I/L.height))}var E=f&&null!=r?r-x:null;null!=E&&E0&&f+i.accumWidth>i.width&&(a=t.split("\n"),h=!0),i.accumWidth=f}else{var g=wrapText(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,o=g.linesWidths,a=g.lines}}else a=t.split("\n");for(var m=0;m=33&&t<=255}var breakCharMap=reduce(",&?/;] ".split(""),(function(e,t){return e[t]=!0,e}),{});function isWordBreakChar(e){return!isLatin(e)||!!breakCharMap[e]}function wrapText(e,t,n,i,r){for(var a=[],o=[],s="",l="",u=0,c=0,h=0;hn:r+c+d>n)?c?(s||l)&&(f?(s||(s=l,l="",c=u=0),a.push(s),o.push(c-u),l+=p,s="",c=u+=d):(l&&(s+=l,c+=u,l="",u=0),a.push(s),o.push(c),s=p,c=d)):f?(a.push(l),o.push(u),l=p,u=d):(a.push(p),o.push(d)):(c+=d,f?(l+=p,u+=d):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,c+=u),a.push(s),o.push(c),s="",l="",u=0,c=0}return a.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),1===a.length&&(c+=r),{accumWidth:c,lines:a,linesWidths:o}}function parsePercent$1(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}var DEFAULT_RICH_TEXT_COLOR={fill:"#000"},DEFAULT_STROKE_LINE_WIDTH=2,DEFAULT_TEXT_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},ZRText=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=DEFAULT_RICH_TEXT_COLOR,n.attr(t),n}return __extends(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,M=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=i.calculatedLineHeight,I=0;I=0&&"right"===(C=_[I]).align;)this._placeToken(C,e,S,f,A,"right",m),b-=C.width,A-=C.width,I--;for(M+=(n-(M-d)-(g-A)-b)/2;T<=I;)C=_[T],this._placeToken(C,e,S,f,M+C.width/2,"center",m),M+=C.width,T++;f+=S}},t.prototype._placeToken=function(e,t,n,i,r,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=i+n/2;"top"===l?u=i+e.height/2:"bottom"===l&&(u=i+n-e.height/2),!e.isLineHolder&&needDrawBackground(s)&&this._renderBackground(s,t,"right"===a?r-e.width:"center"===a?r-e.width/2:r,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(r=getTextXForPadding(r,a,h),u-=e.height/2-h[0]-e.innerHeight/2);var p=this._getOrCreateChild(TSpan),d=p.createStyle();p.useStyle(d);var f=this._defaultStyle,g=!1,m=0,y=getStroke("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),v=getStroke("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||o||f.autoStroke&&!g?null:(m=DEFAULT_STROKE_LINE_WIDTH,f.stroke)),_=s.textShadowBlur>0||t.textShadowBlur>0;d.text=e.text,d.x=r,d.y=u,_&&(d.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,d.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",d.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,d.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),d.textAlign=a,d.textBaseline="middle",d.font=e.font||DEFAULT_FONT,d.opacity=retrieve3(s.opacity,t.opacity,1),v&&(d.lineWidth=retrieve3(s.lineWidth,t.lineWidth,m),d.lineDash=retrieve2(s.lineDash,t.lineDash),d.lineDashOffset=t.lineDashOffset||0,d.stroke=v),y&&(d.fill=y);var x=e.contentWidth,S=e.contentHeight;p.setBoundingRect(new BoundingRect(adjustTextX(d.x,x,d.textAlign),adjustTextY(d.y,S,d.textBaseline),x,S))},t.prototype._renderBackground=function(e,t,n,i,r,a){var o,s,l,u=e.backgroundColor,c=e.borderWidth,h=e.borderColor,p=isString(u),d=e.borderRadius,f=this;if(p||c&&h){(o=this._getOrCreateChild(Rect)).useStyle(o.createStyle()),o.style.fill=null;var g=o.shape;g.x=n,g.y=i,g.width=r,g.height=a,g.r=d,o.dirtyShape()}if(p)(l=o.style).fill=u||null,l.fillOpacity=retrieve2(e.fillOpacity,1);else if(u&&u.image){(s=this._getOrCreateChild(ZRImage)).onload=function(){f.dirtyStyle()};var m=s.style;m.image=u.image,m.x=n,m.y=i,m.width=r,m.height=a}c&&h&&((l=o.style).lineWidth=c,l.stroke=h,l.strokeOpacity=retrieve2(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(o||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=retrieve3(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";if(e.fontSize||e.fontFamily||e.fontWeight){var n="";n="string"!=typeof e.fontSize||-1===e.fontSize.indexOf("px")&&-1===e.fontSize.indexOf("rem")&&-1===e.fontSize.indexOf("em")?isNaN(+e.fontSize)?"12px":e.fontSize+"px":e.fontSize,t=[e.fontStyle,e.fontWeight,n,e.fontFamily||"sans-serif"].join(" ")}return t&&trim(t)||e.textFont||e.font},t}(Displayable),VALID_TEXT_ALIGN={left:!0,right:1,center:1},VALID_TEXT_VERTICAL_ALIGN={top:1,bottom:1,middle:1};function normalizeTextStyle(e){return normalizeStyle(e),each(e.rich,normalizeStyle),e}function normalizeStyle(e){if(e){e.font=ZRText.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||VALID_TEXT_ALIGN[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||VALID_TEXT_VERTICAL_ALIGN[n]?n:"top",e.padding&&(e.padding=normalizeCssArray(e.padding))}}function getStroke(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function getFill(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function getTextXForPadding(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function getStyleText(e){var t=e.text;return null!=t&&(t+=""),t}function needDrawBackground(e){return!!(e.backgroundColor||e.borderWidth&&e.borderColor)}var ArcShape=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Arc=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ArcShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(a),u=Math.sin(a);e.moveTo(l*r+n,u*r+i),e.arc(n,i,r,a,o,!s)},t}(Path);Arc.prototype.type="arc";var out=[],BezierCurveShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function someVectorAt(e,t,n){var i=e.cpx2,r=e.cpy2;return null===i||null===r?[(n?cubicDerivativeAt:cubicAt)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?cubicDerivativeAt:cubicAt)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?quadraticDerivativeAt:quadraticAt)(e.x1,e.cpx1,e.x2,t),(n?quadraticDerivativeAt:quadraticAt)(e.y1,e.cpy1,e.y2,t)]}var BezierCurve=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new BezierCurveShape},t.prototype.buildPath=function(e,t){var n=t.x1,i=t.y1,r=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,i),null==l||null==u?(c<1&&(quadraticSubdivide(n,o,r,c,out),o=out[1],r=out[2],quadraticSubdivide(i,s,a,c,out),s=out[1],a=out[2]),e.quadraticCurveTo(o,s,r,a)):(c<1&&(cubicSubdivide(n,o,l,r,c,out),o=out[1],l=out[2],r=out[3],cubicSubdivide(i,s,u,a,c,out),s=out[1],u=out[2],a=out[3]),e.bezierCurveTo(o,s,l,u,r,a)))},t.prototype.pointAt=function(e){return someVectorAt(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=someVectorAt(this.shape,e,!0);return normalize(t,t)},t}(Path);BezierCurve.prototype.type="bezier-curve";var DropletShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Droplet=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new DropletShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i+r),e.bezierCurveTo(n+r,i+r,n+3*r/2,i-r/3,n,i-a),e.bezierCurveTo(n-3*r/2,i-r/3,n-r,i+r,n,i+r),e.closePath()},t}(Path);Droplet.prototype.type="droplet";var HeartShape=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},Heart=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new HeartShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.width,a=t.height;e.moveTo(n,i),e.bezierCurveTo(n+r/2,i-2*a/3,n+2*r,i+a/3,n,i+a),e.bezierCurveTo(n-2*r,i+a/3,n-r/2,i-2*a/3,n,i)},t}(Path);Heart.prototype.type="heart";var PI$3=Math.PI,sin=Math.sin,cos=Math.cos,IsogonShape=function(){this.x=0,this.y=0,this.r=0,this.n=0},Isogon=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new IsogonShape},t.prototype.buildPath=function(e,t){var n=t.n;if(n&&!(n<2)){var i=t.x,r=t.y,a=t.r,o=2*PI$3/n,s=-PI$3/2;e.moveTo(i+a*cos(s),r+a*sin(s));for(var l=0,u=n-1;l4?a*cos$2(2*PI$4/n)/cos$2(PI$4/n):a/3);var s=PI$4/n,l=-PI$4/2,u=i+a*cos$2(l),c=r+a*sin$2(l);l+=s,e.moveTo(u,c);for(var h=0,p=2*n-1,d=void 0;hextent2[1]){if(o=!1,r)return o;var u=Math.abs(extent2[0]-extent[1]),c=Math.abs(extent[0]-extent2[1]);Math.min(u,c)>i.len()&&(u0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},e.prototype.addHover=function(e){},e.prototype.removeHover=function(e){},e.prototype.clearHover=function(){},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},e.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},e.prototype.clearAnimation=function(){this.animation.clear()},e.prototype.getWidth=function(){return this.painter.getWidth()},e.prototype.getHeight=function(){return this.painter.getHeight()},e.prototype.pathToImage=function(e,t){if(this.painter.pathToImage)return this.painter.pathToImage(e,t)},e.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this.handler.off(e,t)},e.prototype.trigger=function(e,t){this.handler.trigger(e,t)},e.prototype.clear=function(){for(var e=this.storage.getRoots(),t=0;t0){if(e<=t[0])return n[0];if(e>=t[1])return n[1]}else{if(e>=t[0])return n[0];if(e<=t[1])return n[1]}else{if(e===t[0])return n[0];if(e===t[1])return n[1]}return(e-t[0])/r*a+n[0]}function parsePercent$2(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?_trim(e).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function round$1(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function asc(e){return e.sort((function(e,t){return e-t})),e}function getPrecision(e){if(e=+e,isNaN(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}function getPrecisionSafe(e){var t=e.toString(),n=t.indexOf("e");if(n>0){var i=+t.slice(n+1);return i<0?-i:0}var r=t.indexOf(".");return r<0?0:t.length-1-r}function getPixelPrecision(e,t){var n=Math.log,i=Math.LN10,r=Math.floor(n(e[1]-e[0])/i),a=Math.round(n(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20}function getPercentWithPrecision(e,t,n){if(!e[t])return 0;var i=reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===i)return 0;for(var r=Math.pow(10,n),a=map(e,(function(e){return(isNaN(e)?0:e)/i*r*100})),o=100*r,s=map(a,(function(e){return Math.floor(e)})),l=reduce(s,(function(e,t){return e+t}),0),u=map(a,(function(e,t){return e-s[t]}));lc&&(c=u[p],h=p);++s[h],u[h]=0,++l}return s[t]/r}var MAX_SAFE_INTEGER=9007199254740991;function remRadian(e){var t=2*Math.PI;return(e%t+t)%t}function isRadianAroundZero(e){return e>-RADIAN_EPSILON&&e=10&&t++,t}function nice(e,t){var n=quantityExponent(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function quantile(e,t){var n=(e.length-1)*t+1,i=Math.floor(n),r=+e[i-1],a=n-i;return a?r+a*(e[i]-r):r}function reformIntervals(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i=0||r&&indexOf(r,s)<0)){var l=n.getShallow(s,t);null!=l&&(a[e[o][0]]=l)}}return a}}var AREA_STYLE_KEY_MAP=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],getAreaStyle=makeStyleMapper(AREA_STYLE_KEY_MAP),AreaStyleMixin=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return getAreaStyle(this,e,t)},e}(),getECData=makeInner(),_highlightNextDigit=1,_highlightKeyMap={},getSavedStates=makeInner(),HOVER_STATE_NORMAL=0,HOVER_STATE_BLUR=1,HOVER_STATE_EMPHASIS=2,SPECIAL_STATES=["emphasis","blur","select"],DISPLAY_STATES=["normal","emphasis","blur","select"],Z2_EMPHASIS_LIFT=10,Z2_SELECT_LIFT=9,HIGHLIGHT_ACTION_TYPE="highlight",DOWNPLAY_ACTION_TYPE="downplay",SELECT_ACTION_TYPE="select",UNSELECT_ACTION_TYPE="unselect",TOGGLE_SELECT_ACTION_TYPE="toggleSelect";function hasFillOrStroke(e){return null!=e&&"none"!==e}var liftedColorCache=new LRU(100);function liftColor(e){if("string"!=typeof e)return e;var t=liftedColorCache.get(e);return t||(t=lift(e,-.1),liftedColorCache.put(e,t)),t}function doChangeHoverState(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function singleEnterEmphasis(e){doChangeHoverState(e,"emphasis",HOVER_STATE_EMPHASIS)}function singleLeaveEmphasis(e){e.hoverState===HOVER_STATE_EMPHASIS&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterBlur(e){doChangeHoverState(e,"blur",HOVER_STATE_BLUR)}function singleLeaveBlur(e){e.hoverState===HOVER_STATE_BLUR&&doChangeHoverState(e,"normal",HOVER_STATE_NORMAL)}function singleEnterSelect(e){e.selected=!0}function singleLeaveSelect(e){e.selected=!1}function updateElementState(e,t,n){t(e,n)}function traverseUpdateState(e,t,n){updateElementState(e,t,n),e.isGroup&&e.traverse((function(e){updateElementState(e,t,n)}))}function setStatesFlag(e,t){switch(t){case"emphasis":e.hoverState=HOVER_STATE_EMPHASIS;break;case"normal":e.hoverState=HOVER_STATE_NORMAL;break;case"blur":e.hoverState=HOVER_STATE_BLUR;break;case"select":e.selected=!0}}function getFromStateStyle(e,t,n,i){for(var r=e.style,a={},o=0;o=0,a=!1;if(e instanceof Path){var o=getSavedStates(e),s=r&&o.selectFill||o.normalFill,l=r&&o.selectStroke||o.normalStroke;if(hasFillOrStroke(s)||hasFillOrStroke(l)){var u=(i=i||{}).style||{};!hasFillOrStroke(u.fill)&&hasFillOrStroke(s)?(a=!0,i=extend({},i),(u=extend({},u)).fill=liftColor(s)):!hasFillOrStroke(u.stroke)&&hasFillOrStroke(l)&&(a||(i=extend({},i),u=extend({},u)),u.stroke=liftColor(l)),i.style=u}}if(i&&null==i.z2){a||(i=extend({},i));var c=e.z2EmphasisLift;i.z2=e.z2+(null!=c?c:Z2_EMPHASIS_LIFT)}return i}function createSelectDefaultState(e,t,n){if(n&&null==n.z2){n=extend({},n);var i=e.z2SelectLift;n.z2=e.z2+(null!=i?i:Z2_SELECT_LIFT)}return n}function createBlurDefaultState(e,t,n){var i=indexOf(e.currentStates,t)>=0,r=e.style.opacity,a=i?null:getFromStateStyle(e,["opacity"],t,{opacity:1}),o=(n=n||{}).style||{};return null==o.opacity&&(n=extend({},n),o=extend({opacity:i?r:.1*a.opacity},o),n.style=o),n}function elementStateProxy(e,t){var n=this.states[e];if(this.style){if("emphasis"===e)return createEmphasisDefaultState(this,e,t,n);if("blur"===e)return createBlurDefaultState(this,e,n);if("select"===e)return createSelectDefaultState(this,e,n)}return n}function setDefaultStateProxy(e){e.stateProxy=elementStateProxy;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=elementStateProxy),n&&(n.stateProxy=elementStateProxy)}function enterEmphasisWhenMouseOver(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasisWhenMouseOut(e,t){!shouldSilent(e,t)&&!e.__highByOuter&&traverseUpdateState(e,singleLeaveEmphasis)}function enterEmphasis(e,t){e.__highByOuter|=1<<(t||0),traverseUpdateState(e,singleEnterEmphasis)}function leaveEmphasis(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&traverseUpdateState(e,singleLeaveEmphasis)}function enterBlur(e){traverseUpdateState(e,singleEnterBlur)}function leaveBlur(e){traverseUpdateState(e,singleLeaveBlur)}function enterSelect(e){traverseUpdateState(e,singleEnterSelect)}function leaveSelect(e){traverseUpdateState(e,singleLeaveSelect)}function shouldSilent(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function allLeaveBlur(e){e.getModel().eachComponent((function(t,n){("series"===t?e.getViewOfSeriesModel(n):e.getViewOfComponentModel(n)).group.traverse((function(e){singleLeaveBlur(e)}))}))}function toggleSeriesBlurState(e,t,n,i,r){var a=i.getModel();function o(e,t){for(var n=0;n0){var a={dataIndex:r,seriesIndex:e.seriesIndex};null!=i&&(a.dataType=i),t.push(a)}}))})),t}function enableHoverEmphasis(e,t,n){setAsHighDownDispatcher(e,!0),traverseUpdateState(e,setDefaultStateProxy),enableHoverFocus(e,t,n)}function enableHoverFocus(e,t,n){var i=getECData(e);null!=t?(i.focus=t,i.blurScope=n):i.focus&&(i.focus=null)}var OTHER_STATES=["emphasis","blur","select"],defaultStyleGetterMap={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function setStatesStylesFromModel(e,t,n,i){n=n||"itemStyle";for(var r=0;r0?l?t.animateFrom(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,scope:e,during:o}):t.animateTo(n,{duration:f,delay:m||0,easing:g,done:a,force:!!a||!!o,setToFinal:!0,scope:e,during:o}):(t.stopAnimation(),!l&&t.attr(n),a&&a())}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),a&&a()}function updateProps(e,t,n,i,r,a){animateOrSetProps("update",e,t,n,i,r,a)}function initProps(e,t,n,i,r,a){animateOrSetProps("init",e,t,n,i,r,a)}function removeElement(e,t,n,i,r,a){isElementRemoved(e)||animateOrSetProps("remove",e,t,n,i,r,a)}function fadeOutDisplayable(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),removeElement(e,{style:{opacity:0}},t,n,i)}function removeElementWithFadeOut(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse((function(e){e.isGroup||fadeOutDisplayable(e,t,n,i)})):fadeOutDisplayable(e,t,n,i)}function isElementRemoved(e){if(!e.__zr)return!0;for(var t=0;tMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function isNotGroup(e){return!e.isGroup}function isPath(e){return null!=e.shape}function groupTransition(e,t,n){if(e&&t){var i,r=(i={},e.traverse((function(e){isNotGroup(e)&&e.anid&&(i[e.anid]=e)})),i);t.traverse((function(e){if(isNotGroup(e)&&e.anid){var t=r[e.anid];if(t){var i=a(e);e.attr(a(t)),updateProps(e,i,n,getECData(e).dataIndex)}}}))}function a(e){var t={x:e.x,y:e.y,rotation:e.rotation};return isPath(e)&&(t.shape=extend({},e.shape)),t}}function clipPointsByRect(e,t){return map(e,(function(e){var n=e[0];n=mathMax$4(n,t.x),n=mathMin$4(n,t.x+t.width);var i=e[1];return i=mathMax$4(i,t.y),[n,i=mathMin$4(i,t.y+t.height)]}))}function clipRectByRect(e,t){var n=mathMax$4(e.x,t.x),i=mathMin$4(e.x+e.width,t.x+t.width),r=mathMax$4(e.y,t.y),a=mathMin$4(e.y+e.height,t.y+t.height);if(i>=n&&a>=r)return{x:n,y:r,width:i-n,height:a-r}}function createIcon(e,t,n){var i=extend({rectHover:!0},t),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(r.image=e.slice(8),defaults(r,n),new ZRImage(i)):makePath(e.replace("path://",""),i,n,"center")}function linePolygonIntersect(e,t,n,i,r){for(var a=0,o=r[r.length-1];a1)return!1;var m=crossProduct2d(d,f,c,h)/p;return!(m<0||m>1)}function crossProduct2d(e,t,n,i){return e*i-n*t}function nearZero(e){return e<=1e-6&&e>=-1e-6}registerShape("circle",Circle),registerShape("ellipse",Ellipse),registerShape("sector",Sector),registerShape("ring",Ring),registerShape("polygon",Polygon),registerShape("polyline",Polyline),registerShape("rect",Rect),registerShape("line",Line),registerShape("bezierCurve",BezierCurve),registerShape("arc",Arc);var graphic=Object.freeze({__proto__:null,extendShape:extendShape,extendPath:extendPath,registerShape:registerShape,getShapeClass:getShapeClass,makePath:makePath,makeImage:makeImage,mergePath:mergePath$1,resizePath:resizePath,subPixelOptimizeLine:subPixelOptimizeLine$1,subPixelOptimizeRect:subPixelOptimizeRect$1,subPixelOptimize:subPixelOptimize$1,updateProps:updateProps,initProps:initProps,removeElement:removeElement,removeElementWithFadeOut:removeElementWithFadeOut,isElementRemoved:isElementRemoved,getTransform:getTransform,applyTransform:applyTransform$1,transformDirection:transformDirection,groupTransition:groupTransition,clipPointsByRect:clipPointsByRect,clipRectByRect:clipRectByRect,createIcon:createIcon,linePolygonIntersect:linePolygonIntersect,lineLineIntersect:lineLineIntersect,Group:Group,Image:ZRImage,Text:ZRText,Circle:Circle,Ellipse:Ellipse,Sector:Sector,Ring:Ring,Polygon:Polygon,Polyline:Polyline,Rect:Rect,Line:Line,BezierCurve:BezierCurve,Arc:Arc,IncrementalDisplayable:IncrementalDisplayble,CompoundPath:CompoundPath,LinearGradient:LinearGradient,RadialGradient:RadialGradient,BoundingRect:BoundingRect,OrientedBoundingRect:OrientedBoundingRect,Point:Point,Path:Path}),EMPTY_OBJ={};function setLabelText(e,t){for(var n=0;n=0&&n.push(e)})),n}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),each(s,(function(e){indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=n(i,e);indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:i,noEntryList:r}}(i),s=o.graph,l=o.noEntryList,u={};for(each(e,(function(e){u[e]=!0}));l.length;){var c=l.pop(),h=s[c],p=!!u[c];p&&(r.call(a,c,h.originalDeps.slice()),delete u[c]),each(h.successor,p?f:d)}each(u,(function(){var e="";throw new Error(e)}))}function d(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,d(e)}}}function inheritDefaultOption(e,t){return merge(merge({},e,!0),t,!0)}var langEN={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Guage",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},langZH={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},LOCALE_ZH="ZH",LOCALE_EN="EN",DEFAULT_LOCALE=LOCALE_EN,localeStorage={},localeModels={},SYSTEM_LANG=env.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase().indexOf(LOCALE_ZH)>-1?LOCALE_ZH:DEFAULT_LOCALE;function registerLocale(e,t){e=e.toUpperCase(),localeModels[e]=new Model(t),localeStorage[e]=t}function createLocaleObject(e){if(isString(e)){var t=localeStorage[e.toUpperCase()]||{};return e===LOCALE_ZH||e===LOCALE_EN?clone(t):merge(clone(t),clone(localeStorage[DEFAULT_LOCALE]),!1)}return merge(clone(e),clone(localeStorage[DEFAULT_LOCALE]),!1)}function getLocaleModel(e){return localeModels[e]}function getDefaultLocaleModel(){return localeModels[DEFAULT_LOCALE]}registerLocale(LOCALE_EN,langEN),registerLocale(LOCALE_ZH,langZH);var ONE_SECOND=1e3,ONE_MINUTE=60*ONE_SECOND,ONE_HOUR=60*ONE_MINUTE,ONE_DAY=24*ONE_HOUR,ONE_YEAR=365*ONE_DAY,defaultLeveledFormatter={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{hh}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}"},fullDayFormatter="{yyyy}-{MM}-{dd}",fullLeveledFormatter={year:"{yyyy}",month:"{yyyy}-{MM}",day:fullDayFormatter,hour:fullDayFormatter+" "+defaultLeveledFormatter.hour,minute:fullDayFormatter+" "+defaultLeveledFormatter.minute,second:fullDayFormatter+" "+defaultLeveledFormatter.second,millisecond:defaultLeveledFormatter.none},primaryTimeUnits=["year","month","day","hour","minute","second","millisecond"],timeUnits=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function pad(e,t){return"0000".substr(0,t-(e+="").length)+e}function getPrimaryTimeUnit(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function isPrimaryTimeUnit(e){return e===getPrimaryTimeUnit(e)}function getDefaultFormatPrecisionOfInterval(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function format(e,t,n,i){var r=parseDate(e),a=r[fullYearGetterName(n)](),o=r[monthGetterName(n)]()+1,s=Math.floor((o-1)/4)+1,l=r[dateGetterName(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[hoursGetterName(n)](),h=(c-1)%12+1,p=r[minutesGetterName(n)](),d=r[secondsGetterName(n)](),f=r[millisecondsGetterName(n)](),g=(i instanceof Model?i:getLocaleModel(i||SYSTEM_LANG)||getDefaultLocaleModel()).getModel("time"),m=g.get("month"),y=g.get("monthAbbr"),v=g.get("dayOfWeek"),_=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,a%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,pad(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,pad(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,pad(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,pad(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,pad(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,pad(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,pad(f,3)).replace(/{S}/g,f+"")}function leveledFormat(e,t,n,i,r){var a=null;if("string"==typeof n)a=n;else if("function"==typeof n)a=n(e.value,t,{level:e.level});else{var o=extend({},defaultLeveledFormatter);if(e.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(isArray(a)){var c=null==e.level?0:e.level>=0?e.level:a.length+e.level;a=a[c=Math.min(c,a.length-1)]}}return format(new Date(e.value),a,r,i)}function getUnitFromValue(e,t){var n=parseDate(e),i=n[monthGetterName(t)]()+1,r=n[dateGetterName(t)](),a=n[hoursGetterName(t)](),o=n[minutesGetterName(t)](),s=n[secondsGetterName(t)](),l=0===n[millisecondsGetterName(t)](),u=l&&0===s,c=u&&0===o,h=c&&0===a,p=h&&1===r;return p&&1===i?"year":p?"month":h?"day":c?"hour":u?"minute":l?"second":"millisecond"}function getUnitValue(e,t,n){var i="number"==typeof e?parseDate(e):e;switch(t=t||getUnitFromValue(e,n)){case"year":return i[fullYearGetterName(n)]();case"half-year":return i[monthGetterName(n)]()>=6?1:0;case"quarter":return Math.floor((i[monthGetterName(n)]()+1)/4);case"month":return i[monthGetterName(n)]();case"day":return i[dateGetterName(n)]();case"half-day":return i[hoursGetterName(n)]()/24;case"hour":return i[hoursGetterName(n)]();case"minute":return i[minutesGetterName(n)]();case"second":return i[secondsGetterName(n)]();case"millisecond":return i[millisecondsGetterName(n)]()}}function fullYearGetterName(e){return e?"getUTCFullYear":"getFullYear"}function monthGetterName(e){return e?"getUTCMonth":"getMonth"}function dateGetterName(e){return e?"getUTCDate":"getDate"}function hoursGetterName(e){return e?"getUTCHours":"getHours"}function minutesGetterName(e){return e?"getUTCMinutes":"getMinutes"}function secondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function millisecondsGetterName(e){return e?"getUTCSeconds":"getSeconds"}function fullYearSetterName(e){return e?"setUTCFullYear":"setFullYear"}function monthSetterName(e){return e?"setUTCMonth":"setMonth"}function dateSetterName(e){return e?"setUTCDate":"setDate"}function hoursSetterName(e){return e?"setUTCHours":"setHours"}function minutesSetterName(e){return e?"setUTCMinutes":"setMinutes"}function secondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function millisecondsSetterName(e){return e?"setUTCSeconds":"setSeconds"}function getTextRect(e,t,n,i,r,a,o,s){return deprecateLog("getTextRect is deprecated."),new ZRText({style:{text:e,font:t,align:n,verticalAlign:i,padding:r,rich:a,overflow:o?"truncate":null,lineHeight:s}}).getBoundingRect()}function addCommas(e){if(!isNumeric(e))return isString(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function toCamelCase(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var normalizeCssArray$1=normalizeCssArray,replaceReg=/([&<>"'])/g,replaceMap={"&":"&","<":"<",">":">",'"':""","'":"'"};function encodeHTML(e){return null==e?"":(e+"").replace(replaceReg,(function(e,t){return replaceMap[t]}))}function makeValueReadable(e,t,n){function i(e){return e&&trim(e)?e:"-"}function r(e){return!(null==e||isNaN(e)||!isFinite(e))}var a="time"===t,o=e instanceof Date;if(a||o){var s=a?parseDate(e):e;if(!isNaN(+s))return format(s,"yyyy-MM-dd hh:mm:ss",n);if(o)return"-"}if("ordinal"===t)return isStringSafe(e)?i(e):isNumber(e)&&r(e)?e+"":"-";var l=numericToNumber(e);return r(l)?addCommas(l):isStringSafe(e)?i(e):"-"}var TPL_VAR_ALIAS=["a","b","c","d","e","f","g"],wrapVar=function(e,t){return"{"+e+(null==t?"":t)+"}"};function formatTpl(e,t,n){isArray(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],a=0;a':'':{renderMode:a,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function formatTime(e,t,n){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var i=parseDate(t),r=n?"UTC":"",a=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),c=i["get"+r+"Seconds"](),h=i["get"+r+"Milliseconds"]();return e=e.replace("MM",pad(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100+"").replace("dd",pad(s,2)).replace("d",s).replace("hh",pad(l,2)).replace("h",l).replace("mm",pad(u,2)).replace("m",u).replace("ss",pad(c,2)).replace("s",c).replace("SSS",pad(h,3))}function capitalFirst(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e}function convertToColorString(e,t){return t=t||"transparent",isString(e)?e:isObject(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function windowOpen(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var formatUtil=Object.freeze({__proto__:null,addCommas:addCommas,toCamelCase:toCamelCase,normalizeCssArray:normalizeCssArray$1,encodeHTML:encodeHTML,makeValueReadable:makeValueReadable,formatTpl:formatTpl,formatTplSimple:formatTplSimple,getTooltipMarker:getTooltipMarker,formatTime:formatTime,capitalFirst:capitalFirst,convertToColorString:convertToColorString,windowOpen:windowOpen,truncateText:truncateText,getTextRect:getTextRect}),each$1=each,LOCATION_PARAMS=["left","right","top","bottom","width","height"],HV_NAMES=[["width","left","right"],["height","top","bottom"]];function boxLayout(e,t,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var c,h,p=l.getBoundingRect(),d=t.childAt(u+1),f=d&&d.getBoundingRect();if("horizontal"===e){var g=p.width+(f?-f.x+p.x:0);(c=a+g)>i||l.newline?(a=0,c=g,o+=s+n,s=p.height):s=Math.max(s,p.height)}else{var m=p.height+(f?-f.y+p.y:0);(h=o+m)>r||l.newline?(a+=s+n,o=0,h=m,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),"horizontal"===e?a=c+n:o=h+n)}))}var box=boxLayout,vbox=curry(boxLayout,"vertical"),hbox=curry(boxLayout,"horizontal");function getAvailableSize(e,t,n){var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r);return(isNaN(a)||isNaN(parseFloat(e.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(e.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.bottom)))&&(l=r),n=normalizeCssArray$1(n||0),{width:Math.max(s-a-n[1]-n[3],0),height:Math.max(l-o-n[0]-n[2],0)}}function getLayoutRect(e,t,n){n=normalizeCssArray$1(n||0);var i=t.width,r=t.height,a=parsePercent$2(e.left,i),o=parsePercent$2(e.top,r),s=parsePercent$2(e.right,i),l=parsePercent$2(e.bottom,r),u=parsePercent$2(e.width,i),c=parsePercent$2(e.height,r),h=n[2]+n[0],p=n[1]+n[3],d=e.aspect;switch(isNaN(u)&&(u=i-s-p-a),isNaN(c)&&(c=r-l-h-o),null!=d&&(isNaN(u)&&isNaN(c)&&(d>i/r?u=.8*i:c=.8*r),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=i-s-u-p),isNaN(o)&&(o=r-l-c-h),e.left||e.right){case"center":a=i/2-u/2-n[3];break;case"right":a=i-u-p}switch(e.top||e.bottom){case"middle":case"center":o=r/2-c/2-n[0];break;case"bottom":o=r-c-h}a=a||0,o=o||0,isNaN(u)&&(u=i-p-a-(s||0)),isNaN(c)&&(c=r-h-o-(l||0));var f=new BoundingRect(a+n[3],o+n[0],u,c);return f.margin=n,f}function positionElement(e,t,n,i,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new BoundingRect(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}var c=getLayoutRect(defaults({width:l.width,height:l.height},t),n,i),h=a?c.x-l.x:0,p=o?c.y-l.y:0;"raw"===s?(e.x=h,e.y=p):(e.x+=h,e.y+=p),e.markRedraw()}}function sizeCalculable(e,t){return null!=e[HV_NAMES[t][0]]||null!=e[HV_NAMES[t][1]]&&null!=e[HV_NAMES[t][2]]}function fetchLayoutMode(e){var t=e.layoutMode||e.constructor.layoutMode;return isObject(t)?t:t?{type:t}:null}function mergeLayoutParam(e,t,n){var i=n&&n.ignoreSize;!isArray(i)&&(i=[i,i]);var r=o(HV_NAMES[0],0),a=o(HV_NAMES[1],1);function o(n,r){var a={},o=0,u={},c=0;if(each$1(n,(function(t){u[t]=e[t]})),each$1(n,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&c++})),i[r])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2!==c&&o){if(o>=2)return a;for(var h=0;h=0;o--)a=merge(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",i=e+"Id";return queryReferringComponents(this.ecModel,e,{index:this.get(n,!0),id:this.get(i,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Model);function getDependencies(e){var t=[];return each(ComponentModel.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=map(t,(function(e){return parseClassType(e).main})),"dataset"!==e&&indexOf(t,"dataset")<=0&&t.unshift("dataset"),t}mountExtend(ComponentModel,Model),enableClassManagement(ComponentModel,{registerWhenExtend:!0}),enableSubTypeDefaulter(ComponentModel),enableTopologicalTravel(ComponentModel,getDependencies);var platform="";"undefined"!=typeof navigator&&(platform=navigator.platform||"");var decalColor="rgba(0, 0, 0, 0.2)",globalDefault={darkMode:"auto",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:decalColor,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:decalColor,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:decalColor,dashArrayX:[1,0],dashArrayY:[4,3],dashLineOffset:0,rotation:-Math.PI/4},{color:decalColor,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:decalColor,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:decalColor,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:platform.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},VISUAL_DIMENSIONS=createHashMap(["tooltip","label","itemName","itemId","seriesName"]),SOURCE_FORMAT_ORIGINAL="original",SOURCE_FORMAT_ARRAY_ROWS="arrayRows",SOURCE_FORMAT_OBJECT_ROWS="objectRows",SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",SOURCE_FORMAT_TYPED_ARRAY="typedArray",SOURCE_FORMAT_UNKNOWN="unknown",SERIES_LAYOUT_BY_COLUMN="column",SERIES_LAYOUT_BY_ROW="row",BE_ORDINAL={Must:1,Might:2,Not:3},innerGlobalModel=makeInner();function resetSourceDefaulter(e){innerGlobalModel(e).datasetMap=createHashMap()}function inheritSourceMetaRawOption(e,t){var n=e?e.metaRawOption:null;return{seriesLayoutBy:retrieve2(t.seriesLayoutBy,n?n.seriesLayoutBy:null),sourceHeader:retrieve2(t.sourceHeader,e?e.startIndex:null),dimensions:retrieve2(t.dimensions,e?e.dimensionsDefine:null)}}function makeSeriesEncodeForAxisCoordSys(e,t,n){var i={},r=querySeriesUpstreamDatasetModel(t);if(!r||!e)return i;var a,o,s=[],l=[],u=t.ecModel,c=innerGlobalModel(u).datasetMap,h=r.uid+"_"+n.seriesLayoutBy;each(e=e.slice(),(function(t,n){var r=isObject(t)?t:e[n]={name:t};"ordinal"===r.type&&null==a&&(a=n,o=f(r)),i[r.name]=[]}));var p=c.get(h)||c.set(h,{categoryWayDim:o,valueWayDim:0});function d(e,t,n){for(var i=0;it)return e[i];return e[n-1]}function getFromPalette(e,t,n,i,r,a,o){var s=t(a=a||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=null!=o&&i?getNearestPalette(i,o):n;if((c=c||n)&&c.length){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}function clearPalette(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var OPTION_INNER_KEY="\0_ec_inner",GlobalModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(e,t,n,i,r,a){i=i||{},this.option=null,this._theme=new Model(i),this._locale=new Model(r),this._optionManager=a},t.prototype.setOption=function(e,t,n){assert(!(OPTION_INNER_KEY in e),"please use chart.getOption()");var i=normalizeSetOptionInput(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,normalizeSetOptionInput(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var r=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(r,t)):initBase(this,r),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var a=i.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||"recreate"===e||"media"===e){var o=i.getMediaOption(this);o.length&&each(o,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,r=this._componentsCount,a=[],o=createHashMap(),s=t&&t.replaceMergeMainTypeMap;resetSourceDefaulter(this),each(e,(function(e,t){null!=e&&(ComponentModel.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=null==n[t]?clone(e):merge(n[t],e,!0))})),s&&s.each((function(e,t){ComponentModel.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))})),ComponentModel.topologicalTravel(a,ComponentModel.getAllClassMainTypes(),(function(t){var a=concatInternalOptions(this,t,normalizeToArray(e[t])),o=i.get(t),l=o?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",u=mappingToExists(o,a,l);setComponentTypeToKeyInfo(u,t,ComponentModel),n[t]=null,i.set(t,null),r.set(t,0);var c=[],h=[],p=0;each(u,(function(e,n){var i=e.existing,r=e.newOption;if(r){var a=ComponentModel.getClass(t,e.keyInfo.subType,!0);if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var o=extend({componentIndex:n},e.keyInfo);extend(i=new a(r,this,this,o),o),e.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),h.push(i),p++):(c.push(void 0),h.push(void 0))}),this),n[t]=c,i.set(t,h),r.set(t,p),"series"===t&&reCreateSeriesIndices(this)}),this),this._seriesIndices||reCreateSeriesIndices(this)},t.prototype.getOption=function(){var e=clone(this.option);return each(e,(function(t,n){if(ComponentModel.hasClass(n)){for(var i=normalizeToArray(t),r=i.length,a=!1,o=r-1;o>=0;o--)i[o]&&!isComponentIdInternal(i[o])?a=!0:(i[o]=null,!a&&r--);i.length=r,e[n]=i}})),delete e[OPTION_INNER_KEY],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.getLocale=function(e){return this.getLocaleModel().get(e)},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t)for(var r=0;r=t:"max"===n?e<=t:e===t}function indicesEquals(e,t){return e.join(",")===t.join(",")}var each$2=each,isObject$1=isObject,POSSIBLE_STYLES=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function compatEC2ItemStyle(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=POSSIBLE_STYLES.length;n=0;f--){var g=e[f];if(s||(h=g.data.rawIndexOf(g.stackedByDimension,c)),h>=0){var m=g.data.getByRawIndex(g.stackResultDimension,h);if(p>=0&&m>0||p<=0&&m<0){p+=m,d=m;break}}}return i[0]=p,i[1]=d,i}));o.hostModel.setData(l),t.data=l}))}var _a,_b,_c,providerMethods,mountMethods,SourceImpl=function(e){this.data=e.data||(e.sourceFormat===SOURCE_FORMAT_KEYED_COLUMNS?{}:[]),this.sourceFormat=e.sourceFormat||SOURCE_FORMAT_UNKNOWN,this.seriesLayoutBy=e.seriesLayoutBy||SERIES_LAYOUT_BY_COLUMN,this.startIndex=e.startIndex||0,this.dimensionsDefine=e.dimensionsDefine,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.encodeDefine=e.encodeDefine,this.metaRawOption=e.metaRawOption};function isSourceInstance(e){return e instanceof SourceImpl}function createSource(e,t,n,i){n=n||detectSourceFormat(e);var r=t.seriesLayoutBy,a=determineSourceDimensions(e,n,r,t.sourceHeader,t.dimensions);return new SourceImpl({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(i),metaRawOption:clone(t)})}function createSourceFromSeriesDataOption(e){return new SourceImpl({data:e,sourceFormat:isTypedArray(e)?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL})}function cloneSourceShallow(e){return new SourceImpl({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:clone(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount,encodeDefine:makeEncodeDefine(e.encodeDefine)})}function makeEncodeDefine(e){return e?createHashMap(e):null}function detectSourceFormat(e){var t=SOURCE_FORMAT_UNKNOWN;if(isTypedArray(e))t=SOURCE_FORMAT_TYPED_ARRAY;else if(isArray(e)){0===e.length&&(t=SOURCE_FORMAT_ARRAY_ROWS);for(var n=0,i=e.length;nu&&(u=d)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(e){for(var t=0;t=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=this._doReset(i)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(a||p1&&i>0?s:o}};return a;function o(){return t=e?null:at},gte:function(e,t){return e>=t}},FilterOrderComparator=function(){function e(e,t){if("number"!=typeof t){var n="";0,throwError(n)}this._opFn=ORDER_COMPARISON_OP_MAP[e],this._rvalFloat=numericToNumber(t)}return e.prototype.evaluate=function(e){return"number"==typeof e?this._opFn(e,this._rvalFloat):this._opFn(numericToNumber(e),this._rvalFloat)},e}(),SortOrderComparator=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=typeof e,i=typeof t,r="number"===n?e:numericToNumber(e),a="number"===i?t:numericToNumber(t),o=isNaN(r),s=isNaN(a);if(o&&(r=this._incomparable),s&&(a=this._incomparable),o&&s){var l="string"===n,u="string"===i;l&&(r=u?e:0),u&&(a=l?t:0)}return ra?-this._resultLT:0},e}(),FilterEqualityComparator=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=numericToNumber(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=numericToNumber(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function createFilterComparator(e,t){return"eq"===e||"ne"===e?new FilterEqualityComparator("eq"===e,t):hasOwn(ORDER_COMPARISON_OP_MAP,e)?new FilterOrderComparator(e,t):null}var ExternalSource=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return parseDataValue(e,t)},e}();function createExternalSource(e,t){var n=new ExternalSource,i=e.data,r=n.sourceFormat=e.sourceFormat,a=e.startIndex,o=[],s={},l=e.dimensionsDefine;if(l)each(l,(function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};if(o.push(i),null!=n){var r="";hasOwn(s,n)&&throwError(r),s[n]=i}}));else for(var u=0;u9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&this._createSource()},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(isSeries(n)){var a=n,o=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),o=(l=u.getSource()).data,s=l.sourceFormat,t=[u._getVersionSign()]}else s=isTypedArray(o=a.get("data",!0))?SOURCE_FORMAT_TYPED_ARRAY:SOURCE_FORMAT_ORIGINAL,t=[];e=[createSource(o,inheritSourceMetaRawOption(l,this._getSourceMetaRawOption()),s,a.get("encode",!0))]}else{var c=n;if(r){var h=this._applyTransform(i);e=h.sourceList,t=h.upstreamSignList}else{e=[createSource(c.get("source",!0),this._getSourceMetaRawOption(),null,null)],t=[]}}this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var a="";1!==e.length&&doThrow(a)}var o=[],s=[];return each(e,(function(e){e.prepareSource();var t=e.getSource(r||0),n="";null==r||t||doThrow(n),o.push(t),s.push(e._getVersionSign())})),i?t=applyDataTransform(i,o,{datasetIndex:n.componentIndex}):null!=r&&(t=[cloneSourceShallow(o[0])]),{sourceList:t,upstreamSignList:s}},e.prototype._isDirty=function(){if(!this._sourceList.length)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!e.noHeader,i=0;each(e.blocks,(function(e){getBuilder(e).planLayout(e);var t=e.__gapLevelBetweenSubBlocks;t>=i&&(i=t+(!n||t&&("section"!==e.type||e.noHeader)?0:1))})),e.__gapLevelBetweenSubBlocks=i},build:function(e,t,n){var i=t.noHeader,r=getGap(t),a=buildSubBlocks(e,t,i?n:r.html);if(i)return a;var o=makeValueReadable(t.header,"ordinal",e.useUTC);return"richText"===e.renderMode?wrapInlineNameRichText(e,o)+r.richText+a:wrapBlockHTML('
'+encodeHTML(o)+"
"+a,n)}},nameValue:{planLayout:function(e){e.__gapLevelBetweenSubBlocks=0},build:function(e,t,n){var i=e.renderMode,r=t.noName,a=t.noValue,o=!t.markerType,s=t.name,l=t.value,u=e.useUTC;if(!r||!a){var c=o?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",i),h=r?"":makeValueReadable(s,"ordinal",u),p=t.valueType,d=a?[]:isArray(l)?map(l,(function(e,t){return makeValueReadable(e,isArray(p)?p[t]:p,u)})):[makeValueReadable(l,isArray(p)?p[0]:p,u)],f=!o||!r,g=!o&&r;return"richText"===i?(o?"":c)+(r?"":wrapInlineNameRichText(e,h))+(a?"":wrapInlineValueRichText(e,d,f,g)):wrapBlockHTML((o?"":c)+(r?"":wrapInlineNameHTML(h,!o))+(a?"":wrapInlineValueHTML(d,f,g)),n)}}}};function buildSubBlocks(e,t,n){var i=[],r=t.blocks||[];assert(!r||isArray(r)),r=r||[];var a=e.orderMode;if(t.sortBlocks&&a){r=r.slice();var o={valueAsc:"asc",valueDesc:"desc"};if(hasOwn(o,a)){var s=new SortOrderComparator(o[a],null);r.sort((function(e,t){return s.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===a&&r.reverse()}var l=getGap(t);if(each(r,(function(t,n){var r=getBuilder(t).build(e,t,n>0?l.html:0);null!=r&&i.push(r)})),i.length)return"richText"===e.renderMode?i.join(l.richText):wrapBlockHTML(i.join(""),n)}function buildTooltipMarkup(e,t,n,i,r){if(e){var a=getBuilder(e);a.planLayout(e);var o={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t};return a.build(o,e,0)}}function getGap(e){var t=e.__gapLevelBetweenSubBlocks;return{html:HTML_GAPS[t],richText:RICH_TEXT_GAPS[t]}}function wrapBlockHTML(e,t){return'
'+e+'
'}function wrapInlineNameHTML(e,t){return''+encodeHTML(e)+""}function wrapInlineValueHTML(e,t,n){return''+map(e,(function(e){return encodeHTML(e)})).join("  ")+""}function wrapInlineNameRichText(e,t){return e.markupStyleCreator.wrapRichTextStyle(t,TOOLTIP_TEXT_STYLE_RICH)}function wrapInlineValueRichText(e,t,n,i){var r=[TOOLTIP_VALUE_TEXT_STYLE_RICH],a=i?10:20;return n&&r.push({padding:[0,0,0,a],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(t.join(" "),r)}function retrieveVisualColorForTooltipMarker(e,t){return convertToColorString(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function getPaddingFromTooltipModel(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var TooltipMarkupStyleCreator=function(){function e(){this.richTextStyles={},this._nextStyleNameId=getRandomIdBase()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i="richText"===n?this._generateStyleName():null,r=getTooltipMarker({color:t,type:e,renderMode:n,markerId:i});return isString(r)?r:(this.richTextStyles[i]=r.style,r.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};isArray(t)?each(t,(function(e){return extend(n,e)})):extend(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}();function defaultSeriesFormatTooltip(e){var t,n,i,r,a=e.series,o=e.dataIndex,s=e.multipleSeries,l=a.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=a.getRawValue(o),p=isArray(h),d=retrieveVisualColorForTooltipMarker(a,o);if(c>1||p&&!c){var f=formatTooltipArrayValue(h,a,o,u,d);t=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);r=t=retrieveRawValue(l,o,u[0]),n=g.type}else r=t=p?h[0]:h;var m=isNameSpecified(a),y=m&&a.name||"",v=l.getName(o),_=s?y:v;return createTooltipMarkup("section",{header:y,noHeader:s||!m,sortParam:r,blocks:[createTooltipMarkup("nameValue",{markerType:"item",markerColor:d,name:_,noName:!trim(_),value:t,valueType:n})].concat(i||[])})}function formatTooltipArrayValue(e,t,n,i,r){var a=t.getData(),o=reduce(e,(function(e,t,n){var i=a.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function c(e,t){var n=a.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(o?u.push(createTooltipMarkup("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?each(i,(function(e){c(retrieveRawValue(a,n,e),e)})):each(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}var inner$1=makeInner();function getSelectionKey(e,t){return e.getName(t)||e.getId(t)}var SeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return __extends(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=createTask({count:dataTaskCount,reset:dataTaskReset}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(inner$1(this).sourceManager=new SourceManager(this)).prepareSource();var i=this.getInitialData(e,n);wrapData(i,this),this.dataTask.context.data=i,inner$1(this).dataBeforeProcessed=i,autoSeriesName(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=fetchLayoutMode(this),i=n?getLayoutParams(e):{},r=this.subType;ComponentModel.hasClass(r)&&(r+="Series"),merge(e,t.getTheme().get(this.subType)),merge(e,this.getDefaultOption()),defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&mergeLayoutParam(e,i,n)},t.prototype.mergeOption=function(e,t){e=merge(this.option,e,!0),this.fillDataTextStyle(e.data);var n=fetchLayoutMode(this);n&&mergeLayoutParam(this.option,e,n);var i=inner$1(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);wrapData(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,inner$1(this).dataBeforeProcessed=r,autoSeriesName(this),this._initSelectedMapFromData(r)},t.prototype.fillDataTextStyle=function(e){if(e&&!isTypedArray(e))for(var t=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,r=PaletteMixin.prototype.getColorFromPalette.call(this,e,t,n);return r||(r=i.getColorFromPalette(e,t,n)),r},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n)for(var i=this.getData(t),r=0;r=0&&n.push(r)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;return n&&n[getSelectionKey(this.getData(t),e)]||!1},t.prototype._innerSelect=function(e,t){var n,i,r=this.option.selectedMode,a=t.length;if(r&&a)if("multiple"===r)for(var o=this.option.selectedMap||(this.option.selectedMap={}),s=0;s0&&this._innerSelect(e,t)}},t.registerClass=function(e){return ComponentModel.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.useColorPaletteOnData=!1,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(ComponentModel);function autoSeriesName(e){var t=e.name;isNameSpecified(e)||(e.name=getSeriesAutoName(e)||t)}function getSeriesAutoName(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),i=[];return each(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)})),i.join(" ")}function dataTaskCount(e){return e.model.getRawData().count()}function dataTaskReset(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),dataTaskProgress}function dataTaskProgress(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function wrapData(e,t){each(__spreadArrays(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,curry(onDataChange,t))}))}function onDataChange(e,t){var n=getCurrentTask(e);return n&&n.setOutputEnd((t||this).count()),t}function getCurrentTask(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(e.uid))}return i}}mixin(SeriesModel,DataFormatMixin),mixin(SeriesModel,PaletteMixin),mountExtend(SeriesModel,ComponentModel);var ComponentView=function(){function e(){this.group=new Group,this.uid=getUID("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.blurSeries=function(e,t){},e}();function createRenderPlanner(){var e=makeInner();return function(t){var n=e(t),i=t.pipelineContext,r=!!n.large,a=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===o&&a===s)&&"reset"}}enableClassExtend(ComponentView),enableClassManagement(ComponentView,{registerWhenExtend:!0});var inner$2=makeInner(),renderPlanner=createRenderPlanner(),ChartView=function(){function e(){this.group=new Group,this.uid=getUID("viewChart"),this.renderTask=createTask({plan:renderTaskPlan,reset:renderTaskReset}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.highlight=function(e,t,n,i){toggleHighlight(e.getData(),i,"emphasis")},e.prototype.downplay=function(e,t,n,i){toggleHighlight(e.getData(),i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.markUpdateMethod=function(e,t){inner$2(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function elSetState(e,t,n){e&&("emphasis"===t?enterEmphasis:leaveEmphasis)(e,n)}function toggleHighlight(e,t,n){var i=queryDataIndex(e,t),r=t&&null!=t.highlightKey?getHighlightDigit(t.highlightKey):null;null!=i?each(normalizeToArray(i),(function(t){elSetState(e.getItemGraphicEl(t),n,r)})):e.eachItemGraphicEl((function(e){elSetState(e,n,r)}))}function renderTaskPlan(e){return renderPlanner(e.model)}function renderTaskReset(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=r&&inner$2(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,n,i,r),progressMethodMap[l]}enableClassExtend(ChartView,["dispose"]),enableClassManagement(ChartView,{registerWhenExtend:!0});var progressMethodMap={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},ORIGIN_METHOD="\0__throttleOriginMethod",RATE="\0__throttleRate",THROTTLE_TYPE="\0__throttleType";function throttle(e,t,n){var i,r,a,o,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,e.apply(a,o||[])}t=t||0;var p=function(){for(var e=[],p=0;p=0?h():c=setTimeout(h,-r),l=i};return p.clear=function(){c&&(clearTimeout(c),c=null)},p.debounceNextCall=function(e){s=e},p}function createOrUpdate(e,t,n,i){var r=e[t];if(r){var a=r[ORIGIN_METHOD]||r,o=r[THROTTLE_TYPE];if(r[RATE]!==n||o!==i){if(null==n||!i)return e[t]=a;(r=e[t]=throttle(a,n,"debounce"===i))[ORIGIN_METHOD]=a,r[THROTTLE_TYPE]=i,r[RATE]=n}return r}}function clear(e,t){var n=e[t];n&&n[ORIGIN_METHOD]&&(e[t]=n[ORIGIN_METHOD])}var inner$3=makeInner(),defaultStyleMappers={itemStyle:makeStyleMapper(ITEM_STYLE_KEY_MAP,!0),lineStyle:makeStyleMapper(LINE_STYLE_KEY_MAP,!0)},defaultColorKey={lineStyle:"stroke",itemStyle:"fill"};function getStyleMapper(e,t){var n=e.visualStyleMapper||defaultStyleMappers[t];return n||(console.warn("Unkown style type '"+t+"'."),defaultStyleMappers.itemStyle)}function getDefaultColorKey(e,t){var n=e.visualDrawType||defaultColorKey[t];return n||(console.warn("Unkown style type '"+t+"'."),"fill")}var seriesStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),a=getStyleMapper(e,i)(r),o=r.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=getDefaultColorKey(e,i),l=a[s],u=isFunction(l)?l:null;if(a[s]&&!u||(a[s]=e.getColorFromPalette(e.name,null,t.getSeriesCount()),n.setVisual("colorFromPalette",!0)),n.setVisual("style",a),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),r=extend({},a);r[s]=u(i),t.setItemVisual(n,"style",r)}}}},sharedModel=new Model,dataStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=getStyleMapper(e,i),a=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){sharedModel.option=n[i];var o=r(sharedModel);extend(e.ensureUniqueItemVisual(t,"style"),o),sharedModel.option.decal&&(e.setItemVisual(t,"decal",sharedModel.option.decal),sharedModel.option.decal.dirty=!0),a in o&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},dataColorPaletteTask={performRawSeries:!0,overallReset:function(e){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$3(e).scope=n}})),e.eachSeries((function(t){if(t.useColorPaletteOnData&&!e.isSeriesFiltered(t)){var n=t.getRawData(),i={},r=t.getData(),a=inner$3(t).scope,o=t.visualStyleAccessPath||"itemStyle",s=getDefaultColorKey(t,o);r.each((function(e){var t=r.getRawIndex(e);i[t]=e})),n.each((function(e){var o=i[e];if(r.getItemVisual(o,"colorFromPalette")){var l=r.ensureUniqueItemVisual(o,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,a,c)}}))}}))}},PI$5=Math.PI;function defaultLoading(e,t){defaults(t=t||{},{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Group,i=new Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(i);var r,a=t.fontSize+" sans-serif",o=new Rect({style:{fill:"none"},textContent:new ZRText({style:{text:t.text,fill:t.textColor,font:a}}),textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(o),t.showSpinner&&((r=new Arc({shape:{startAngle:-PI$5/2,endAngle:-PI$5/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*PI$5/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*PI$5/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=getWidth(t.text,a),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner?0:n/2),u=e.getHeight()/2;t.showSpinner&&r.setShape({cx:l,cy:u}),o.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var Scheduler=function(){function e(e,t,n,i){this._stageTaskMap=createHashMap(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,r=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=i&&i.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),r=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,a=e.get("large")&&i>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:r,modDataCount:o,large:a}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=createHashMap();e.eachSeries((function(e){var i=e.getProgressive(),r=e.uid;n.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;each(this._allHandlers,(function(i){var r=e.get(i.uid)||e.set(i.uid,{}),a="";assert(!(i.reset&&i.overallReset),a),i.reset&&this._createSeriesStageTask(i,r,t,n),i.overallReset&&this._createOverallStageTask(i,r,t,n)}),this)},e.prototype.prepareView=function(e,t,n,i){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=n,a.api=i,r.__block=!e.incrementalPrepareRender,this._pipe(t,r)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var r=!1,a=this;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}each(e,(function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=a._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,p=c.agentStubMap;p.each((function(e){o(i,e)&&(e.dirty(),h=!0)})),h&&c.dirty(),a.updatePayload(c,n);var d=a.getPerformArgs(c,i.block);p.each((function(e){e.perform(d)})),c.perform(d)&&(r=!0)}else u&&u.each((function(s,l){o(i,s)&&s.dirty();var u=a.getPerformArgs(s,i.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var r=this,a=t.seriesTaskMap,o=t.seriesTaskMap=createHashMap(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=o.set(s,a&&a.get(s)||createTask({plan:seriesTaskPlan,reset:seriesTaskReset,count:seriesTaskCount}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:r},r._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},e.prototype._createOverallStageTask=function(e,t,n,i){var r=this,a=t.overallTask=t.overallTask||createTask({reset:overallTaskReset});a.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var o=a.agentStubMap,s=a.agentStubMap=createHashMap(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1,p="";function d(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(h=!0,createTask({reset:stubReset,onDirty:stubOnDirty})));n.context={model:e,overallProgress:c},n.agent=a,n.__block=c,r._pipe(e,n)}assert(!e.createOnAllSeries,p),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,each(n.getSeries(),d)),h&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return isFunction(e)&&(e={overallReset:e,seriesType:detectSeriseType(e)}),e.uid=getUID("stageHandler"),t&&(e.visualType=t),e},e}();function overallTaskReset(e){e.overallReset(e.ecModel,e.api,e.payload)}function stubReset(e){return e.overallProgress&&stubProgress}function stubProgress(){this.agent.dirty(),this.getDownstream().dirty()}function stubOnDirty(){this.agent&&this.agent.dirty()}function seriesTaskPlan(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function seriesTaskReset(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=normalizeToArray(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?map(t,(function(e,t){return makeSeriesTaskProgress(t)})):singleSeriesTaskProgress}var singleSeriesTaskProgress=makeSeriesTaskProgress(0);function makeSeriesTaskProgress(e){return function(t,n){var i=n.data,r=n.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(r)&&(n[r]=e,s=!0),s||(i[r]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,a,"mainType")&&u(s,a,"subType")&&u(s,a,"index","componentIndex")&&u(s,a,"name")&&u(s,a,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,r));function u(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),seriesSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendSymbol&&n.setVisual("legendSymbol",e.legendSymbol),e.hasSymbolVisual){var i=e.get("symbol"),r=e.get("symbolSize"),a=e.get("symbolKeepAspect"),o=e.get("symbolRotate"),s=isFunction(i),l=isFunction(r),u=isFunction(o),c=s||l||u,h=!s&&i?i:e.defaultSymbol,p=l?null:r,d=u?null:o;if(n.setVisual({legendSymbol:e.legendSymbol||h,symbol:h,symbolSize:p,symbolKeepAspect:a,symbolRotate:d}),!t.isSeriesFiltered(e))return{dataEach:c?function(t,n){var a=e.getRawValue(n),c=e.getDataParams(n);s&&t.setItemVisual(n,"symbol",i(a,c)),l&&t.setItemVisual(n,"symbolSize",r(a,c)),u&&t.setItemVisual(n,"symbolRotate",o(a,c))}:null}}}},dataSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){var n=e.getItemModel(t),i=n.getShallow("symbol",!0),r=n.getShallow("symbolSize",!0),a=n.getShallow("symbolRotate",!0),o=n.getShallow("symbolKeepAspect",!0);null!=i&&e.setItemVisual(t,"symbol",i),null!=r&&e.setItemVisual(t,"symbolSize",r),null!=a&&e.setItemVisual(t,"symbolRotate",a),null!=o&&e.setItemVisual(t,"symbolKeepAspect",o)}:null}}};function getItemVisualFromData(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:0}}function getVisualFromData(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:0}}function setItemVisualFromData(e,t,n,i){switch(n){case"color":e.ensureUniqueItemVisual(t,"style")[e.getVisual("drawType")]=i,e.setItemVisual(t,"colorFromPalette",!1);break;case"opacity":e.ensureUniqueItemVisual(t,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":e.setItemVisual(t,n,i);break;default:0}}var PI2$7=2*Math.PI,CMD$4=PathProxy.CMD,DEFAULT_SEARCH_SPACE=["top","right","bottom","left"];function getCandidateAnchor(e,t,n,i,r){var a=n.width,o=n.height;switch(e){case"top":i.set(n.x+a/2,n.y-t),r.set(0,-1);break;case"bottom":i.set(n.x+a/2,n.y+o+t),r.set(0,1);break;case"left":i.set(n.x-t,n.y+o/2),r.set(-1,0);break;case"right":i.set(n.x+a+t,n.y+o/2),r.set(1,0)}}function projectPointToArc(e,t,n,i,r,a,o,s,l){o-=e,s-=t;var u=Math.sqrt(o*o+s*s),c=(o/=u)*n+e,h=(s/=u)*n+t;if(Math.abs(i-r)%PI2$7<1e-4)return l[0]=c,l[1]=h,u-n;if(a){var p=i;i=normalizeRadian(r),r=normalizeRadian(p)}else i=normalizeRadian(i),r=normalizeRadian(r);i>r&&(r+=PI2$7);var d=Math.atan2(s,o);if(d<0&&(d+=PI2$7),d>=i&&d<=r||d+PI2$7>=i&&d+PI2$7<=r)return l[0]=c,l[1]=h,u-n;var f=n*Math.cos(i)+e,g=n*Math.sin(i)+t,m=n*Math.cos(r)+e,y=n*Math.sin(r)+t,v=(f-o)*(f-o)+(g-s)*(g-s),_=(m-o)*(m-o)+(y-s)*(y-s);return v<_?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=m,l[1]=y,Math.sqrt(_))}function projectPointToLine(e,t,n,i,r,a,o,s){var l=r-e,u=a-t,c=n-e,h=i-t,p=Math.sqrt(c*c+h*h),d=(l*(c/=p)+u*(h/=p))/p;s&&(d=Math.min(Math.max(d,0),1)),d*=p;var f=o[0]=e+d*c,g=o[1]=t+d*h;return Math.sqrt((f-r)*(f-r)+(g-a)*(g-a))}function projectPointToRect(e,t,n,i,r,a,o){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i);var s=e+n,l=t+i,u=o[0]=Math.min(Math.max(r,e),s),c=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-r)*(u-r)+(c-a)*(c-a))}var tmpPt=[];function nearestPointOnRect(e,t,n){var i=projectPointToRect(t.x,t.y,t.width,t.height,e.x,e.y,tmpPt);return n.set(tmpPt[0],tmpPt[1]),i}function nearestPointOnPath(e,t,n){for(var i,r,a=0,o=0,s=0,l=0,u=1/0,c=t.data,h=e.x,p=e.y,d=0;d0){t=t/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt0,pt1),Point.sub(dir2,pt2,pt1);var n=dir.len(),i=dir2.len();if(!(n<.001||i<.001)){dir.scale(1/n),dir2.scale(1/i);var r=dir.dot(dir2);if(Math.cos(t)1&&Point.copy(tmpProjPoint,pt2),tmpProjPoint.toArray(e[1])}}}}function limitSurfaceAngle(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,pt0.fromArray(e[0]),pt1.fromArray(e[1]),pt2.fromArray(e[2]),Point.sub(dir,pt1,pt0),Point.sub(dir2,pt2,pt1);var i=dir.len(),r=dir2.len();if(!(i<.001||r<.001))if(dir.scale(1/i),dir2.scale(1/r),dir.dot(t)=o)Point.copy(tmpProjPoint,pt2);else{tmpProjPoint.scaleAndAdd(dir2,a/Math.tan(Math.PI/2-s));var l=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(l))return;l<0?Point.copy(tmpProjPoint,pt1):l>1&&Point.copy(tmpProjPoint,pt2)}tmpProjPoint.toArray(e[1])}}}function setLabelLineState(e,t,n,i){var r="normal"===n,a=r?e:e.ensureState(n);a.ignore=t;var o=i.get("smooth");o&&!0===o&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();r?e.useStyle(s):a.style=s}function buildLabelLinePath(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=dist(i[0],i[1]),a=dist(i[1],i[2]);if(!r||!a)return e.lineTo(i[1][0],i[1][1]),void e.lineTo(i[2][0],i[2][1]);var o=Math.min(r,a)*n,s=lerp([],i[1],i[0],o/r),l=lerp([],i[1],i[2],o/a),u=lerp([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&a&&x(-c/o,0,o);var f,g,m=e[0],y=e[o-1];return v(),f<0&&S(-f,.8),g<0&&S(g,.8),v(),_(f,g,1),_(g,f,-1),v(),f<0&&b(-f),g<0&&b(g),u}function v(){f=m.rect[t]-i,g=r-y.rect[t]-y.rect[n]}function _(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){x(i*n,0,o);var r=i+e;r<0&&S(-r*n,1)}else S(-e*n,1)}}function x(n,i,r){0!==n&&(u=!0);for(var a=i;a0)for(l=0;l0;l--){x(-(a[l-1]*h),l,o)}}}function b(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),i=0;i0?x(n,0,i+1):x(-n,o-i-1,o),(e-=n)<=0)return}}function shiftLayoutOnX(e,t,n,i){return shiftLayout(e,"x","width",t,n,i)}function shiftLayoutOnY(e,t,n,i){return shiftLayout(e,"y","height",t,n,i)}function hideOverlap(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new BoundingRect(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var r=0;r=0&&n.attr(d.oldLayoutSelect),indexOf(u,"emphasis")>=0&&n.attr(d.oldLayoutEmphasis)),updateProps(n,s,t,o)}else if(n.attr(s),!labelInner(n).valueAnimation){var c=retrieve2(n.style.opacity,1);n.style.opacity=0,initProps(n,{style:{opacity:c}},t,o)}if(d.oldLayout=s,n.states.select){var h=d.oldLayoutSelect={};extendWithKeys(h,s,LABEL_LAYOUT_PROPS),extendWithKeys(h,n.states.select,LABEL_LAYOUT_PROPS)}if(n.states.emphasis){var p=d.oldLayoutEmphasis={};extendWithKeys(p,s,LABEL_LAYOUT_PROPS),extendWithKeys(p,n.states.emphasis,LABEL_LAYOUT_PROPS)}animateLabelValue(n,o,l,t)}if(i&&!i.ignore&&!i.invisible){r=(d=labelLineAnimationStore(i)).oldLayout;var d,f={points:i.shape.points};r?(i.attr({shape:r}),updateProps(i,{shape:f},t)):(i.setShape(f),i.style.strokePercent=0,initProps(i,{style:{strokePercent:1}},t)),d.oldLayout=f}},e}();function createLegacyDataSelectAction(e,t){function n(t,n){var i=[];return t.eachComponent({mainType:"series",subType:e,query:n},(function(e){i.push(e.seriesIndex)})),i}each([[e+"ToggleSelect","toggleSelect"],[e+"Select","select"],[e+"UnSelect","unselect"]],(function(e){t(e[0],(function(t,i,r){t=extend({},t),r.dispatchAction(extend(t,{type:e[1],seriesIndex:n(i,t)}))}))}))}function handleSeriesLegacySelectEvents(e,t,n,i,r){var a=e+t;n.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var t=e.seriesIndex,i=r.selected,o=0;o0?(t=t||1,"dashed"===e?[4*t,2*t]:"dotted"===e?[t]:isNumber(e)?[e]:isArray(e)?e:null):null}var pathProxyForDraw=new PathProxy(!0);function styleHasStroke(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function styleHasFill(e){var t=e.fill;return null!=t&&"none"!==t}function doFillPath(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function doStrokePath(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function createCanvasPattern(e,t,n){var i=createOrUpdateImage(t.image,t.__image,n);if(isImageReady(i)){var r=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix){var a=new DOMMatrix;a.rotateSelf(0,0,(t.rotation||0)/Math.PI*180),a.scaleSelf(t.scaleX||1,t.scaleY||1),a.translateSelf(t.x||0,t.y||0),r.setTransform(a)}return r}}function brushPath(e,t,n,i){var r=styleHasStroke(n),a=styleHasFill(n),o=n.strokePercent,s=o<1,l=!t.path;t.silent&&!s||!l||t.createPathProxy();var u=t.path||pathProxyForDraw;if(!i){var c=n.fill,h=n.stroke,p=a&&!!c.colorStops,d=r&&!!h.colorStops,f=a&&!!c.image,g=r&&!!h.image,m=void 0,y=void 0,v=void 0,_=void 0,x=void 0;(p||d)&&(x=t.getBoundingRect()),p&&(m=t.__dirty?getCanvasGradient(e,c,x):t.__canvasFillGradient,t.__canvasFillGradient=m),d&&(y=t.__dirty?getCanvasGradient(e,h,x):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),f&&(v=t.__dirty||!t.__canvasFillPattern?createCanvasPattern(e,c,t):t.__canvasFillPattern,t.__canvasFillPattern=v),g&&(_=t.__dirty||!t.__canvasStrokePattern?createCanvasPattern(e,h,t):t.__canvasStrokePattern,t.__canvasStrokePattern=v),p?e.fillStyle=m:f&&(v?e.fillStyle=v:a=!1),d?e.strokeStyle=y:g&&(_?e.strokeStyle=_:r=!1)}var S=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),b=n.lineDashOffset,T=!!e.setLineDash,M=t.getGlobalScale();if(u.setScale(M[0],M[1],t.segmentIgnoreThreshold),S){var A=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;A&&1!==A&&(S=map(S,(function(e){return e/A})),b/=A)}var I=!0;(l||t.__dirty&Path.SHAPE_CHANGED_BIT||S&&!T&&r)&&(u.setDPR(e.dpr),s?u.setContext(null):(u.setContext(e),I=!1),u.reset(),S&&!T&&(u.setLineDash(S),u.setLineDashOffset(b)),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),I&&u.rebuildPath(e,s?o:1),S&&T&&(e.setLineDash(S),e.lineDashOffset=b),i||(n.strokeFirst?(r&&doStrokePath(e,n),a&&doFillPath(e,n)):(a&&doFillPath(e,n),r&&doStrokePath(e,n))),S&&T&&e.setLineDash([])}function brushImage(e,t,n){var i=t.__image=createOrUpdateImage(n.image,t.__image,t,t.onload);if(i&&isImageReady(i)){var r=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(null==o&&null!=s?o=s*l:null==s&&null!=o?s=o/l:null==o&&null==s&&(o=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(i,u,c,n.sWidth,n.sHeight,r,a,o,s)}else if(n.sx&&n.sy){var h=o-(u=n.sx),p=s-(c=n.sy);e.drawImage(i,u,c,h,p,r,a,o,s)}else e.drawImage(i,r,a,o,s)}}function brushText(e,t,n){var i=n.text;if(null!=i&&(i+=""),i){e.font=n.font||DEFAULT_FONT,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var r=void 0;if(e.setLineDash){var a=n.lineDash&&n.lineWidth>0&&normalizeLineDash(n.lineDash,n.lineWidth),o=n.lineDashOffset;if(a){var s=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;s&&1!==s&&(a=map(a,(function(e){return e/s})),o/=s),e.setLineDash(a),e.lineDashOffset=o,r=!0}}n.strokeFirst?(styleHasStroke(n)&&e.strokeText(i,n.x,n.y),styleHasFill(n)&&e.fillText(i,n.x,n.y)):(styleHasFill(n)&&e.fillText(i,n.x,n.y),styleHasStroke(n)&&e.strokeText(i,n.x,n.y)),r&&e.setLineDash([])}}var SHADOW_NUMBER_PROPS=["shadowBlur","shadowOffsetX","shadowOffsetY"],STROKE_PROPS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function bindCommonProps(e,t,n,i,r){var a=!1;if(!i&&t===(n=n||{}))return!1;(i||t.opacity!==n.opacity)&&(a||(flushPathDrawn(e,r),a=!0),e.globalAlpha=null==t.opacity?DEFAULT_COMMON_STYLE.opacity:t.opacity),(i||t.blend!==n.blend)&&(a||(flushPathDrawn(e,r),a=!0),e.globalCompositeOperation=t.blend||DEFAULT_COMMON_STYLE.blend);for(var o=0;o=o)}}for(var c=this.__startIndex;c15)break}n.prevElClipPaths&&l.restore()};if(h)if(0===h.length)d=s.__endIndex;else for(var x=p.dpr,S=0;S0&&e>i[0]){for(s=0;se);s++);o=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var l=o.dom;l.nextSibling?a.insertBefore(t.dom,l.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.__painter=this}else logError("Layer of zlevel "+e+" is not valid")},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?EL_AFTER_INCREMENTAL_INC:0),this._needsManuallyCompositing),u.__builtin__||logError("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,t(r),a=u),s.__dirty&Element.REDARAW_BIT&&!s.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}t(r),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,each(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?merge(n[e],t,!0):n[e]=t;for(var i=0;i0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.setOption=function(e,t,n){if(this._disposed)disposedWarning(this.id);else{var i,r,a;if(isObject$2(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,a=t.transition,t=t.notMerge),this[IN_MAIN_PROCESS_KEY]=!0,!this._model||t){var o=new OptionManager(this._api),s=this._theme,l=this._model=new GlobalModel;l.scheduler=this._scheduler,l.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:r},optionPreprocessorFuncs),setTransitionOpt(this,a),n?(this[OPTION_UPDATED_KEY]={silent:i},this[IN_MAIN_PROCESS_KEY]=!1,this.getZr().wakeUp()):(prepare(this),updateMethods.update.call(this),this._zr.flush(),this[OPTION_UPDATED_KEY]=!1,this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i))}},t.prototype.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){if(env.canvasSupported)return(e=extend({},e||{})).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},t.prototype.getSvgDataURL=function(){if(env.svgSupported){var e=this._zr;return each(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,i=[],r=this;each$3(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return each$3(i,(function(e){e.group.ignore=!1})),a}disposedWarning(this.id)},t.prototype.getConnectedDataURL=function(e){if(this._disposed)disposedWarning(this.id);else if(env.canvasSupported){var t="svg"===e.type,n=this.group,i=Math.min,r=Math.max,a=1/0;if(connectedGroups[n]){var o=a,s=a,l=-1/0,u=-1/0,c=[],h=e&&e.pixelRatio||1;each(instances$1,(function(a,h){if(a.group===n){var p=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(clone(e)),d=a.getDom().getBoundingClientRect();o=i(d.left,o),s=i(d.top,s),l=r(d.right,l),u=r(d.bottom,u),c.push({dom:p,left:d.left,top:d.top})}}));var p=(l*=h)-(o*=h),d=(u*=h)-(s*=h),f=createCanvas(),g=init(f,{renderer:t?"svg":"canvas"});if(g.resize({width:p,height:d}),t){var m="";return each$3(c,(function(e){var t=e.left-o,n=e.top-s;m+=''+e.dom+""})),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new Rect({shape:{x:0,y:0,width:p,height:d},style:{fill:e.connectedBackgroundColor}})),each$3(c,(function(e){var t=new ZRImage({style:{x:e.left*h-o,y:e.top*h-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},t.prototype.convertToPixel=function(e,t){return doConvertPixel(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return doConvertPixel(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return each(parseFinder(this._model,e),(function(e,i){i.indexOf("Models")>=0&&each(e,(function(e){var r=e.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(t);else if("seriesModels"===i){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n=n||a.containPoint(t,e))}else 0}),this)}),this),!!n;disposedWarning(this.id)},t.prototype.getVisual=function(e,t){var n=parseFinder(this._model,e,{defaultMainType:"series"}),i=n.seriesModel;var r=i.getData(),a=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?r.indexOfRawIndex(n.dataIndex):null;return null!=a?getItemVisualFromData(r,a,t):getVisualFromData(r,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;each$3(MOUSE_EVENT_NAMES,(function(t){var n=function(n){var i,r=e.getModel(),a=n.target,o="globalout"===t;if(o?i={}:a&&findEventDispatcher(a,(function(e){var t=getECData(e);if(t&&null!=t.dataIndex){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return i=n&&n.getDataParams(t.dataIndex,t.dataType)||{},!0}if(t.eventData)return i=extend({},t.eventData),!0}),!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),c=u&&e["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,i.event=n,i.type=t,e._$eventProcessor.eventInfo={targetEl:a,packedEvent:i,model:u,view:c},e.trigger(t,i)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)})),each$3(eventActionMap,(function(t,n){e._messageCenter.on(n,(function(e){this.trigger(n,e)}),e)})),each$3(["selectchanged"],(function(t){e._messageCenter.on(t,(function(e){this.trigger(t,e)}),e)})),handleLegacySelectEvents(this._messageCenter,this,this._model)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?disposedWarning(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)disposedWarning(this.id);else{this._disposed=!0,setAttribute(this.getDom(),DOM_ATTRIBUTE_KEY,"");var e=this._api,t=this._model;each$3(this._componentsViews,(function(n){n.dispose(t,e)})),each$3(this._chartsViews,(function(n){n.dispose(t,e)})),this._zr.dispose(),delete instances$1[this.id]}},t.prototype.resize=function(e){if(this._disposed)disposedWarning(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[IN_MAIN_PROCESS_KEY]=!0,n&&prepare(this),updateMethods.update.call(this,{type:"resize",animation:{duration:0}}),this[IN_MAIN_PROCESS_KEY]=!1,flushPendingActions.call(this,i),triggerUpdatedEvent.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),loadingEffects[e]){var n=loadingEffects[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?disposedWarning(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=extend({},e);return t.type=eventActionMap[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)disposedWarning(this.id);else if(isObject$2(t)||(t={silent:!!t}),actions[e.type]&&this._model)if(this[IN_MAIN_PROCESS_KEY])this._pendingActions.push(e);else{var n=t.silent;doDispatchAction.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&env.browser.weChat&&this._throttledZrFlush(),flushPendingActions.call(this,n),triggerUpdatedEvent.call(this,n)}},t.prototype.updateLabelLayout=function(){var e=this._labelManager;e.updateLayoutConfig(this._api),e.layout(this._api),e.processLabelsOverall()},t.prototype.appendData=function(e){if(this._disposed)disposedWarning(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);0,n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){for(var t=[],n=e.currentStates,i=0;i0?{duration:a,delay:i.get("delay"),easing:i.get("easing")}:null;n.group.traverse((function(t){if(t.states&&t.states.emphasis){if(isElementRemoved(t))return;if(t instanceof Path&&savePathStates(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=o;var i=t.getTextContent(),a=t.getTextGuideLine();i&&(i.stateTransition=o),a&&(a.stateTransition=o)}t.__dirty&&e(t)}}))}prepare=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),prepareView(e,!0),prepareView(e,!1),t.plan()},prepareView=function(e,t){for(var n=e._model,i=e._scheduler,r=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,l=0;lt.get("hoverLayerThreshold")&&!env.node&&!env.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.group.traverse((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,r)},performPostUpdateFuncs=function(e,t){each$3(postUpdateFuncs,(function(n){n(e,t)}))},markStatusToUpdate=function(e){e[STATUS_NEEDS_UPDATE_KEY]=!0,e.getZr().wakeUp()},applyChangedStates=function(t){t[STATUS_NEEDS_UPDATE_KEY]&&(t.getZr().storage.traverse((function(t){isElementRemoved(t)||e(t)})),t[STATUS_NEEDS_UPDATE_KEY]=!1)},createExtensionAPI=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){enterEmphasis(t,n),markStatusToUpdate(e)},n.prototype.leaveEmphasis=function(t,n){leaveEmphasis(t,n),markStatusToUpdate(e)},n.prototype.enterBlur=function(t){enterBlur(t),markStatusToUpdate(e)},n.prototype.leaveBlur=function(t){leaveBlur(t),markStatusToUpdate(e)},n.prototype.enterSelect=function(t){enterSelect(t),markStatusToUpdate(e)},n.prototype.leaveSelect=function(t){leaveSelect(t),markStatusToUpdate(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(ExtensionAPI))(e)},enableConnect=function(e){function t(e,t){for(var n=0;n1){var u=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(u,a)}else 1===l?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(r,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},r=[],a=[];this._initIndexMap(e,n,r,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),i[s]=null;else if(c>1)for(var p=0;p1)for(var o=0;oy[1]&&(y[1]=m)}t&&(this._nameList[d]=t[f],this._dontMakeIdFromName||makeIdFromName(this,d))}this._rawCount=this._count=s,this._extent={},prepareInvertedIndex(this)},e.prototype._initDataFromProvider=function(e,t,n){if(!(e>=t)){for(var i=this._rawData,r=this._storage,a=this.dimensions,o=a.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,c=this._rawExtent,h=i.getSource().sourceFormat===SOURCE_FORMAT_ORIGINAL,p=0;pS[1]&&(S[1]=x)}if(h&&!i.pure&&m){var b=m.name;null==l[y]&&null!=b&&(l[y]=convertOptionIdName(b,null));var T=m.id;null==u[y]&&null!=T&&(u[y]=convertOptionIdName(T,null))}this._dontMakeIdFromName||makeIdFromName(this,y)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent={},prepareInvertedIndex(this)}},e.prototype.count=function(){return this._count},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var r=0;r=0&&t=0&&t=0&&to&&(o=l)}return i=[a,o],this._extent[e]=i,i},e.prototype.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){isObject$3(e)?extend(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getSum=function(e){var t=0;if(this._storage[e])for(var n=0,i=this.count();n=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&ne))return a;r=a-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._storage[e],r=[];if(!i)return r;null==n&&(n=1/0);for(var a=1/0,o=-1,s=0,l=0,u=this.count();l=0&&o<0)&&(a=h,o=c,s=0),c===o&&(r[s++]=l))}return r.length=s,r},e.prototype.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],n=0;n=h&&S<=p||isNaN(S))&&(s[l++]=g),g++}f=!0}else if(2===a){m=d[c[0]];var v=d[c[1]],_=e[i[1]][0],x=e[i[1]][1];for(y=0;y=h&&S<=p||isNaN(S))&&(b>=_&&b<=x||isNaN(b))&&(s[l++]=g),g++}f=!0}}if(!f)if(1===a)for(y=0;y=h&&S<=p||isNaN(S))&&(s[l++]=T)}else for(y=0;ye[I][1])&&(M=!1)}M&&(s[l++]=this.getRawIndex(y))}return lx[1]&&(x[1]=_)}}}return o},e.prototype.downSample=function(e,t,n,i){for(var r=cloneListForMapAndSample(this,[e]),a=r._storage,o=[],s=mathFloor(1/t),l=a[e],u=this.count(),c=r._rawExtent[e],h=new(getIndicesCtor(this))(u),p=0,d=0;du-d&&(s=u-d,o.length=s);for(var f=0;fc[1]&&(c[1]=m),h[p++]=y}return r._count=p,r._indices=h,r.getRawIndex=getRawIndexWithIndices,r},e.prototype.lttbDownSample=function(e,t){var n,i,r,a=cloneListForMapAndSample(this,[]),o=a._storage[e],s=this.count(),l=new(getIndicesCtor(this))(s),u=0,c=mathFloor(1/t),h=this.getRawIndex(0);l[u++]=h;for(var p=1;pn&&(n=i,r=T)}l[u++]=r,h=r}return l[u++]=this.getRawIndex(s-1),a._count=u,a._indices=l,a.getRawIndex=getRawIndexWithIndices,a},e.prototype.getItemModel=function(e){var t=this.hostModel,n=this.getRawDataItem(e);return new Model(n,t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new DataDiffer(e?e.getIndices():[],this.getIndices(),(function(t){return getId(e,t)}),(function(e){return getId(t,e)}))},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},isObject$3(e)?extend(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],i=n&&n[t];return null==i?this.getVisual(t):i},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var r=i[t];return null==r&&(isArray(r=this.getVisual(t))?r=r.slice():isObject$3(r)&&(r=extend({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,isObject$3(t)?extend(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){if(isObject$3(e))for(var n in e)e.hasOwnProperty(n)&&this.setLayout(n,e[n]);else this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?extend(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel;if(t){var i=getECData(t);i.dataIndex=e,i.dataType=this.dataType,i.seriesIndex=n&&n.seriesIndex,"group"===t.type&&t.traverse(setItemDataAndSeriesIndex,t)}this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){each(this._graphicEls,(function(n,i){n&&e&&e.call(t,n,i)}))},e.prototype.cloneShallow=function(t){t||(t=new e(map$1(this.dimensions,this.getDimensionInfo,this),this.hostModel));if(t._storage=this._storage,t._storageArr=this._storageArr,transferProperties(t,this),this._indices){var n=this._indices.constructor;if(n===Array){var i=this._indices.length;t._indices=new n(i);for(var r=0;r65535?CtorUint32Array:CtorUint16Array},prepareStorage=function(e,t,n,i){var r=dataCtors[t.type],a=t.name;if(i){var o=e[a],s=o&&o.length;if(s!==n){for(var l=new r(n),u=0;u=0?this._indices[e]:-1},getId=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=getIdNameFromStore(e,e._idDimIdx,e._idOrdinalMeta,t)),null==n&&(n=ID_PREFIX+t),n},normalizeDimensions=function(e){return isArray(e)||(e=null!=e?[e]:[]),e},validateDimensions=function(e,t){for(var n=0;n=0?(s[h]=(a=l[h],o=void 0,(o=a.constructor)===Array?a.slice():new o(a)),r._rawExtent[h]=getInitialExtent(),r._extent[h]=null):s[h]=l[h],u.push(s[h]))}return r},getInitialExtent=function(){return[1/0,-1/0]},setItemDataAndSeriesIndex=function(e){var t=getECData(e),n=getECData(this);t.seriesIndex=n.seriesIndex,t.dataIndex=n.dataIndex,t.dataType=n.dataType},transferProperties=function(e,t){each(TRANSFERABLE_PROPERTIES.concat(t.__wrappedMethods||[]),(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e.__wrappedMethods=t.__wrappedMethods,each(CLONE_PROPERTIES,(function(n){e[n]=clone(t[n])})),e._calculationInfo=extend({},t._calculationInfo)},makeIdFromName=function(e,t){var n=e._nameList,i=e._idList,r=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=i[t];if(null==o&&null!=r&&(n[t]=o=getIdNameFromStore(e,r,e._nameOrdinalMeta,t)),null==s&&null!=a&&(i[t]=s=getIdNameFromStore(e,a,e._idOrdinalMeta,t)),null==s&&null!=o){var l=e._nameRepeatCount,u=l[o]=(l[o]||0)+1;s=o,u>1&&(s+="__ec__"+u),i[t]=s}}}(),e}();function completeDimensions(e,t,n){isSourceInstance(t)||(t=createSourceFromSeriesDataOption(t)),n=n||{},e=(e||[]).slice();for(var i=(n.dimsDef||[]).slice(),r=createHashMap(),a=createHashMap(),o=[],s=getDimCount(t,e,i,n.dimCount),l=0;lt[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();enableClassManagement(Scale,{registerWhenExtend:!0});var OrdinalMeta=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&map(i,getName);return new e({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if("string"!=typeof e&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=createHashMap(this.categories))},e}();function getName(e){return isObject(e)&&null!=e.value?e.value:e+""}var roundNumber=round$1;function intervalScaleNiceTicks(e,t,n,i){var r={},a=e[1]-e[0],o=r.interval=nice(a/t,!0);null!=n&&oi&&(o=r.interval=i);var s=r.intervalPrecision=getIntervalPrecision(o);return fixExtent(r.niceTickExtent=[roundNumber(Math.ceil(e[0]/o)*o,s),roundNumber(Math.floor(e[1]/o)*o,s)],e),r}function getIntervalPrecision(e){return getPrecisionSafe(e)+2}function clamp(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function fixExtent(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),clamp(e,0,t),clamp(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function contain$1(e,t){return e>=t[0]&&e<=t[1]}function normalize$1(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function scale$2(e,t){return e*(t[1]-t[0])+t[0]}var OrdinalScale=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new OrdinalMeta({})),isArray(i)&&(i=new OrdinalMeta({categories:map(i,(function(e){return isObject(e)?e.value:e}))})),n._ordinalMeta=i,n._categorySortInfo=[],n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return __extends(t,e),t.prototype.parse=function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return contain$1(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return normalize$1(e=this.getCategoryIndex(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=this.getCategoryIndex(e),Math.round(scale$2(e,this._extent))},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:this.getCategoryIndex(n)}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setCategorySortInfo=function(e){this._categorySortInfo=e},t.prototype.getCategorySortInfo=function(){return this._categorySortInfo},t.prototype.getCategoryIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].beforeSortIndex:e},t.prototype.getRawIndex=function(e){return this._categorySortInfo.length?this._categorySortInfo[e].ordinalNumber:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawIndex(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this.getCategoryIndex(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.niceTicks=function(){},t.prototype.niceExtent=function(){},t.type="ordinal",t}(Scale);Scale.registerClass(OrdinalScale);var roundNumber$1=round$1,IntervalScale=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return __extends(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e,this._extent)},t.prototype.normalize=function(e){return normalize$1(e,this._extent)},t.prototype.scale=function(e){return scale$2(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=getIntervalPrecision(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;n[0]1e4)return[];var s=a.length?a[a.length-1].value:i[1];return n[1]>s&&(e?a.push({value:roundNumber$1(s+t,r)}):a.push({value:n[1]})),a},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&c0&&(a=null===a?s:Math.min(a,s))}n[i]=a}}return n}function makeColumnLayout(e){var t=getValueAxesMinGaps(e),n=[];return each(e,(function(e){var i,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),c=Math.abs(u[1]-u[0]);i=s?l/c*s:l}else{var h=e.getData();i=Math.abs(a[1]-a[0])/h.count()}var p=parsePercent$2(e.get("barWidth"),i),d=parsePercent$2(e.get("barMaxWidth"),i),f=parsePercent$2(e.get("barMinWidth")||1,i),g=e.get("barGap"),m=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:getAxisKey(r),stackId:getSeriesStackId(e)})})),doCalBarWidthAndOffset(n)}function doCalBarWidthAndOffset(e){var t={};each(e,(function(e,n){var i=e.axisKey,r=e.bandWidth,a=t[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=a.stacks;t[i]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var c=e.barMinWidth;c&&(o[s].minWidth=c);var h=e.barGap;null!=h&&(a.gap=h);var p=e.barCategoryGap;null!=p&&(a.categoryGap=p)}));var n={};return each(t,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=e.categoryGap;if(null==a){var o=keys(i).length;a=Math.max(35-4*o,15)+"%"}var s=parsePercent$2(a,r),l=parsePercent$2(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),each(i,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,u-=i+l*i,c--}else{var i=h;t&&ti&&(i=n),i!==h&&(e.width=i,u-=i+l*i,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var p,d=0;each(i,(function(e,t){e.width||(e.width=h),p=e,d+=e.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;each(i,(function(e,i){n[t][i]=n[t][i]||{bandWidth:r,offset:f,width:e.width},f+=e.width*(1+l)}))})),n}function retrieveColumnLayout(e,t,n){if(e&&t){var i=e[getAxisKey(t)];return null!=i&&null!=n?i[getSeriesStackId(n)]:i}}function layout(e,t){var n=prepareLayoutBarSeries(e,t),i=makeColumnLayout(n),r={};each(n,(function(e){var t=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),o=getSeriesStackId(e),s=i[getAxisKey(a)][o],l=s.offset,u=s.width,c=n.getOtherAxis(a),h=e.get("barMinHeight")||0;r[o]=r[o]||[],t.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var p=t.mapDimension(c.dim),d=t.mapDimension(a.dim),f=isDimensionStacked(t,p),g=c.isHorizontal(),m=getValueAxisStart(a,c),y=0,v=t.count();y=0?"p":"n",b=m;f&&(r[o][x]||(r[o][x]={p:m,n:m}),b=r[o][x][S]);var T,M=void 0,A=void 0,I=void 0,C=void 0;if(g)M=b,A=(T=n.dataToPoint([_,x]))[1]+l,I=T[0]-m,C=u,Math.abs(I)LARGE_BAR_MIN_WIDTH||(c=LARGE_BAR_MIN_WIDTH),{progress:function(e,t){for(var h,p=e.count,d=new LargeArr(2*p),f=new LargeArr(2*p),g=new LargeArr(p),m=[],y=[],v=0,_=0;null!=(h=e.next());)y[u]=t.get(o,h),y[1-u]=t.get(s,h),m=n.dataToPoint(y,null,m),f[v]=l?i.x+i.width:m[0],d[v++]=m[0],f[v]=l?m[1]:i.y+i.height,d[v++]=m[1],g[_++]=h;t.setLayout({largePoints:d,largeDataIndices:g,largeBackgroundPoints:f,barWidth:c,valueAxisStart:getValueAxisStart(r,a),backgroundStart:l?i.x:i.y,valueAxisHorizontal:l})}}}}};function isOnCartesian(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function isInLargeMode(e){return e.pipelineContext&&e.pipelineContext.large}function getValueAxisStart(e,t,n){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var bisect=function(e,t,n,i){for(;n>>1;e[r][1]n&&(this._approxInterval=n);var a=scaleIntervals.length,o=Math.min(bisect(scaleIntervals,this._approxInterval,0,a),a-1);this._interval=scaleIntervals[o][1],this._minLevelUnit=scaleIntervals[Math.max(o-1,0)][0]},t.prototype.parse=function(e){return"number"==typeof e?e:+parseDate(e)},t.prototype.contain=function(e){return contain$1(this.parse(e),this._extent)},t.prototype.normalize=function(e){return normalize$1(this.parse(e),this._extent)},t.prototype.scale=function(e){return scale$2(e,this._extent)},t.type="time",t}(IntervalScale),scaleIntervals=[["second",ONE_SECOND],["minute",ONE_MINUTE],["hour",ONE_HOUR],["quarter-day",6*ONE_HOUR],["half-day",12*ONE_HOUR],["day",1.2*ONE_DAY],["half-week",3.5*ONE_DAY],["week",7*ONE_DAY],["month",31*ONE_DAY],["quarter",95*ONE_DAY],["half-year",ONE_YEAR/2],["year",ONE_YEAR]];function isUnitValueSame(e,t,n,i){var r=parseDate(t),a=parseDate(n),o=function(e){return getUnitValue(r,e,i)===getUnitValue(a,e,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},h=function(){return c()&&o("minute")},p=function(){return h()&&o("second")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return p();case"millisecond":return p()&&o("millisecond")}}function getDateInterval(e,t){return(e/=ONE_DAY)>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function getMonthInterval(e){return(e/=30*ONE_DAY)>6?6:e>3?3:e>2?2:1}function getHourInterval(e){return(e/=ONE_HOUR)>12?12:e>6?6:e>3.5?4:e>2?2:1}function getMinutesAndSecondsInterval(e,t){return(e/=t?ONE_MINUTE:ONE_SECOND)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function getMillisecondsInterval(e){return nice(e,!0)}function getFirstTimestampOfUnit(e,t,n){var i=new Date(e);switch(getPrimaryTimeUnit(t)){case"year":case"month":i[monthSetterName(n)](0);case"day":i[dateSetterName(n)](1);case"hour":i[hoursSetterName(n)](0);case"minute":i[minutesSetterName(n)](0);case"second":i[secondsSetterName(n)](0),i[millisecondsSetterName(n)](0)}return i.getTime()}function getIntervalTicks(e,t,n,i){var r=timeUnits,a=0;function o(e,t,n,r,a,o,s){for(var l=new Date(t),u=t,c=l[r]();u1&&0===u&&a.unshift({value:a[0].value-p})}}for(u=0;u=i[0]&&m<=i[1]&&c++)}var y=(i[1]-i[0])/t;if(c>1.5*y&&h>y/1.5)break;if(l.push(f),c>y||e===r[p])break}u=[]}}var v=filter(map(l,(function(e){return filter(e,(function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd}))})),(function(e){return e.length>0})),_=[],x=v.length-1;for(p=0;p0;)i*=10;var r=[round$1(mathCeil(t[0]/i)*i),round$1(mathFloor$1(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.niceExtent=function(e){intervalScaleProto.niceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return contain$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.normalize=function(e){return normalize$1(e=mathLog(e)/mathLog(this.base),this._extent)},t.prototype.scale=function(e){return e=scale$2(e,this._extent),mathPow$1(this.base,e)},t.type="log",t}(Scale),proto=LogScale.prototype;function fixRoundingError(e,t){return roundingErrorFix(e,getPrecisionSafe$1(t))}proto.getMinorTicks=intervalScaleProto.getMinorTicks,proto.getLabel=intervalScaleProto.getLabel,Scale.registerClass(LogScale);var ScaleRawExtentInfo=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]s&&(o=NaN,s=NaN);var c=eqNaN(o)||eqNaN(s)||e&&!i;this._needCrossZero&&(o>0&&s>0&&!l&&(o=0),o<0&&s<0&&!u&&(s=0));var h=this._determinedMin,p=this._determinedMax;return null!=h&&(o=h,l=!0),null!=p&&(s=p,u=!0),{min:o,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[DATA_MIN_MAX_ATTR[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=DETERMINED_MIN_MAX_ATTR[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),DETERMINED_MIN_MAX_ATTR={min:"_determinedMin",max:"_determinedMax"},DATA_MIN_MAX_ATTR={min:"_dataMin",max:"_dataMax"};function ensureScaleRawExtentInfo(e,t,n){var i=e.rawExtentInfo;return i||(i=new ScaleRawExtentInfo(e,t,n),e.rawExtentInfo=i,i)}function parseAxisModelMinMax(e,t){return null==t?null:eqNaN(t)?NaN:e.parse(t)}function getScaleExtent(e,t){var n=e.type,i=ensureScaleRawExtentInfo(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var r=i.min,a=i.max,o=t.ecModel;if(o&&"time"===n){var s=prepareLayoutBarSeries("bar",o),l=!1;if(each(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=makeColumnLayout(s),c=adjustScaleForOverflow(r,a,t,u);r=c.min,a=c.max}}return{extent:[r,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function adjustScaleForOverflow(e,t,n,i){var r=n.axis.getExtent(),a=r[1]-r[0],o=retrieveColumnLayout(i,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,h=c/(1-(s+l)/a)-c;return{min:e-=h*(s/u),max:t+=h*(l/u)}}function niceScaleExtent(e,t){var n=getScaleExtent(e,t),i=n.extent,r=t.get("splitNumber");e instanceof LogScale&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(i[0],i[1]),e.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)}function createScaleByModel(e,t){if(t=t||e.get("type"))switch(t){case"category":return new OrdinalScale({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new TimeScale({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Scale.getClass(t)||IntervalScale)}}function ifAxisCrossZero(e){var t=e.scale.getExtent(),n=t[0],i=t[1];return!(n>0&&i>0||n<0&&i<0)}function makeLabelFormatter(e){var t,n,i=e.getLabelModel().get("formatter"),r="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=i,function(t,i){return e.scale.getFormattedLabel(t,i,n)}):"string"==typeof i?function(t){return function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(i):"function"==typeof i?(t=i,function(n,i){return null!=r&&(i=n.value-r),t(getAxisRawValue(e,n),i,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function getAxisRawValue(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function estimateLabelUnionRect(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var i,r,a=n.getExtent();r=n instanceof OrdinalScale?n.count():(i=n.getTicks()).length;var o,s=e.getLabelModel(),l=makeLabelFormatter(e),u=1;r>40&&(u=Math.ceil(r/40));for(var c=0;ce[1]&&(e[1]=i[1])}))}var AxisModelCommonMixin=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();function createList(e){return createListFromArray(e.getSource(),e)}var dataStack$1={isDimensionStacked:isDimensionStacked,enableDataStack:enableDataStack,getStackedDimension:getStackedDimension};function createScale(e,t){var n=t;t instanceof Model||(n=new Model(t));var i=createScaleByModel(n);return i.setExtent(e[0],e[1]),niceScaleExtent(i,n),i}function mixinAxisModelCommonMethods(e){mixin(e,AxisModelCommonMixin)}var helper=Object.freeze({__proto__:null,createList:createList,getLayoutRect:getLayoutRect,dataStack:dataStack$1,createScale:createScale,mixinAxisModelCommonMethods:mixinAxisModelCommonMethods,getECData:getECData,createDimensions:createDimensions,createSymbol:createSymbol}),EPSILON$3=1e-8;function isAroundEqual$1(e,t){return Math.abs(e-t)>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,i.push([s/n,l/n])}return i}function parseGeoJSON(e,t){return map(filter((e=decode(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,i=e.geometry,r=[];if("Polygon"===i.type){var a=i.coordinates;r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)})}"MultiPolygon"===i.type&&each(a=i.coordinates,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new Region(n[t||"name"],r,n.cp);return o.properties=n,o}))}var inner$4=makeInner();function createAxisLabels(e){return"category"===e.type?makeCategoryLabels(e):makeRealNumberLabels(e)}function createAxisTicks(e,t){return"category"===e.type?makeCategoryTicks(e,t):{ticks:map(e.scale.getTicks(),(function(e){return e.value}))}}function makeCategoryLabels(e){var t=e.getLabelModel(),n=makeCategoryLabelsActually(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function makeCategoryLabelsActually(e,t){var n,i=getListCache(e,"labels"),r=getOptionCategoryInterval(t),a=listCacheGet(i,r);return a||listCacheSet(i,r,{labels:isFunction(r)?makeLabelsByCustomizedCategoryInterval(e,r):makeLabelsByNumericCategoryInterval(e,n="auto"===r?makeAutoCategoryInterval(e):r),labelCategoryInterval:n})}function makeCategoryTicks(e,t){var n,i,r=getListCache(e,"ticks"),a=getOptionCategoryInterval(t),o=listCacheGet(r,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(n=[]),isFunction(a))n=makeLabelsByCustomizedCategoryInterval(e,a,!0);else if("auto"===a){var s=makeCategoryLabelsActually(e,e.getLabelModel());i=s.labelCategoryInterval,n=map(s.labels,(function(e){return e.tickValue}))}else n=makeLabelsByNumericCategoryInterval(e,i=a,!0);return listCacheSet(r,a,{ticks:n,tickCategoryInterval:i})}function makeRealNumberLabels(e){var t=e.scale.getTicks(),n=makeLabelFormatter(e);return{labels:map(t,(function(t,i){return{formattedLabel:n(t,i),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}function getListCache(e,t){return inner$4(e)[t]||(inner$4(e)[t]=[])}function listCacheGet(e,t){for(var n=0;n40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),p=0,d=0;l<=a[1];l+=s){var f,g,m=getBoundingRect(n({value:l}),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var y=p/c,v=d/h;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var _=Math.max(0,Math.floor(Math.min(y,v))),x=inner$4(e.model),S=e.getExtent(),b=x.lastAutoInterval,T=x.lastTickCount;return null!=b&&null!=T&&Math.abs(b-_)<=1&&Math.abs(T-o)<=1&&b>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=b:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function fetchAutoCategoryIntervalCalculationParams(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function makeLabelsByNumericCategoryInterval(e,t,n){var i=makeLabelFormatter(e),r=e.scale,a=r.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=r.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=shouldShowAllLabels(e),p=o.get("showMinLabel")||h,d=o.get("showMaxLabel")||h;p&&u!==a[0]&&g(a[0]);for(var f=u;f<=a[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:r.getLabel(t),tickValue:e})}return d&&f-l!==a[1]&&g(a[1]),s}function makeLabelsByCustomizedCategoryInterval(e,t,n){var i=e.scale,r=makeLabelFormatter(e),a=[];return each(i.getTicks(),(function(e){var o=i.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:r(e),rawLabel:o,tickValue:s})})),a}var NORMALIZED_EXTENT=[0,1],Axis=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return getPixelPrecision(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count()),linearMap(e,NORMALIZED_EXTENT,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&fixExtentWithBands(n=n.slice(),i.count());var r=linearMap(e,n,NORMALIZED_EXTENT,t);return this.scale.scale(r)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=map(createAxisTicks(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawIndex(e):e),tickValue:e}}),this);return fixOnBandTicksCoords(this,n,t.get("alignWithLabel"),e.clamp),n},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),map(this.scale.getMinorTicks(e),(function(e){return map(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return createAxisLabels(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(){return calculateCategoryInterval(this)},e}();function fixExtentWithBands(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}function fixOnBandTicksCoords(e,t,n,i){var r=t.length;if(e.onBand&&!n&&r){var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;each(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift()),i&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]}),h(s[1],a.coord)&&(i?a.coord=s[1]:t.pop()),i&&h(a.coord,s[1])&&t.push({coord:s[1]})}function h(e,t){return e=round$1(e),t=round$1(t),c?e>t:e":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},RegExpEvaluator=function(){function e(e){if(null==(this._condVal=isString(e)?new RegExp(e):isRegExp(e)?e:null)){var t="";0,throwError(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return"string"===t?this._condVal.test(e):"number"===t&&this._condVal.test(e+"")},e}(),ConstConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),AndConditionInternal=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t0?n=i[0]:i[1]<0&&(n=i[1]),n}function getStackedOnPoint(e,t,n,i){var r=NaN;e.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,i),o[1-a]=r,t.dataToPoint(o)}var supportFloat32Array="undefined"!=typeof Float32Array,Float32ArrayCtor=supportFloat32Array?Float32Array:Array;function createFloat32Array(e){return isArray(e)?supportFloat32Array?new Float32Array(e):e:new Float32ArrayCtor(e)}function diffData(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}function lineAnimationDiff(e,t,n,i,r,a,o,s){for(var l=diffData(e,t),u=[],c=[],h=[],p=[],d=[],f=[],g=[],m=prepareDataCoordInfo(r,t,o),y=prepareDataCoordInfo(a,e,s),v=e.getLayout("points")||[],_=t.getLayout("points")||[],x=0;x=r||g<0)break;if(isPointNull(y,v)){if(l){g+=a;continue}break}if(g===n)e[a>0?"moveTo":"lineTo"](y,v),h=y,p=v;else{var _=y-u,x=v-c;if(_*_+x*x<.5){g+=a;continue}if(o>0){var S=g+a,b=t[2*S],T=t[2*S+1],M=m+1;if(l)for(;isPointNull(b,T)&&M=i||isPointNull(b,T))d=y,f=v;else{I=b-u,C=T-c;var L=y-u,E=b-y,D=v-c,R=T-v,O=void 0,k=void 0;"x"===s?(O=Math.abs(L),k=Math.abs(E),d=y-O*o,f=v,w=y+O*o,P=v):"y"===s?(O=Math.abs(D),k=Math.abs(R),d=y,f=v-O*o,w=y,P=v+O*o):(O=Math.sqrt(L*L+D*D),d=y-I*o*(1-(A=(k=Math.sqrt(E*E+R*R))/(k+O))),f=v-C*o*(1-A),P=v+C*o*A,w=mathMin$5(w=y+I*o*A,mathMax$5(b,y)),P=mathMin$5(P,mathMax$5(T,v)),w=mathMax$5(w,mathMin$5(b,y)),f=v-(C=(P=mathMax$5(P,mathMin$5(T,v)))-v)*O/k,d=mathMin$5(d=y-(I=w-y)*O/k,mathMax$5(u,y)),f=mathMin$5(f,mathMax$5(c,v)),w=y+(I=y-(d=mathMax$5(d,mathMin$5(u,y))))*k/O,P=v+(C=v-(f=mathMax$5(f,mathMin$5(c,v))))*k/O)}e.bezierCurveTo(h,p,d,f,y,v),h=w,p=P}else e.lineTo(y,v)}u=y,c=v,g+=a}return m}var ECPolylineShape=function(){this.smooth=0,this.smoothConstraint=!0},ECPolyline=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ECPolylineShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&isPointNull(n[2*r-2],n[2*r-1]);r--);for(;i=0){var m=o?(c-i)*g+i:(u-n)*g+n;return o?[e,m]:[m,e]}n=u,i=c;break;case a.C:u=r[l++],c=r[l++],h=r[l++],p=r[l++],d=r[l++],f=r[l++];var y=o?cubicRootAt(n,u,h,d,e,s):cubicRootAt(i,c,p,f,e,s);if(y>0)for(var v=0;v=0){m=o?cubicAt(i,c,p,f,_):cubicAt(n,u,h,d,_);return o?[e,m]:[m,e]}}n=d,i=f}}},t}(Path),ECPolygonShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(ECPolylineShape),ECPolygon=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new ECPolygonShape},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,r=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&isPointNull(n[2*a-2],n[2*a-1]);a--);for(;r=0;a--){var o=n[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(i=l&&l.coordDim)||"y"===i){r=n[a];break}}if(r){var u=t.getAxis(i),c=map(r.stops,(function(e){return{offset:0,coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),h=c.length,p=r.outerColors.slice();h&&c[0].coord>c[h-1].coord&&(c.reverse(),p.reverse());var d=c[0].coord-10,f=c[h-1].coord+10,g=f-d;if(g<.001)return"transparent";each(c,(function(e){e.offset=(e.coord-d)/g})),c.push({offset:h?c[h-1].offset:.5,color:p[1]||"transparent"}),c.unshift({offset:h?c[0].offset:.5,color:p[0]||"transparent"});var m=new LinearGradient(0,0,0,0,c,!0);return m[i]=d,m[i+"2"]=f,m}}}function getIsIgnoreFunc(e,t,n){var i=e.get("showAllSymbol"),r="auto"===i;if(!i||r){var a=n.getAxesByScale("ordinal")[0];if(a&&(!r||!canShowAllSymbolForCategory(a,t))){var o=t.mapDimension(a.dim),s={};return each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function canShowAllSymbolForCategory(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var r=t.count(),a=Math.max(1,Math.round(r/5)),o=0;oi)return!1;return!0}function isPointNull$1(e,t){return isNaN(e)||isNaN(t)}function getLastIndexNotNull(e){for(var t=e.length/2;t>0&&isPointNull$1(e[2*t-2],e[2*t-1]);t--);return t-1}function getPointAtIndex(e,t){return[e[2*t],e[2*t+1]]}function getIndexRange(e,t,n){for(var i,r,a=e.length/2,o="x"===n?0:1,s=0,l=-1,u=0;u=t||i>=t&&r<=t){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(t-i)/(r-i)}}function createLineClipPath(e,t,n,i){if(isCoordinateSystemType(t,"cartesian2d")){var r=i.getModel("endLabel"),a=r.get("show"),o=r.get("valueAnimation"),s=i.getData(),l={lastFrameIndex:0},u=a?function(n,i){e._endLabelOnDuring(n,i,s,l,o,r,t)}:null,c=t.getBaseAxis().isHorizontal(),h=createGridClipPath(t,n,i,(function(){var t=e._endLabel;t&&n&&null!=l.originalX&&t.attr({x:l.originalX,y:l.originalY})}),u);if(!i.get("clip",!0)){var p=h.shape,d=Math.max(p.width,p.height);c?(p.y-=d,p.height+=2*d):(p.x-=d,p.width+=2*d)}return u&&u(1,h),h}return createPolarClipPath(t,n,i)}function getEndLabelStateSpecified(e,t){var n=t.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,a=i?r?"right":"left":"center",o=i?"middle":r?"top":"bottom";return{normal:{align:e.get("align")||a,verticalAlign:e.get("verticalAlign")||o,padding:e.get("distance")||0}}}var LineView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(){var e=new Group,t=new SymbolDraw;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem,a=this.group,o=e.getData(),s=e.getModel("lineStyle"),l=e.getModel("areaStyle"),u=o.getLayout("points")||[],c="polar"===r.type,h=this._coordSys,p=this._symbolDraw,d=this._polyline,f=this._polygon,g=this._lineGroup,m=e.get("animation"),y=!l.isEmpty(),v=l.get("origin"),_=prepareDataCoordInfo(r,o,v),x=y&&getStackedOnPoints(r,o,_),S=e.get("showSymbol"),b=S&&!c&&getIsIgnoreFunc(e,o,r),T=this._data;T&&T.eachItemGraphicEl((function(e,t){e.__temp&&(a.remove(e),T.setItemGraphicEl(t,null))})),S||p.remove(),a.add(g);var M,A=!c&&e.get("step");r&&r.getArea&&e.get("clip",!0)&&(null!=(M=r.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M,d&&h.type===r.type&&A===this._step?(y&&!f?f=this._newPolygon(u,x):f&&!y&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!1,e)),S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),isPointsSame(this._stackedOnPoints,x)&&isPointsSame(this._points,u)||(m?this._doUpdateAnimation(o,x,r,n,A,v):(A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d.setShape({points:u}),f&&f.setShape({points:u,stackedOnPoints:x})))):(S&&p.updateData(o,{isIgnore:b,clipShape:M,disableAnimation:!0,getSymbolPoint:function(e){return[u[2*e],u[2*e+1]]}}),m&&this._initSymbolLabelAnimation(o,r,M),A&&(u=turnPointsIntoStep(u,r,A),x&&(x=turnPointsIntoStep(x,r,A))),d=this._newPolyline(u),y&&(f=this._newPolygon(u,x)),c||this._initOrUpdateEndLabel(e,r),g.setClipPath(createLineClipPath(this,r,!0,e)));var I=getVisualGradient(o,r)||o.getVisual("style")[o.getVisual("drawType")],C=e.get(["emphasis","focus"]),w=e.get(["emphasis","blurScope"]);(d.useStyle(defaults(s.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),setStatesStylesFromModel(d,e,"lineStyle"),d.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=d.style.lineWidth+1);getECData(d).seriesIndex=e.seriesIndex,enableHoverEmphasis(d,C,w);var P=getSmooth(e.get("smooth")),L=e.get("smoothMonotone"),E=e.get("connectNulls");if(d.setShape({smooth:P,smoothMonotone:L,connectNulls:E}),f){var D=o.getCalculationInfo("stackedOnSeries"),R=0;f.useStyle(defaults(l.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),D&&(R=getSmooth(D.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:R,smoothMonotone:L,connectNulls:E}),setStatesStylesFromModel(f,e,"areaStyle"),getECData(f).seriesIndex=e.seriesIndex,enableHoverEmphasis(f,C,w)}var O=function(e){i._changePolyState(e)};o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=O)})),this._polyline.onHoverStateChange=O,this._data=o,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=A,this._valueOrigin=v},t.prototype.dispose=function(){},t.prototype.highlight=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("emphasis"),!(a instanceof Array)&&null!=a&&a>=0){var o=r.getLayout("points"),s=r.getItemGraphicEl(a);if(!s){var l=o[2*a],u=o[2*a+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;(s=new Symbol(r,a)).x=l,s.y=u,s.setZ(e.get("zlevel"),e.get("z")),s.__temp=!0,r.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else ChartView.prototype.highlight.call(this,e,t,n,i)},t.prototype.downplay=function(e,t,n,i){var r=e.getData(),a=queryDataIndex(r,i);if(this._changePolyState("normal"),null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else ChartView.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;setStatesFlag(this._polyline,e),t&&setStatesFlag(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new ECPolyline({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new ECPolygon({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,r,a=t.getBaseAxis(),o=a.inverse;"cartesian2d"===t.type?(i=a.isHorizontal(),r=!1):"polar"===t.type&&(i="angle"===a.dim,r=!0);var s=e.hostModel,l=s.get("animationDuration");"function"==typeof l&&(l=l(null));var u=s.get("animationDelay")||0,c="function"==typeof u?u(null):u;e.eachItemGraphicEl((function(e,a){var s=e;if(s){var h=[e.x,e.y],p=void 0,d=void 0,f=void 0;if(r){var g=n,m=t.pointToCoord(h);i?(p=g.startAngle,d=g.endAngle,f=-m[1]/180*Math.PI):(p=g.r0,d=g.r,f=m[0])}else{var y=n;i?(p=y.x,d=y.x+y.width,f=e.x):(p=y.y+y.height,d=y.y,f=e.y)}var v=d===p?0:(f-p)/(d-p);o&&(v=1-v);var _="function"==typeof u?u(a):l*v+c,x=s.getSymbolPath(),S=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,delay:_}),S&&S.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t){var n=e.getModel("endLabel");if(n.get("show")){var i=e.getData(),r=this._polyline,a=this._endLabel;a||((a=this._endLabel=new ZRText({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);var o=getLastIndexNotNull(i.getLayout("points"));o>=0&&setLabelStyle(a,getLabelStatesModels(e,"endLabel"),{labelFetcher:e,labelDataIndex:o,defaultText:function(e,t,n){return n?getDefaultInterpolatedLabel(i,n):getDefaultLabel(i,e)},enableTextSetter:!0},getEndLabelStateSpecified(n,t))}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,r,a,o){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),p=a.get("precision"),d=o.getBaseAxis(),f=d.isHorizontal(),g=d.inverse,m=t.shape,y=g?f?m.x:m.y+m.height:f?m.x+m.width:m.y,v=f?"x":"y",_=getIndexRange(u,y,v),x=_.range,S=x[1]-x[0],b=void 0;if(S>=1){if(S>1&&!h){var T=getPointAtIndex(u,x[0]);s.attr({x:T[0],y:T[1]}),r&&(b=c.getRawValue(x[0]))}else{(T=l.getPointOn(y,v))&&s.attr({x:T[0],y:T[1]});var M=c.getRawValue(x[0]),A=c.getRawValue(x[1]);r&&(b=interpolateRawValues(n,p,M,A,_.t))}i.lastFrameIndex=x[0]}else{var I=1===e||i.lastFrameIndex>0?x[0]:0;T=getPointAtIndex(u,I);r&&(b=c.getRawValue(I)),s.attr({x:T[0],y:T[1]})}r&&labelInner(s).setLabelText(b)}},t.prototype._doUpdateAnimation=function(e,t,n,i,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=lineAnimationDiff(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),c=u.current,h=u.stackedOnCurrent,p=u.next,d=u.stackedOnNext;if(r&&(c=turnPointsIntoStep(u.current,n,r),h=turnPointsIntoStep(u.stackedOnCurrent,n,r),p=turnPointsIntoStep(u.next,n,r),d=turnPointsIntoStep(u.stackedOnNext,n,r)),getBoundingDiff(c,p)>3e3||s&&getBoundingDiff(h,d)>3e3)return o.setShape({points:p}),void(s&&s.setShape({points:p,stackedOnPoints:d}));o.shape.__points=u.current,o.shape.points=c;var f={shape:{points:p}};u.current!==c&&(f.shape.__points=u.next),o.stopAnimation(),updateProps(o,f,l),s&&(s.setShape({points:c,stackedOnPoints:h}),s.stopAnimation(),updateProps(s,{shape:{stackedOnPoints:d}},l),o.shape.points!==s.shape.points&&(s.shape.points=o.shape.points));for(var g=[],m=u.status,y=0;yt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&"cartesian2d"===a.type&&r){var s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),p=Math.round(o/h);if(p>1){"lttb"===r&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/p));var d=void 0;"string"==typeof r?d=samplers[r]:"function"==typeof r&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/p,d,indexSampler))}}}}}var defaultOption={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},categoryAxis=merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},defaultOption),valueAxis=merge({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},defaultOption),timeAxis=merge({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},valueAxis),logAxis=defaults({scale:!0,logBase:10},valueAxis),axisDefault={category:categoryAxis,value:valueAxis,time:timeAxis,log:logAxis},AXIS_TYPES={value:1,category:1,time:1,log:1};function axisModelCreator(e,t,n){each(AXIS_TYPES,(function(i,r){var a=merge(merge({},axisDefault[r],!0),n,!0),o=function(t){function n(){for(var n=[],i=0;i0?"top":"bottom",i="center"):isRadianAroundZero(a-PI$6)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=a>0&&a0?"right":"left":n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:r}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),builders={axisLine:function(e,t,n,i){var r=t.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0];o&&(applyTransform(s,s,o),applyTransform(l,l,o));var u=extend({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Line({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});c.anid="line",n.add(c);var h=t.get(["axisLine","symbol"]),p=t.get(["axisLine","symbolSize"]),d=t.get(["axisLine","symbolOffset"])||0;if("number"==typeof d&&(d=[d,d]),null!=h){"string"==typeof h&&(h=[h,h]),"string"!=typeof p&&"number"!=typeof p||(p=[p,p]);var f=p[0],g=p[1];each([{rotate:e.rotation+Math.PI/2,offset:d[0],r:0},{rotate:e.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,i){if("none"!==h[i]&&null!=h[i]){var r=createSymbol(h[i],-f/2,-g/2,f,g,u.stroke,!0),a=t.r+t.offset;r.attr({rotation:t.rotate,x:s[0]+a*Math.cos(e.rotation),y:s[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(e,t,n,i){var r=buildAxisMajorTicks(n,i,t,e);fixMinMaxLabelShow(t,buildAxisLabel(n,i,t,e),r),buildAxisMinorTicks(n,i,t,e.tickDirection)},axisName:function(e,t,n,i){var r=retrieve(e.axisName,t.get("name"));if(r){var a,o,s=t.get("nameLocation"),l=e.nameDirection,u=t.getModel("nameTextStyle"),c=t.get("nameGap")||0,h=t.axis.getExtent(),p=h[0]>h[1]?-1:1,d=["start"===s?h[0]-p*c:"end"===s?h[1]+p*c:(h[0]+h[1])/2,isNameLocationCenter(s)?e.labelOffset+l*c:0],f=t.get("nameRotate");null!=f&&(f=f*PI$6/180),isNameLocationCenter(s)?a=AxisBuilder.innerTextLayout(e.rotation,null!=f?f:e.rotation,l):(a=endTextLayout(e.rotation,s,f||0,h),null!=(o=e.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(a.rotation)),!isFinite(o)&&(o=null)));var g=u.getFont(),m=t.get("nameTruncate",!0)||{},y=m.ellipsis,v=retrieve(e.nameTruncateMaxWidth,m.maxWidth,o),_=t.get("tooltip",!0),x=t.mainType,S={componentType:x,name:r,$vars:["name"]};S[x+"Index"]=t.componentIndex;var b=new ZRText({x:d[0],y:d[1],rotation:a.rotation,silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(u,{text:r,font:g,overflow:"truncate",width:v,ellipsis:y,fill:u.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:u.get("align")||a.textAlign,verticalAlign:u.get("verticalAlign")||a.textVerticalAlign}),z2:1});if(b.tooltip=_&&_.show?extend({content:r,formatter:function(){return r},formatterParams:S},_):null,b.__fullText=r,b.anid="name",t.get("triggerEvent")){var T=AxisBuilder.makeAxisEventDataBase(t);T.targetType="axisName",T.name=r,getECData(b).eventData=T}i.add(b),b.updateTransform(),n.add(b),b.decomposeTransform()}}};function endTextLayout(e,t,n,i){var r,a,o=remRadian(n-e),s=i[0]>i[1],l="start"===t&&!s||"start"!==t&&s;return isRadianAroundZero(o-PI$6/2)?(a=l?"bottom":"top",r="center"):isRadianAroundZero(o-1.5*PI$6)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*PI$6&&o>PI$6/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}function fixMinMaxLabelShow(e,t,n){if(!shouldShowAllLabels(e.axis)){var i=e.get(["axisLabel","showMinLabel"]),r=e.get(["axisLabel","showMaxLabel"]);n=n||[];var a=(t=t||[])[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],p=n[n.length-2];!1===i?(ignoreEl(a),ignoreEl(u)):isTwoLabelOverlapped(a,o)&&(i?(ignoreEl(o),ignoreEl(c)):(ignoreEl(a),ignoreEl(u))),!1===r?(ignoreEl(s),ignoreEl(h)):isTwoLabelOverlapped(l,s)&&(r?(ignoreEl(l),ignoreEl(p)):(ignoreEl(s),ignoreEl(h)))}}function ignoreEl(e){e&&(e.ignore=!0)}function isTwoLabelOverlapped(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=identity([]);return rotate(r,r,-e.rotation),n.applyTransform(mul$1([],r,e.getLocalTransform())),i.applyTransform(mul$1([],r,t.getLocalTransform())),n.intersect(i)}}function isNameLocationCenter(e){return"middle"===e||"center"===e}function createTicks(e,t,n,i,r){for(var a=[],o=[],s=[],l=0;l=0||e===t}function fixValue(e){var t=getAxisInfo(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,r=n.option,a=n.get("status"),o=n.get("value");null!=o&&(o=i.parse(o));var s=isHandleTrigger(n);null==a&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),on.min&&i.modifyDataMinMax("min",t[0]),!n.maxFixed&&t[1]e[1]&&(e[1]=t)}ComponentView.registerClass(CartesianXAxisView),ComponentView.registerClass(CartesianYAxisView),registerProcessor(PRIORITY.PROCESSOR.FILTER+10,{getTargetSeries:function(e){var t=createHashMap();return e.eachSeries((function(e){isCartesian2DSeries(e)&&t.set(e.uid,e)})),t},overallReset:function(e,t){var n=[],i=createHashMap();prepareDataExtentOnAxis(e,i,n),calculateFilteredExtent(i,n),shrinkAxisExtent(i)}});var GridModel=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(ComponentModel),GridView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return __extends(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new Rect({shape:e.coordinateSystem.getRect(),style:defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(ComponentView);ComponentView.registerClass(GridView),ComponentModel.registerClass(GridModel),registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),registerLayout(pointsLayout("line",!0)),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("line"));var Cartesian=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return map(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),filter(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),cartesian2DDimensions=["x","y"];function canCalculateAffineTransform(e){return"interval"===e.type||"time"===e.type}var Cartesian2D=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=cartesian2DDimensions,t}return __extends(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(canCalculateAffineTransform(e)&&canCalculateAffineTransform(t)){var n=e.getExtent(),i=t.getExtent(),r=this.dataToPoint([n[0],i[0]]),a=this.dataToPoint([n[1],i[1]]),o=n[1]-n[0],s=i[1]-i[0];if(o&&s){var l=(a[0]-r[0])/o,u=(a[1]-r[1])/s,c=r[0]-n[0]*l,h=r[1]-i[0]*u,p=this._transform=[l,0,0,u,c,h];this._invTransform=invert([],p)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],r=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return applyTransform(n,e,this._transform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.toGlobalCoord(a.dataToCoord(i)),n[1]=o.toGlobalCoord(o.dataToCoord(r)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),a=i.getExtent(),o=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),o),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t){if(t=t||[],this._invTransform)return applyTransform(t,e,this._invTransform);var n=this.getAxis("x"),i=this.getAxis("y");return t[0]=n.coordToData(n.toLocalCoord(e[0])),t[1]=i.coordToData(i.toLocalCoord(e[1])),t},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),n=Math.min(e[0],e[1]),i=Math.min(t[0],t[1]),r=Math.max(e[0],e[1])-n,a=Math.max(t[0],t[1])-i;return new BoundingRect(n,i,r,a)},t}(Cartesian),Axis2D=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.index=0,o.type=r||"value",o.position=a||"bottom",o}return __extends(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setCategorySortInfo(e)},t}(Axis),Grid=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=cartesian2DDimensions,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model),each(n.x,(function(e){niceScaleExtent(e.scale,e.model)})),each(n.y,(function(e){niceScaleExtent(e.scale,e.model)}));var i={};each(n.x,(function(e){fixAxisOnZero(n,"y",e,i)})),each(n.y,(function(e){fixAxisOnZero(n,"x",e,i)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),r=!n&&e.get("containLabel"),a=getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});this._rect=a;var o=this._axesList;function s(){each(o,(function(e){var t=e.isHorizontal(),n=t?[0,a.width]:[0,a.height],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),updateAxisTransform(e,t?a.x:a.y)}))}s(),r&&(each(o,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=estimateLabelUnionRect(e);if(t){var n=e.isHorizontal()?"height":"width",i=e.model.get(["axisLabel","margin"]);a[n]-=t[n]+i,"top"===e.position?a.y+=t.height+i:"left"===e.position&&(a.x+=t.width+i)}}})),s()),each(this._coordsList,(function(e){e.calcAffineTransform()}))},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}isObject(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,r=this._coordsList;ie&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=inheritDefaultOption(BaseBarSeriesModel.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(BaseBarSeriesModel);SeriesModel.registerClass(BarSeriesModel);var SausageShape=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},SausagePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SausageShape},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=Math.cos(l),p=Math.sin(l),d=Math.cos(u),f=Math.sin(u);(c?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(h*r+n,p*r+i),e.arc(h*s+n,p*s+i,o,-Math.PI+l,l,!c)),e.arc(n,i,a,l,u,!c),e.moveTo(d*a+n,f*a+i),e.arc(d*s+n,f*s+i,o,u-2*Math.PI,u-Math.PI,!c),0!==r&&(e.arc(n,i,r,u,l,c),e.moveTo(h*r+n,f*r+i)),e.closePath()},t}(Path),BAR_BORDER_WIDTH_QUERY=["itemStyle","borderWidth"],BAR_BORDER_RADIUS_QUERY=["itemStyle","borderRadius"],_eventPos=[0,0],mathMax$6=Math.max,mathMin$6=Math.min;function getClipArea(e,t){var n=e.getArea&&e.getArea();if(isCoordinateSystemType(e,"cartesian2d")){var i=e.getBaseAxis();if("category"!==i.type||!i.onBand){var r=t.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}var BarView=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){this._model=e,this.removeOnRenderedListener(n),this._updateDrawMode(e);var r=e.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._incrementalRenderLarge(e,t)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,i){var r,a=this,o=this.group,s=e.getData(),l=this._data,u=e.coordinateSystem,c=u.getBaseAxis();"cartesian2d"===u.type?r=c.isHorizontal():"polar"===u.type&&(r="angle"===c.dim);var h=e.isAnimationEnabled()?e:null,p=c.model,d=e.get("realtimeSort");if(d&&s.count()){if(this._isFirstFrame)return this._initSort(s,r,c,n),void(this._isFirstFrame=!1);this._onRendered=function(){a._updateSort(s,(function(e){var t=s.getItemGraphicEl(e);if(t){var n=t.shape;return(r?n.y+n.height:n.x+n.width)||0}return 0}),c,n)},n.getZr().on("rendered",this._onRendered)}var f=e.get("clip",!0)||d,g=getClipArea(u,s);o.removeClipPath();var m=e.get("roundCap",!0),y=e.get("showBackground",!0),v=e.getModel("backgroundStyle"),_=v.get("borderRadius")||0,x=[],S=this._backgroundEls,b=i&&i.isInitSort,T=i&&"changeAxisOrder"===i.type;function M(e){var t=getLayout[u.type](s,e),n=createBackgroundEl(u,r,t);return n.useStyle(v.getItemStyle()),"cartesian2d"===u.type&&n.setShape("r",_),x[e]=n,n}s.diff(l).add((function(t){var n=s.getItemModel(t),i=getLayout[u.type](s,t,n);if(y&&M(t),s.hasValue(t)){var a=!1;f&&(a=clip[u.type](g,i));var l=elementCreator[u.type](e,s,t,i,r,h,c.model,!1,m);updateStyle(l,s,t,n,i,e,r,"polar"===u.type),b?l.attr({shape:i}):d?updateRealtimeAnimation(e,p,h,l,i,t,r,!1,!1):initProps(l,{shape:i},e,t),s.setItemGraphicEl(t,l),o.add(l),l.ignore=a}})).update((function(t,n){var i=s.getItemModel(t),a=getLayout[u.type](s,t,i);if(y){var A=void 0;0===S.length?A=M(n):((A=S[n]).useStyle(v.getItemStyle()),"cartesian2d"===u.type&&A.setShape("r",_),x[t]=A);var I=getLayout[u.type](s,t);updateProps(A,{shape:createBackgroundShape(r,I,u)},h,t)}var C=l.getItemGraphicEl(n);if(!s.hasValue(t))return o.remove(C),void(C=null);var w=!1;f&&(w=clip[u.type](g,a))&&o.remove(C),C||(C=elementCreator[u.type](e,s,t,a,r,h,c.model,!!C,m)),T||updateStyle(C,s,t,i,a,e,r,"polar"===u.type),b?C.attr({shape:a}):d?updateRealtimeAnimation(e,p,h,C,a,t,r,!0,T):updateProps(C,{shape:a},e,t,null),s.setItemGraphicEl(t,C),C.ignore=w,o.add(C)})).remove((function(t){var n=l.getItemGraphicEl(t);n&&removeElementWithFadeOut(n,e,t)})).execute();var A=this._backgroundGroup||(this._backgroundGroup=new Group);A.removeAll();for(var I=0;Ii)return!0;i=a}return!1},t.prototype._updateSort=function(e,t,n,i){var r=n.scale.getCategorySortInfo();if(this._isDataOrderChanged(e,t,r))for(var a=this._dataSort(e,t),o=n.scale.getExtent(),s=o[0];s0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*r/2,y:i.y+o*r/2,width:i.width-a*r,height:i.height-o*r}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle}}};function isZeroOnPolar(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function updateStyle(e,t,n,i,r,a,o,s){var l=t.getItemVisual(n,"style");s||e.setShape("r",i.get(BAR_BORDER_RADIUS_QUERY)||0),e.useStyle(l);var u=i.getShallow("cursor");if(u&&e.attr("cursor",u),!s){var c=o?r.height>0?"bottom":"top":r.width>0?"left":"right",h=getLabelStatesModels(i);setLabelStyle(e,h,{labelFetcher:a,labelDataIndex:n,defaultText:getDefaultLabel(a.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c}),setLabelValueAnimation(e.getTextContent(),h,a.getRawValue(n),(function(e){return getDefaultInterpolatedLabel(t,e)}))}var p=i.getModel(["emphasis"]);enableHoverEmphasis(e,p.get("focus"),p.get("blurScope")),setStatesStylesFromModel(e,i),isZeroOnPolar(r)&&(e.style.fill="none",e.style.stroke="none",each(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}function getLineWidth(e,t){var n=e.get(BAR_BORDER_WIDTH_QUERY)||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),r=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,r)}var LagePathShape=function(){},LargePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new LagePathShape},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.__startPoint,r=this.__baseDimIdx,a=0;a=0?t:null}),30,!1);function largePathFindDataIndex(e,t,n){var i=e.__baseDimIdx,r=1-i,a=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[r];_eventPos[0]=t,_eventPos[1]=n;for(var u=_eventPos[i],c=_eventPos[1-i],h=u-s,p=u+s,d=0,f=a.length/2;d=h&&m<=p&&(l<=y?c>=l&&c<=y:c>=y&&c<=l))return o[d]}return-1}function setLargeStyle(e,t,n){var i=n.getVisual("style");e.useStyle(extend({},i)),e.style.fill=null,e.style.stroke=i.fill,e.style.lineWidth=n.getLayout("barWidth")}function setLargeBackgroundStyle(e,t,n){var i=t.get("borderColor")||t.get("color"),r=t.getItemStyle();e.useStyle(r),e.style.fill=null,e.style.stroke=i,e.style.lineWidth=n.getLayout("barWidth")}function createBackgroundShape(e,t,n){if(isCoordinateSystemType(n,"cartesian2d")){var i=t,r=n.getArea();return{x:e?i.x:r.x,y:e?r.y:i.y,width:e?i.width:r.width,height:e?r.height:i.height}}var a=t;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:e?r.r0:a.r0,r:e?r.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:2*Math.PI}}function createBackgroundEl(e,t,n){return new("polar"===e.type?Sector:Rect)({shape:createBackgroundShape(t,n,e),silent:!0,z2:0})}function createListSimply(e,t,n){t=isArray(t)&&{coordDimensions:t}||extend({},t);var i=e.getSource(),r=createDimensions(i,t),a=new List(r,e);return a.initData(i,n),a}ChartView.registerClass(BarView),registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))})),registerLayout(PRIORITY.VISUAL.LAYOUT,curry(layout,"bar")),registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,largeLayout),registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}}),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,dataSample("bar"));var LegendVisualProvider=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),PieSeriesModel=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),r=[];return n.each(n.mapDimension("value"),(function(e){r.push(e)})),i.percent=getPercentWithPrecision(r,t,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},t.prototype._defaultLabelLine=function(e){defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(SeriesModel);SeriesModel.registerClass(PieSeriesModel);var RADIAN=Math.PI/180;function adjustSingleSide(e,t,n,i,r,a,o,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;hn?o:a,c=Math.abs(l.label.y-n);if(c>u.maxY){var h=l.label.x-t-l.len2*r,p=i+l.len,f=h0?"right":"left":L>0?"left":"right"}var F=m.get("rotate");if(D="number"==typeof F?F*(Math.PI/180):F?L<0?-P+Math.PI:-P:0,a=!!D,p.x=A,p.y=I,p.rotation=D,p.setStyle({verticalAlign:"middle"}),R){p.setStyle({align:w});var $=p.states.select;$&&($.x+=p.x,$.y+=p.y)}else{var z=p.getBoundingRect().clone();z.applyTransform(p.getComputedTransform());var G=(p.style.margin||0)+2.1;z.y-=G/2,z.height+=G,r.push({label:p,labelLine:f,position:y,len:T,len2:M,minTurnAngle:b.get("minTurnAngle"),maxSurfaceAngle:b.get("maxSurfaceAngle"),surfaceNormal:new Point(L,E),linePoints:C,textAlign:w,labelDistance:v,labelAlignTo:_,edgeDistance:x,bleedMargin:S,rect:z})}s.setTextConfig({inside:R})}})),!a&&e.get("avoidLabelOverlap")&&avoidOverlap(r,t,n,l,u,p,c,h);for(var f=0;f0){for(var l=a.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=n.r0}},t.type="pie",t}(ChartView);ChartView.registerClass(PieView);var PI2$8=2*Math.PI,RADIAN$1=Math.PI/180;function getViewRect(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function pieLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),i=t.mapDimension("value"),r=getViewRect(e,n),a=e.get("center"),o=e.get("radius");isArray(o)||(o=[0,o]),isArray(a)||(a=[a,a]);var s=parsePercent$2(r.width,n.getWidth()),l=parsePercent$2(r.height,n.getHeight()),u=Math.min(s,l),c=parsePercent$2(a[0],s)+r.x,h=parsePercent$2(a[1],l)+r.y,p=parsePercent$2(o[0],u/2),d=parsePercent$2(o[1],u/2),f=-e.get("startAngle")*RADIAN$1,g=e.get("minAngle")*RADIAN$1,m=0;t.each(i,(function(e){!isNaN(e)&&m++}));var y=t.getSum(i),v=Math.PI/(y||m)*2,_=e.get("clockwise"),x=e.get("roseType"),S=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var T=PI2$8,M=0,A=f,I=_?1:-1;if(t.setLayout({viewRect:r,r:d}),t.each(i,(function(e,n){var i;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:c,cy:h,r0:p,r:x?NaN:d});else{(i="area"!==x?0===y&&S?v:e*v:PI2$8/m)=0;s--){var l=2*s,u=i[l]-a/2,c=i[l+1]-o/2;if(e>=u&&t>=c&&e<=u+a&&t<=c+o)return s}return-1},t}(Path),LargeSymbolDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e,t){this.group.removeAll();var n=new LargeSymbolPath({rectHover:!0,cursor:"default"});n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,!1,t),this.group.add(n),this._incremental=null},e.prototype.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("points");this.group.eachChild((function(e){if(null!=e.startIndex){var n=2*(e.endIndex-e.startIndex),i=4*e.startIndex*2;t=new Float32Array(t.buffer,i,n)}e.setShape("points",t)}))}},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t,n){var i;this._incremental?(i=new LargeSymbolPath,this._incremental.addDisplayable(i,!0)):((i=new LargeSymbolPath({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(i)),i.setShape({points:t.getLayout("points")}),this._setCommon(i,t,!!this._incremental,n)},e.prototype._setCommon=function(e,t,n,i){var r=t.hostModel;i=i||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=i.clipShape||null,e.symbolProxy=createSymbol(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]=0&&(u.dataIndex=n+(e.startIndex||0))}))}},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),ScatterView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=pointsLayout("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get("clip",!0)?n:null},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new LargeSymbolDraw:new SymbolDraw,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(ChartView);ChartView.registerClass(ScatterView),registerLayout(pointsLayout("scatter"));var IndicatorAxis=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.type="value",r.angle=0,r.name="",r}return __extends(t,e),t}(Axis),Radar=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=map(e.getIndicatorModels(),(function(e,t){var n="indicator_"+t,i=new IndicatorAxis(n,new IntervalScale);return i.name=e.get("name"),i.model=e,e.axis=i,this.dimensions.push(n),i}),this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=Math.sqrt(t*t+n*n);t/=i,n/=i;for(var r,a=Math.atan2(-n,t),o=1/0,s=-1,l=0;ln[0]&&isFinite(h)&&isFinite(n[0]))}else{o.getTicks().length-1>r&&(u=a(u));h=round$1((c=Math.ceil(n[1]/u)*u)-u*r);o.setExtent(h,c),o.setInterval(u)}}))},e.prototype.convertToPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn("Not implemented."),null},e.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},e.create=function(t,n){var i=[];return t.eachComponent("radar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},e.dimensions=[],e}();CoordinateSystemManager.register("radar",Radar);var valueAxisDefault=axisDefault.value;function defaultsShow(e,t){return defaults({show:t},e)}var RadarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),n=this.get("scale"),i=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisLabel"),o=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),u=this.get("axisNameGap"),c=this.get("triggerEvent"),h=map(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var p=o;null!=h.color&&(p=defaults({color:h.color},o));var d=merge(clone(h),{boundaryGap:e,splitNumber:t,scale:n,axisLine:i,axisTick:r,axisLabel:a,name:h.text,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:c},!1);if(s||(d.name=""),"string"==typeof l){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else"function"==typeof l&&(d.name=l(d.name,d));var g=new Model(d,null,this.ecModel);return mixin(g,AxisModelCommonMixin.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:merge({lineStyle:{color:"#bbb"}},valueAxisDefault.axisLine),axisLabel:defaultsShow(valueAxisDefault.axisLabel,!1),axisTick:defaultsShow(valueAxisDefault.axisTick,!1),splitLine:defaultsShow(valueAxisDefault.splitLine,!0),splitArea:defaultsShow(valueAxisDefault.splitArea,!0),indicator:[]},t}(ComponentModel);ComponentModel.registerClass(RadarModel);var axisBuilderAttrs$1=["axisLine","axisTickLabel","axisName"],RadarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;each(map(t.getIndicatorAxes(),(function(e){return new AxisBuilder(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){each(axisBuilderAttrs$1,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var i=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),c=o.get("color"),h=s.get("color"),p=isArray(c)?c:[c],d=isArray(h)?h:[h],f=[],g=[];if("circle"===i)for(var m=n[0].getTicksCoords(),y=t.cx,v=t.cy,_=0;_3?1.4:r>1?1.2:1.1;checkPointerAndTrigger(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(i);checkPointerAndTrigger(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){isTaken(this._zr,"globalPan")||checkPointerAndTrigger(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Eventful);function checkPointerAndTrigger(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(stop(i.event),trigger(e,t,n,i,r))}function trigger(e,t,n,i,r){r.isAvailableBehavior=bind(isAvailableBehavior,null,n,i),e.trigger(t,r)}function isAvailableBehavior(e,t,n){var i=n[e];return!e||i&&(!isString(i)||t.event[i+"Key"])}function updateViewOnPan(e,t,n){var i=e.target;i.x+=t,i.y+=n,i.dirty()}function updateViewOnZoom(e,t,n,i){var r=e.target,a=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/e.zoom;e.zoom=o,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var IRRELEVANT_EXCLUDES={axisPointer:1,tooltip:1,brush:1};function onIrrelevantElement(e,t,n){var i=t.getComponentByElement(e.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!IRRELEVANT_EXCLUDES.hasOwnProperty(i.mainType)&&r&&r.model!==n}function getFixedItemStyle(e){var t=e.getItemStyle(),n=e.get("areaColor");return null!=n&&(t.fill=n),t}var MapDraw=function(){function e(e){var t=new Group;this.uid=getUID("ec_map_draw"),this._controller=new RoamController(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Group),t.add(this._backgroundGroup=new Group)}return e.prototype.draw=function(e,t,n,i,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u,c=this._regionsGroup,h=this.group,p=s.getTransformInfo(),d=!c.childAt(0)||r;if(d)h.transform=p.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new Transformable;f.transform=p.roamTransform,f.decomposeTransform();var g={scaleX:f.scaleX,scaleY:f.scaleY,x:f.x,y:f.y};l=f.scaleX,u=f.scaleY,updateProps(h,g,e)}c.removeAll();var m=createHashMap(),y=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0;each(s.regions,(function(t){var i=m.get(t.name)||m.set(t.name,new Group),r=new CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(r);var s,f=e.getRegionModel(t.name)||e,g=f.getModel("itemStyle"),v=f.getModel("emphasis"),_=v.getModel("itemStyle"),x=f.getModel(["blur","itemStyle"]),S=f.getModel(["select","itemStyle"]),b=getFixedItemStyle(g),T=getFixedItemStyle(_),M=getFixedItemStyle(x),A=getFixedItemStyle(S);if(o){s=o.indexOfName(t.name);var I=o.getItemVisual(s,"style"),C=o.getItemVisual(s,"decal");y&&I.fill&&(b.fill=I.fill),C&&(b.decal=createOrUpdatePatternFromDecal(C,n))}var w=p.rawScaleX,P=p.rawScaleY,L=p.rawX,E=p.rawY,D=function(e){return[e[0]*w+L,e[1]*P+E]};each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],n=0;n=0)&&(F=e);var $=D(t.center),z=new ZRText({x:$[0],y:$[1],scaleX:1/h.scaleX,scaleY:1/h.scaleY,z2:10,silent:!0});setLabelStyle(z,getLabelStatesModels(f),{labelFetcher:F,labelDataIndex:V,defaultText:t.name},{normal:{align:"center",verticalAlign:"middle"}}),r.setTextContent(z),r.setTextConfig({local:!0}),r.disableLabelAnimation=!0,d||updateProps(z,{scaleX:1/l,scaleY:1/u},e)}if(o)o.setItemGraphicEl(s,i);else{var G=e.getRegionModel(t.name);getECData(r).eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:G&&G.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),enableHoverEmphasis(i,v.get("focus"),v.get("blurScope")),c.add(i)})),this._updateController(e,t,n),this._updateMapSelectHandler(e,c,n,i)},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&geoSourceManager.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost=null},e.prototype._updateBackground=function(e){var t=e.map;this._mapName!==t&&each(geoSourceManager.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},e.prototype._updateController=function(e,t,n){var i=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=i.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,updateViewOnPan(a,e.dx,e.dy),n.dispatchAction(extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){this._mouseDownFlag=!1,updateViewOnZoom(a,e.scale,e.originX,e.originY),n.dispatchAction(extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY}));var t=this.group;this._regionsGroup.traverse((function(e){var n=e.getTextContent();n&&(n.scaleX=1/t.scaleX,n.scaleY=1/t.scaleY,n.markRedraw())}))}),this),r.setPointerChecker((function(t,r,a){return i.getViewRectAfterRoam().contain(r,a)&&!onIrrelevantElement(t,n,e)}))},e.prototype._updateMapSelectHandler=function(e,t,n,i){var r=this;t.off("mousedown"),e.get("selectedMode")&&(t.on("mousedown",(function(){r._mouseDownFlag=!0})),t.on("click",(function(e){r._mouseDownFlag&&(r._mouseDownFlag=!1)})))},e}(),MapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new MapDraw(n);r.add(a.group),a.draw(e,t,n,this,i),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var i=e.originalData,r=this.group;i.each(i.mapDimension("value"),(function(t,n){if(!isNaN(t)){var a=i.getItemLayout(n);if(a&&a.point){var o=a.point,s=a.offset,l=new Circle({style:{fill:e.getData().getVisual("style").fill},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),c=i.getName(n),h=u.indexOfName(c),p=i.getItemModel(n),d=p.getModel("label"),f=u.getItemGraphicEl(h);setLabelStyle(l,getLabelStatesModels(p),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(h,n)}}}),l.disableLabelAnimation=!0,d.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(e){l.useState(e)}}r.add(l)}}}))},t.type="map",t}(ChartView);function updateCenterAndZoom(e,t,n){var i=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy&&(o[0]-=t.dx,o[1]-=t.dy,e.setCenter(e.pointToData(o))),null!=a){if(n){var s=n.min||0,l=n.max||1/0;a=Math.max(Math.min(i*a,l),s)/i}e.scaleX*=a,e.scaleY*=a;var u=(t.originX-e.x)*(a-1),c=(t.originY-e.y)*(a-1);e.x-=u,e.y-=c,e.updateTransform(),e.setCenter(e.pointToData(o)),e.setZoom(a*i)}return{center:e.getCenter(),zoom:e.getZoom()}}ChartView.registerClass(MapView),registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){var i=t.coordinateSystem;if("geo"===i.type){var r=updateCenterAndZoom(i,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===n&&each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var v2ApplyTransform=applyTransform,View=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new Transformable,n._rawTransformable=new Transformable,n.name=t,n}return __extends(t,e),t.prototype.setBoundingRect=function(e,t,n,i){return this._rect=new BoundingRect(e,t,n,i),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,i){this.transformTo(e,t,n,i),this._viewRect=new BoundingRect(e,t,n,i)},t.prototype.transformTo=function(e,t,n,i){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new BoundingRect(e,t,n,i)),a.decomposeTransform(),this._updateTransform()},t.prototype.setCenter=function(e){e&&(this._center=e,this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),r=this.getZoom();i=applyTransform([],i,e),n=applyTransform([],n,e),t.originX=i[0],t.originY=i[1],t.x=n[0]-i[0],t.y=n[1]-i[1],t.scaleX=t.scaleY=r,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),copy$1(this.transform||(this.transform=[]),t.transform||create$1()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],invert(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?slice(e):create$1(),rawScaleX:t.scaleX,rawScaleY:t.scaleY,rawX:t.x,rawY:t.y}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var i=t?this._rawTransform:this.transform;return n=n||[],i?v2ApplyTransform(n,e,i):copy(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?v2ApplyTransform([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=getCoordSys(t);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(Transformable);function getCoordSys(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var Geo=function(e){function t(t,n,i,r){var a=e.call(this,t)||this;a.dimensions=["lng","lat"],a.type="geo",a.map=n;var o=geoSourceManager.load(n,i);return a._nameCoordMap=o.nameCoordMap,a._regionsMap=o.regionsMap,a._invertLongitute=null==r||r,a.regions=o.regions,a._rect=o.boundingRect,a}return __extends(t,e),t.prototype.containCoord=function(e){for(var t=this.regions,n=0;n1?(s.width=o,s.height=o/d):(s.height=o,s.width=o*d),s.y=a[1]-s.height/2,s.x=a[0]-s.width/2;else{var g=e.getBoxLayoutParams();g.aspect=d,s=getLayoutRect(g,{width:h,height:p})}this.setViewRect(s.x,s.y,s.width,s.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function setGeoCoords(e,t){each(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}mixin(Geo,View);var GeoCreator=function(){function e(){this.dimensions=Geo.prototype.dimensions}return e.prototype.create=function(e,t){var n=[];e.eachComponent("geo",(function(e,i){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=mapDataStorage.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new Geo(r+i,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),n.push(l),e.coordinateSystem=l,l.model=e,l.resize=resizeGeo,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var i={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}})),each(i,(function(e,i){var r=map(e,(function(e){return e.get("nameMap")})),a=new Geo(i,i,mergeAll(r));a.zoomLimit=retrieve.apply(null,map(e,(function(e){return e.get("scaleLimit")}))),n.push(a),a.resize=resizeGeo,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),each(e,(function(e){e.coordinateSystem=a,setGeoCoords(a,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n){for(var i=(e||[]).slice(),r=createHashMap(),a=0;at&&(t=i.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),Tree=function(){function e(e){this.type="tree",this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,i=t.length;na&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var i=this.getData().tree,r=i.root.children[0],a=i.getNodeByDataIndex(e),o=a.getValue(),s=a.name;a&&a!==r;)s=a.parentNode.name+"."+s,a=a.parentNode;return createTooltipMarkup("nameValue",{name:s,value:o,noValue:isNaN(o)||null==o})},t.type="series.tree",t.layoutMode="box",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(SeriesModel);function init$2(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,r=[t];n=r.pop();)if(i=n.children,n.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(o)}}function firstWalk(e,t){var n=e.isExpand?e.children:[],i=e.parentNode.children,r=e.hierNode.i?i[e.hierNode.i-1]:null;if(n.length){executeShifts(e);var a=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=apportion(e,r,e.parentNode.hierNode.defaultAncestor||i[0],t)}function secondWalk(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function separation(e){return arguments.length?e:defaultSeparation}function radialCoordinate(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function getViewRect$1(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function executeShifts(e){for(var t=e.children,n=t.length,i=0,r=0;--n>=0;){var a=t[n];a.hierNode.prelim+=i,a.hierNode.modifier+=i,r+=a.hierNode.change,i+=a.hierNode.shift+r}}function apportion(e,t,n,i){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=nextRight(s),a=nextLeft(a),s&&a;){r=nextRight(r),o=nextLeft(o),r.hierNode.ancestor=e;var p=s.hierNode.prelim+h-a.hierNode.prelim-u+i(s,a);p>0&&(moveSubtree(nextAncestor(s,e,n),e,p),u+=p,l+=p),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,c+=o.hierNode.modifier}s&&!nextRight(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=h-l),a&&!nextLeft(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,n=e)}return n}function nextRight(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function nextLeft(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function nextAncestor(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function moveSubtree(e,t,n){var i=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=i,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=i}function defaultSeparation(e,t){return e.parentNode===t.parentNode?1:2}SeriesModel.registerClass(TreeSeriesModel);var TreeEdgeShape=function(){this.parentPoint=[],this.childPoints=[]},TreePath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new TreeEdgeShape},t.prototype.buildPath=function(e,t){var n=t.childPoints,i=n.length,r=t.parentPoint,a=n[0],o=n[i-1];if(1===i)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=parsePercent$2(t.forkPosition,1),h=[];h[l]=r[l],h[u]=r[u]+(o[u]-r[u])*c,e.moveTo(r[0],r[1]),e.lineTo(h[0],h[1]),e.moveTo(a[0],a[1]),h[l]=a[l],e.lineTo(h[0],h[1]),h[l]=o[l],e.lineTo(h[0],h[1]),e.lineTo(o[0],o[1]);for(var p=1;pv.x)||(x-=Math.PI);var T=S?"left":"right",M=s.getModel("label"),A=M.get("rotate"),I=A*(Math.PI/180),C=m.getTextContent();C&&(m.setTextConfig({position:M.get("position")||T,rotation:null==A?-x:I,origin:"center"}),C.setStyle("verticalAlign","middle"))}var w=s.get(["emphasis","focus"]),P="ancestor"===w?o.getAncestorsIndices():"descendant"===w?o.getDescendantIndices():null;P&&(getECData(n).focus=P),drawEdge(r,o,c,n,f,d,g,i),n.__edge&&(n.onHoverStateChange=function(t){if("blur"!==t){var i=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);i&&i.hoverState===HOVER_STATE_BLUR||setStatesFlag(n.__edge,t)}})}function drawEdge(e,t,n,i,r,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),h=e.getOrient(),p=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)t.parentNode&&t.parentNode!==n&&(g||(g=i.__edge=new BezierCurve({shape:getEdgeShape(c,h,p,r,r)})),updateProps(g,{shape:getEdgeShape(c,h,p,a,o)},e));else if("polyline"===u)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var m=t.children,y=[],v=0;v=0;a--)i.push(r[a])}}function treeLayout(e,t){e.eachSeriesByType("tree",(function(e){commonLayout(e,t)}))}function commonLayout(e,t){var n=getViewRect$1(e,t);e.layoutInfo=n;var i=e.get("layout"),r=0,a=0,o=null;"radial"===i?(r=2*Math.PI,a=Math.min(n.height,n.width)/2,o=separation((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=n.width,a=n.height,o=separation());var s=e.getData().tree.root,l=s.children[0];if(l){init$2(s),eachAfter(l,firstWalk,o),s.hierNode.modifier=-l.hierNode.prelim,eachBefore(l,secondWalk);var u=l,c=l,h=l;eachBefore(l,(function(e){var t=e.getLayout().x;tc.getLayout().x&&(c=e),e.depth>h.depth&&(h=e)}));var p=u===c?1:o(u,c)/2,d=p-u.getLayout().x,f=0,g=0,m=0,y=0;if("radial"===i)f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y=(e.depth-1)*g;var t=radialCoordinate(m,y);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:y},!0)}));else{var v=e.getOrient();"RL"===v||"LR"===v?(g=a/(c.getLayout().x+p+d),f=r/(h.depth-1||1),eachBefore(l,(function(e){y=(e.getLayout().x+d)*g,m="LR"===v?(e.depth-1)*f:r-(e.depth-1)*f,e.setLayout({x:m,y:y},!0)}))):"TB"!==v&&"BT"!==v||(f=r/(c.getLayout().x+p+d),g=a/(h.depth-1||1),eachBefore(l,(function(e){m=(e.getLayout().x+d)*f,y="TB"===v?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:y},!0)})))}}}function treeVisual(e){e.eachSeriesByType("tree",(function(e){var t=e.getData();t.tree.eachNode((function(e){var n=e.getModel().getModel("itemStyle").getItemStyle();extend(t.ensureUniqueItemVisual(e.dataIndex,"style"),n)}))}))}function retrieveTargetInfo(e,t,n){if(e&&indexOf(t,e.type)>=0){var i=n.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=i.getNodeById(a)))return{node:r}}}function getPathToRoot(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function aboveViewRoot(e,t){return indexOf(getPathToRoot(e),t)>=0}function wrapTreePathInfo(e,t){for(var n=[];e;){var i=e.dataIndex;n.push({name:e.name,dataIndex:i,value:t.getRawValue(i)}),e=e.parentNode}return n.reverse(),n}function enableAriaDecalForTree(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var i=t;i&&i.depth>1;)i=i.parentNode;var r=getDecalFromPalette(e.ecModel,i.name||i.dataIndex+"",n);t.setVisual("decal",r)}))}ChartView.registerClass(TreeView),registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=e.dataIndex,i=t.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var n=updateCenterAndZoom(t.coordinateSystem,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))})),registerLayout(treeLayout),registerVisual(treeVisual);var TreemapSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue(n);var i=e.levels||[],r=this.designatedVisualItemStyle={},a=new Model({itemStyle:r},this,t),o=map((i=e.levels=setDefault(i,t))||[],(function(e){return new Model(e,a,t)}),this),s=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),i=o[n.depth];return e.parentModel=i||a,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e);return createTooltipMarkup("nameValue",{name:i.getName(e),value:r})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},extend(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=createHashMap(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(SeriesModel);function completeTreeValue(e){var t=0;each(e.children,(function(e){completeTreeValue(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}function setDefault(e,t){var n=normalizeToArray(t.get("color")),i=normalizeToArray(t.get("decals"));if(n){var r,a;each(e=e||[],(function(e){var t=new Model(e),n=t.get("color"),i=t.get("decal");(t.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(t.get(["itemStyle","decal"])||i&&"none"!==i)&&(a=!0)}));var o=e[0]||(e[0]={});return r||(o.color=n.slice()),!a&&i&&(o.decal=i.slice()),e}}SeriesModel.registerClass(TreemapSeriesModel);var TEXT_PADDING=8,ITEM_GAP=8,ARRAY_LENGTH=5,Breadcrumb=function(){function e(e){this.group=new Group,e.add(this.group)}return e.prototype.render=function(e,t,n,i){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&n){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(e,l,o,s,i),positionElement(a,l.pos,l.box)}},e.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var r=convertOptionIdName(i.getModel().get("name"),""),a=n.getTextRect(r),o=Math.max(a.width+2*TEXT_PADDING,t.emptyItemWidth);t.totalWidth+=o+ITEM_GAP,t.renderList.push({node:i,text:r,width:o})}},e.prototype._renderContent=function(e,t,n,i,r){for(var a=0,o=t.emptyItemWidth,s=e.get(["breadcrumb","height"]),l=getAvailableSize(t.pos,t.box),u=t.totalWidth,c=t.renderList,h=c.length-1;h>=0;h--){var p=c[h],d=p.node,f=p.width,g=p.text;u>l.width&&(u-=f-o,f=o,g=null);var m=new Polygon({shape:{points:makeItemPoints(a,0,f,s,h===c.length-1,0===h)},style:defaults(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new ZRText({style:{text:g,fill:i.getTextColor(),font:i.getFont()}}),textConfig:{position:"inside"},z:10,onclick:curry(r,d)});m.disableLabelAnimation=!0,this.group.add(m),packEventData(m,e,d),a+=f+ITEM_GAP}},e.prototype.remove=function(){this.group.removeAll()},e}();function makeItemPoints(e,t,n,i,r,a){var o=[[r?e:e-ARRAY_LENGTH,t],[e+n,t],[e+n,t+i],[r?e:e-ARRAY_LENGTH,t+i]];return!a&&o.splice(2,0,[e+n+ARRAY_LENGTH,t+i/2]),!r&&o.push([e,t+i/2]),o}function packEventData(e,t,n){getECData(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&wrapTreePathInfo(n,t)}}var AnimationWrap=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,i,r){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:r}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,r=this._storage.length;iDRAG_THRESHOLD||Math.abs(e.dy)>DRAG_THRESHOLD)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var a=new BoundingRect(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,n-=o.y;var s=create$1();translate(s,s,[-t,-n]),scale$1(s,s,[e.scale,e.scale]),translate(s,s,[t,n]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var i=t.findTarget(e.offsetX,e.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)t._rootToNode(i);else if("zoomToNode"===n)t._zoomToNode(i);else if("link"===n){var a=r.hostTree.data.getItemModel(r.dataIndex),o=a.get("link",!0),s=a.get("target",!0)||"blank";o&&windowOpen(o,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var i=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new Breadcrumb(this.group))).render(e,t,n.node,(function(t){"animating"!==i._state&&(aboveViewRoot(e.getViewRoot(),t)?i._rootToNode({node:t}):i._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=createStorage(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;n={node:i,offsetX:a[0],offsetY:a[1]}}}),this),n},t.type="treemap",t}(ChartView);function createStorage(){return{nodeGroup:[],background:[],content:[]}}function renderNode(e,t,n,i,r,a,o,s,l,u){if(o){var c=o.getLayout(),h=e.getData(),p=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),c&&c.isInView){var d=c.width,f=c.height,g=c.borderWidth,m=c.invisible,y=o.getRawIndex(),v=s&&s.getRawIndex(),_=o.viewChildren,x=c.upperHeight,S=_&&_.length,b=p.getModel("itemStyle"),T=p.getModel(["emphasis","itemStyle"]),M=p.getModel(["blur","itemStyle"]),A=p.getModel(["select","itemStyle"]),I=b.get("borderRadius")||0,C=N("nodeGroup",Group$1);if(C){if(l.add(C),C.x=c.x||0,C.y=c.y||0,C.markRedraw(),inner$9(C).nodeWidth=d,inner$9(C).nodeHeight=f,c.isAboveViewRoot)return C;var w=N("background",Rect$1,u,Z_BG);w&&function(t,n,i){var r=getECData(n);if(r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:d,height:f,r:I}),m)R(n);else{n.invisible=!1;var a=o.getVisual("style"),s=a.stroke,l=getItemStyleNormal(b);l.fill=s;var u=getStateItemStyle(T);u.fill=T.get("borderColor");var c=getStateItemStyle(M);c.fill=M.get("borderColor");var h=getStateItemStyle(A);if(h.fill=A.get("borderColor"),i){var p=d-2*g;O(n,s,p,x,a.opacity,{x:g,y:0,width:p,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,setDefaultStateProxy(n)}t.add(n)}(C,w,S&&c.upperLabelHeight);var P=p.get(["emphasis","focus"]),L=p.get(["emphasis","blurScope"]),E="ancestor"===P?o.getAncestorsIndices():"descendant"===P?o.getDescendantIndices():null;if(S)isHighDownDispatcher(C)&&setAsHighDownDispatcher(C,!1),w&&(setAsHighDownDispatcher(w,!0),h.setItemGraphicEl(o.dataIndex,w),enableHoverFocus(w,E||P,L));else{var D=N("content",Rect$1,u,Z_CONTENT);D&&function(t,n){var i=getECData(n);i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var r=Math.max(d-2*g,0),a=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:a,r:I}),m)R(n);else{n.invisible=!1;var s=o.getVisual("style"),l=s.fill,u=getItemStyleNormal(b);u.fill=l,u.decal=s.decal;var c=getStateItemStyle(T),h=getStateItemStyle(M),p=getStateItemStyle(A);O(n,l,r,s.opacity),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=p,setDefaultStateProxy(n)}t.add(n)}(C,D),w&&isHighDownDispatcher(w)&&setAsHighDownDispatcher(w,!1),setAsHighDownDispatcher(C,!0),h.setItemGraphicEl(o.dataIndex,C),enableHoverFocus(C,E||P,L)}return C}}}function R(e){!e.invisible&&a.push(e)}function O(t,n,i,r,a,s){var l=p.getModel(s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),u=retrieve(e.getFormattedLabel(o.dataIndex,"normal",null,null,l.get("formatter")),convertOptionIdName(p.get("name"),null));if(!s&&c.isLeafRoot){var h=e.get("drillDownIcon",!0);u=h?h+" "+u:u}var d=l.getShallow("show");setLabelStyle(t,getLabelStatesModels(p,s?PATH_UPPERLABEL_NORMAL:PATH_LABEL_NOAMAL),{defaultText:d?u:null,inheritColor:n,defaultOpacity:i,labelFetcher:e,labelDataIndex:o.dataIndex});var f=t.getTextContent(),g=f.style,m=normalizeCssArray(g.padding||0);s&&(t.setTextConfig({layoutRect:s}),f.disableLabelLayout=!0),f.beforeUpdate=function(){var e=Math.max((s?s.width:t.shape.width)-m[1]-m[3],0),n=Math.max((s?s.height:t.shape.height)-m[0]-m[2],0);g.width===e&&g.height===n||f.setStyle({width:e,height:n})},g.truncateMinChar=2,g.lineOverflow="truncate",k(g,s,c);var y=f.getState("emphasis");k(y?y.style:null,s,c)}function k(t,n,i){var r=t?t.text:null;if(!n&&i.isLeafRoot&&null!=r){var a=e.get("drillDownIcon",!0);t.text=a?a+" "+r:r}}function N(e,a,s,l){var u=null!=v&&n[e][v],c=r[e];return u?(n[e][v]=null,function(e,t){var n=e[y]={};t instanceof Group$1?(n.oldX=t.x,n.oldY=t.y):n.oldShape=extend({},t.shape)}(c,u)):m||((u=new a)instanceof Displayable&&(u.z=calculateZ(s,l)),function(e,t){var n=e[y]={},a=o.parentNode,s=t instanceof Group;if(a&&(!i||"drillDown"===i.direction)){var l=0,u=0,c=r.background[a.getRawIndex()];!i&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}(c,u)),t[e][y]=u}}function calculateZ(e,t){var n=e*Z_BASE+t;return(n-1)/n}ChartView.registerClass(TreemapView);for(var noop$1=function(){},actionTypes=["treemapZoomToNode","treemapRender","treemapMove"],i$1=0;i$1=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}function normalizeVisualRange(e,t){var n=e.visual,i=[];isObject(n)?each$4(n,(function(e){i.push(e)})):null!=n&&i.push(n);t||1!==i.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(i[1]=i[0]),setVisualToOption(e,i)}function makePartialColorVisualHandler(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:createNormalizedToNumericVisual([0,1])}}function doMapToArray(e){var t=this.option.visual;return t[Math.round(linearMap(e,[0,1],[0,t.length-1],!0))]||{}}function makeApplyVisual(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function doMapCategory(e){var t=this.option.visual;return t[this.option.loop&&e!==CATEGORY_DEFAULT_VISUAL_INDEX?e%t.length:e]}function doMapFixed(){return this.option.visual[0]}function createNormalizedToNumericVisual(e){return{linear:function(t){return linearMap(t,e,this.option.visual,!0)},category:doMapCategory,piecewise:function(t,n){var i=getSpecifiedVisual.call(this,n);return null==i&&(i=linearMap(t,e,this.option.visual,!0)),i},fixed:doMapFixed}}function getSpecifiedVisual(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=n[VisualMapping.findPieceIndex(e,n)];if(i&&i.visual)return i.visual[this.type]}}function setVisualToOption(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=map(t,(function(e){return parse(e)}))),t}var normalizers={linear:function(e){return linearMap(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=VisualMapping.findPieceIndex(e,t,!0);if(null!=n)return linearMap(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?CATEGORY_DEFAULT_VISUAL_INDEX:t},fixed:noop};function littleThan(e,t,n){return e?t<=n:t=n.length||e===n[e.depth])&&travelTree(e,mapVisual(r,u,e,t,f,i),n,i)}))}else s=calculateColor(u),c.fill=s}}function buildVisuals(e,t,n){var i=extend({},t),r=n.designatedVisualItemStyle;return each(["color","colorAlpha","colorSaturation"],(function(n){r[n]=t[n];var a=e.get(n);r[n]=null,null!=a&&(i[n]=a)})),i}function calculateColor(e){var t=getValueVisualDefine(e,"color");if(t){var n=getValueVisualDefine(e,"colorAlpha"),i=getValueVisualDefine(e,"colorSaturation");return i&&(t=modifyHSL(t,null,null,i)),n&&(t=modifyAlpha(t,n)),t}}function calculateBorderColor(e,t){return null!=t?modifyHSL(t,null,null,e):null}function getValueVisualDefine(e,t){var n=e[t];if(null!=n&&"none"!==n)return n}function buildVisualMapping(e,t,n,i,r,a){if(a&&a.length){var o=getRangeVisual(t,"color")||null!=r.color&&"none"!==r.color&&(getRangeVisual(t,"colorAlpha")||getRangeVisual(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var p=new VisualMapping(h);return inner$a(p).drColorMappingBy=c,p}}}function getRangeVisual(e,t){var n=e.get(t);return isArray(n)&&n.length?{name:t,range:n}:null}function mapVisual(e,t,n,i,r,a){var o=extend({},t);if(r){var s=r.type,l="color"===s&&inner$a(r).drColorMappingBy,u="index"===l?i:"id"===l?a.mapIdToIndex(n.getId()):n.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}var mathMax$7=Math.max,mathMin$7=Math.min,retrieveValue=retrieve,each$5=each,PATH_BORDER_WIDTH=["itemStyle","borderWidth"],PATH_GAP_WIDTH=["itemStyle","gapWidth"],PATH_UPPER_LABEL_SHOW=["upperLabel","show"],PATH_UPPER_LABEL_HEIGHT=["upperLabel","height"],treemapLayout={seriesType:"treemap",reset:function(e,t,n,i){var r=n.getWidth(),a=n.getHeight(),o=e.option,s=getLayoutRect(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=o.size||[],u=parsePercent$2(retrieveValue(s.width,l[0]),r),c=parsePercent$2(retrieveValue(s.height,l[1]),a),h=i&&i.type,p=retrieveTargetInfo(i,["treemapZoomToNode","treemapRootToNode"],e),d="treemapRender"===h||"treemapMove"===h?i.rootRect:null,f=e.getViewRoot(),g=getPathToRoot(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?estimateRootSize(e,p,f,u,c):d?[d.width,d.height]:[u,c],y=o.sort;y&&"asc"!==y&&"desc"!==y&&(y="desc");var v={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),squarify(f,v,!1,0),_=f.getLayout(),each$5(g,(function(e,t){var n=(g[t+1]||f).getValue();e.setLayout(extend({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(calculateRootPosition(s,d,p),!0),e.setLayoutInfo(s),prunning(x,new BoundingRect(-s.x,-s.y,r,a),g,f,0)}};function squarify(e,t,n,i){var r,a;if(!e.isRemoved()){var o=e.getLayout();r=o.width,a=o.height;var s=e.getModel(),l=s.get(PATH_BORDER_WIDTH),u=s.get(PATH_GAP_WIDTH)/2,c=getUpperLabelHeight(s),h=Math.max(l,c),p=l-u,d=h-u;e.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0);var f=(r=mathMax$7(r-2*p,0))*(a=mathMax$7(a-p-d,0)),g=initChildren(e,s,f,t,n,i);if(g.length){var m={x:p,y:d,width:r,height:a},y=mathMin$7(r,a),v=1/0,_=[];_.area=0;for(var x=0,S=g.length;x=0;l--){var u=r["asc"===i?o-l-1:l].getValue();u/n*to[1]&&(o[1]=t)}))):o=[NaN,NaN],{sum:i,dataExtent:o}}function worst(e,t,n){for(var i=0,r=1/0,a=0,o=void 0,s=e.length;ai&&(i=o));var l=e.area*e.area,u=t*t*n;return l?mathMax$7(u*i/l,l/(u*r)):1/0}function position(e,t,n,i,r){var a=t===n.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=n[s[a]],c=t?e.area/t:0;(r||c>n[l[o]])&&(c=n[l[o]]);for(var h=0,p=e.length;hMAX_SAFE_INTEGER&&(u=MAX_SAFE_INTEGER),o=a}u=0&&e.call(t,n[r],r)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&e.call(t,n[r],r)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof GraphNode||(t=this._nodesMap[generateNodeKey(t)]),t){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",a=0;a=0&&n.node2.dataIndex>=0}));for(r=0,a=i.length;r=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function createGraphFromNodeEdge(e,t,n,i,r){for(var a=new Graph(i),o=0;o "+p)),u++)}var d,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=createListFromArray(e,n);else{var g=CoordinateSystemManager.get(f),m=g&&g.dimensions||[];indexOf(m,"value")<0&&m.concat(["value"]);var y=createDimensions(e,{coordDimensions:m});(d=new List(y,n)).initData(e)}var v=new List(["value"],n);return v.initData(l,s),r&&r(d,v),linkList({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}mixin(GraphNode,createGraphDataProxyMixin("hostGraph","data")),mixin(GraphEdge,createGraphDataProxyMixin("hostGraph","edgeData"));var KEY_DELIMITER="--\x3e",getAutoCurvenessParams=function(e){return e.get("autoCurveness")||null},createCurveness=function(e,t){var n=getAutoCurvenessParams(e),i=20,r=[];if("number"==typeof n)i=n;else if(isArray(n))return void(e.__curvenessList=n);t>i&&(i=t);var a=i%2?i+2:i+3;r=[];for(var o=0;o "),value:r.value,noValue:null==r.value})}return defaultSeriesFormatTooltip({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=map(this.option.categories||[],(function(e){return null!=e.value?e:extend({value:0},e)})),t=new List(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);SeriesModel.registerClass(GraphSeriesModel);var straightLineProto=Line.prototype,bezierCurveProto=BezierCurve.prototype,StraightLineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},CurveShape=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(StraightLineShape);function isStraightLine(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ECLinePath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new StraightLineShape},t.prototype.buildPath=function(e,t){isStraightLine(t)?straightLineProto.buildPath.call(this,e,t):bezierCurveProto.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return isStraightLine(this.shape)?straightLineProto.pointAt.call(this,e):bezierCurveProto.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=isStraightLine(t)?[t.x2-t.x1,t.y2-t.y1]:bezierCurveProto.tangentAt.call(this,e);return normalize(n,n)},t}(Path),SYMBOL_CATEGORIES=["fromSymbol","toSymbol"];function makeSymbolTypeKey(e){return"_"+e+"Type"}function createSymbol$1(e,t,n){var i=t.getItemVisual(n,e);if(i&&"none"!==i){var r=t.getItemVisual(n,e+"Size"),a=t.getItemVisual(n,e+"Rotate"),o=isArray(r)?r:[r,r],s=createSymbol(i,-o[0]/2,-o[1]/2,o[0],o[1]);return s.__specifiedRotation=null==a||isNaN(a)?void 0:+a*Math.PI/180||0,s.name=e,s}}function createLine(e){var t=new ECLinePath({name:"line",subPixelOptimize:!0});return setLinePoints(t.shape,e),t}function setLinePoints(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var Line$1=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return __extends(t,e),t.prototype._createLine=function(e,t,n){var i=e.hostModel,r=createLine(e.getItemLayout(t));r.shape.percent=0,initProps(r,{shape:{percent:1}},i,t),this.add(r),each(SYMBOL_CATEGORIES,(function(n){var i=createSymbol$1(n,e,t);this.add(i),this[makeSymbolTypeKey(n)]=e.getItemVisual(t,n)}),this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};setLinePoints(o.shape,a),updateProps(r,o,i,t),each(SYMBOL_CATEGORIES,(function(n){var i=e.getItemVisual(t,n),r=makeSymbolTypeKey(n);if(this[r]!==i){this.remove(this.childOfName(n));var a=createSymbol$1(n,e,t);this.add(a)}this[r]=i}),this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels;if(!n||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel(["emphasis","lineStyle"]).getLineStyle(),o=u.getModel(["blur","lineStyle"]).getLineStyle(),s=u.getModel(["select","lineStyle"]).getLineStyle(),l=getLabelStatesModels(u)}var c=e.getItemVisual(t,"style"),h=c.stroke;r.useStyle(c),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=a,r.ensureState("blur").style=o,r.ensureState("select").style=s,each(SYMBOL_CATEGORIES,(function(e){var t=this.childOfName(e);if(t){t.setColor(h),t.style.opacity=c.opacity;for(var n=0;n0&&(v[0]=-v[0],v[1]=-v[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var S=-Math.atan2(y[1],y[0]);u[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+b,h=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+b,h="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+b,h=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-b}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||h})}}}function T(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(Group),LineDraw=function(){function e(e){this.group=new Group,this._LineCtor=e||Line$1}return e.prototype.isPersistent=function(){return!0},e.prototype.updateData=function(e){var t=this,n=this,i=n.group,r=n._lineData;n._lineData=e,r||i.removeAll();var a=makeSeriesScope$1(e);e.diff(r).add((function(n){t._doAdd(e,n,a)})).update((function(n,i){t._doUpdate(r,e,i,n,a)})).remove((function(e){i.remove(r.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=makeSeriesScope$1(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||isEffectObject(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function makeSeriesScope$1(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:getLabelStatesModels(t)}}function isPointNaN(e){return isNaN(e[0])||isNaN(e[1])}function lineNeedsDraw(e){return!isPointNaN(e[0])&&!isPointNaN(e[1])}function getNodeGlobalScale(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var n=e.option.nodeScaleRatio,i=t.scaleX;return((t.getZoom()-1)*n+1)/i}function getSymbolSize(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var v1=[],v2=[],v3=[],quadraticAt$1=quadraticAt,v2DistSquare=distSquare,mathAbs$2=Math.abs;function intersectCurveCircle(e,t,n){for(var i,r=e[0],a=e[1],o=e[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){v1[0]=quadraticAt$1(r[0],a[0],o[0],c),v1[1]=quadraticAt$1(r[1],a[1],o[1],c),(d=mathAbs$2(v2DistSquare(v1,t)-l))=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function adjustEdge(e,t){var n=[],i=quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[clone$1(l[0]),clone$1(l[1])],l[2]&&l.__original.push(clone$1(l[2])));var h=l.__original;if(null!=l[2]){if(copy(r[0],h[0]),copy(r[1],h[2]),copy(r[2],h[1]),u&&"none"!==u){var p=getSymbolSize(e.node1),d=intersectCurveCircle(r,h[0],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],d,n),r[0][1]=n[3],r[1][1]=n[4]}if(c&&"none"!==c){p=getSymbolSize(e.node2),d=intersectCurveCircle(r,h[1],p*t);i(r[0][0],r[1][0],r[2][0],d,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],d,n),r[1][1]=n[1],r[2][1]=n[2]}copy(l[0],r[0]),copy(l[1],r[2]),copy(l[2],r[1])}else{if(copy(a[0],h[0]),copy(a[1],h[1]),sub(o,a[1],a[0]),normalize(o,o),u&&"none"!==u){p=getSymbolSize(e.node1);scaleAndAdd(a[0],a[0],o,p*t)}if(c&&"none"!==c){p=getSymbolSize(e.node2);scaleAndAdd(a[1],a[1],o,-p*t)}copy(l[0],a[0]),copy(l[1],a[1])}}))}function isViewCoordSys(e){return"view"===e.type}var GraphView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new SymbolDraw,i=new LineDraw,r=this.group;this._controller=new RoamController(t.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if(isViewCoordSys(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):updateProps(s,l,e)}adjustEdge(e.getGraph(),getNodeGlobalScale(e));var u=e.getData();a.updateData(u);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var h=e.forceLayout,p=e.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p),u.graph.eachNode((function(e){var t=e.dataIndex,n=e.getGraphicEl(),r=e.getModel();n.off("drag").off("dragend");var a=r.get("draggable");a&&n.on("drag",(function(){h&&(h.warmUp(),!i._layouting&&i._startForceLayoutIteration(h,p),h.setFixed(t),u.setItemLayout(t,[n.x,n.y]))})).on("dragend",(function(){h&&h.setUnfixed(t)})),n.setDraggable(a&&!!h),"adjacency"===r.get(["emphasis","focus"])&&(getECData(n).focus=e.getAdjacentDataIndices())})),u.graph.eachEdge((function(e){var t=e.getGraphicEl();"adjacency"===e.getModel().get(["emphasis","focus"])&&(getECData(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var d="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var n=u.getItemModel(t).get(["label","rotate"])||0,i=e.getSymbolPath();if(d){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-f);a<0&&(a=2*Math.PI+a);var o=r[0]=r/3?1:2),l=t.y-i(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(o)*a,t.y+i(o)*a),e.lineTo(t.x+n(t.angle)*r,t.y+i(t.angle)*r),e.lineTo(t.x-n(o)*a,t.y-i(o)*a),e.lineTo(s,l)},t}(Path);function parsePosition(e,t){var n=e.get("center"),i=t.getWidth(),r=t.getHeight(),a=Math.min(i,r);return{cx:parsePercent$2(n[0],t.getWidth()),cy:parsePercent$2(n[1],t.getHeight()),r:parsePercent$2(e.get("radius"),a/2)}}function formatLabel(e,t){var n=null==e?"":e+"";return t&&("string"==typeof t?n=t.replace("{value}",n):"function"==typeof t&&(n=t(e))),n}var PI2$9=2*Math.PI,GaugeView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i=e.get(["axisLine","lineStyle","color"]),r=parsePosition(e,n);this._renderMain(e,t,n,i,r),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,r){for(var a=this.group,o=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?SausagePath:Sector,h=u.get("show"),p=u.getModel("lineStyle"),d=p.get("width"),f=(l-s)%PI2$9||l===s?(l-s)%PI2$9:PI2$9,g=s,m=0;h&&m=e&&(0===t?0:i[t-1][0]).8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0}))}if(v.get("show")&&L!==x){D=(D=v.get("distance"))?D+l:l;for(var k=0;k<=S;k++){u=Math.cos(M),c=Math.sin(M);var N=new Line({shape:{x1:u*(f-D)+p,y1:c*(f-D)+d,x2:u*(f-T-D)+p,y2:c*(f-T-D)+d},silent:!0,style:w});"auto"===w.stroke&&N.setStyle({stroke:i((L+k/S)/x)}),h.add(N),M+=I}M-=I}else M+=A}},t.prototype._renderPointer=function(e,t,n,i,r,a,o,s,l){var u=this.group,c=this._data,h=this._progressEls,p=[],d=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),y=m.mapDimension("value"),v=+e.get("min"),_=+e.get("max"),x=[v,_],S=[a,o];function b(t,n){var i,a=m.getItemModel(t).getModel("pointer"),o=parsePercent$2(a.get("width"),r.r),s=parsePercent$2(a.get("length"),r.r),l=e.get(["pointer","icon"]),u=a.get("offsetCenter"),c=a.get("keepAspect");return(i=l?createSymbol(l,parsePercent$2(u[0],r.r)-o/2,parsePercent$2(u[1],r.r)-s,o,s,null,c):new PointerPath({shape:{angle:-Math.PI/2,width:parsePercent$2(a.get("width"),r.r),r:parsePercent$2(a.get("length"),r.r)}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function T(e,t){var n=f.get("roundCap")?SausagePath:Sector,i=f.get("overlap"),o=i?f.get("width"):l/m.count(),u=i?r.r-o:r.r-(e+1)*o,c=i?r.r:r.r-e*o,h=new n({shape:{startAngle:a,endAngle:t,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:c}});return i&&(h.z2=_-m.get(y,e)%_),h}(g||d)&&(m.diff(c).add((function(t){if(d){var n=b(t,a);initProps(n,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(n),m.setItemGraphicEl(t,n)}if(g){var i=T(t,a),r=f.get("clip");initProps(i,{shape:{endAngle:linearMap(m.get(y,t),x,S,r)}},e),u.add(i),p[t]=i}})).update((function(t,n){if(d){var i=c.getItemGraphicEl(n),r=i?i.rotation:a,o=b(t,r);o.rotation=r,updateProps(o,{rotation:-(linearMap(m.get(y,t),x,S,!0)+Math.PI/2)},e),u.add(o),m.setItemGraphicEl(t,o)}if(g){var s=h[n],l=T(t,s?s.shape.endAngle:a),v=f.get("clip");updateProps(l,{shape:{endAngle:linearMap(m.get(y,t),x,S,v)}},e),u.add(l),p[t]=l}})).execute(),m.each((function(e){var t=m.getItemModel(e),n=t.getModel("emphasis");if(d){var r=m.getItemGraphicEl(e);r.useStyle(m.getItemVisual(e,"style")),r.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===r.style.fill&&r.setStyle("fill",i(linearMap(m.get(y,e),x,[0,1],!0))),r.z2EmphasisLift=0,setStatesStylesFromModel(r,t),enableHoverEmphasis(r,n.get("focus"),n.get("blurScope"))}if(g){var a=p[e];a.useStyle(m.getItemVisual(e,"style")),a.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),a.z2EmphasisLift=0,setStatesStylesFromModel(a,t),enableHoverEmphasis(a,n.get("focus"),n.get("blurScope"))}})),this._progressEls=p)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),a=n.get("offsetCenter"),o=n.get("keepAspect"),s=createSymbol(r,t.cx-i/2+parsePercent$2(a[0],t.r),t.cy-i/2+parsePercent$2(a[1],t.r),i,i,null,o);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,r){var a=this,o=e.getData(),s=o.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new Group,h=[],p=[],d=e.isAnimationEnabled();o.diff(this._data).add((function(e){h[e]=new ZRText({silent:!0}),p[e]=new ZRText({silent:!0})})).update((function(e,t){h[e]=a._titleEls[t],p[e]=a._detailEls[t]})).execute(),o.each((function(t){var n=o.getItemModel(t),a=o.get(s,t),f=new Group,g=i(linearMap(a,[l,u],[0,1],!0)),m=n.getModel("title");if(m.get("show")){var y=m.get("offsetCenter"),v=r.cx+parsePercent$2(y[0],r.r),_=r.cy+parsePercent$2(y[1],r.r);(C=h[t]).attr({style:createTextStyle(m,{x:v,y:_,text:o.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:g})}),setLabelValueAnimation(C,{normal:m},e.getRawValue(t),(function(){return o.getName(t)})),d&&animateLabelValue(C,t,o,e),f.add(C)}var x=n.getModel("detail");if(x.get("show")){var S=x.get("offsetCenter"),b=r.cx+parsePercent$2(S[0],r.r),T=r.cy+parsePercent$2(S[1],r.r),M=parsePercent$2(x.get("width"),r.r),A=parsePercent$2(x.get("height"),r.r),I=e.get(["progress","show"])?o.getItemVisual(t,"style").fill:g,C=p[t],w=x.get("formatter");C.attr({style:createTextStyle(x,{x:b,y:T,text:formatLabel(a,w),width:isNaN(M)?null:M,height:isNaN(A)?null:A,align:"center",verticalAlign:"middle"},{inheritColor:I})}),setLabelValueAnimation(C,{normal:x},e.getRawValue(t),(function(e){return formatLabel(e,w)})),d&&animateLabelValue(C,t,o,e),f.add(C)}c.add(f)})),this.group.add(c),this._titleEls=h,this._detailEls=p},t.type="gauge",t}(ChartView);ChartView.registerClass(GaugeView);var FunnelSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return createListSimply(this,{coordDimensions:["value"],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)})},t.prototype._defaultLabelLine=function(e){defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),r=n.mapDimension("value"),a=n.getSum(r);return i.percent=a?+(n.get(r,t)/a*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(SeriesModel);ComponentModel.registerClass(FunnelSeriesModel);var opacityAccessPath=["itemStyle","opacity"],FunnelPiece=function(e){function t(t,n){var i=e.call(this)||this,r=i,a=new Polyline,o=new ZRText;return r.setTextContent(o),i.setTextGuideLine(a),i.updateData(t,n,!0),i}return __extends(t,e),t.prototype.updateData=function(e,t,n){var i=this,r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel("emphasis"),l=a.get(opacityAccessPath);l=null==l?1:l,i.useStyle(e.getItemVisual(t,"style")),i.style.lineJoin="round",n?(i.setShape({points:o.points}),i.style.opacity=0,initProps(i,{style:{opacity:l}},r,t)):updateProps(i,{style:{opacity:l},shape:{points:o.points}},r,t),setStatesStylesFromModel(i,a),this._updateLabel(e,t),enableHoverEmphasis(this,s.get("focus"),s.get("blurScope"))},t.prototype._updateLabel=function(e,t){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),u=l.fill;setLabelStyle(r,getLabelStatesModels(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Point(c[0][0],c[0][1]):null},updateProps(r,{style:{x:s.x,y:s.y}},a,t),r.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),setLabelLineStyle(n,getLabelLineStatesModels(o),{stroke:u})},t}(Polygon),FunnelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this._data,a=this.group;i.diff(r).add((function(e){var t=new FunnelPiece(i,e);i.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var n=r.getItemGraphicEl(t);n.updateData(i,e),a.add(n),i.setItemGraphicEl(e,n)})).remove((function(t){removeElementWithFadeOut(r.getItemGraphicEl(t),e,t)})).execute(),this._data=i},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(ChartView);function getViewRect$3(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function getSortedIndices(e,t){for(var n=e.mapDimension("value"),i=e.mapArray(n,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();oa&&(t[1-i]=t[i]+u.sign*a),t}function getSpanSign(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function restrict(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var each$6=each,mathMin$8=Math.min,mathMax$8=Math.max,mathFloor$2=Math.floor,mathCeil$1=Math.ceil,round$2=round$1,PI$8=Math.PI,Parallel=function(){function e(e,t,n){this.type="parallel",this._axesMap=createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=e.dimensions,r=e.parallelAxisIndex;each$6(i,(function(e,n){var i=r[n],a=t.getComponent("parallelAxis",i),o=this._axesMap.set(e,new ParallelAxis(e,createScaleByModel(a),[0,0],a.get("type"),i)),s="category"===o.type;o.onBand=s&&a.get("boundaryGap"),o.inverse=a.get("inverse"),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,r=t.pixelDimIndex,a=e[1-r],o=e[r];return a>=n&&a<=n+t.axisLength&&o>=i&&o<=i+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var i=n.getData();each$6(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(i,i.mapDimension(e)),niceScaleExtent(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,i=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=n[r[o]],l=[0,s],u=this.dimensions.length,c=restrict$1(t.get("axisExpandWidth"),l),h=restrict$1(t.get("axisExpandCount")||0,[0,u]),p=t.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,d=t.get("axisExpandWindow");d?(e=restrict$1(d[1]-d[0],l),d[1]=d[0]+e):(e=restrict$1(c*(h-1),l),(d=[c*(t.get("axisExpandCenter")||mathFloor$2(u/2))-e/2])[1]=d[0]+e);var f=(s-e)/(u-h);f<3&&(f=0);var g=[mathFloor$2(round$2(d[0]/c,1))+1,mathCeil$1(round$2(d[1]/c,1))-1],m=f/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:n[i[o]],layoutLength:s,axisBase:n[i[1-o]],axisLength:n[r[1-o]],axisExpandable:p,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:d,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;t.each((function(e){var t=[0,i.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),each$6(n,(function(t,n){var a=(i.axisExpandable?layoutAxisWithExpand:layoutAxisWithoutExpand)(n,i),o={horizontal:{x:a.position,y:i.axisLength},vertical:{x:0,y:a.position}},s={horizontal:PI$8/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],c=create$1();rotate(c,c,u),translate(c,c,l),this._axesLayout[t]={position:l,rotation:u,transform:c,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,i){null==n&&(n=0),null==i&&(i=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-c[0])?(l="jump",o=s-r*(1-c[2])):(o=s-r*c[1])>=0&&(o=s-r*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?sliderMove(o,i,a,"all"):l="none";else{var p=i[1]-i[0];(i=[mathMax$8(0,a[1]*s/p-p/2)])[1]=mathMin$8(a[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:l}},e}();function restrict$1(e,t){return mathMin$8(mathMax$8(e,t[0]),t[1])}function layoutAxisWithoutExpand(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function layoutAxisWithExpand(e,t){var n,i,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,c=!1;return e=0;n--)asc(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var i=0,r=t.length;iUNSELECT_THRESHOLD}function getTrackEnds(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function createBaseRectCover(e,t,n,i){var r=new Group;return r.add(new Rect({name:"main",style:makeStyle(n),silent:!0,draggable:!0,cursor:"move",drift:curry(driftRect,e,t,r,["n","s","w","e"]),ondragend:curry(trigger$1,t,{isEnd:!0})})),each(i,(function(n){r.add(new Rect({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:curry(driftRect,e,t,r,n),ondragend:curry(trigger$1,t,{isEnd:!0})}))})),r}function updateBaseRect(e,t,n,i){var r=i.brushStyle.lineWidth||0,a=mathMax$9(r,MIN_RESIZE_LINE_WIDTH),o=n[0][0],s=n[1][0],l=o-r/2,u=s-r/2,c=n[0][1],h=n[1][1],p=c-a+r/2,d=h-a+r/2,f=c-o,g=h-s,m=f+r,y=g+r;updateRectShape(e,t,"main",o,s,f,g),i.transformable&&(updateRectShape(e,t,"w",l,u,a,y),updateRectShape(e,t,"e",p,u,a,y),updateRectShape(e,t,"n",l,u,m,a),updateRectShape(e,t,"s",l,d,m,a),updateRectShape(e,t,"nw",l,u,a,a),updateRectShape(e,t,"ne",p,u,a,a),updateRectShape(e,t,"sw",l,d,a,a),updateRectShape(e,t,"se",p,d,a,a))}function updateCommon(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(makeStyle(n)),r.attr({silent:!i,cursor:i?"move":"default"}),each([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=t.childOfName(n.join("")),a=1===n.length?getGlobalDirection1(e,n[0]):getGlobalDirection2(e,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?CURSOR_MAP[a]+"-resize":null})}))}function updateRectShape(e,t,n,i,r,a,o){var s=t.childOfName(n);s&&s.setShape(pointsToRect(clipByPanel(e,t,[[i,r],[i+a,r+o]])))}function makeStyle(e){return defaults({strokeNoScale:!0},e.brushStyle)}function formatRectRange(e,t,n,i){var r=[mathMin$9(e,n),mathMin$9(t,i)],a=[mathMax$9(e,n),mathMax$9(t,i)];return[[r[0],a[0]],[r[1],a[1]]]}function getTransform$1(e){return getTransform(e.group)}function getGlobalDirection1(e,t){return{left:"w",right:"e",top:"n",bottom:"s"}[transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],getTransform$1(e))]}function getGlobalDirection2(e,t){var n=[getGlobalDirection1(e,t[0]),getGlobalDirection1(e,t[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function driftRect(e,t,n,i,r,a){var o=n.__brushOption,s=e.toRectRange(o.range),l=toLocalDelta(t,r,a);each(i,(function(e){var t=DIRECTION_MAP[e];s[t[0]][t[1]]+=l[t[0]]})),o.range=e.fromRectRange(formatRectRange(s[0][0],s[1][0],s[0][1],s[1][1])),updateCoverAfterCreation(t,n),trigger$1(t,{isEnd:!1})}function driftPolygon(e,t,n,i){var r=t.__brushOption.range,a=toLocalDelta(e,n,i);each(r,(function(e){e[0]+=a[0],e[1]+=a[1]})),updateCoverAfterCreation(e,t),trigger$1(e,{isEnd:!1})}function toLocalDelta(e,t,n){var i=e.group,r=i.transformCoordToLocal(t,n),a=i.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function clipByPanel(e,t,n){var i=getPanelByCover(e,t);return i&&i!==BRUSH_PANEL_GLOBAL?i.clipPath(n,e._transform):clone(n)}function pointsToRect(e){var t=mathMin$9(e[0][0],e[1][0]),n=mathMin$9(e[0][1],e[1][1]);return{x:t,y:n,width:mathMax$9(e[0][0],e[1][0])-t,height:mathMax$9(e[0][1],e[1][1])-n}}function resetCursor(e,t,n){if(e._brushType&&!isOutsideZrArea(e,t.offsetX,t.offsetY)){var i=e._zr,r=e._covers,a=getPanelByPoint(e,t,n);if(!e._dragging)for(var o=0;oi.getWidth()||n<0||n>i.getHeight()}var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function(e,t){function n(e){return e}return createBaseRectCover({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=getTrackEnds(e);return formatRectRange(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){updateBaseRect(e,t,n,i)},updateCommon:updateCommon,contain:mainShapeContain},polygon:{createCover:function(e,t){var n=new Group;return n.add(new Polyline({name:"main",style:makeStyle(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Polygon({name:"main",draggable:!0,drift:curry(driftPolygon,e,t),ondragend:curry(trigger$1,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:clipByPanel(e,t,n)})},updateCommon:updateCommon,contain:mainShapeContain}};function getLineRenderer(e){return{createCover:function(t,n){return createBaseRectCover({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=getTrackEnds(t);return[mathMin$9(n[0][e],n[1][e]),mathMax$9(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var a,o=getPanelByCover(t,n);if(o!==BRUSH_PANEL_GLOBAL&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[i,a];e&&l.reverse(),updateBaseRect(t,n,l,r)},updateCommon:updateCommon,contain:mainShapeContain}}function makeRectPanelClipPath(e){return e=normalizeRect(e),function(t){return clipPointsByRect(t,e)}}function makeLinearBrushOtherExtent(e,t){return e=normalizeRect(e),function(n){var i=null!=t?t:n,r=i?e.width:e.height,a=i?e.x:e.y;return[a,a+(r||0)]}}function makeRectIsTargetByCursor(e,t,n){var i=normalizeRect(e);return function(e,r){return i.contain(r[0],r[1])&&!onIrrelevantElement(e,t,n)}}function normalizeRect(e){return BoundingRect.create(e)}var elementList=["axisLine","axisTickLabel","axisName"],ParallelAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new BrushController(n.getZr())).on("brush",bind(this._onBrush,this))},t.prototype.render=function(e,t,n,i){if(!fromAxisAreaSelect(e,t,i)){this.axisModel=e,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Group,this.group.add(this._axisGroup),e.get("show")){var a=getCoordSysModel(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,c=extend({strokeContainThreshold:l},o.getAxisLayout(u)),h=new AxisBuilder(e,c);each(elementList,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,e,a,l,n),groupTransition(r,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,i,r,a){var o=n.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=BoundingRect.create({x:o[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:makeRectPanelClipPath(u),isTargetByCursor:makeRectIsTargetByCursor(u,a,i),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(getCoverInfoList(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,i=n.axis,r=map(t,(function(e){return[i.coordToData(e.range[0],!0),i.coordToData(e.range[1],!0)]}));(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(ComponentView);function fromAxisAreaSelect(e,t,n){return n&&"axisAreaSelect"===n.type&&t.findComponents({mainType:"parallelAxis",query:n})[0]===e}function getCoverInfoList(e){var t=e.axis;return map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}function getCoordSysModel(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}ComponentView.registerClass(ParallelAxisView);var CLICK_THRESHOLD=5,ParallelView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},each(handlers,(function(e,t){n.getZr().on(t,this._handlers[t]=bind(e,this))}),this)),createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},t.prototype.dispose=function(e,t){each(this._handlers,(function(e,n){t.getZr().off(n,e)})),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(extend({type:"parallelAxisExpand"},e))},t.type="parallel",t}(ComponentView);ComponentView.registerClass(ParallelView);var handlers={mousedown:function(e){checkTrigger(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(checkTrigger(this,"click")&&t){var n=[e.offsetX,e.offsetY];if(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)>CLICK_THRESHOLD)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&checkTrigger(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function checkTrigger(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}registerPreprocessor(parallelPreprocessor);var ParallelSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:bind(makeDefaultEncode,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),i=[];return t.eachActiveState(n,(function(t,r){e===t&&i.push(n.getRawIndex(r))})),i},t.type="series.parallel",t.dependencies=["parallel"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},t}(SeriesModel);function makeDefaultEncode(e){var t=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(t){var n={};return each(t.dimensions,(function(e){var t=convertDimNameToNumber(e);n[e]=t})),n}}function convertDimNameToNumber(e){return+e.replace("dim","")}SeriesModel.registerClass(ParallelSeriesModel);var DEFAULT_SMOOTH=.3,ParallelView$1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Group,n._initialized=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,i){var r=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=makeSeriesScope$2(e);if(a.diff(o).add((function(e){updateElCommon(addEl(a,r,e,l,s),a,e,u)})).update((function(t,n){var i=o.getItemGraphicEl(n),r=createLinePoints(a,t,l,s);a.setItemGraphicEl(t,i),updateProps(i,{shape:{points:r}},e,t),updateElCommon(i,a,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);r.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=createGridClipShape(s,e,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(c)}this._data=a},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var i=t.getData(),r=t.coordinateSystem,a=r.dimensions,o=makeSeriesScope$2(t),s=e.start;s=0&&(a[r[o].depth]=new Model(r[o],this,t));if(i&&n)return createGraphFromNodeEdge(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getData().getItemLayout(t);if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(i){var r=i.depth,a=n.levelModels[r];a&&(e.parentModel=a)}return e}))})).data},t.prototype.setNodePosition=function(e,t){var n=this.option.data[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function i(e){return isNaN(e)||null==e}if("edge"===n){var r=this.getDataParams(e,n),a=r.data,o=r.value;return createTooltipMarkup("nameValue",{name:a.source+" -- "+a.target,value:o,noValue:i(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value;return createTooltipMarkup("nameValue",{name:this.getDataParams(e,n).data.name,value:s,noValue:i(s)})},t.prototype.optionUpdated=function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},t.prototype.getDataParams=function(t,n){var i=e.prototype.getDataParams.call(this,t,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(t).getLayout().value;i.value=r}return i},t.type="series.sankey",t.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(SeriesModel);SeriesModel.registerClass(SankeySeriesModel);var SankeyPathShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},SankeyPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultShape=function(){return new SankeyPathShape},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){enterEmphasis(this)},t.prototype.downplay=function(){leaveEmphasis(this)},t}(Path),SankeyView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),c=e.getData("edge"),h=e.get("orient");this._model=e,a.removeAll(),a.x=o.x,a.y=o.y,r.eachEdge((function(t){var n=new SankeyPath,i=getECData(n);i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var r,o,u,p,d,f,g,m,y=t.getModel(),v=y.getModel("lineStyle"),_=v.get("curveness"),x=t.node1.getLayout(),S=t.node1.getModel(),b=S.get("localX"),T=S.get("localY"),M=t.node2.getLayout(),A=t.node2.getModel(),I=A.get("localX"),C=A.get("localY"),w=t.getLayout();switch(n.shape.extent=Math.max(1,w.dy),n.shape.orient=h,"vertical"===h?(r=(null!=b?b*s:x.x)+w.sy,o=(null!=T?T*l:x.y)+x.dy,u=(null!=I?I*s:M.x)+w.ty,d=r,f=o*(1-_)+(p=null!=C?C*l:M.y)*_,g=u,m=o*_+p*(1-_)):(r=(null!=b?b*s:x.x)+x.dx,o=(null!=T?T*l:x.y)+w.sy,d=r*(1-_)+(u=null!=I?I*s:M.x)*_,f=o,g=r*_+u*(1-_),m=p=(null!=C?C*l:M.y)+w.ty),n.setShape({x1:r,y1:o,x2:u,y2:p,cpx1:d,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(v.getItemStyle()),n.style.fill){case"source":n.style.fill=t.node1.getVisual("color"),n.style.decal=t.node1.getVisual("style").decal;break;case"target":n.style.fill=t.node2.getVisual("color"),n.style.decal=t.node2.getVisual("style").decal;break;case"gradient":var P=t.node1.getVisual("color"),L=t.node2.getVisual("color");"string"==typeof P&&"string"==typeof L&&(n.style.fill=new LinearGradient(0,0,1,0,[{color:P,offset:0},{color:L,offset:1}]))}var E=y.getModel("emphasis");setStatesStylesFromModel(n,y,"lineStyle",(function(e){return e.getItemStyle()})),a.add(n),c.setItemGraphicEl(t.dataIndex,n);var D=E.get("focus");enableHoverEmphasis(n,"adjacency"===D?t.getAdjacentDataIndices():D,E.get("blurScope")),getECData(n).dataType="edge"})),r.eachNode((function(t){var n=t.getLayout(),i=t.getModel(),r=i.get("localX"),o=i.get("localY"),c=i.getModel("emphasis"),h=new Rect({shape:{x:null!=r?r*s:n.x,y:null!=o?o*l:n.y,width:n.dx,height:n.dy},style:i.getModel("itemStyle").getItemStyle()});setLabelStyle(h,getLabelStatesModels(i),{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id}),h.disableLabelAnimation=!0,h.setStyle("fill",t.getVisual("color")),h.setStyle("decal",t.getVisual("style").decal),setStatesStylesFromModel(h,i),a.add(h),u.setItemGraphicEl(t.dataIndex,h),getECData(h).dataType="node";var p=c.get("focus");enableHoverEmphasis(h,"adjacency"===p?t.getAdjacentDataIndices():p,c.get("blurScope"))})),u.eachItemGraphicEl((function(t,r){u.getItemModel(r).get("draggable")&&(t.drift=function(t,a){i._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){i._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&a.setClipPath(createGridClipShape$1(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(ChartView);function createGridClipShape$1(e,t,n){var i=new Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return initProps(i,{shape:{width:e.width+20}},t,n),i}function sankeyLayout(e,t){e.eachSeriesByType("sankey",(function(e){var n=e.get("nodeWidth"),i=e.get("nodeGap"),r=getViewRect$4(e,t);e.layoutInfo=r;var a=r.width,o=r.height,s=e.getGraph(),l=s.nodes,u=s.edges;computeNodeValues(l),layoutSankey(l,u,n,i,a,o,0!==filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function getViewRect$4(e,t){return getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function layoutSankey(e,t,n,i,r,a,o,s,l){computeNodeBreadths(e,t,n,r,a,s,l),computeNodeDepths(e,t,a,r,i,o,s),computeEdgeDepths(e,s)}function computeNodeValues(e){each(e,(function(e){var t=sum(e.outEdges,getEdgeValue),n=sum(e.inEdges,getEdgeValue),i=e.getValue()||0,r=Math.max(t,n,i);e.setLayout({value:r},!0)}))}function computeNodeBreadths(e,t,n,i,r,a,o){for(var s=[],l=[],u=[],c=[],h=0,p=0;p=0;y&&m.depth>d&&(d=m.depth),g.setLayout({depth:y?m.depth:h},!0),"vertical"===a?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;vh-1?d:h-1;o&&"left"!==o&&adjustNodeWithNodeAlign(e,o,a,S),scaleNodeBreadths(e,"vertical"===a?(r-n)/S:(i-n)/S,a)}function isNodeDepth(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function adjustNodeWithNodeAlign(e,t,n,i){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s0;a--)relaxRightToLeft(s,l*=.99,o),resolveCollisions(s,r,n,i,o),relaxLeftToRight(s,l,o),resolveCollisions(s,r,n,i,o)}function prepareNodesByBreadth(e,t){var n=[],i="vertical"===t?"y":"x",r=groupData(e,(function(e){return e.getLayout()[i]}));return r.keys.sort((function(e,t){return e-t})),each(r.keys,(function(e){n.push(r.buckets.get(e))})),n}function initializeNodeDepth(e,t,n,i,r,a){var o=1/0;each(e,(function(e){var t=e.length,s=0;each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===a?(i-(t-1)*r)/s:(n-(t-1)*r)/s;l0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[h]+t;if((l=u-t-("vertical"===r?i:n))>0){o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o;for(p=c-2;p>=0;--p)(l=(s=e[p]).getLayout()[a]+s.getLayout()[h]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}}))}function relaxRightToLeft(e,t,n){each(e.slice().reverse(),(function(e){each(e,(function(e){if(e.outEdges.length){var i=sum(e.outEdges,weightedTarget,n)/sum(e.outEdges,getEdgeValue);if(isNaN(i)){var r=e.outEdges.length;i=r?sum(e.outEdges,centerTarget,n)/r:0}if("vertical"===n){var a=e.getLayout().x+(i-center$1(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(i-center$1(e,n))*t;e.setLayout({y:o},!0)}}}))}))}function weightedTarget(e,t){return center$1(e.node2,t)*e.getValue()}function centerTarget(e,t){return center$1(e.node2,t)}function weightedSource(e,t){return center$1(e.node1,t)*e.getValue()}function centerSource(e,t){return center$1(e.node1,t)}function center$1(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function getEdgeValue(e){return e.getValue()}function sum(e,t,n){for(var i=0,r=e.length,a=-1;++ai&&(i=t)})),each(t,(function(t){var r=new VisualMapping({type:"color",mappingMethod:"linear",dataExtent:[n,i],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get(["itemStyle","color"]);null!=a?(t.setVisual("color",a),t.setVisual("style",{fill:a})):(t.setVisual("color",r),t.setVisual("style",{fill:r}))}))}}))}ChartView.registerClass(SankeyView),registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))})),registerLayout(sankeyLayout),registerVisual(sankeyVisual);var WhiskerBoxCommonMixin=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,i,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(e.layout="vertical",n=a.getOrdinalMeta(),i=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],p=[r,a],d=p[u].get("type"),f=p[1-u].get("type"),g=e.data;if(g&&i){var m=[];each(g,(function(e,t){var n;isArray(e)?(n=e.slice(),e.unshift(t)):isArray(e.value)?(n=e.value.slice(),e.value.unshift(t)):n=e,m.push(n)})),e.data=m}var y=this.defaultValueDimensions,v=[{name:c,type:getDimensionTypeByAxis(d),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:getDimensionTypeByAxis(f),dimsDef:y.slice()}];return createListSimply(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:curry(makeSeriesEncodeForAxisCoordSys,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),BoxplotSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return __extends(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(SeriesModel);mixin(BoxplotSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(BoxplotSeriesModel);var BoxplotView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;i.diff(a).add((function(e){if(i.hasValue(e)){var t=createNormalBox(i.getItemLayout(e),i,e,o,!0);i.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(i.hasValue(e)){var s=i.getItemLayout(e);n?updateNormalBoxData(s,n,i,e):n=createNormalBox(s,i,e,o),r.add(n),i.setItemGraphicEl(e,n)}else r.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=i},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot",t}(ChartView),BoxPathShape=function(){},BoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new BoxPathShape},t.prototype.buildPath=function(e,t){var n=t.points,i=0;for(e.moveTo(n[i][0],n[i][1]),i++;i<4;i++)e.lineTo(n[i][0],n[i][1]);for(e.closePath();ig){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}var boxplotTransform={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==SOURCE_FORMAT_ARRAY_ROWS){var n="";0,throwError(n)}var i=prepareBoxplotData(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};registerVisual(boxplotVisual),registerLayout(boxplotLayout),registerTransform(boxplotTransform);var CandlestickSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return __extends(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var i=t.getItemLayout(e);return i&&n.rect(i.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(SeriesModel);mixin(CandlestickSeriesModel,WhiskerBoxCommonMixin,!0),SeriesModel.registerClass(CandlestickSeriesModel);var SKIP_PROPS=["color","borderColor"],CandlestickView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,i){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;null!=this._isLargeDraw&&t===this._isLargeDraw||(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,i=this.group,r=t.getLayout("isSimpleBox"),a=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||i.removeAll(),t.diff(n).add((function(n){if(t.hasValue(n)){var o=t.getItemLayout(n);if(a&&isNormalBoxClipped(s,o))return;var l=createNormalBox$1(o,n,!0);initProps(l,{shape:{points:o.ends}},e,n),setBoxCommon(l,t,n,r),i.add(l),t.setItemGraphicEl(n,l)}})).update((function(o,l){var u=n.getItemGraphicEl(l);if(t.hasValue(o)){var c=t.getItemLayout(o);a&&isNormalBoxClipped(s,c)?i.remove(u):(u?updateProps(u,{shape:{points:c.ends}},e,o):u=createNormalBox$1(c),setBoxCommon(u,t,o,r),i.add(u),t.setItemGraphicEl(o,u))}else i.remove(u)})).remove((function(e){var t=n.getItemGraphicEl(e);t&&i.remove(t)})).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),createLarge$1(e,this.group);var t=e.get("clip",!0)?createClipPath(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n,i=t.getData(),r=i.getLayout("isSimpleBox");null!=(n=e.next());){var a=createNormalBox$1(i.getItemLayout(n));setBoxCommon(a,i,n,r),a.incremental=!0,this.group.add(a)}},t.prototype._incrementalRenderLarge=function(e,t){createLarge$1(t,this.group,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(ChartView);ChartView.registerClass(CandlestickView);var NormalBoxPathShape=function(){},NormalBoxPath=function(e){function t(t){var n=e.call(this,t)||this;return n.type="normalCandlestickBox",n}return __extends(t,e),t.prototype.getDefaultShape=function(){return new NormalBoxPathShape},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Path);function createNormalBox$1(e,t,n){var i=e.ends;return new NormalBoxPath({shape:{points:n?transInit$1(i,e):i},z2:100})}function isNormalBoxClipped(e,t){for(var n=!0,i=0;i0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]),a=n.getModel("itemStyle").getItemStyle(SKIP_PROPS);t.useStyle(a),t.style.fill=null,t.style.stroke=r}function candlestickPreprocessor(e){e&&isArray(e.series)&&each(e.series,(function(e){isObject(e)&&"k"===e.type&&(e.type="candlestick")}))}var positiveBorderColorQuery=["itemStyle","borderColor"],negativeBorderColorQuery=["itemStyle","borderColor0"],positiveColorQuery=["itemStyle","color"],negativeColorQuery=["itemStyle","color0"],candlestickVisual={seriesType:"candlestick",plan:createRenderPlanner(),performRawSeries:!0,reset:function(e,t){function n(e,t){return t.get(e>0?positiveColorQuery:negativeColorQuery)}function i(e,t){return t.get(e>0?positiveBorderColorQuery:negativeBorderColorQuery)}if(e.getData().setVisual("legendSymbol","roundRect"),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var r;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign,s=a.getItemStyle();s.fill=n(o,a),s.stroke=i(o,a)||s.fill,extend(t.ensureUniqueItemVisual(r,"style"),s)}}}}},LargeArr$1="undefined"!=typeof Float32Array?Float32Array:Array,candlestickLayout={seriesType:"candlestick",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),i=calculateCandleWidth(e,n),r=["x","y"],a=n.mapDimension(r[0]),o=n.mapDimensionsAll(r[1]),s=o[0],l=o[1],u=o[2],c=o[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,n){var i,r,o=new LargeArr$1(4*e.count),h=0,p=[],d=[];for(;null!=(r=e.next());){var f=n.get(a,r),g=n.get(s,r),m=n.get(l,r),y=n.get(u,r),v=n.get(c,r);isNaN(f)||isNaN(y)||isNaN(v)?(o[h++]=NaN,h+=3):(o[h++]=getSign(n,r,g,m,l),p[0]=f,p[1]=y,i=t.dataToPoint(p,null,d),o[h++]=i?i[0]:NaN,o[h++]=i?i[1]:NaN,p[1]=v,i=t.dataToPoint(p,null,d),o[h++]=i?i[1]:NaN)}n.setLayout("largePoints",o)}:function(e,n){var r;for(;null!=(r=e.next());){var o=n.get(a,r),h=n.get(s,r),p=n.get(l,r),d=n.get(u,r),f=n.get(c,r),g=Math.min(h,p),m=Math.max(h,p),y=b(g,o),v=b(m,o),_=b(d,o),x=b(f,o),S=[];T(S,v,0),T(S,y,1),S.push(A(x),A(v),A(_),A(y)),n.setItemLayout(r,{sign:getSign(n,r,h,p,l),initBaseline:h>p?v[1]:y[1],ends:S,brushRect:M(d,f,o)})}function b(e,n){var i=[];return i[0]=n,i[1]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(i)}function T(e,t,n){var r=t.slice(),a=t.slice();r[0]=subPixelOptimize$1(r[0]+i/2,1,!1),a[0]=subPixelOptimize$1(a[0]-i/2,1,!0),n?e.push(r,a):e.push(a,r)}function M(e,t,n){var r=b(e,n),a=b(t,n);return r[0]-=i/2,a[0]-=i/2,{x:r[0],y:r[1],width:i,height:a[1]-r[1]}}function A(e){return e[0]=subPixelOptimize$1(e[0],1),e}}}}};function getSign(e,t,n,i,r){return n>i?-1:n0?e.get(r,t-1)<=i?1:-1:1}function calculateCandleWidth(e,t){var n,i=e.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/t.count()),a=parsePercent$2(retrieve2(e.get("barMaxWidth"),r),r),o=parsePercent$2(retrieve2(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?parsePercent$2(s,r):Math.max(Math.min(r/2,a),o)}registerPreprocessor(candlestickPreprocessor),registerVisual(candlestickVisual),registerLayout(candlestickLayout);var EffectScatterSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type="series.effectScatter",t.dependencies=["grid","polar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10},t}(SeriesModel);SeriesModel.registerClass(EffectScatterSeriesModel);var EFFECT_RIPPLE_NUMBER=3;function normalizeSymbolSize$1(e){return isArray(e)||(e=[+e,+e]),e}function updateRipplePath(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var EffectSymbol=function(e){function t(t,n){var i=e.call(this)||this,r=new Symbol(t,n),a=new Group;return i.add(r),i.add(a),i.updateData(t,n),i}return __extends(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,i=this.childAt(1),r=0;r ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(SeriesModel);SeriesModel.registerClass(LinesSeriesModel);var EffectLine=function(e){function t(t,n,i){var r=e.call(this)||this;return r.add(r.createLine(t,n,i)),r._updateEffectSymbol(t,n),r}return __extends(t,e),t.prototype.createLine=function(e,t,n){return new Line$1(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel("effect"),i=n.get("symbolSize"),r=n.get("symbol");isArray(i)||(i=[i,i]);var a=e.getItemVisual(t,"style"),o=n.get("color")||a&&a.stroke,s=this.childAt(1);this._symbolType!==r&&(this.remove(s),(s=createSymbol(r,-.5,-.5,1,1,o)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",o),s.setStyle(n.getItemStyle(["color"])),s.scaleX=i[0],s.scaleY=i[1],s.setColor(o),this._symbolType=r,this._symbolScale=i,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var i=this.childAt(1);if(i){var r=this,a=e.getItemLayout(n),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=retrieve(t.get("delay"),(function(t){return t/e.count()*o/3}));if(i.ignore=!0,this._updateAnimationPoints(i,a),l>0&&(o=this._getLineLength(i)/l*1e3),(o!==this._period||s!==this._loop)&&(i.stopAnimation(),o>0)){var c=void 0;c="function"==typeof u?u(n):u,i.__t>0&&(c=-o*i.__t),i.__t=0;var h=i.animate("",s).when(o,{__t:1}).delay(c).during((function(){r._updateSymbolPosition(i)}));s||h.done((function(){r.remove(i)})),h.start()}this._period=o,this._loop=s}},t.prototype._getLineLength=function(e){return dist(e.__p1,e.__cp1)+dist(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,i=e.__cp1,r=e.__t,a=[e.x,e.y],o=a.slice(),s=quadraticAt,l=quadraticDerivativeAt;a[0]=s(t[0],i[0],n[0],r),a[1]=s(t[1],i[1],n[1],r);var u=l(t[0],i[0],n[0],r),c=l(t[1],i[1],n[1],r);e.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT=0&&!(i[a]<=t);a--);a=Math.min(a,r-2)}else{for(a=o;at);a++);a=Math.min(a-1,r-2)}var s=(t-i[a])/(i[a+1]-i[a]),l=n[a],u=n[a+1];e.x=l[0]*(1-s)+s*u[0],e.y=l[1]*(1-s)+s*u[1];var c=u[0]-l[0],h=u[1]-l[1];e.rotation=-Math.atan2(h,c)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=t,e.ignore=!1}},t}(EffectLine),LargeLinesPathShape=function(){this.polyline=!1,this.curveness=0,this.segs=[]},LargeLinesPath=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LargeLinesPathShape},t.prototype.buildPath=function(e,t){var n=t.segs,i=t.curveness;if(t.polyline)for(var r=0;r0){e.moveTo(n[r++],n[r++]);for(var o=1;o0){var h=(s+u)/2-(l-c)*i,p=(l+c)/2-(u-s)*i;e.quadraticCurveTo(h,p,u,c)}else e.lineTo(u,c)}},t.prototype.findDataIndex=function(e,t){var n=this.shape,i=n.segs,r=n.curveness,a=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s0)for(var u=i[s++],c=i[s++],h=1;h0){if(containStroke$2(u,c,(u+p)/2-(c-d)*r,(c+d)/2-(p-u)*r,p,d,a,e,t))return o}else if(containStroke(u,c,p,d,a,e,t))return o;o++}return-1},t}(Path),LargeLineDraw=function(){function e(){this.group=new Group}return e.prototype.isPersistent=function(){return!this._incremental},e.prototype.updateData=function(e){this.group.removeAll();var t=new LargeLinesPath({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new IncrementalDisplayble({silent:!0})),this.group.add(this._incremental)):this._incremental=null},e.prototype.incrementalUpdate=function(e,t){var n=new LargeLinesPath;n.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(n,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=e.start,this.group.add(n))},e.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},e.prototype._setCommon=function(e,t,n){var i=t.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("style");if(r&&r.stroke&&e.setStyle("stroke",r.stroke),e.setStyle("fill",null),!n){var a=getECData(e);a.seriesIndex=i.seriesIndex,e.on("mousemove",(function(t){a.dataIndex=null;var n=e.findDataIndex(t.offsetX,t.offsetY);n>0&&(a.dataIndex=n+e.__startIndex)}))}},e.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},e}(),linesLayout={seriesType:"lines",plan:createRenderPlanner(),reset:function(e){var t=e.coordinateSystem,n=e.get("polyline"),i=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,c=r.start;c0){var A=a(y)?s:l;y>0&&(y=y*T+b),_[x++]=A[M],_[x++]=A[M+1],_[x++]=A[M+2],_[x++]=A[M+3]*y*256}else x+=4}return h.putImageData(v,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),r=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,r),i[a++]=r[0],i[a++]=r[1],i[a++]=r[2],i[a++]=r[3];return i},e}();function getIsInPiecewiseRange(e,t,n){var i=e[1]-e[0],r=(t=map(t,(function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}}))).length,a=0;return function(e){var i;for(i=a;i=0;i--){var o;if((o=t[i].interval)[0]<=e&&e<=o[1]){a=i;break}}return i>=0&&i=t[0]&&e<=t[1]}}function isGeoCoordSys(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var HeatmapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(i=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):isGeoCoordSys(r)&&this._renderOnGeo(r,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var a,o,s,l,u=e.coordinateSystem;if(isCoordinateSystemType(u,"cartesian2d")){var c=u.getAxis("x"),h=u.getAxis("y");0,a=c.getBandWidth(),o=h.getBandWidth(),s=c.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,d=e.getData(),f=e.getModel(["emphasis","itemStyle"]).getItemStyle(),g=e.getModel(["blur","itemStyle"]).getItemStyle(),m=e.getModel(["select","itemStyle"]).getItemStyle(),y=getLabelStatesModels(e),v=e.get(["emphasis","focus"]),_=e.get(["emphasis","blurScope"]),x=isCoordinateSystemType(u,"cartesian2d")?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],S=n;Ss[1]||Al[1])continue;var I=u.dataToPoint([M,A]);b=new Rect({shape:{x:Math.floor(Math.round(I[0])-a/2),y:Math.floor(Math.round(I[1])-o/2),width:Math.ceil(a),height:Math.ceil(o)},style:T})}else{if(isNaN(d.get(x[1],S)))continue;b=new Rect({z2:1,shape:u.dataToRect([d.get(x[0],S)]).contentShape,style:T})}var C=d.getItemModel(S);if(d.hasItemOption){var w=C.getModel("emphasis");f=w.getModel("itemStyle").getItemStyle(),g=C.getModel(["blur","itemStyle"]).getItemStyle(),m=C.getModel(["select","itemStyle"]).getItemStyle(),v=w.get("focus"),_=w.get("blurScope"),y=getLabelStatesModels(C)}var P=e.getRawValue(S),L="-";P&&null!=P[2]&&(L=P[2]+""),setLabelStyle(b,y,{labelFetcher:e,labelDataIndex:S,defaultOpacity:T.opacity,defaultText:L}),b.ensureState("emphasis").style=f,b.ensureState("blur").style=g,b.ensureState("select").style=m,enableHoverEmphasis(b,v,_),b.incremental=r,r&&(b.states.emphasis.hoverLayer=!0),p.add(b),d.setItemGraphicEl(S,b)}},t.prototype._renderOnGeo=function(e,t,n,i){var r=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new HeatmapLayer;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),p=Math.min(l.width+l.x,i.getWidth()),d=Math.min(l.height+l.y,i.getHeight()),f=p-c,g=d-h,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],y=o.mapArray(m,(function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=c,r[1]-=h,r.push(i),r})),v=n.getExtent(),_="visualMap.continuous"===n.type?getIsInContinuousRange(v,n.option.range):getIsInPiecewiseRange(v,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var x=new ZRImage({style:{width:f,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(x)},t.type="heatmap",t}(ChartView);ChartView.registerClass(HeatmapView);var PictorialBarSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return __extends(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=inheritDefaultOption(BaseBarSeriesModel.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(BaseBarSeriesModel);SeriesModel.registerClass(PictorialBarSeriesModel);var BAR_BORDER_WIDTH_QUERY$1=["itemStyle","borderWidth"],LAYOUT_ATTRS=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pathForLineWidth=new Circle,PictorialBarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=o.getBaseAxis().isHorizontal(),l=o.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:LAYOUT_ATTRS[+s],categoryDim:LAYOUT_ATTRS[1-+s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=getItemModel(r,e),n=getSymbolMeta(r,e,t,u),a=createBar(r,u,n);r.setItemGraphicEl(e,a),i.add(a),updateCommon$1(a,u,n)}})).update((function(e,t){var n=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=getItemModel(r,e),s=getSymbolMeta(r,e,o,u),l=getShapeStr(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(e,null),n=null),n?updateBar(n,u,s):n=createBar(r,u,s,!0),r.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=s,i.add(n),updateCommon$1(n,u,s)}else i.remove(n)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&removeBar(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},t.prototype.remove=function(e,t){var n=this.group,i=this._data;e.get("animation")?i&&i.eachItemGraphicEl((function(t){removeBar(i,getECData(t).dataIndex,e,t)})):n.removeAll()},t.type="pictorialBar",t}(ChartView);function getSymbolMeta(e,t,n,i){var r=e.getItemLayout(t),a=n.get("symbolRepeat"),o=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:t,layout:r,itemModel:n,symbolType:e.getItemVisual(t,"symbol")||"circle",style:e.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};prepareBarLength(n,a,r,i,h),prepareSymbolSize(e,t,r,a,o,h.boundingLength,h.pxSign,u,i,h),prepareLineWidth(n,h.symbolScale,l,i,h);var p=h.symbolSize,d=n.get("symbolOffset");return isArray(d)&&(d=[parsePercent$2(d[0],p[0]),parsePercent$2(d[1],p[1])]),prepareLayoutInfo(n,p,r,a,o,d,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function prepareBarLength(e,t,n,i,r){var a,o=i.valueDim,s=e.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[o.wh]<=0);if(isArray(s)){var h=[convertToCoordOnAxis(l,s[0])-u,convertToCoordOnAxis(l,s[1])-u];h[1]0?1:a<0?-1:0}function convertToCoordOnAxis(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function prepareSymbolSize(e,t,n,i,r,a,o,s,l,u){var c,h=l.valueDim,p=l.categoryDim,d=Math.abs(n[p.wh]),f=e.getItemVisual(t,"symbolSize");(c=isArray(f)?f.slice():null==f?["100%","100%"]:[f,f])[p.index]=parsePercent$2(c[p.index],d),c[h.index]=parsePercent$2(c[h.index],i?d:Math.abs(a)),u.symbolSize=c,(u.symbolScale=[c[0]/s,c[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}function prepareLineWidth(e,t,n,i,r){var a=e.get(BAR_BORDER_WIDTH_QUERY$1)||0;a&&(pathForLineWidth.attr({scaleX:t[0],scaleY:t[1],rotation:n}),pathForLineWidth.updateTransform(),a/=pathForLineWidth.getLineScale(),a*=t[i.valueDim.index]),r.valueLineWidth=a}function prepareLayoutInfo(e,t,n,i,r,a,o,s,l,u,c,h){var p=c.categoryDim,d=c.valueDim,f=h.pxSign,g=Math.max(t[d.index]+s,0),m=g;if(i){var y=Math.abs(l),v=retrieve(e.get("symbolMargin"),"15%")+"",_=!1;v.lastIndexOf("!")===v.length-1&&(_=!0,v=v.slice(0,v.length-1));var x=parsePercent$2(v,t[d.index]),S=Math.max(g+2*x,0),b=_?0:2*x,T=isNumeric(i),M=T?i:toIntTimes((y+b)/S);S=g+2*(x=(y-M*g)/2/(_?M:M-1)),b=_?0:2*x,T||"fixed"===i||(M=u?toIntTimes((Math.abs(u)+b)/S):0),m=M*S-b,h.repeatTimes=M,h.symbolMargin=x}var A=f*(m/2),I=h.pathPosition=[];I[p.index]=n[p.wh]/2,I[d.index]="start"===o?A:"end"===o?l-A:l/2,a&&(I[0]+=a[0],I[1]+=a[1]);var C=h.bundlePosition=[];C[p.index]=n[p.xy],C[d.index]=n[d.xy];var w=h.barRectShape=extend({},n);w[d.wh]=f*Math.max(Math.abs(n[d.wh]),Math.abs(I[d.index]+A)),w[p.wh]=n[p.wh];var P=h.clipShape={};P[p.xy]=-n[p.xy],P[p.wh]=c.ecSize[p.wh],P[d.xy]=0,P[d.wh]=n[d.wh]}function createPath(e){var t=e.symbolPatternSize,n=createSymbol(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function createOrUpdateRepeatSymbols(e,t,n,i){var r=e.__pictorialBundle,a=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,u=n.repeatTimes||0,c=0,h=a[t.valueDim.index]+o+2*n.symbolMargin;for(eachPath(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=u,c0:i<0)&&(r=u-1-e),t[l.index]=h*(r-u/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function createOrUpdateSingleSymbol(e,t,n,i){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?updateAttr(a,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(a=e.__pictorialMainPath=createPath(n),r.add(a),updateAttr(a,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function createOrUpdateBarRect(e,t,n){var i=extend({},t.barRectShape),r=e.__pictorialBarRect;r?updateAttr(r,null,{shape:i},t,n):(r=e.__pictorialBarRect=new Rect({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function createOrUpdateClip(e,t,n,i){if(n.symbolClip){var r=e.__pictorialClipPath,a=extend({},n.clipShape),o=t.valueDim,s=n.animationModel,l=n.dataIndex;if(r)updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=n.clipShape[o.wh],graphic[i?"updateProps":"initProps"](r,{shape:u},s,l)}}}function getItemModel(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=getAnimationDelayParams,n.isAnimationEnabled=isAnimationEnabled,n}function getAnimationDelayParams(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function isAnimationEnabled(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function createBar(e,t,n,i){var r=new Group,a=new Group;return r.add(a),r.__pictorialBundle=a,a.x=n.bundlePosition[0],a.y=n.bundlePosition[1],n.symbolRepeat?createOrUpdateRepeatSymbols(r,t,n):createOrUpdateSingleSymbol(r,t,n),createOrUpdateBarRect(r,n,i),createOrUpdateClip(r,t,n,i),r.__pictorialShapeStr=getShapeStr(e,n),r.__pictorialSymbolMeta=n,r}function updateBar(e,t,n){var i=n.animationModel,r=n.dataIndex;updateProps(e.__pictorialBundle,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?createOrUpdateRepeatSymbols(e,t,n,!0):createOrUpdateSingleSymbol(e,t,n,!0),createOrUpdateBarRect(e,n,!0),createOrUpdateClip(e,t,n,!0)}function removeBar(e,t,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var a=[];eachPath(i,(function(e){a.push(e)})),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),each(a,(function(e){removeElement(e,{scaleX:0,scaleY:0},n,t,(function(){i.parent&&i.parent.remove(i)}))})),e.setItemGraphicEl(t,null)}function getShapeStr(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function eachPath(e,t,n){each(e.__pictorialBundle.children(),(function(i){i!==e.__pictorialBarRect&&t.call(n,i)}))}function updateAttr(e,t,n,i,r,a){t&&e.attr(t),i.symbolClip&&!r?n&&e.attr(n):n&&graphic[r?"updateProps":"initProps"](e,n,i.animationModel,i.dataIndex,a)}function updateCommon$1(e,t,n){var i=n.dataIndex,r=n.itemModel,a=r.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),p=a.get("scale");eachPath(e,(function(e){if(e instanceof ZRImage){var t=e.style;e.useStyle(extend({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var i=e.ensureState("emphasis");i.style=o,p&&(i.scaleX=1.1*e.scaleX,i.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,u&&(e.cursor=u),e.z2=n.z2}));var d=t.valueDim.posDesc[+(n.boundingLength>0)];setLabelStyle(e.__pictorialBarRect,getLabelStatesModels(r),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:getDefaultLabel(t.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:d}),enableHoverEmphasis(e,c,h)}function toIntTimes(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}ChartView.registerClass(PictorialBarView),registerLayout(curry(layout,"pictorialBar"));var SingleAxis=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.type=r||"value",o.position=a||"bottom",o}return __extends(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(Axis),Single=function(){function e(e,t,n){this.type="single",this.dimension="single",this.dimensions=["single"],this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var i=this.dimension,r=new SingleAxis(i,createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},e.prototype.update=function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();each(t.mapDimensionsAll(this.dimension),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},e.prototype.resize=function(e,t){this._rect=getLayoutRect({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),i=n?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(i[r],i[1-r]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),i=n[0]+n[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return i-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),i[r]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$2(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$2(t)===this?this.pointToData(n):null},e}();function getCoordSys$2(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function create$3(e,t){var n=[];return e.eachComponent("singleAxis",(function(i,r){var a=new Single(i,e,t);a.name="single_"+r,a.resize(i,t),i.coordinateSystem=a,n.push(a)})),e.eachSeries((function(e){if("singleAxis"===e.get("coordinateSystem")){var t=e.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0];e.coordinateSystem=t&&t.coordinateSystem}})),n}function layout$2(e,t){t=t||{};var n=e.coordinateSystem,i=e.axis,r={},a=i.position,o=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]];r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o];r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),retrieve(t.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),r.labelRotation="top"===a?-c:c,r.z2=1,r}CoordinateSystemManager.register("single",{create:create$3,dimensions:Single.prototype.dimensions});var axisBuilderAttrs$2=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs$1=["splitArea","splitLine"],SingleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}return __extends(t,e),t.prototype.render=function(t,n,i,r){var a=this.group;a.removeAll();var o=this._axisGroup;this._axisGroup=new Group;var s=layout$2(t),l=new AxisBuilder(t,s);each(axisBuilderAttrs$2,l.add,l),a.add(this._axisGroup),a.add(l.getGroup()),each(selfBuilderAttrs$1,(function(e){t.get([e,"show"])&&axisElementBuilders$1[e](this,this.group,this._axisGroup,t)}),this),groupTransition(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)},t.prototype.remove=function(){rectCoordAxisHandleRemove(this)},t.type="singleAxis",t}(AxisView),axisElementBuilders$1={splitLine:function(e,t,n,i){var r=i.axis;if(!r.scale.isBlank()){var a=i.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=[],h=0,p=r.getTicksCoords({tickModel:a}),d=[],f=[],g=0;g=0&&s<0)&&(o=f,s=d,r=u,a.length=0),each(c,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}function showPointer(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function showTooltip(e,t,n,i){var r=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=makeKey(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function updateModelActually(e,t,n){var i=n.axesInfo=[];each(t,(function(t,n){var r=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}function dispatchTooltipActually(e,t,n,i){if(!illegalPoint(t)&&e.list.length){var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}else i({type:"hideTip"})}function dispatchHighDownActually(e,t,n){var i=n.getZr(),r="axisPointerLastHighlights",a=inner$b(i)[r]||{},o=inner$b(i)[r]={};each(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&each(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];each(a,(function(e,t){!o[t]&&l.push(e)})),each(o,(function(e,t){!a[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function findInputAxisInfo(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function makeMapperParam(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function illegalPoint(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var inner$c=makeInner(),each$8=each;function register(e,t,n){if(!env.node){var i=t.getZr();inner$c(i).records||(inner$c(i).records={}),initGlobalListeners(i,t),(inner$c(i).records[e]||(inner$c(i).records[e]={})).handler=n}}function initGlobalListeners(e,t){function n(n,i){e.on(n,(function(n){var r=makeDispatchAction(t);each$8(inner$c(e).records,(function(e){e&&i(e,n,r.dispatchAction)})),dispatchTooltipFinally(r.pendings,t)}))}inner$c(e).initialized||(inner$c(e).initialized=!0,n("click",curry(doEnter,"click")),n("mousemove",curry(doEnter,"mousemove")),n("globalout",onLeave))}function dispatchTooltipFinally(e,t){var n,i=e.showTip.length,r=e.hideTip.length;i?n=e.showTip[i-1]:r&&(n=e.hideTip[r-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function onLeave(e,t,n){e.handler("leave",null,n)}function doEnter(e,t,n,i){t.handler(e,n,i)}function makeDispatchAction(e){var t={showTip:[],hideTip:[]},n=function(i){var r=t[i.type];r?r.push(i):(i.dispatchAction=n,e.dispatchAction(i))};return{dispatchAction:n,pendings:t}}function unregister(e,t){if(!env.node){var n=t.getZr();(inner$c(n).records||{})[e]&&(inner$c(n).records[e]=null)}}var AxisPointerView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";register("axisPointer",n,(function(e,t,n){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){unregister("axisPointer",t)},t.prototype.dispose=function(e,t){unregister("axisPointer",t)},t.type="axisPointer",t}(ComponentView);ComponentView.registerClass(AxisPointerView);var inner$d=makeInner(),clone$3=clone,bind$1=bind,BaseAxisPointer=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(o){var h=curry(updateProps$1,t,c);this.updatePointerEl(o,l,h),this.updateLabelEl(o,l,h,t)}else o=this._group=new Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),n.getZr().add(o);updateMandatoryProps(o,t,!0),this._renderHandle(r)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,r="category"===i.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===n||null==n){var o=this.animationThreshold;if(r&&i.getBandWidth()>o)return!0;if(a){var s=getAxisInfo(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,r){},e.prototype.createPointerEl=function(e,t,n,i){var r=t.pointer;if(r){var a=inner$d(e).pointerEl=new graphic[r.type](clone$3(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=inner$d(e).labelEl=new ZRText(clone$3(t.label));e.add(r),updateLabelShowHide(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=inner$d(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var r=inner$d(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),updateLabelShowHide(r,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,a=n.getModel("handle"),o=n.get("status");if(!a.get("show")||!o||"hide"===o)return r&&i.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){stop(e.event)},onmousedown:bind$1(this._onHandleDragMove,this,0,0),drift:bind$1(this._onHandleDragMove,this),ondragend:bind$1(this._onHandleDragEnd,this)}),i.add(r)),updateMandatoryProps(r,n,!1),r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");isArray(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){updateProps$1(this._axisPointerModel,!t&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(getHandleTransProps(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(getHandleTransProps(i)),inner$d(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function updateProps$1(e,t,n,i){propsEqual(inner$d(n).lastProp,i)||(inner$d(n).lastProp=i,t?updateProps(n,i,e):(n.stopAnimation(),n.attr(i)))}function propsEqual(e,t){if(isObject(e)&&isObject(t)){var n=!0;return each(t,(function(t,i){n=n&&propsEqual(e[i],t)})),!!n}return e===t}function updateLabelShowHide(e,t){e[t.get(["label","show"])?"show":"hide"]()}function getHandleTransProps(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function updateMandatoryProps(e,t,n){var i=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r),e.silent=n)}))}function buildElStyle(e){var t,n=e.get("type"),i=e.getModel(n+"Style");return"line"===n?(t=i.getLineStyle()).fill=null:"shadow"===n&&((t=i.getAreaStyle()).stroke=null),t}function buildLabelElOption(e,t,n,i,r){var a=getValueLabel(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),o=n.getModel("label"),s=normalizeCssArray$1(o.get("padding")||0),l=o.getFont(),u=getBoundingRect(a,l),c=r.position,h=u.width+s[1]+s[3],p=u.height+s[0]+s[2],d=r.align;"right"===d&&(c[0]-=h),"center"===d&&(c[0]-=h/2);var f=r.verticalAlign;"bottom"===f&&(c[1]-=p),"middle"===f&&(c[1]-=p/2),confineInContainer(c,h,p,i);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:createTextStyle(o,{text:a,font:l,fill:o.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function confineInContainer(e,t,n,i){var r=i.getWidth(),a=i.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function getValueLabel(e,t,n,i,r){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:r.precision}),o=r.formatter;if(o){var s={value:getAxisRawValue(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};each(i,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)})),isString(o)?a=o.replace("{value}",a):isFunction(o)&&(a=o(s))}return a}function getTransformedPosition(e,t,n){var i=create$1();return rotate(i,i,n.rotation),translate(i,i,n.position),applyTransform$1([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function buildCartesianSingleLabelElOption(e,t,n,i,r,a){var o=AxisBuilder.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),buildLabelElOption(t,i,r,a,{position:getTransformedPosition(i.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function makeLineShape(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function makeRectShape(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function makeSectorShape(e,t,n,i,r,a){return{cx:e,cy:t,r0:n,r:i,startAngle:r,endAngle:a,clockwise:!0}}var CartesianAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.grid,s=i.get("type"),l=getCartesian(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var c=buildElStyle(i),h=pointerShapeBuilder[s](a,u,l);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$1(o.model,n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$1(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.grid,o=r.getGlobalExtent(!0),s=getCartesian(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];return{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(BaseAxisPointer);function getCartesian(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var pointerShapeBuilder={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getAxisDimIndex(e))}},shadow:function(e,t,n){var i=Math.max(1,e.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getAxisDimIndex(e))}}};function getAxisDimIndex(e){return"x"===e.dim?0:1}AxisView.registerAxisPointerClass("CartesianAxisPointer",CartesianAxisPointer);var AxisPointerModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="axisPointer",t.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(ComponentModel);ComponentModel.registerClass(AxisPointerModel),registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!isArray(t)&&(e.axisPointer.link=[t])}})),registerProcessor(PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=collect(e,t)})),registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},axisTrigger);var XY=["x","y"],WH=["width","height"],SingleAxisPointer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var a=n.axis,o=a.coordinateSystem,s=getGlobalExtent(o,1-getPointDimIndex(a)),l=o.dataToPoint(t)[0],u=i.get("type");if(u&&"none"!==u){var c=buildElStyle(i),h=pointerShapeBuilder$1[u](a,l,s);h.style=c,e.graphicKey=h.type,e.pointer=h}buildCartesianSingleLabelElOption(t,e,layout$2(n),n,i,r)},t.prototype.getHandleTransform=function(e,t,n){var i=layout$2(t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=getTransformedPosition(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,a=r.coordinateSystem,o=getPointDimIndex(r),s=getGlobalExtent(a,o),l=[e.x,e.y];l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=getGlobalExtent(a,1-o),c=(u[1]+u[0])/2,h=[c,c];return h[o]=l[o],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},t}(BaseAxisPointer),pointerShapeBuilder$1={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:makeLineShape([t,n[0]],[t,n[1]],getPointDimIndex(e))}},shadow:function(e,t,n){var i=e.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:makeRectShape([t-i/2,n[0]],[i,r],getPointDimIndex(e))}}};function getPointDimIndex(e){return e.isHorizontal()?0:1}function getGlobalExtent(e,t){var n=e.getRect();return[n[XY[t]],n[XY[t]]+n[WH[t]]]}AxisView.registerAxisPointerClass("SingleAxisPointer",SingleAxisPointer),extendComponentView({type:"single"});var DATA_NAME_INDEX=2,ThemeRiverSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.useColorPaletteOnData=!0,n}return __extends(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},i=groupData(e,(function(e){return n.hasOwnProperty(e[0]+"")||(n[e[0]+""]=-1),e[2]})),r=[];i.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;oa&&(a=s),i.push(s)}for(var u=0;ua&&(a=h)}return{y0:r,max:a}}ChartView.registerClass(ThemeRiverView),registerLayout(themeRiverLayout),registerProcessor(dataFilter("themeRiver"));var SunburstSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return __extends(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};completeTreeValue$1(n);var i=map(e.levels||[],(function(e){return new Model(e,this,t)}),this),r=Tree.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=r.getNodeByDataIndex(t),a=i[n.depth];return a&&(e.parentModel=a),e}))}));return r.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=wrapTreePathInfo(i,this),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},t.type="series.sunburst",t.defaultOption={zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],levels:[],sort:"desc"},t}(SeriesModel);function completeTreeValue$1(e){var t=0;each(e.children,(function(e){completeTreeValue$1(e);var n=e.value;isArray(n)&&(n=n[0]),t+=n}));var n=e.value;isArray(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),isArray(e.value)?e.value[0]=n:e.value=n}SeriesModel.registerClass(SunburstSeriesModel);var DEFAULT_SECTOR_Z=2,DEFAULT_TEXT_Z=4,SunburstPiece=function(e){function t(t,n,i,r){var a=e.call(this)||this;a.z2=DEFAULT_SECTOR_Z,a.textConfig={inside:!0},getECData(a).seriesIndex=n.seriesIndex;var o=new ZRText({z2:DEFAULT_TEXT_Z,silent:t.getModel().get(["label","silent"])});return a.setTextContent(o),a.updateData(!0,t,n,i,r),a}return __extends(t,e),t.prototype.updateData=function(e,t,n,i,r){this.node=t,t.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var a=this;getECData(a).dataIndex=t.dataIndex;var o=t.getModel(),s=o.getModel("emphasis"),l=t.getLayout(),u=extend({},l);u.label=null;var c=t.getVisual("style");c.lineJoin="bevel";var h=t.getVisual("decal");h&&(c.decal=createOrUpdatePatternFromDecal(h,r));var p=getSectorCornerRadius(o.getModel("itemStyle"),u);extend(u,p),each(SPECIAL_STATES,(function(e){var t=a.ensureState(e),n=o.getModel([e,"itemStyle"]);t.style=n.getItemStyle();var i=getSectorCornerRadius(n,u);i&&(t.shape=i)})),e?(a.setShape(u),a.shape.r=l.r0,updateProps(a,{shape:{r:l.r}},n,t.dataIndex)):updateProps(a,{shape:u},n),a.useStyle(c),this._updateLabel(n);var d=o.getShallow("cursor");d&&a.attr("cursor",d),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus");enableHoverEmphasis(this,("ancestor"===f?t.getAncestorsIndices():"descendant"===f?t.getDescendantIndices():null)||f,s.get("blurScope"))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),a=r.endAngle-r.startAngle,o=(r.startAngle+r.endAngle)/2,s=Math.cos(o),l=Math.sin(o),u=this,c=u.getTextContent(),h=this.node.dataIndex,p=i.get("minAngle")/180*Math.PI,d=i.get("show")&&!(null!=p&&Math.abs(a)Math.PI/2?"right":"left"):b&&"center"!==b?"left"===b?(y=r.r0+S,o>Math.PI/2&&(b="right")):"right"===b&&(y=r.r-S,o>Math.PI/2&&(b="left")):(y=(r.r+r.r0)/2,b="center"),d.style.align=b,d.style.verticalAlign=f(a,"verticalAlign")||"middle",d.x=y*s+r.cx,d.y=y*l+r.cy;var T=f(a,"rotate"),M=0;"radial"===T?(M=-o)<-Math.PI/2&&(M+=Math.PI):"tangential"===T?(M=Math.PI/2-o)>Math.PI/2?M-=Math.PI:M<-Math.PI/2&&(M+=Math.PI):"number"==typeof T&&(M=T*Math.PI/180),d.rotation=M})),c.dirtyStyle()},t}(Sector),ROOT_TO_NODE_ACTION="sunburstRootToNode";registerAction({type:ROOT_TO_NODE_ACTION,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,n){var i=retrieveTargetInfo(e,[ROOT_TO_NODE_ACTION],t);if(i){var r=t.getViewRoot();r&&(e.direction=aboveViewRoot(r,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}}))}));var HIGHLIGHT_ACTION="sunburstHighlight";registerAction({type:HIGHLIGHT_ACTION,update:"none"},(function(e,t,n){e=extend({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t){var n=retrieveTargetInfo(e,[HIGHLIGHT_ACTION],t);n&&(e.dataIndex=n.node.dataIndex)})),n.dispatchAction(extend(e,{type:"highlight"}))}));var UNHIGHLIGHT_ACTION="sunburstUnhighlight";registerAction({type:UNHIGHLIGHT_ACTION,update:"updateView"},(function(e,t,n){e=extend({},e),n.dispatchAction(extend(e,{type:"downplay"}))}));var SunburstView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this;this.seriesModel=e,this.api=n,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),c=[];s.eachNode((function(e){c.push(e)}));var h=this._oldChildren||[];!function(i,r){if(0===i.length&&0===r.length)return;function s(e){return e.getId()}function c(s,c){!function(i,r){u||!i||i.getValue()||(i=null);if(i!==o&&r!==o)if(r&&r.piece)i?(r.piece.updateData(!1,i,e,t,n),a.setItemGraphicEl(i.dataIndex,r.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(r);else if(i){var s=new SunburstPiece(i,e,t,n);l.add(s),a.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==c?null:r[c])}new DataDiffer(r,i,s,s).add(c).update(c).remove(curry(c,null)).execute()}(c,h),function(i,a){a.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,e,t,n):(r.virtualPiece=new SunburstPiece(i,e,t,n),l.add(r.virtualPiece)),a.piece.off("click"),r.virtualPiece.on("click",(function(e){r._rootToNode(a.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===t.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(i);else if("link"===r){var a=i.getModel(),o=a.get("link");if(o)windowOpen(o,a.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:ROOT_TO_NODE_ACTION,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,a=Math.sqrt(i*i+r*r);return a<=n.r&&a>=n.r0}},t.type="sunburst",t}(ChartView);ChartView.registerClass(SunburstView);var RADIAN$2=Math.PI/180;function sunburstLayout(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),i=e.get("radius");isArray(i)||(i=[0,i]),isArray(t)||(t=[t,t]);var r=n.getWidth(),a=n.getHeight(),o=Math.min(r,a),s=parsePercent$2(t[0],r),l=parsePercent$2(t[1],a),u=parsePercent$2(i[0],o/2),c=parsePercent$2(i[1],o/2),h=-e.get("startAngle")*RADIAN$2,p=e.get("minAngle")*RADIAN$2,d=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&initChildren$1(f,m);var y=0;each(f.children,(function(e){!isNaN(e.getValue())&&y++}));var v=f.getValue(),_=Math.PI/(v||y)*2,x=f.depth>0,S=f.height-(x?-1:1),b=(c-u)/(S||1),T=e.get("clockwise"),M=e.get("stillShowZeroSum"),A=T?1:-1,I=function(e,t){if(e){var n=t;if(e!==d){var i=e.getValue(),r=0===v&&M?_:i*_;r1;)r=r.parentNode;var a=n.getColorFromPalette(r.name||r.dataIndex+"",t);return e.depth>1&&"string"==typeof a&&(a=lift(a,(e.depth-1)/(i-1)*.5)),a}(r,e,i.root.height)),extend(n.ensureUniqueItemVisual(r.dataIndex,"style"),a)}))}))}function dataToCoordSize(e,t){return t=t||[0,0],map(["x","y"],(function(n,i){var r=this.getAxis(n),a=t[i],o=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o))}),this)}function cartesianPrepareCustom(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize,e)}}}function dataToCoordSize$1(e,t){return t=t||[0,0],map([0,1],(function(n){var i=t[n],r=e[n]/2,a=[],o=[];return a[n]=i-r,o[n]=i+r,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])}),this)}function geoPrepareCustom(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize$1,e)}}}function dataToCoordSize$2(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function singlePrepareCustom(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:bind(dataToCoordSize$2,e)}}}function dataToCoordSize$3(e,t){return t=t||[0,0],map(["Radius","Angle"],(function(n,i){var r=this["get"+n+"Axis"](),a=t[i],o=e[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function polarPrepareCustom(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),a=n.dataToAngle(i[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o},size:bind(dataToCoordSize$3,e)}}}function calendarPrepareCustom(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}registerLayout(curry(sunburstLayout,"sunburst")),registerProcessor(curry(dataFilter,"sunburst")),registerVisual(sunburstVisual);var deprecatedLogs={};function isEC4CompatibleStyle(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||hasOwn(e,"text")))}function convertFromEC4CompatibleStyle(e,t,n){var i,r,a,o=e;if("text"===t)a=o;else{a={},hasOwn(o,"text")&&(a.text=o.text),hasOwn(o,"rich")&&(a.rich=o.rich),hasOwn(o,"textFill")&&(a.fill=o.textFill),hasOwn(o,"textStroke")&&(a.stroke=o.textStroke),r={type:"text",style:a,silent:!0},i={};var s=hasOwn(o,"textPosition");n?i.position=s?o.textPosition:"inside":s&&(i.position=o.textPosition),hasOwn(o,"textPosition")&&(i.position=o.textPosition),hasOwn(o,"textOffset")&&(i.offset=o.textOffset),hasOwn(o,"textRotation")&&(i.rotation=o.textRotation),hasOwn(o,"textDistance")&&(i.distance=o.textDistance)}return convertEC4CompatibleRichItem(a,e),each(a.rich,(function(e){convertEC4CompatibleRichItem(e,e)})),{textConfig:i,textContent:r}}function convertEC4CompatibleRichItem(e,t){t&&(t.font=t.textFont||t.font,hasOwn(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),hasOwn(t,"textAlign")&&(e.align=t.textAlign),hasOwn(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),hasOwn(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),hasOwn(t,"textWidth")&&(e.width=t.textWidth),hasOwn(t,"textHeight")&&(e.height=t.textHeight),hasOwn(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),hasOwn(t,"textPadding")&&(e.padding=t.textPadding),hasOwn(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),hasOwn(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),hasOwn(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),hasOwn(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),hasOwn(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),hasOwn(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),hasOwn(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function convertToEC4StyleForCustomSerise(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,a=e.fill||"#000";convertToEC4RichItem(i,t);var o=null==i.textFill;return r?o&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=a),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(o&&(i.textFill=n.outsideFill||a),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,each(t.rich,(function(e){convertToEC4RichItem(e,e)})),i}function convertToEC4RichItem(e,t){t&&(hasOwn(t,"fill")&&(e.textFill=t.fill),hasOwn(t,"stroke")&&(e.textStroke=t.fill),hasOwn(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),hasOwn(t,"font")&&(e.font=t.font),hasOwn(t,"fontStyle")&&(e.fontStyle=t.fontStyle),hasOwn(t,"fontWeight")&&(e.fontWeight=t.fontWeight),hasOwn(t,"fontSize")&&(e.fontSize=t.fontSize),hasOwn(t,"fontFamily")&&(e.fontFamily=t.fontFamily),hasOwn(t,"align")&&(e.textAlign=t.align),hasOwn(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),hasOwn(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),hasOwn(t,"width")&&(e.textWidth=t.width),hasOwn(t,"height")&&(e.textHeight=t.height),hasOwn(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),hasOwn(t,"padding")&&(e.textPadding=t.padding),hasOwn(t,"borderColor")&&(e.textBorderColor=t.borderColor),hasOwn(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),hasOwn(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),hasOwn(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),hasOwn(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),hasOwn(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),hasOwn(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),hasOwn(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),hasOwn(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),hasOwn(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),hasOwn(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}function warnDeprecated(e,t){}var inner$e=makeInner(),TRANSFORM_PROPS={x:1,y:1,scaleX:1,scaleY:1,originX:1,originY:1,rotation:1},transformPropNamesStr=keys(TRANSFORM_PROPS).join(", "),STYLE_VISUAL_TYPE={color:"fill",borderColor:"stroke"},NON_STYLE_VISUAL_PROPS={symbol:1,symbolSize:1,symbolKeepAspect:1,legendSymbol:1,visualMeta:1,liftZ:1,decal:1},EMPHASIS="emphasis",NORMAL="normal",BLUR="blur",SELECT="select",STATES=[NORMAL,EMPHASIS,BLUR,SELECT],PATH_ITEM_STYLE={normal:["itemStyle"],emphasis:[EMPHASIS,"itemStyle"],blur:[BLUR,"itemStyle"],select:[SELECT,"itemStyle"]},PATH_LABEL={normal:["label"],emphasis:[EMPHASIS,"label"],blur:[BLUR,"label"],select:[SELECT,"label"]},GROUP_DIFF_PREFIX="e\0\0",attachedTxInfoTmp={normal:{},emphasis:{},blur:{},select:{}},LEGACY_TRANSFORM_PROPS={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},tmpTransformable=new Transformable,prepareCustoms={cartesian2d:cartesianPrepareCustom,geo:geoPrepareCustom,singleAxis:singlePrepareCustom,polar:polarPrepareCustom,calendar:calendarPrepareCustom},CustomSeriesModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return createListFromArray(this.getSource(),this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=inner$e(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},t}(SeriesModel);ComponentModel.registerClass(CustomSeriesModel);var checkNonStyleTansitionRefer,checkTransformPropRefer,CustomSeriesView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this._data,a=e.getData(),o=this.group,s=makeRenderItem(e,a,t,n),l=e.__transientTransitionOpt;if(!l||null!=l.from&&null!=l.to){var u=new MorphPreparation(e,l),c=l?"multiple":"oneToOne";new DataDiffer(r?r.getIndices():[],a.getIndices(),createGetKey(r,c,l&&l.from),createGetKey(a,c,l&&l.to),null,c).add((function(t){createOrUpdateItem(n,null,t,s(t,i),e,o,a,null)})).remove((function(t){doRemoveEl(r.getItemGraphicEl(t),e,o)})).update((function(t,l){u.reset("oneToOne");var c=r.getItemGraphicEl(l);u.findAndAddFrom(c),u.hasFrom()&&(removeElementDirectly(c,o),c=null),createOrUpdateItem(n,c,t,s(t,i),e,o,a,u),u.applyMorphing()})).updateManyToOne((function(t,l){u.reset("manyToOne");for(var c=0;c=0){!s&&(s=r[e]={});var f=keys(l);for(h=0;h=0){var d=e.getAnimationStyleProps(),f=d?d.style:null;if(f){!o&&(o=r.style={});var g=keys(i);for(c=0;c=0?a.replaceAt(t,l):a.add(t),t}function doesElNeedRecreate(e,t){var n=inner$e(e),i=t.type,r=t.shape,a=t.style;return null!=i&&i!==n.customGraphicType||"path"===i&&hasOwnPathData(r)&&getPathData(r)!==n.customPathData||"image"===i&&hasOwn(a,"image")&&a.image!==n.customImagePath}function doCreateOrUpdateClipPath(e,t,n,i,r){var a=n.clipPath;if(!1===a)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&doesElNeedRecreate(o,a)&&(o=null),o||(o=createEl(a),e.setClipPath(o)),updateElNormal(null,o,null,t,a,null,null,i,r,!1)}}function doCreateOrUpdateAttachedTx(e,t,n,i,r,a){if(!e.isGroup){processTxInfo(n,null,a),processTxInfo(n,EMPHASIS,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(null!=o||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===o)c&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=createEl(o),e.setTextContent(c));var h=o&&o.style;updateElNormal(null,c,null,t,o,h,null,i,r,!0);for(var p=0;p=h;p--)doRemoveEl(t.childAt(p),r,t)}}function diffGroupChildren(e){new DataDiffer(e.oldChildren,e.newChildren,getKey,getKey,e).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute()}function getKey(e,t){var n=e&&e.name;return null!=n?n:GROUP_DIFF_PREFIX+t}function processAddUpdate(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;doCreateOrUpdateEl(n.api,r,n.dataIndex,i,n.seriesModel,n.group,!1,n.morphPreparation)}function processRemove(e){var t=this.context;doRemoveEl(t.oldChildren[e],t.seriesModel,t.group)}function doRemoveEl(e,t,n){if(e){var i=inner$e(e).leaveToProps;i?updateProps(e,i,t,{cb:function(){n.remove(e)}}):n.remove(e)}}function getPathData(e){return e&&(e.pathData||e.d)}function hasOwnPathData(e){return e&&(hasOwn(e,"pathData")||hasOwn(e,"d"))}function isPath$1(e){return e&&e instanceof Path}function removeElementDirectly(e,t){e&&t.remove(e)}var MorphPreparation=function(){function e(e,t){this._fromList=[],this._toList=[],this._toElOptionList=[],this._allPropsFinalList=[],this._toDataIndices=[],this._morphConfigList=[],this._seriesModel=e,this._transOpt=t}return e.prototype.hasFrom=function(){return!!this._fromList.length},e.prototype.findAndAddFrom=function(e){if(e&&(inner$e(e).canMorph&&this._fromList.push(e),e.isGroup))for(var t=e.childrenRef(),n=0;n=n?i-o:a;this._manyToOneForSingleTo(r,o>=i?null:o,s)}else if("oneToMany"===e)for(var l=Math.max(1,Math.floor(n/i)),u=0,c=0;u=n?n-u:l;this._oneToManyForSingleFrom(u,h,c>=i?null:c)}},e.prototype._oneToOneForSingleTo=function(e,t){var n=this._toList[e],i=this._toElOptionList[e],r=this._toDataIndices[e],a=this._allPropsFinalList[e],o=this._fromList[t],s=this._getOrCreateMorphConfig(r),l=s.duration;if(o&&isCombiningPath(o)){if(applyPropsFinal(n,a,i.style),l){var u=combine([o],n,s,copyPropsWhenDivided);this._processResultIndividuals(u,e,null)}}else{var c=l&&o&&(o!==n||isInAnyMorphing(o))?o:null,h={};prepareShapeOrExtraTransitionFrom("shape",n,c,i,h,!1),prepareShapeOrExtraTransitionFrom("extra",n,c,i,h,!1),prepareTransformTransitionFrom(n,c,i,h,!1),prepareStyleTransitionFrom(n,c,i,i.style,h,!1),applyPropsFinal(n,a,i.style),c&&morphPath(c,n,s),applyTransitionFrom(n,r,i,this._seriesModel,h,!1)}},e.prototype._manyToOneForSingleTo=function(e,t,n){var i=this._toList[e],r=this._toElOptionList[e];applyPropsFinal(i,this._allPropsFinalList[e],r.style);var a=this._getOrCreateMorphConfig(this._toDataIndices[e]);if(a.duration&&null!=t){for(var o=[],s=t;s=0?"p":"n",I=x;v&&(i[s][M]||(i[s][M]={p:x,n:x}),I=i[s][M][A]);var C=void 0,w=void 0,P=void 0,L=void 0;if("radius"===h.dim){var E=h.dataToCoord(T)-x,D=a.dataToCoord(M);Math.abs(E)c?c=p:(h.lastTickCount=r,h.lastAutoInterval=c),c},t}(Axis);AngleAxis.prototype.dataToAngle=Axis.prototype.dataToCoord,AngleAxis.prototype.angleToData=Axis.prototype.coordToData;var Polar=function(){function e(e){this.dimensions=["radius","angle"],this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new RadiusAxis,this._angleAxis=new AngleAxis,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);i.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,u=lo;)l+=360*u;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,i=t-this.cy,r=n*n+i*i,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}},e.prototype.convertToPixel=function(e,t,n){return getCoordSys$3(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return getCoordSys$3(t)===this?this.pointToData(n):null},e}();function getCoordSys$3(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function resizePolar(e,t,n){var i=t.get("center"),r=n.getWidth(),a=n.getHeight();e.cx=parsePercent$2(i[0],r),e.cy=parsePercent$2(i[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:isArray(l)||(l=[0,l]);var u=[parsePercent$2(l[0],s),parsePercent$2(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function updatePolarScale(e,t){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();each(getDataDimensionsOnAxis(t,"radius"),(function(e){r.scale.unionExtentFromData(t,e)})),each(getDataDimensionsOnAxis(t,"angle"),(function(e){i.scale.unionExtentFromData(t,e)}))}})),niceScaleExtent(i.scale,i.model),niceScaleExtent(r.scale,r.model),"category"===i.type&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function isAngleAxisModel(e){return"angleAxis"===e.mainType}function setAxis(e,t){if(e.type=t.get("type"),e.scale=createScaleByModel(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),isAngleAxisModel(t)){e.inverse=e.inverse!==t.get("clockwise");var n=t.get("startAngle");e.setExtent(n,n+(e.inverse?-360:360))}t.axis=e,e.model=t}var polarCreator={dimensions:Polar.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,i){var r=new Polar(i+"");r.update=updatePolarScale;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");setAxis(a,s),setAxis(o,l),resizePolar(r,e,t),n.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",SINGLE_REFERRING).models[0];0,e.coordinateSystem=t.coordinateSystem}})),n}};CoordinateSystemManager.register("polar",polarCreator);var elementList$1=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function getAxisLineShape(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var i=e.coordToPoint([t[0],n]),r=e.coordToPoint([t[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function getRadiusIdx(e){return e.getRadiusAxis().inverse?0:1}function fixAngleOverlap(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var AngleAxisView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return __extends(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),a=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=map(n.getViewLabels(),(function(e){return(e=clone(e)).coord=n.dataToCoord(e.tickValue),e}));fixAngleOverlap(s),fixAngleOverlap(a),each(elementList$1,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||angelAxisElementsBuilders[t](this.group,e,i,a,o,r,s)}),this)}},t.type="angleAxis",t}(AxisView),angelAxisElementsBuilders={axisLine:function(e,t,n,i,r,a){var o,s=t.getModel(["axisLine","lineStyle"]),l=getRadiusIdx(n),u=l?0:1;(o=0===a[u]?new Circle({shape:{cx:n.cx,cy:n.cy,r:a[l]},style:s.getLineStyle(),z2:1,silent:!0}):new Ring({shape:{cx:n.cx,cy:n.cy,r:a[l],r0:a[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(o)},axisTick:function(e,t,n,i,r,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[getRadiusIdx(n)],u=map(i,(function(e){return new Line({shape:getAxisLineShape(n,[l,l+s],e.coord)})}));e.add(mergePath$1(u,{style:defaults(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,i,r,a){if(r.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[getRadiusIdx(n)],c=[],h=0;hf?"left":"right",y=Math.abs(d[1]-g)/p<.3?"middle":d[1]>g?"top":"bottom";if(s&&s[h]){var v=s[h];isObject(v)&&v.textStyle&&(o=new Model(v.textStyle,l,l.ecModel))}var _=new ZRText({silent:AxisBuilder.isLabelSilent(t),style:createTextStyle(o,{x:d[0],y:d[1],fill:o.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:y})});if(e.add(_),c){var x=AxisBuilder.makeAxisEventDataBase(t);x.targetType="axisLabel",x.value=i.rawLabel,getECData(_).eventData=x}}),this)},splitLine:function(e,t,n,i,r,a){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;cm?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}var pointerShapeBuilder$2={line:function(e,t,n,i){return"angle"===e.dim?{type:"Line",shape:makeLineShape(t.coordToPoint([i[0],n]),t.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,i){var r=Math.max(1,e.getBandWidth()),a=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:makeSectorShape(t.cx,t.cy,i[0],i[1],(-n-r/2)*a,(r/2-n)*a)}:{type:"Sector",shape:makeSectorShape(t.cx,t.cy,n-r/2,n+r/2,0,2*Math.PI)}}};AxisView.registerAxisPointerClass("PolarAxisPointer",PolarAxisPointer),registerLayout(curry(barLayoutPolar,"bar")),extendComponentView({type:"polar"});var GeoView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){var n=new MapDraw(t);this._mapDraw=n,this.group.add(n.group),this._api=t},t.prototype.render=function(e,t,n,i){var r=this._mapDraw;e.get("show")?r.draw(e,t,n,this,i):this._mapDraw.group.removeAll(),r.group.on("click",this._handleRegionClick,this),r.group.silent=e.get("silent"),this._model=e,this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){for(var t,n=e.target;n&&null==(t=getECData(n).eventData);)n=n.__hostTarget||n.parent;t&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var i=this;this._mapDraw.group.traverse((function(e){var t=getECData(e).eventData;if(t)return i._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0}))},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type="geo",t}(ComponentView);ComponentView.registerClass(GeoView);var GeoModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),defaultEmphasis(t,"label",["show"])},t.prototype.optionUpdated=function(){var e=this.option,t=this;e.regions=geoCreator.getFilledRegions(e.regions,e.map,e.nameMap);var n={};this._optionModelMap=reduce(e.regions||[],(function(e,i){var r=i.name;return r&&(e.set(r,new Model(i,t)),i.selected&&(n[r]=!0)),e}),createHashMap()),e.selectedMap||(e.selectedMap=n)},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new Model(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),i="normal"===t?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),r={name:e};return"function"==typeof i?(r.status=t,i(r)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;n&&("multiple"!==n&&(t.selectedMap=null),(t.selectedMap||(t.selectedMap={}))[e]=!0)},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?"unSelect":"select"](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!(!t||!t[e])},t.prototype._initSelectedMapFromData=function(){},t.type="geo",t.layoutMode="box",t.defaultOption={zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},t}(ComponentModel);function makeAction(e,t){t.update="geo:updateSelectStatus",registerAction(t,(function(t,n){var i={};return n.eachComponent({mainType:"geo",query:t},(function(n){n[e](t.name),each(n.coordinateSystem.regions,(function(e){i[e.name]=n.isSelected(e.name)||!1}))})),{selected:i,name:t.name}}))}ComponentModel.registerClass(GeoModel),makeAction("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),makeAction("select",{type:"geoSelect",event:"geoselected"}),makeAction("unSelect",{type:"geoUnSelect",event:"geounselected"});var PROXIMATE_ONE_DAY=864e5,Calendar=function(){function e(t,n,i){this.type="calendar",this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t}return e.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){var t=(e=parseDate(e)).getFullYear(),n=e.getMonth()+1,i=n<10?"0"+n:""+n,r=e.getDate(),a=r<10?"0"+r:""+r,o=e.getDay();return{y:t+"",m:i,d:a,day:o=Math.abs((o+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+a,date:e}},e.prototype.getNextNDay=function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},e.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,i=["width","height"],r=this._model.getCellSize().slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[n,7]:[7,n];each([0,1],(function(e){u(r,e)&&(a[i[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}each([0,1],(function(e){u(r,e)||(r[e]=l[i[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},e.prototype.dataToPoint=function(e,t){isArray(e)&&(e=e[0]),null==t&&(t=!0);var n=this.getDateInfo(e),i=this._rangeInfo,r=n.formatedDate;if(t&&!(n.time>=i.start.time&&n.timeo.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var i=Math.floor(n[1].time/PROXIMATE_ONE_DAY)-Math.floor(n[0].time/PROXIMATE_ONE_DAY)+1,r=new Date(n[0].time),a=r.getDate(),o=n[1].date.getDate();r.setDate(a+i-1);var s=r.getDate();if(s!==o)for(var l=r.getTime()-n[1].time>0?1:-1;(s=r.getDate())!==o&&(r.getTime()-n[1].time)*l>0;)i-=l,r.setDate(s-l);var u=Math.floor((i+n[0].day+6)/7),c=t?1-u:u-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||0===e&&ti.lweek)return null;var r=7*(e-1)-i.fweek+t,a=new Date(i.start.time);return a.setDate(+i.start.d+r),this.getDateInfo(a)},e.create=function(t,n){var i=[];return t.eachComponent("calendar",(function(r){var a=new e(r,t,n);i.push(a),r.coordinateSystem=a})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},e.dimensions=["time","value"],e}();function getCoordSys$4(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}CoordinateSystemManager.register("calendar",Calendar);var CalendarModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(t,n,i){var r=getLayoutParams(t);e.prototype.init.apply(this,arguments),mergeAndNormalizeLayoutParams(t,r)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),mergeAndNormalizeLayoutParams(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(ComponentModel);function mergeAndNormalizeLayoutParams(e,t){var n,i=e.cellSize;1===(n=isArray(i)?i:e.cellSize=[i,i]).length&&(n[1]=n[0]);var r=map([0,1],(function(e){return sizeCalculable(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));mergeLayoutParam(e,t,{type:"box",ignoreSize:r})}ComponentModel.registerClass(CalendarModel);var MONTH_TEXT={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},WEEK_TEXT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]},CalendarView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){var i=this.group;i.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,i),this._renderLines(e,a,o,i),this._renderYearText(e,a,o,i),this._renderMonthText(e,o,i),this._renderWeekText(e,a,o,i)},t.prototype._renderDayRect=function(e,t,n){for(var i=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=i.getCellWidth(),o=i.getCellHeight(),s=t.start.time;s<=t.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});n.add(u)}},t.prototype._renderLines=function(e,t,n,i){var r=this,a=e.coordinateSystem,o=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,c=0;u.time<=t.end.time;c++){p(u.formatedDate),0===c&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=a.getDateInfo(h)}function p(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,i)}p(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),o,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),o,i)},t.prototype._getEdgesPoints=function(e,t,n){var i=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-t/2,i[1][r]=i[1][r]+t/2,i},t.prototype._drawSplitline=function(e,t,n){var i=new Polyline({z2:20,shape:{points:e},style:t});n.add(i)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var i=e.coordinateSystem,r=i.getDateInfo(t),a=[],o=0;o<7;o++){var s=i.getNextNDay(r.time,o),l=i.dataToRect([s.time],!1);a[2*s.day]=l.tl,a[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return a},t.prototype._formatterLabel=function(e,t){return"string"==typeof e&&e?formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,i,r){var a=t[0],o=t[1],s=["center","bottom"];"bottom"===i?(o+=r,s=["center","top"]):"left"===i?a-=r:"right"===i?(a+=r,s=["center","top"]):o-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,i){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},p=t.start.y;+t.end.y>+t.start.y&&(p=p+"-"+t.end.y);var d=r.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:p},g=this._formatterLabel(d,f),m=new ZRText({z2:30,style:createTextStyle(r,{text:g})});m.attr(this._yearTextPositionControl(m,h[o],n,o,a)),i.add(m)}},t.prototype._monthTextPositionControl=function(e,t,n,i,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===n?(l+=r,t&&(a="center"),"start"===i&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===i&&(a="right")),{x:s,y:l,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n){var i=e.getModel("monthLabel");if(i.get("show")){var r=i.get("nameMap"),a=i.get("margin"),o=i.get("position"),s=i.get("align"),l=[this._tlpoints,this._blpoints];isString(r)&&(r=MONTH_TEXT[r.toUpperCase()]||[]);var u="start"===o?0:1,c="horizontal"===t?0:1;a="start"===o?-a:a;for(var h="center"===s,p=0;p=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},t.prototype._flatten=function(e,t,n){each(e,(function(e){if(e){n&&(e.parentOption=n),t.push(e);var i=e.children;"group"===e.type&&i&&this._flatten(i,t,e),delete e.children}}),this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type="graphic",t.defaultOption={elements:[]},t}(ComponentModel);ComponentModel.registerClass(GraphicComponentModel);var GraphicComponentView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(){this._elMap=createHashMap()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,i=this.group;each(t,(function(t){var r=convertOptionIdName(t.id,null),a=null!=r?n.get(r):null,o=convertOptionIdName(t.parentId,null),s=null!=o?n.get(o):i,l=t.type,u=t.style;"text"===l&&u&&t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=u.verticalAlign=u.align=null);var c=t.textContent,h=t.textConfig;if(u&&isEC4CompatibleStyle(u,l,!!h,!!c)){var p=convertFromEC4CompatibleStyle(u,l,!0);!h&&p.textConfig&&(h=t.textConfig=p.textConfig),!c&&p.textContent&&(c=p.textContent)}var d=getCleanedElOption(t);var f=t.$action||"merge";"merge"===f?a?a.attr(d):createEl$1(r,s,d,n):"replace"===f?(removeEl(a,n),createEl$1(r,s,d,n)):"remove"===f&&removeEl(a,n);var g=n.get(r);if(g&&c)if("merge"===f){var m=g.getTextContent();m?m.attr(c):g.setTextContent(new ZRText(c))}else"replace"===f&&g.setTextContent(new ZRText(c));if(g){var y=inner$g(g);y.__ecGraphicWidthOption=t.width,y.__ecGraphicHeightOption=t.height,setEventData(g,e,t)}}))}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,i=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s=0;s--){var h,p,d;if(d=null!=(p=convertOptionIdName((h=n[s]).id,null))?r.get(p):null){var f=d.parent;c=inner$g(f);positionElement(d,h,f===i?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight},null,{hv:h.hv,boundingMode:h.bounding})}}},t.prototype._clear=function(){var e=this._elMap;e.each((function(t){removeEl(t,e)})),this._elMap=createHashMap()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(ComponentView);function createEl$1(e,t,n,i){var r=n.type;var a=hasOwn(_nonShapeGraphicElements,r)?_nonShapeGraphicElements[r]:getShapeClass(r);var o=new a(n);t.add(o),i.set(e,o),inner$g(o).__ecGraphicId=e}function removeEl(e,t){var n=e&&e.parent;n&&("group"===e.type&&e.traverse((function(e){removeEl(e,t)})),t.removeKey(inner$g(e).__ecGraphicId),n.remove(e))}function getCleanedElOption(e){return e=extend({},e),each(["id","parentId","$action","hv","bounding","textContent"].concat(LOCATION_PARAMS),(function(t){delete e[t]})),e}function isSetLoc(e,t){var n;return each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}function setKeyInfoToNewElOption(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),null==t.parentId){var i=t.parentOption;i?t.parentId=i.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function mergeNewElOptionToExist(e,t,n){var i=extend({},n),r=e[t],a=n.$action||"merge";"merge"===a?r?(merge(r,i,!0),mergeLayoutParam(r,i,{ignoreSize:!0}),copyLayoutParams(n,r)):e[t]=i:"replace"===a?e[t]=i:"remove"===a&&r&&(e[t]=null)}function setLayoutInfoToExist(e,t){if(e&&(e.hv=t.hv=[isSetLoc(t,["left","right"]),isSetLoc(t,["top","bottom"])],"group"===e.type)){var n=e,i=t;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}function setEventData(e,t,n){var i=getECData(e).eventData;e.silent||e.ignore||i||(i=getECData(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),i&&(i.info=n.info)}ComponentView.registerClass(GraphicComponentView);var ToolboxFeature=function(){},features={};function registerFeature(e,t){features[e]=t}function getFeature(e){return features[e]}var ToolboxModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;each(this.option.feature,(function(e,n){var i=getFeature(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),merge(e,i.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}},t}(ComponentModel);function layout$3(e,t,n){var i=t.getBoxLayoutParams(),r=t.get("padding"),a={width:n.getWidth(),height:n.getHeight()},o=getLayoutRect(i,a,r);box(t.get("orient"),e,t.get("itemGap"),o.width,o.height),positionElement(e,i,a,r)}function makeBackground(e,t){var n=normalizeCssArray$1(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Rect({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}ComponentModel.registerClass(ToolboxModel);var ToolboxView=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];each(o,(function(e,t){l.push(t)})),new DataDiffer(this._featureNames||[],l).add(u).update(u).remove(curry(u,null)).execute(),this._featureNames=l,layout$3(r,e,n),r.add(makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=e.getTextContent(),l=s&&s.states.emphasis;if(l&&!isFunction(l)&&t){var u=l.style||(l.style={}),c=getBoundingRect(t,ZRText.makeFont(u)),h=e.x+r.x,p=!1;e.y+r.y+a+c.height>n.getHeight()&&(o.position="top",p=!0);var d=p?-5-c.height:a+8;h+c.width/2>n.getWidth()?(o.position=["100%",d],u.align="right"):h-c.width/2<0&&(o.position=[0,d],u.align="left")}}))}function u(u,c){var h,p=l[u],d=l[c],f=o[p],g=new Model(f,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===p&&(f.title=i.newTitle),p&&!d){if(isUserFeatureName(p))h={onclick:g.option.onclick,featureName:p};else{var m=getFeature(p);if(!m)return;h=new m}s[p]=h}else if(!(h=s[d]))return;if(h.uid=getUID("toolbox-feature"),h.model=g,h.ecModel=t,h.api=n,h instanceof ToolboxFeature){if(!p&&d)return void(h.dispose&&h.dispose(t,n));if(!g.get("show")||h.unusable)return void(h.remove&&h.remove(t,n))}!function(i,o,s){var l,u,c=i.getModel("iconStyle"),h=i.getModel(["emphasis","iconStyle"]),p=o instanceof ToolboxFeature&&o.getIcons?o.getIcons():i.get("icon"),d=i.get("title")||{};"string"==typeof p?(l={})[s]=p:l=p;"string"==typeof d?(u={})[s]=d:u=d;var f=i.iconPaths={};each(l,(function(s,l){var p=createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});p.setStyle(c.getItemStyle()),p.ensureState("emphasis").style=h.getItemStyle();var d=new ZRText({style:{text:u[l],align:h.get("textAlign"),borderRadius:h.get("textBorderRadius"),padding:h.get("textPadding"),fill:null},ignore:!0});p.setTextContent(d);var g=e.getModel("tooltip");g&&g.get("show")&&(p.tooltip=extend({content:u[l],formatter:g.get("formatter",!0)||function(){return u[l]},formatterParams:{componentType:"toolbox",name:l,title:u[l],$vars:["name","title"]},position:g.get("position",!0)||"bottom"},g.option)),p.__title=u[l],p.on("mouseover",(function(){var t=h.getItemStyle(),n="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({fill:h.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:h.get("textBackgroundColor")}),p.setTextConfig({position:h.get("textPosition")||n}),d.ignore=!e.get("showTitle"),enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",l])&&leaveEmphasis(this),d.hide()})),("emphasis"===i.get(["iconStatus",l])?enterEmphasis:leaveEmphasis)(p),r.add(p),p.on("click",bind(o.onclick,o,t,n,l)),f[l]=p}))}(g,h,p),g.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?enterEmphasis:leaveEmphasis)(i[e])},h instanceof ToolboxFeature&&h.render&&h.render(g,t,n,i)}},t.prototype.updateView=function(e,t,n,i){each(this._features,(function(e){e instanceof ToolboxFeature&&e.updateView&&e.updateView(e.model,t,n,i)}))},t.prototype.remove=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){each(this._features,(function(n){n instanceof ToolboxFeature&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox",t}(ComponentView);function isUserFeatureName(e){return 0===e.indexOf("my")}ComponentView.registerClass(ToolboxView);var SaveAsImage=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||env.browser.ie||env.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,i+"."+r)}else{var c=n.get("lang"),h='';window.open().document.write(h)}else{var p=document.createElement("a");p.download=i+"."+r,p.target="_blank",p.href=a;var d=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});p.dispatchEvent(d)}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:e.getLocale(["toolbox","saveAsImage","lang"])}},t}(ToolboxFeature);SaveAsImage.prototype.unusable=!env.canvasSupported,registerFeature("saveAsImage",SaveAsImage);var INNER_STACK_KEYWORD="__ec_magicType_stack__",radioTypes=[["line","bar"],["stack"]],MagicType=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return each(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i=this.model,r=i.get(["seriesIndex",n]);if(seriesOptGenreator[n]){var a,o={series:[]};each(radioTypes,(function(e){indexOf(e,n)>=0&&each(e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(e){var t=e.subType,r=e.id,a=seriesOptGenreator[n](t,r,e,i);a&&(defaults(a,e.option),o.series.push(a));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,SINGLE_REFERRING).models[0].componentIndex;o[u]=o[u]||[];for(var h=0;h<=c;h++)o[u][c]=o[u][c]||{};o[u][c].boundaryGap="bar"===n}}})),"stack"===n&&(a=merge({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title)),t.dispatchAction({type:"changeMagicType",currentType:n,newOption:o,newTitle:a,featureName:"magicType"})}},t}(ToolboxFeature),seriesOptGenreator={line:function(e,t,n,i){if("bar"===e)return merge({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return merge({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===INNER_STACK_KEYWORD;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),merge({id:t,stack:r?"":INNER_STACK_KEYWORD},i.get(["option","stack"])||{},!0)}};registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),registerFeature("magicType",MagicType);var BLOCK_SPLITER=new Array(60).join("-"),ITEM_SPLITER="\t";function groupSeries(e){var t={},n=[],i=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(e);else{var a=r.getBaseAxis();if("category"===a.type){var o=a.dim+"_"+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:r.getOtherAxis(a),series:[]},i.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}})),{seriesGroupByCategoryAxis:t,other:n,meta:i}}function assembleSeriesWithCategoryAxis(e){var t=[];return each(e,(function(e,n){var i=e.categoryAxis,r=e.valueAxis.dim,a=[" "].concat(map(e.series,(function(e){return e.name}))),o=[i.model.getCategories()];each(e.series,(function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),(function(e){return e})))}));for(var s=[a.join(ITEM_SPLITER)],l=0;l=0)return!0}var itemSplitRegex=new RegExp("["+ITEM_SPLITER+"]+","g");function parseTSVContents(e){for(var t=e.split(/\n+/g),n=[],i=map(trim$1(t.shift()).split(itemSplitRegex),(function(e){return{name:e,data:[]}})),r=0;r=0)&&e(r,i._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=coordConvert[e.brushType](0,n,t);e.__rangeOffset={offset:diffProcessor[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){each(e,(function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&each(i.coordSyses,(function(i){var r=coordConvert[e.brushType](1,i,e.range);n(e,r.values,i,t)}))}),this)},e.prototype.setInputRanges=function(e,t){each(e,(function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var i=coordConvert[e.brushType](0,n.coordSys,e.coordRange),r=e.__rangeOffset;e.range=r?diffProcessor[e.brushType](i.values,r.offset,getScales(i.xyMinMax,r.xyMinMax)):i.values}}),this)},e.prototype.makePanelOpts=function(e,t){return map(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:makeRectPanelClipPath(i),isTargetByCursor:makeRectIsTargetByCursor(i,e,n.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(i)}}))},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&indexOf(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=parseFinder$1(t,e),r=0;re[1]&&e.reverse(),e}function parseFinder$1(e,t){return parseFinder(e,t,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES})}var targetInfoBuilders={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,a=createHashMap(),o={},s={};(n||i||r)&&(each(n,(function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0})),each(i,(function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0})),each(r,(function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),a.each((function(e){var r=e.coordinateSystem,a=[];each(r.getCartesians(),(function(e,t){(indexOf(n,e.getAxis("x").model)>=0||indexOf(i,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:panelRectBuilders.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){each(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:panelRectBuilders.geo})}))}},targetInfoMatchers=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,r=e.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],panelRectBuilders={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(getTransform(e)),t}},coordConvert={lineX:curry(axisConvert,0),lineY:curry(axisConvert,1),rect:function(e,t,n){var i=t[COORD_CONVERTS[e]]([n[0][0],n[1][0]]),r=t[COORD_CONVERTS[e]]([n[0][1],n[1][1]]),a=[formatMinMax([i[0],r[0]]),formatMinMax([i[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:map(n,(function(n){var r=t[COORD_CONVERTS[e]](n);return i[0][0]=Math.min(i[0][0],r[0]),i[1][0]=Math.min(i[1][0],r[1]),i[0][1]=Math.max(i[0][1],r[0]),i[1][1]=Math.max(i[1][1],r[1]),r})),xyMinMax:i}}};function axisConvert(e,t,n,i){var r=n.getAxis(["x","y"][e]),a=formatMinMax(map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(i[e])):r.toGlobalCoord(r.dataToCoord(i[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var diffProcessor={lineX:curry(axisDiffProcessor,0),lineY:curry(axisDiffProcessor,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return map(e,(function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]}))}};function axisDiffProcessor(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function getScales(e,t){var n=getSize(e),i=getSize(t),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function getSize(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var each$9=each,inner$h=makeInner();function push(e,t){var n=getStoreSnapshots(e);each$9(t,(function(t,i){for(var r=n.length-1;r>=0;r--){if(n[r][i])break}if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(a){var o=a.getPercentRange();n[0][i]={dataZoomId:i,start:o[0],end:o[1]}}}})),n.push(t)}function pop(e){var t=getStoreSnapshots(e),n=t[t.length-1];t.length>1&&t.pop();var i={};return each$9(n,(function(e,n){for(var r=t.length-1;r>=0;r--)if(e=t[r][n]){i[n]=e;break}})),i}function clear$1(e){inner$h(e).snapshots=null}function count(e){return getStoreSnapshots(e).length}function getStoreSnapshots(e){var t=inner$h(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}ComponentModel.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var DATA_ZOOM_AXIS_DIMENSIONS=["x","y","radius","angle","single"],SERIES_COORDS=["cartesian2d","polar","singleAxis"];function isCoordSupported(e){var t=e.get("coordinateSystem");return indexOf(SERIES_COORDS,t)>=0}function getAxisMainType(e){return e+"Axis"}function findEffectedDataZooms(e,t){var n,i=createHashMap(),r=[],a=createHashMap();e.eachComponent({mainType:"dataZoom",query:t},(function(e){a.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",o)}while(n);function o(e){!a.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var r=i.get(e);r&&r[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){a.set(e.uid,!0),r.push(e),e.eachTargetAxis((function(e,t){(i.get(e)||i.set(e,[]))[t]=!0}))}return r}function collectReferCoordSysModelInfo(e){var t=e.ecModel,n={infoList:[],infoMap:createHashMap()};return e.eachTargetAxis((function(e,i){var r=t.getComponent(getAxisMainType(e),i);if(r){var a=r.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(r)}}})),n}var DataZoomAxisInfo=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),DataZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return __extends(t,e),t.prototype.init=function(e,t,n){var i=retrieveRawOption(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=retrieveRawOption(e);merge(this.option,e,!0),merge(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;each([["start","startValue"],["end","endValue"]],(function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=createHashMap();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return each(DATA_ZOOM_AXIS_DIMENSIONS,(function(n){var i=this.getReferringComponents(getAxisMainType(n),MULTIPLE_REFERRING);if(i.specified){t=!0;var r=new DataZoomAxisInfo;each(i.models,(function(e){r.add(e.componentIndex)})),e.set(n,r)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0;if(i){var r="vertical"===t?"y":"x";a(n.findComponents({mainType:r+"Axis"}),r)}i&&a(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function a(t,n){var r=t[0];if(r){var a=new DataZoomAxisInfo;if(a.add(r.componentIndex),e.set(n,a),i=!1,"x"===n||"y"===n){var o=r.getReferringComponents("grid",SINGLE_REFERRING).models[0];o&&each(t,(function(e){r.componentIndex!==e.componentIndex&&o===e.getReferringComponents("grid",SINGLE_REFERRING).models[0]&&a.add(e.componentIndex)}))}}}i&&each(DATA_ZOOM_AXIS_DIMENSIONS,(function(t){if(i){var r=n.findComponents({mainType:getAxisMainType(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var a=new DataZoomAxisInfo;a.add(r[0].componentIndex),e.set(t,a),i=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");each([["start","startValue"],["end","endValue"]],(function(i,r){var a=null!=e[i[0]],o=null!=e[i[1]];a&&!o?t[r]="percent":!a&&o?t[r]="value":n?t[r]=n[r]:a&&(t[r]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(getAxisMainType(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,i){each(n.indexList,(function(n){e.call(t,i,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(getAxisMainType(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;each([["start","startValue"],["end","endValue"]],(function(i){null==e[i[0]]&&null==e[i[1]]||(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;each(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;ia[1];if(u&&!c&&!h)return!0;u&&(o=!0),c&&(n=!0),h&&(r=!0)}return o&&n&&r})):each$a(i,(function(n){if("empty"===r)e.setData(t=t.map(n,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var i={};i[n]=a,t.selectRange(i)}})),each$a(i,(function(e){t.setApproximateExtent(a,e)})))}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;each$a(["min","max"],(function(i){var r=t.get(i+"Span"),a=t.get(i+"ValueSpan");null!=a&&(a=this.getAxisModel().axis.scale.parse(a)),null!=a?r=linearMap(n[0]+a,n,[0,100],!0):null!=r&&(a=linearMap(r,[0,100],n,!0)-n[0]),e[i+"Span"]=r,e[i+"ValueSpan"]=a}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=getPixelPrecision(n,[0,500]);i=Math.min(i,20);var r=e.axis.scale.rawExtentInfo;0!==t[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},e}();function calculateDataExtent(e,t,n){var i=[1/0,-1/0];each$a(n,(function(e){unionAxisExtentFromData(i,e.getData(),t)}));var r=e.getAxisModel(),a=ensureScaleRawExtentInfo(r.axis.scale,r,i).calculate();return[a.min,a.max]}registerProcessor(PRIORITY.PROCESSOR.FILTER,{getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var a=e.getComponent(getAxisMainType(i),r);t(i,r,a,n)}))}))}t((function(e,t,n,i){n.__dzAxisProxy=null}));var n=[];t((function(t,i,r,a){r.__dzAxisProxy||(r.__dzAxisProxy=new AxisProxy(t,i,a,e),n.push(r.__dzAxisProxy))}));var i=createHashMap();return each(n,(function(e){each(e.getTargetSeriesModels(),(function(e){i.set(e.uid,e)}))})),i},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){e.getAxisProxy(t,n).reset(e)})),e.eachTargetAxis((function(n,i){e.getAxisProxy(n,i).filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}}),registerAction("dataZoom",(function(e,t){each(findEffectedDataZooms(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var each$b=each,DATA_ZOOM_ID_BASE=makeInternalComponentId("toolbox-dataZoom_"),DataZoomFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n,i){this.brushController||(this.brushController=new BrushController(n.getZr()),this.brushController.on("brush",bind(this._onBrush,this)).mount()),updateZoomBtnStatus(e,t,this,i,n),updateBackBtnStatus(e,t)},t.prototype.onclick=function(e,t,n){handlers$1[n].call(this)},t.prototype.remove=function(e,t){this.brushController.unmount()},t.prototype.dispose=function(e,t){this.brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},i=this.ecModel;this.brushController.updateCovers([]),new BrushTargetManager(makeAxisFinder(this.model),i,{include:["grid"]}).matchOutputRanges(t,i,(function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(r("x",n,t[0]),r("y",n,t[1])):r({lineX:"x",lineY:"y"}[i],n,t)}})),push(i,n),this._dispatchZoomAction(n)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(i=n)})),i}(e,o,i),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=sliderMove(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];each$b(e,(function(e,n){t.push(clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocale(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(ToolboxFeature),handlers$1={zoom:function(){var e=!this.isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(pop(this.ecModel))}};function makeAxisFinder(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}function updateBackBtnStatus(e,t){e.setIconStatus("back",count(t)>1?"emphasis":"normal")}function updateZoomBtnStatus(e,t,n,i,r){var a=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(a="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n.isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new BrushTargetManager(makeAxisFinder(e),t,{include:["grid"]}).makePanelOpts(r,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n.brushController.setPanels(o).enableBrush(!(!a||!o.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}registerFeature("dataZoom",DataZoomFeature),registerInternalOptionCreator("dataZoom",(function(e){var t=e.getComponent("toolbox",0);if(t){var n=t.getModel(["feature","dataZoom"]),i=[],r=parseFinder(e,makeAxisFinder(n));return each$b(r.xAxisModels,(function(e){return a(e,"xAxis","xAxisIndex")})),each$b(r.yAxisModels,(function(e){return a(e,"yAxis","yAxisIndex")})),i}function a(e,t,r){var a=e.componentIndex,o={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:DATA_ZOOM_ID_BASE+t+a};o[r]=a,i.push(o)}}));var RestoreOption=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onclick=function(e,t){clear$1(e),t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocale(["toolbox","restore","title"])}},t}(ToolboxFeature);registerFeature("restore",RestoreOption),registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")}));var TooltipModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderColor:"#333",borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(ComponentModel);function shouldTooltipConfine(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}ComponentModel.registerClass(TooltipModel);var vendors=["-ms-","-moz-","-o-","-webkit-",""],gCssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";function mirrorPos(e){return e="left"===e?"right":"right"===e?"left":"top"===e?"bottom":"top"}function assembleArrow(e,t,n){if(!isString(n)||"inside"===n)return"";t=convertToColorString(t);var i=mirrorPos(n),r="",a="";return indexOf(["left","right"],i)>-1?(r=i+":-6px;top:50%;",a="translateY(-50%) rotate("+("left"===i?-225:-45)+"deg)"):(r=i+":-6px;left:50%;",a="translateX(-50%) rotate("+("top"===i?225:45)+"deg)"),'
'}function assembleTransition(e,t){var n="cubic-bezier(0.23, 1, 0.32, 1)",i="opacity "+e/2+"s "+n+",visibility "+e/2+"s "+n;return t||(i+=",left "+e+"s "+n+",top "+e+"s "+n),map(vendors,(function(e){return e+"transition:"+i})).join(";")}function assembleFont(e){var t=[],n=e.get("fontSize"),i=e.getTextColor();i&&t.push("color:"+i),t.push("font:"+e.getFont()),n&&t.push("line-height:"+Math.round(3*n/2)+"px");var r=e.get("textShadowColor"),a=e.get("textShadowBlur")||0,o=e.get("textShadowOffsetX")||0,s=e.get("textShadowOffsetY")||0;return r&&a&&t.push("text-shadow:"+o+"px "+s+"px "+a+"px "+r),each(["decoration","align"],(function(n){var i=e.get(n);i&&t.push("text-"+n+":"+i)})),t.join(";")}function assembleCssText(e,t,n){var i=[],r=e.get("transitionDuration"),a=e.get("backgroundColor"),o=e.get("shadowBlur"),s=e.get("shadowColor"),l=e.get("shadowOffsetX"),u=e.get("shadowOffsetY"),c=e.getModel("textStyle"),h=getPaddingFromTooltipModel(e,"html"),p=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+p),t&&r&&i.push(assembleTransition(r,n)),a&&(env.canvasSupported?i.push("background-Color:"+a):(i.push("background-Color:#"+toHex(a)),i.push("filter:alpha(opacity=70)"))),each(["width","color","radius"],(function(t){var n="border-"+t,r=toCamelCase(n),a=e.get(r);null!=a&&i.push(n+":"+a+("color"===t?"":"px"))})),i.push(assembleFont(c)),null!=h&&i.push("padding:"+normalizeCssArray$1(h).join("px ")+"px"),i.join(";")+";"}function makeStyleCoord(e,t,n,i,r){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&transformLocalCoord(e,o,document.body,i,r)}else{e[0]=i,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var TooltipHTMLContent=function(){function e(e,t,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,env.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=t.getZr(),a=this._appendToBody=n&&n.appendToBody;makeStyleCoord(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(i):e.appendChild(i),this._container=e;var o=this;i.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},i.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler;normalizeEvent(r.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},i.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){var t=this._container,n=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==n.position&&(i.position="relative"),e.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=this._styleCoord,r=n.offsetHeight/2;t=convertToColorString(t),n.style.cssText=gCssText+assembleCssText(e,!this._firstShow,this._longHide)+";left:"+i[0]+"px;top:"+(i[1]-r)+"px;border-color: "+t+";"+(e.get("extraCssText")||""),n.style.display=n.innerHTML?"block":"none",n.style.pointerEvents=this._enterable?"auto":"none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,i,r){if(null!=e){var a=this.el;if(isString(r)&&"item"===n.get("trigger")&&!shouldTooltipConfine(n)&&(e+=assembleArrow(n.get("backgroundColor"),i,r)),isString(e))a.innerHTML=e;else if(e){a.innerHTML="",isArray(e)||(e=[e]);for(var o=0;o=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!env.node){var r=makeDispatchAction$1(i,n);this._ticket="";var a=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var o=proxyRect;o.x=i.x,o.y=i.y,o.update(),o.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:o},r)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:a,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var s=findPointFromSeries(i,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:i.position,target:s.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},t.prototype.manuallyHideTip=function(e,t,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(makeDispatchAction$1(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var r=i.seriesIndex,a=i.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s)if("axis"===buildTooltipModel([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e]).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i=e.dataByCoordSys;i&&i.length?this._showAxisTooltip(i,e):n&&findEventDispatcher(n,(function(e){return null!=getECData(e).dataIndex}))?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,n,t)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,n,t)):(this._lastDataByCoordSys=null,this._hide(t))}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=bind(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,r=[t.offsetX,t.offsetY],a=buildTooltipModel([t.tooltipOption,i]),o=this._renderMode,s=[],l=createTooltipMarkup("section",{blocks:[],noHeader:!0}),u=[],c=new TooltipMarkupStyleCreator;each$c(e,(function(e){each$c(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var r=getValueLabel(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),a=createTooltipMarkup("section",{header:r,noHeader:!trim(r),sortBlocks:!0,blocks:[]});l.blocks.push(a),each(e.seriesDataIndices,(function(l){var h=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,d=h.getDataParams(p);d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=getAxisRawValue(t.axis,{value:i}),d.axisValueLabel=r,d.marker=c.makeTooltipMarker("item",convertToColorString(d.color),o);var f=normalizeTooltipFormatResult(h.formatTooltip(p,!0,null));f.markupFragment&&a.blocks.push(f.markupFragment),f.markupText&&u.push(f.markupText),s.push(d)}))}}))})),l.blocks.reverse(),u.reverse();var h=t.position,p=a.get("order"),d=buildTooltipMarkup(l,c,o,p,n.get("useUTC"));d&&u.unshift(d);var f="richText"===o?"\n\n":"
",g=u.join(f);this._showOrMove(a,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(a,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(a,g,s,Math.random()+"",r[0],r[1],h,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=findEventDispatcher(t,(function(e){return null!=getECData(e).dataIndex})),r=this._ecModel,a=getECData(i),o=a.seriesIndex,s=r.getSeriesByIndex(o),l=a.dataModel||s,u=a.dataIndex,c=a.dataType,h=l.getData(c),p=this._renderMode,d=buildTooltipModel([h.getItemModel(u),l,s&&(s.coordinateSystem||{}).model,this._tooltipModel]),f=d.get("trigger");if(null==f||"item"===f){var g=l.getDataParams(u,c),m=new TooltipMarkupStyleCreator;g.marker=m.makeTooltipMarker("item",convertToColorString(g.color),p);var y=normalizeTooltipFormatResult(l.formatTooltip(u,!1,c)),v=d.get("order"),_=y.markupFragment?buildTooltipMarkup(y.markupFragment,m,p,v,r.get("useUTC")):y.markupText,x="item_"+l.name+"_"+u;this._showOrMove(d,(function(){this._showTooltipContent(d,_,g,x,e.offsetX,e.offsetY,e.position,e.target,m)})),n({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=t.tooltip;if(isString(i)){i={content:i,formatter:i}}var r=new Model(i,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random()+"",s=new TooltipMarkupStyleCreator;this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t,s)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,c=e.get("formatter");o=o||e.get("position");var h=t,p=this._getNearestPoint([r,a],n,e.get("trigger"));if(c&&isString(c)){var d=e.ecModel.get("useUTC"),f=isArray(n)?n[0]:n;h=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=format(f.axisValue,h,d)),h=formatTpl(h,n,!0)}else if(isFunction(c)){var g=bind$2((function(t,i){t===this._ticket&&(u.setContent(i,l,e,p.color,o),this._updatePosition(e,o,r,a,u,n,s))}),this);this._ticket=i,h=c(n,i,g)}u.setContent(h,l,e,p.color,o),u.show(e,p.color),this._updatePosition(e,o,r,a,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n){return"axis"===n||isArray(t)?{color:"html"===this._renderMode?"#fff":"none"}:isArray(t)?void 0:{color:t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),c=e.get("align"),h=e.get("verticalAlign"),p=o&&o.getBoundingRect().clone();if(o&&p.applyTransform(o.transform),isFunction(t)&&(t=t([n,i],a,r.el,p,{viewSize:[s,l],contentSize:u.slice()})),isArray(t))n=parsePercent$3(t[0],s),i=parsePercent$3(t[1],l);else if(isObject(t)){var d=t;d.width=u[0],d.height=u[1];var f=getLayoutRect(d,{width:s,height:l});n=f.x,i=f.y,c=null,h=null}else if(isString(t)&&o){n=(g=calcTooltipPosition(t,p,u))[0],i=g[1]}else{var g;n=(g=refixTooltipPosition(n,i,r,s,l,c?null:20,h?null:20))[0],i=g[1]}(c&&(n-=isCenterAlign(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=isCenterAlign(h)?u[1]/2:"bottom"===h?u[1]:0),shouldTooltipConfine(e))&&(n=(g=confineTooltipPosition(n,i,r,s,l))[0],i=g[1]);r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e){var t=this._lastDataByCoordSys,n=!!t&&t.length===e.length;return n&&each$c(t,(function(t,i){var r=t.dataByAxis||[],a=(e[i]||{}).dataByAxis||[];(n=n&&r.length===a.length)&&each$c(r,(function(e,t){var i=a[t]||{},r=e.seriesDataIndices||[],o=i.seriesDataIndices||[];(n=n&&e.value===i.value&&e.axisType===i.axisType&&e.axisId===i.axisId&&r.length===o.length)&&each$c(r,(function(e,t){var i=o[t];n=n&&e.seriesIndex===i.seriesIndex&&e.dataIndex===i.dataIndex}))}))})),this._lastDataByCoordSys=e,!!n},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){env.node||(this._tooltipContent.dispose(),unregister("itemTooltip",t))},t.type="tooltip",t}(ComponentView);function buildTooltipModel(e){for(var t=e.pop();e.length;){var n=e.pop();n&&(n instanceof Model&&(n=n.get("tooltip",!0)),isString(n)&&(n={formatter:n}),t=new Model(n,t,t.ecModel))}return t}function makeDispatchAction$1(e,t){return e.dispatchAction||bind(t.dispatchAction,t)}function refixTooltipPosition(e,t,n,i,r,a,o){var s=n.getOuterSize(),l=s.width,u=s.height;return null!=a&&(e+l+a+2>i?e-=l+a:e+=a),null!=o&&(t+u+o>r?t-=u+o:t+=o),[e,t]}function confineTooltipPosition(e,t,n,i,r){var a=n.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,i)-o,t=Math.min(t+s,r)-s,[e=Math.max(e,0),t=Math.max(t,0)]}function calcTooltipPosition(e,t,n){var i=n[0],r=n[1],a=0,o=0,s=t.width,l=t.height;switch(e){case"inside":a=t.x+s/2-i/2,o=t.y+l/2-r/2;break;case"top":a=t.x+s/2-i/2,o=t.y-r-10;break;case"bottom":a=t.x+s/2-i/2,o=t.y+l+10;break;case"left":a=t.x-i-10-5,o=t.y+l/2-r/2;break;case"right":a=t.x+s+10+5,o=t.y+l/2-r/2}return[a,o]}function isCenterAlign(e){return"center"===e||"middle"===e}ComponentView.registerClass(TooltipView),registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var DEFAULT_TOOLBOX_BTNS=["rect","polygon","keep","clear"];function brushPreprocessor(e,t){var n=normalizeToArray(e?e.brush:[]);if(n.length){var i=[];each(n,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(i=i.concat(t))}));var r=e&&e.toolbox;isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a=r.feature||(r.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),removeDuplicate(s),t&&!s.length&&s.push.apply(s,DEFAULT_TOOLBOX_BTNS)}}function removeDuplicate(e){var t={};each(e,(function(e){t[e]=1})),e.length=0,each(t,(function(t,n){e.push(n)}))}var each$d=each;function hasKeys(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function createVisualMappings(e,t,n){var i={};return each$d(t,(function(t){var r,a=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);each$d(e[t],(function(e,i){if(VisualMapping.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),a[i]=new VisualMapping(r),"opacity"===i&&((r=clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new VisualMapping(r))}}))})),i}function replaceVisualOption(e,t,n){var i;each(n,(function(e){t.hasOwnProperty(e)&&hasKeys(t[e])&&(i=!0)})),i&&each(n,(function(n){t.hasOwnProperty(n)&&hasKeys(t[n])?e[n]=clone(t[n]):delete e[n]}))}function applyVisual(e,t,n,i,r,a){var o,s={};function l(e){return getItemVisualFromData(n,o,e)}function u(e,t){setItemVisualFromData(n,o,e,t)}function c(e,c){o=null==a?e:c;var h=n.getRawDataItem(o);if(!h||!1!==h.visualMap)for(var p=i.call(r,e),d=t[p],f=s[p],g=0,m=f.length;gt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&getBoundingRectFromMinMax(t)}};function getBoundingRectFromMinMax(e){return new BoundingRect(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var DEFAULT_OUT_OF_BRUSH_COLOR="#ddd",BrushModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return __extends(t,e),t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&replaceVisualOption(n,e,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:DEFAULT_OUT_OF_BRUSH_COLOR},i.hasOwnProperty("liftZ")||(i.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=map(e,(function(e){return generateBrushOption(this.option,e)}),this))},t.prototype.setBrushOption=function(e){this.brushOption=generateBrushOption(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}(ComponentModel);function generateBrushOption(e,t){return merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Model(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}ComponentModel.registerClass(BrushModel);var BrushView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new BrushController(t.getZr())).on("brush",bind(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,i){this.model=e,this._updateController(e,t,n,i)},t.prototype.updateTransform=function(e,t,n,i){layoutCovers(t),this._updateController(e,t,n,i)},t.prototype.updateVisual=function(e,t,n,i){this.updateTransform(e,t,n,i)},t.prototype.updateView=function(e,t,n,i){this._updateController(e,t,n,i)},t.prototype._updateController=function(e,t,n,i){(!i||i.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:t,areas:clone(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:t,areas:clone(n),$from:t})},t.type="brush",t}(ComponentView);ComponentView.registerClass(BrushView),registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var ICON_TYPES=["rect","polygon","lineX","lineY","keep","clear"],BrushFeature=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.render=function(e,t,n){var i,r,a;t.eachComponent({mainType:"brush"},(function(e){i=e.brushType,r=e.brushOption.brushMode||"single",a=a||!!e.areas.length})),this._brushType=i,this._brushMode=r,each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===i)?"emphasis":"normal")}))},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get("icon",!0),n={};return each(e.get("type",!0),(function(e){t[e]&&(n[e]=t[e])})),n},t.prototype.onclick=function(e,t,n){var i=this._brushType,r=this._brushMode;"clear"===n?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},t.getDefaultOption=function(e){return{show:!0,type:ICON_TYPES.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocale(["toolbox","brush","title"])}},t}(ToolboxFeature);registerFeature("brush",BrushFeature),registerPreprocessor(brushPreprocessor);var TitleModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return __extends(t,e),t.type="title",t.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(ComponentModel);ComponentModel.registerClass(TitleModel);var TitleView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var i=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new ZRText({style:createTextStyle(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new ZRText({style:createTextStyle(a,{text:c,fill:a.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=e.get("link"),d=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!p&&!f,h.silent=!d&&!f,p&&l.on("click",(function(){windowOpen(p,"_"+e.get("target"))})),d&&h.on("click",(function(){windowOpen(d,"_"+e.get("subtarget"))})),getECData(l).eventData=getECData(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(l),c&&i.add(h);var g=i.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=getLayoutRect(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?y.x+=y.width:"center"===o&&(y.x+=y.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:o,verticalAlign:s};l.setStyle(v),h.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var S=new Rect({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(S)}},t.type="title",t}(ComponentView);function timelinePreprocessor(e){var t=e&&e.timeline;isArray(t)||(t=t?[t]:[]),each(t,(function(e){e&&compatibleEC2(e)}))}function compatibleEC2(e){var t=e.type,n={number:"value",time:"time"};if(n[t]&&(e.axisType=n[t],delete e.type),transferItem(e),has(e,"controlPosition")){var i=e.controlStyle||(e.controlStyle={});has(i,"position")||(i.position=e.controlPosition),"none"!==i.position||has(i,"show")||(i.show=!1,delete i.position),delete e.controlPosition}each(e.data||[],(function(e){isObject(e)&&!isArray(e)&&(!has(e,"value")&&has(e,"name")&&(e.value=e.name),transferItem(e))}))}function transferItem(e){var t=e.itemStyle||(e.itemStyle={}),n=t.emphasis||(t.emphasis={}),i=e.label||e.label||{},r=i.normal||(i.normal={}),a={normal:1,emphasis:1};each(i,(function(e,t){a[t]||has(r,t)||(r[t]=e)})),n.label&&!has(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function has(e,t){return e.hasOwnProperty(t)}ComponentView.registerClass(TitleView),ComponentModel.registerSubTypeDefaulter("timeline",(function(){return"slider"})),registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var n=t.getComponent("timeline");return n&&null!=e.currentIndex&&(n.setCurrentIndex(e.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),t.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),defaults({currentIndex:n.option.currentIndex},e)})),registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var n=t.getComponent("timeline");n&&null!=e.playState&&n.setPlayState(e.playState)}));var TimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode="box",n}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],i=t.axisType,r=this._names=[];"category"===i?(e=[],each(n,(function(t,n){var i,a=convertOptionIdName(getDataItemValue(t),"");isObject(t)?(i=clone(t)).value=n:i=n,e.push(i),r.push(a)}))):e=n;var a={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new List([{name:"value",type:a}],this)).initData(e,r)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(ComponentModel);ComponentModel.registerClass(TimelineModel);var SliderTimelineModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline.slider",t.defaultOption=inheritDefaultOption(TimelineModel.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(TimelineModel);mixin(SliderTimelineModel,DataFormatMixin.prototype),ComponentModel.registerClass(SliderTimelineModel);var TimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="timeline",t}(ComponentView),TimelineAxis=function(e){function t(t,n,i,r){var a=e.call(this,t,n,i)||this;return a.type=r||"value",a}return __extends(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(Axis),PI$9=Math.PI,labelDataIndexStore=makeInner(),SliderTimelineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var i=this._layout(e,n),r=this._createGroup("_mainGroup"),a=this._createGroup("_labelGroup"),o=this._axis=this._createAxis(i,e);e.formatTooltip=function(e){return createTooltipMarkup("nameValue",{noName:!0,value:o.scale.getLabel({value:e})})},each(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](i,r,o,e)}),this),this._renderAxisLabel(i,a,o,e),this._position(i,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,i,r,a,o=e.get(["label","position"]),s=e.get("orient"),l=getViewRect$5(e,t),u={horizontal:"center",vertical:(n=null==o||"auto"===o?"horizontal"===s?l.y+l.height/2=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:PI$9/2},p="vertical"===s?l.height:l.width,d=e.getModel("controlStyle"),f=d.get("show",!0),g=f?d.get("itemSize"):0,m=f?d.get("itemGap"):0,y=g+m,v=e.get(["label","rotate"])||0;v=v*PI$9/180;var _=d.get("position",!0),x=f&&d.get("showPlayBtn",!0),S=f&&d.get("showPrevBtn",!0),b=f&&d.get("showNextBtn",!0),T=0,M=p;"left"===_||"bottom"===_?(x&&(i=[0,0],T+=y),S&&(r=[T,0],T+=y),b&&(a=[M-g,0],M-=y)):(x&&(i=[M-g,0],M-=y),S&&(r=[0,0],T+=y),b&&(a=[M-g,0],M-=y));var A=[T,M];return e.get("inverse")&&A.reverse(),{viewRect:l,mainLength:p,orient:s,rotation:h[s],labelRotation:v,labelPosOpt:n,labelAlign:e.get(["label","align"])||u[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:i,prevBtnPosition:r,nextBtnPosition:a,axisExtent:A,controlSize:g,controlGap:m}},t.prototype._position=function(e,t){var n=this._mainGroup,i=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=create$1(),o=r.x,s=r.y+r.height;translate(a,a,[-o,-s]),rotate(a,a,-PI$9/2),translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(n.getBoundingRect()),c=m(i.getBoundingRect()),h=[n.x,n.y],p=[i.x,i.y];p[0]=h[0]=l[0][0];var d,f=e.labelPosOpt;null==f||isString(f)?(y(h,u,l,1,d="+"===f?0:1),y(p,c,l,1,1-d)):(y(h,u,l,1,d=f>=0?0:1),p[1]=h[1]+f);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function y(e,t,n,i,r){e[i]+=n[i][r]-t[i][r]}n.setPosition(h),i.setPosition(p),n.rotation=i.rotation=e.rotation,g(n),g(i)},t.prototype._createAxis=function(e,t){var n=t.getData(),i=t.get("axisType"),r=createScaleByModel$1(t,i);r.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var a=n.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new TimelineAxis("value",r,e.axisExtent,i);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Group;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var a=new Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:extend({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(a);var o=this._progressLine=new Line({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:defaults({lineCap:"round",lineWidth:a.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,i){var r=this,a=i.getData(),o=n.scale.getTicks();this._tickSymbols=[],each(o,(function(e){var o=n.dataToCoord(e.value),s=a.getItemModel(e.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:o,y:0,onclick:bind(r._changeTimeline,r,e.value)},p=giveSymbol(s,l,t,h);p.ensureState("emphasis").style=u.getItemStyle(),p.ensureState("progress").style=c.getItemStyle(),enableHoverEmphasis(p);var d=getECData(p);s.get("tooltip")?(d.dataIndex=e.value,d.dataModel=i):d.dataIndex=d.dataModel=null,r._tickSymbols.push(p)}))},t.prototype._renderAxisLabel=function(e,t,n,i){var r=this;if(n.getLabelModel().get("show")){var a=i.getData(),o=n.getViewLabels();this._tickLabels=[],each(o,(function(i){var o=i.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(i.tickValue),p=new ZRText({x:h,y:0,rotation:e.labelRotation-e.rotation,onclick:bind(r._changeTimeline,r,o),silent:!1,style:createTextStyle(l,{text:i.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});p.ensureState("emphasis").style=createTextStyle(u),p.ensureState("progress").style=createTextStyle(c),t.add(p),enableHoverEmphasis(p),labelDataIndexStore(p).dataIndex=o,r._tickLabels.push(p)}))}},t.prototype._renderControl=function(e,t,n,i){var r=e.controlSize,a=e.rotation,o=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function c(e,n,l,u){if(e){var c=parsePercent(retrieve2(i.get(["controlStyle",n+"BtnSize"]),r),r),h=makeControlIcon(i,n+"Icon",[0,-c/2,c,c],{position:e,origin:[r/2,0],rotation:u?-a:0,rectHover:!0,style:o,onclick:l});h.ensureState("emphasis").style=s,t.add(h),enableHoverEmphasis(h)}}c(e.nextBtnPosition,"next",bind(this._changeTimeline,this,u?"-":"+")),c(e.prevBtnPosition,"prev",bind(this._changeTimeline,this,u?"+":"-")),c(e.playPosition,l?"stop":"play",bind(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,i){var r=i.getData(),a=i.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=bind(s._handlePointerDrag,s),e.ondragend=bind(s._handlePointerDragend,s),pointerMoveTo(e,s._progressLine,a,n,i,!0)},onUpdate:function(e){pointerMoveTo(e,s._progressLine,a,n,i)}};this._currentPointer=giveSymbol(o,o,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],i=asc(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(o[a]=+o[a].toFixed(h)),[o,c]}ComponentModel.registerClass(MarkPointModel);var markerTypeCalculator={min:curry(markerTypeCalculatorWithExtent,"min"),max:curry(markerTypeCalculatorWithExtent,"max"),average:curry(markerTypeCalculatorWithExtent,"average"),median:curry(markerTypeCalculatorWithExtent,"median")};function dataTransform(e,t){var n=e.getData(),i=e.coordinateSystem;if(t&&!hasXAndY(t)&&!isArray(t.coord)&&i){var r=i.dimensions,a=getAxisInfo$1(t,n,i,e);if((t=clone(t)).type&&markerTypeCalculator[t.type]&&a.baseAxis&&a.valueAxis){var o=indexOf(r,a.baseAxis.dim),s=indexOf(r,a.valueAxis.dim),l=markerTypeCalculator[t.type](n,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],c=0;c<2;c++)markerTypeCalculator[u[c]]&&(u[c]=numCalculate(n,n.mapDimension(r[c]),u[c]));t.coord=u}}return t}function getAxisInfo$1(e,t,n,i){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=n.getAxis(dataDimToCoordDim(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim),r.valueDataDim=t.mapDimension(r.valueAxis.dim)),r}function dataDimToCoordDim(e,t){var n=e.getData(),i=n.dimensions;t=n.getDimension(t);for(var r=0;r=0&&"number"==typeof l&&(l=+l.toFixed(Math.min(f,20))),p.coord[c]=d.coord[c]=l,r=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[dataTransform(e,r[0]),dataTransform(e,r[1]),extend({},r[2])];return g[2].type=g[2].type||null,merge(g[2],g[0]),merge(g[2],g[1]),g};function isInifinity(e){return!isNaN(e)&&!isFinite(e)}function ifMarkLineHasOnlyDim(e,t,n,i){var r=1-e,a=i.dimensions[e];return isInifinity(t[r])&&isInifinity(n[r])&&t[e]===n[e]&&i.getAxis(a).containData(t[e])}function markLineFilter(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(ifMarkLineHasOnlyDim(1,n,i,e)||ifMarkLineHasOnlyDim(0,n,i,e)))return!0}return dataFilter$1(e,t[0])&&dataFilter$1(e,t[1])}function updateSingleMarkerEndLayout(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get("x"),r.getWidth()),u=parsePercent$2(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=o.dimensions,h=e.get(c[0],t),p=e.get(c[1],t);a=o.dataToPoint([h,p])}if(isCoordinateSystemType(o,"cartesian2d")){var d=o.getAxis("x"),f=o.getAxis("y");c=o.dimensions;isInifinity(e.get(c[0],t))?a[0]=d.toGlobalCoord(d.getExtent()[n?0:1]):isInifinity(e.get(c[1],t))&&(a[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}var MarkLineView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=inner$k(t).from,a=inner$k(t).to;r.each((function(t){updateSingleMarkerEndLayout(r,t,!0,e,n),updateSingleMarkerEndLayout(a,t,!1,e,n)})),i.each((function(e){i.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new LineDraw);this.group.add(l.group);var u=createList$2(r,e,t),c=u.from,h=u.to,p=u.line;inner$k(t).from=c,inner$k(t).to=h,t.setData(p);var d=t.get("symbol"),f=t.get("symbolSize");function g(t,n,r){var a=t.getItemModel(n);updateSingleMarkerEndLayout(t,n,r,e,i);var s=a.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=getVisualFromData(o,"color")),t.setItemVisual(n,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||f[r?0:1],symbol:a.get("symbol",!0)||d[r?0:1],style:s})}isArray(d)||(d=[d,d]),isArray(f)||(f=[f,f]),u.from.each((function(e){g(c,e,!0),g(h,e,!1)})),p.each((function(e){var t=p.getItemModel(e).getModel("lineStyle").getLineStyle();p.setItemLayout(e,[c.getItemLayout(e),h.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),p.setItemVisual(e,{fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolRotate:h.getItemVisual(e,"symbolRotate"),toSymbolSize:h.getItemVisual(e,"symbolSize"),toSymbol:h.getItemVisual(e,"symbol"),style:t})})),l.updateData(p),u.line.eachItemGraphicEl((function(e,n){e.traverse((function(e){getECData(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(MarkerView);function createList$2(e,t,n){var i;i=e?map(e&&e.dimensions,(function(e){return defaults({name:e},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{})})):[{name:"value",type:"float"}];var r=new List(i,n),a=new List(i,n),o=new List([],n),s=map(n.get("data"),curry(markLineTransform,t,e,n));e&&(s=filter(s,curry(markLineFilter,e)));var l=e?dimValueGetter:function(e){return e.value};return r.initData(map(s,(function(e){return e[0]})),null,l),a.initData(map(s,(function(e){return e[1]})),null,l),o.initData(map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}ComponentView.registerClass(MarkLineView),registerPreprocessor((function(e){e.markLine=e.markLine||{}}));var MarkAreaModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(MarkerModel);ComponentModel.registerClass(MarkAreaModel);var inner$l=makeInner(),markAreaTransform=function(e,t,n,i){var r=dataTransform(e,i[0]),a=dataTransform(e,i[1]),o=r.coord,s=a.coord;o[0]=retrieve(o[0],-1/0),o[1]=retrieve(o[1],-1/0),s[0]=retrieve(s[0],1/0),s[1]=retrieve(s[1],1/0);var l=mergeAll([{},r,a]);return l.coord=[r.coord,a.coord],l.x0=r.x,l.y0=r.y,l.x1=a.x,l.y1=a.y,l};function isInifinity$1(e){return!isNaN(e)&&!isFinite(e)}function ifMarkAreaHasOnlyDim(e,t,n,i){var r=1-e;return isInifinity$1(t[r])&&isInifinity$1(n[r])}function markAreaFilter(e,t){var n=t.coord[0],i=t.coord[1];return!!(isCoordinateSystemType(e,"cartesian2d")&&n&&i&&(ifMarkAreaHasOnlyDim(1,n,i)||ifMarkAreaHasOnlyDim(0,n,i)))||(dataFilter$1(e,{coord:n,x:t.x0,y:t.y0})||dataFilter$1(e,{coord:i,x:t.x1,y:t.y1}))}function getSingleMarkerEndPoint(e,t,n,i,r){var a,o=i.coordinateSystem,s=e.getItemModel(t),l=parsePercent$2(s.get(n[0]),r.getWidth()),u=parsePercent$2(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)a=i.getMarkerPosition(e.getValues(n,t));else{var c=[d=e.get(n[0],t),f=e.get(n[1],t)];o.clampData&&o.clampData(c,c),a=o.dataToPoint(c,!0)}if(isCoordinateSystemType(o,"cartesian2d")){var h=o.getAxis("x"),p=o.getAxis("y"),d=e.get(n[0],t),f=e.get(n[1],t);isInifinity$1(d)?a[0]=h.toGlobalCoord(h.getExtent()["x0"===n[0]?0:1]):isInifinity$1(f)&&(a[1]=p.toGlobalCoord(p.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var dimPermutations=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MarkAreaView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=MarkerModel.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each((function(t){var r=map(dimPermutations,(function(r){return getSingleMarkerEndPoint(i,t,r,e,n)}));i.setItemLayout(t,r),i.getItemGraphicEl(t).setShape("points",r)}))}}),this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new Group});this.group.add(l.group),this.markKeep(l);var u=createList$3(r,e,t);t.setData(u),u.each((function(t){var n=map(dimPermutations,(function(n){return getSingleMarkerEndPoint(u,t,n,e,i)})),a=!0;each(dimPermutations,(function(e){if(a){var n=u.get(e[0],t),i=u.get(e[1],t);(isInifinity$1(n)||r.getAxis("x").containData(n))&&(isInifinity$1(i)||r.getAxis("y").containData(i))&&(a=!1)}})),u.setItemLayout(t,{points:n,allClipped:a});var s=u.getItemModel(t).getModel("itemStyle").getItemStyle(),l=getVisualFromData(o,"color");s.fill||(s.fill=l,"string"==typeof s.fill&&(s.fill=modifyAlpha(s.fill,.4))),s.stroke||(s.stroke=l),u.setItemVisual(t,"style",s)})),u.diff(inner$l(l).data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}})).update((function(e,n){var i=inner$l(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?updateProps(i,{shape:{points:r.points}},t,e):i=new Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))})).remove((function(e){var t=inner$l(l).data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,n){var i=u.getItemModel(n),r=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),setLabelStyle(e,getLabelStatesModels(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:"string"==typeof r.fill?modifyAlpha(r.fill,1):"#000"}),setStatesStylesFromModel(e,i),enableHoverEmphasis(e),getECData(e).dataModel=t})),inner$l(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(MarkerView);function createList$3(e,t,n){var i,r;e?(i=map(e&&e.dimensions,(function(e){var n=t.getData();return defaults({name:e},n.getDimensionInfo(n.mapDimension(e))||{})})),r=new List(map(["x0","y0","x1","y1"],(function(e,t){return{name:e,type:i[t%2].type}})),n)):r=new List(i=[{name:"value",type:"float"}],n);var a=map(n.get("data"),curry(markAreaTransform,t,e,n));e&&(a=filter(a,curry(markAreaFilter,e)));var o=e?function(e,t,n,i){return e.coord[Math.floor(i/2)][i%2]}:function(e){return e.value};return r.initData(a,null,o),r.hasItemOption=!0,r}ComponentView.registerClass(MarkAreaView),registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var getDefaultSelectorOptions=function(e,t){return"all"===t?{type:"all",title:e.getLocale(["legend","selector","all"])}:"inverse"===t?{type:"inverse",title:e.getLocale(["legend","selector","inverse"])}:void 0},LegendModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return __extends(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),isArray(t)&&each(t,(function(e,i){isString(e)&&(e={type:e}),t[i]=merge(e,getDefaultSelectorOptions(n,e.type))}))},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(ComponentModel);function legendSelectActionHandler(e,t,n){var i,r={},a="toggleSelected"===e;return n.eachComponent("legend",(function(n){a&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name)),each(n.getData(),(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&i:r[t]=i}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}ComponentModel.registerClass(LegendModel),registerAction("legendToggleSelect","legendselectchanged",curry(legendSelectActionHandler,"toggleSelected")),registerAction("legendAllSelect","legendselectall",curry(legendSelectActionHandler,"allSelect")),registerAction("legendInverseSelect","legendinverseselect",curry(legendSelectActionHandler,"inverseSelect")),registerAction("legendSelect","legendselected",curry(legendSelectActionHandler,"select")),registerAction("legendUnSelect","legendunselected",curry(legendSelectActionHandler,"unSelect"));var curry$1=curry,each$e=each,Group$2=Group,LegendView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return __extends(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Group$2),this.group.add(this._selectorGroup=new Group$2),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,n,o,a,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=getLayoutRect(l,u,c),p=this.layoutInner(e,r,h,i,o,s),d=getLayoutRect(defaults({width:p.width,height:p.height},l),u,c);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(p,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,r,a,o){var s=this.getContentGroup(),l=createHashMap(),u=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),each$e(t.getData(),(function(r,a){var o=r.get("name");if(!this.newlineDisabled&&(""===o||"\n"===o)){var h=new Group$2;return h.newline=!0,void s.add(h)}var p=n.getSeriesByName(o)[0];if(!l.get(o)){if(p){var d=p.getData(),f=d.getVisual("style"),g=f[d.getVisual("drawType")]||f.fill,m=f.stroke,y=f.decal,v=d.getVisual("legendSymbol")||"roundRect",_=d.getVisual("symbol");this._createItem(o,a,r,t,v,_,e,g,m,y,u).on("click",curry$1(dispatchSelectAction,o,null,i,c)).on("mouseover",curry$1(dispatchHighlightAction,p.name,null,i,c)).on("mouseout",curry$1(dispatchDownplayAction,p.name,null,i,c)),l.set(o,!0)}else n.eachRawSeries((function(n){if(!l.get(o)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(o))return;var h=s.indexOfName(o),p=s.getItemVisual(h,"style"),d=p.stroke,f=p.decal,g=p.fill,m=parse(p.fill);m&&0===m[3]&&(m[3]=.2,g=stringify(m,"rgba"));this._createItem(o,a,r,t,"roundRect",null,e,g,d,f,u).on("click",curry$1(dispatchSelectAction,null,o,i,c)).on("mouseover",curry$1(dispatchHighlightAction,null,o,i,c)).on("mouseout",curry$1(dispatchDownplayAction,null,o,i,c)),l.set(o,!0)}}),this);0}}),this),r&&this._createSelector(r,t,i,a,o)},t.prototype._createSelector=function(e,t,n,i,r){var a=this.getSelectorGroup();each$e(e,(function(e){var i=e.type,r=new ZRText({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});a.add(r),setLabelStyle(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),enableHoverEmphasis(r)}))},t.prototype._createItem=function(e,t,n,i,r,a,o,s,l,u,c){var h=i.get("itemWidth"),p=i.get("itemHeight"),d=i.get("inactiveColor"),f=i.get("inactiveBorderColor"),g=i.get("symbolKeepAspect"),m=i.getModel("itemStyle"),y=i.isSelected(e),v=new Group$2,_=n.getModel("textStyle"),x=n.get("icon"),S=n.getModel("tooltip"),b=S.parentModel,T=createSymbol(r=x||r,0,0,h,p,y?s:d,null==g||g);if(v.add(setSymbolStyle(T,r,m,l,f,u,y)),!x&&a&&(a!==r||"none"===a)){var M=.8*p;"none"===a&&(a="circle");var A=createSymbol(a,(h-M)/2,(p-M)/2,M,M,y?s:d,null==g||g);v.add(setSymbolStyle(A,a,m,l,f,u,y))}var I="left"===o?h+5:-5,C=o,w=i.get("formatter"),P=e;"string"==typeof w&&w?P=w.replace("{name}",null!=e?e:""):"function"==typeof w&&(P=w(e)),v.add(new ZRText({style:createTextStyle(_,{text:P,x:I,y:p/2,fill:y?_.getTextColor():d,align:C,verticalAlign:"middle"})}));var L=new Rect({shape:v.getBoundingRect(),invisible:!0});if(S.get("show")){var E={componentType:"legend",legendIndex:i.componentIndex,name:e,$vars:["name"]};L.tooltip=extend({content:e,formatter:b.get("formatter",!0)||function(e){return e.name},formatterParams:E},S.option)}return v.add(L),v.eachChild((function(e){e.silent=!0})),L.silent=!c,this.getContentGroup().add(v),enableHoverEmphasis(v),v.__legendDataIndex=t,v},t.prototype.layoutInner=function(e,t,n,i,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();box(e.get("orient"),o,e.get("itemGap"),n.width,n.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),o.markRedraw(),r){box("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],p=e.get("selectorButtonGap",!0),d=e.getOrient().index,f=0===d?"width":"height",g=0===d?"height":"width",m=0===d?"y":"x";"end"===a?h[d]+=l[f]+p:u[d]+=c[f]+p,h[1-d]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],o.x=u[0],o.y=u[1];var y={x:0,y:0};return y[f]=l[f]+p+c[f],y[g]=Math.max(l[g],c[g]),y[m]=Math.min(0,c[m]+h[1-d]),y}return o.x=u[0],o.y=u[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ComponentView);function setSymbolStyle(e,t,n,i,r,a,o){var s;return"line"!==t&&t.indexOf("empty")<0?(s=n.getItemStyle(),e.style.stroke=i,e.style.decal=a,o||(s.stroke=r)):s=n.getItemStyle(["borderWidth","borderColor"]),e.setStyle(s),e}function dispatchSelectAction(e,t,n,i){dispatchDownplayAction(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),dispatchHighlightAction(e,t,n,i)}function isUseHoverLayer(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;in[r],f=[-h.x,-h.y];t||(f[i]=l[s]);var g=[0,0],m=[-p.x,-p.y],y=retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?m[i]+=n[r]-p[r]:g[i]+=p[r]+y);m[1-i]+=h[a]/2-p[a]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var v={x:0,y:0};if(v[r]=d?n[r]:h[r],v[a]=Math.max(h[a],p[a]),v[o]=Math.min(0,p[o]+m[1-i]),u.__rectSize=n[r],d){var _={x:0,y:0};_[r]=Math.max(n[r]-p[r]-y,0),_[a]=v[a],u.setClipPath(new Rect({shape:_})),u.__rectSize=_[r]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&updateProps(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?e:null),this._updatePageInfoView(e,x),v},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;each(["pagePrev","pageNext"],(function(i){var r=null!=t[i+"DataIndex"],a=n.childOfName(i);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var i=n.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;i&&r&&i.setStyle("text",isString(r)?r.replace("{current}",null==o?"":o+"").replace("{total}",null==s?"":s+""):r({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,a=WH$1[r],o=XY$1[r],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=c?1:0,p={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var d=v(u);p.contentPosition[r]=-d.s;for(var f=s+1,g=d,m=d,y=null;f<=c;++f)(!(y=v(l[f]))&&m.e>g.s+i||y&&!_(y,g.s))&&(g=m.i>g.i?m:y)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount),m=y;for(f=s-1,g=d,m=d,y=null;f>=-1;--f)(y=v(l[f]))&&_(m,y.s)||!(g.i=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(i,r){var a=i.__legendDataIndex;null==n&&null!=a&&(n=r),a===e&&(t=r)})),null!=t?t:n):0;var t,n},t.type="legend.scroll",t}(LegendView);ComponentView.registerClass(ScrollableLegendView),registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}));var SliderZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=inheritDefaultOption(DataZoomModel.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(DataZoomModel);ComponentModel.registerClass(SliderZoomModel);var Rect$2=Rect,DEFAULT_LOCATION_EDGE_GAP=7,DEFAULT_FRAME_BORDER_WIDTH=1,DEFAULT_FILLER_SIZE=30,DEFAULT_MOVE_HANDLE_SIZE=7,HORIZONTAL="horizontal",VERTICAL="vertical",LABEL_GAP=5,SHOW_DATA_SHADOW_SERIES_TYPE=["line","bar","candlestick","scatter"],REALTIME_ANIMATION_CONFIG={easing:"cubicOut",duration:100},SliderZoomView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return __extends(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=bind(this._onBrush,this),this._onBrushEnd=bind(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),createOrUpdate(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){clear(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?DEFAULT_MOVE_HANDLE_SIZE:0,i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},a=this._orient===HORIZONTAL?{right:r.width-i.x-i.width,top:r.height-DEFAULT_FILLER_SIZE-DEFAULT_LOCATION_EDGE_GAP-n,width:i.width,height:DEFAULT_FILLER_SIZE}:{right:DEFAULT_LOCATION_EDGE_GAP,top:i.y,width:DEFAULT_FILLER_SIZE,height:i.height},o=getLayoutParams(e.option);each(["right","top","width","height"],(function(e){"ph"===o[e]&&(o[e]=a[e])}));var s=getLayoutRect(o,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===VERTICAL&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n!==HORIZONTAL||r?n===HORIZONTAL&&r?{scaleY:o?1:-1,scaleX:-1}:n!==VERTICAL||r?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new Rect$2({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new Rect$2({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:bind(this._onClickPanel,this)}),a=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",a.on("mousemove",this._onBrush),a.on("mouseup",this._onBrushEnd)):(a.off("mousemove",this._onBrush),a.off("mouseup",this._onBrushEnd)),n.add(r)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=e.series,i=n.getRawData(),r=n.getShadowDim?n.getShadowDim():e.otherDim;if(null!=r){var a=i.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],c=[[t[0],0],[0,0]],h=[],p=u[1]/(i.count()-1),d=0,f=Math.round(i.count()/t[0]);i.each([r],(function(e,t){if(f>0&&t%f)d+=p;else{var n=null==e||isNaN(e)||""===e,i=n?0:linearMap(e,a,l,!0);n&&!s&&t?(c.push([c[c.length-1][0],0]),h.push([h[h.length-1][0],0])):!n&&s&&(c.push([d,0]),h.push([d,0])),c.push([d,i]),h.push([d,i]),d+=p,s=n}}));for(var g=this.dataZoomModel,m=0;m<3;m++){var y=v(1===m);this._displayables.sliderGroup.add(y),this._displayables.dataShadowSegs.push(y)}}}function v(e){var t=g.getModel(e?"selectedDataBackground":"dataBackground"),n=new Group,i=new Polygon({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Polyline({shape:{points:h},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,i=this.ecModel;return e.eachTargetAxis((function(r,a){each(e.getAxisProxy(r,a).getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,e.get("type"))<0)){var o,s=i.getComponent(getAxisMainType(r),a).axis,l=getOtherDim(r),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:r,otherDim:l,otherAxisInverse:o}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],r=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,l=o.get("borderRadius")||0,u=o.get("brushSelect"),c=t.filler=new Rect$2({silent:u,style:{fill:o.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new Rect$2({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:l},style:{stroke:o.get("dataBackgroundColor")||o.get("borderColor"),lineWidth:DEFAULT_FRAME_BORDER_WIDTH,fill:"rgba(0,0,0,0)"}})),each([0,1],(function(t){var a=o.get("handleIcon");!symbolBuildProxies[a]&&a.indexOf("path://")<0&&(a="path://"+a);var s=createSymbol(a,-1,0,2,2,null,!0);s.attr({cursor:getCursor(this._orient),draggable:!0,drift:bind(this._onDragMove,this,t),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=o.get("handleSize");this._handleHeight=parsePercent$2(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(o.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=o.getModel(["emphasis","handleStyle"]).getItemStyle(),enableHoverEmphasis(s);var c=o.get("handleColor");null!=c&&(s.style.fill=c),r.add(n[t]=s);var h=o.getModel("textStyle");e.add(i[t]=new ZRText({silent:!0,invisible:!0,style:{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()},z2:10}))}),this);var h=c;if(u){var p=parsePercent$2(o.get("moveHandleSize"),a[1]),d=t.moveHandle=new Rect({style:o.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:p}}),f=.8*p,g=t.moveHandleIcon=createSymbol(o.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=a[1]+p/2-.5,d.ensureState("emphasis").style=o.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(a[1]/2,Math.max(p,10));(h=t.moveZone=new Rect({invisible:!0,shape:{y:a[1]-m,height:p+m}})).on("mouseover",(function(){s.enterEmphasis(d)})).on("mouseout",(function(){s.leaveEmphasis(d)})),r.add(d),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:getCursor(this._orient),drift:bind(this._onDragMove,this,"all"),ondragstart:bind(this._showDataInfo,this,!0),ondragend:bind(this._onDragEnd,this),onmouseover:bind(this._showDataInfo,this,!0),onmouseout:bind(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[linearMap(e[0],[0,100],t,!0),linearMap(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];sliderMove(t,i,r,n.get("zoomLock")?"all":e,null!=a.minSpan?linearMap(a.minSpan,o,r,!0):null,null!=a.maxSpan?linearMap(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=asc([linearMap(i[0],r,o,!0),linearMap(i[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=asc(n.slice()),r=this._size;each([0,1],(function(e){var i=t.handles[e],a=this._handleHeight;i.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:r[1]/2-a/2})}),this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var a={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;lt[0]||n[1]<0||n[1]>t[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,a=this._updateInterval("all",n[0]-r);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Point(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=asc([linearMap(n.x,i,r,!0),linearMap(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(stop(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new Rect$2({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),l=o.transformCoordToLocal(a.x,a.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?REALTIME_ANIMATION_CONFIG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=collectReferCoordSysModelInfo(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),r=this.api.getHeight();e={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return e},t.type="dataZoom.slider",t}(DataZoomView);function getOtherDim(e){return{x:"y",y:"x",radius:"angle",angle:"radius"}[e]}function getCursor(e){return"vertical"===e?"ns-resize":"ew-resize"}ComponentView.registerClass(SliderZoomView);var InsideZoomModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.type="dataZoom.inside",t.defaultOption=inheritDefaultOption(DataZoomModel.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(DataZoomModel);ComponentModel.registerClass(InsideZoomModel);var inner$m=makeInner();function setViewInfoToCoordSysRecord(e,t,n){inner$m(e).coordSysRecordMap.each((function(e){var i=e.dataZoomInfoMap.get(t.uid);i&&(i.getRange=n)}))}function disposeCoordSysRecordIfNeeded(e,t){for(var n=inner$m(e).coordSysRecordMap,i=n.keys(),r=0;ri[n+t]&&(t=o),r=r&&a.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}registerProcessor(PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=inner$m(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=createHashMap());i.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){each(collectReferCoordSysModelInfo(e).infoList,(function(n){var r=n.model.uid,a=i.get(r)||i.set(r,createCoordSysRecord(t,n.model));(a.dataZoomInfoMap||(a.dataZoomInfoMap=createHashMap())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),i.each((function(e){var t,n=e.controller,r=e.dataZoomInfoMap;if(r){var a=r.keys()[0];null!=a&&(t=r.get(a))}if(t){var o=mergeControllerParams(r);n.enable(o.controlType,o.opt),n.setPointerChecker(e.containsPoint),createOrUpdate(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else disposeCoordSysRecord(i,e)}))}));var InsideZoomView=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return __extends(t,e),t.prototype.render=function(t,n,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),setViewInfoToCoordSysRecord(i,t,{pan:bind(getRangeHandlers.pan,this),zoom:bind(getRangeHandlers.zoom,this),scrollMove:bind(getRangeHandlers.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){disposeCoordSysRecordIfNeeded(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(DataZoomView),getRangeHandlers={zoom:function(e,t,n,i){var r=this.range,a=r.slice(),o=e.axisModels[0];if(o){var s=getDirectionInfo[t](null,[i.originX,i.originY],o,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return sliderMove(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:makeMover((function(e,t,n,i,r,a){var o=getDirectionInfo[i]([a.oldX,a.oldY],[a.newX,a.newY],t,r,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:makeMover((function(e,t,n,i,r,a){return getDirectionInfo[i]([0,0],[a.scrollDelta,a.scrollDelta],t,r,n).signal*(e[1]-e[0])*a.scrollDelta}))};function makeMover(e){return function(t,n,i,r){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s)return sliderMove(e(o,s,t,n,i,r),o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}var getDirectionInfo={grid:function(e,t,n,i,r){var a=n.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,i,r){var a=n.axis,o={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,i,r){var a=n.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};ComponentView.registerClass(InsideZoomView);var each$f=each;function visualMapPreprocessor(e){var t=e&&e.visualMap;isArray(t)||(t=t?[t]:[]),each$f(t,(function(e){if(e){has$1(e,"splitList")&&!has$1(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&isArray(t)&&each$f(t,(function(e){isObject(e)&&(has$1(e,"start")&&!has$1(e,"min")&&(e.min=e.start),has$1(e,"end")&&!has$1(e,"max")&&(e.max=e.end))}))}}))}function has$1(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}ComponentModel.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var VISUAL_PRIORITY=PRIORITY.VISUAL.COMPONENT;function getColorVisual(e,t,n,i){for(var r=t.targetVisuals[i],a=VisualMapping.prepareVisualTypes(r),o={color:getVisualFromData(e.getData(),"color")},s=0,l=a.length;s"],isArray(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);return isString(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):isFunction(s)?i?s(e[0],e[1]):s(e):i?e[0]===o[0]?n[0]+" "+l[1]:e[1]===o[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(e){return e===o[0]?"min":e===o[1]?"max":(+e).toFixed(Math.min(a,20))}},t.prototype.resetExtent=function(){var e=this.option,t=asc$2([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimension=function(e){var t=this.option.dimension,n=e.dimensions;if(null!=t||n.length){if(null!=t)return e.getDimension(t);for(var i=e.dimensions,r=i.length-1;r>=0;r--){var a=i[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),r=t.controller||(t.controller={});merge(i,n),merge(r,n);var a=this.isCategory();function o(n){isArray$1(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,r),function(e,t,n){var i=e[t],r=e[n];i&&!r&&(r=e[n]={},each$g(i,(function(e,t){if(VisualMapping.isValidType(t)){var n=visualDefault.get(t,"inactive",a);null!=n&&(r[t]=n,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor");each$g(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?i:[i]}),null==s.symbol&&(s.symbol=t&&clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&clone(n)||(a?o[0]:[o[0],o[0]])),s.symbol=mapVisual$1(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;eachVisual(l,(function(e){e>u&&(u=e)})),s.symbolSize=mapVisual$1(l,(function(e){return linearMap$1(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(ComponentModel),DEFAULT_BAR_BOUND=[20,140],ContinuousModel=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=DEFAULT_BAR_BOUND[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=DEFAULT_BAR_BOUND[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=asc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var i=[],r=n.getData();r.each(this.getDataDimension(r),(function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)}),this),t.push({seriesId:n.id,dataIndex:i})}),this),t},t.prototype.getVisualMeta=function(e){var t=getColorStopValues(this,"outOfRange",this.getExtent()),n=getColorStopValues(this,"inRange",this.option.range.slice()),i=[];function r(t,n){i.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,l=t.length;oe[1])break;n.push({color:this.getControllerVisual(a,"color",t),offset:r/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Group("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,a=n.handleLabels,o=i.itemSize,s=i.getExtent();each$h([0,1],(function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=linearMap$2(e[l],[0,o[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/o[0],u.x=o[0]-h/2;var p=applyTransform$1(n.handleLabelPoints[l],getTransform(u,this.group));a[l].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,i){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),p=linearMap$2(e,a,s,!0),d=o[0]-h/2,f={x:u.x,y:u.y};u.y=p,u.x=d;var g=applyTransform$1(l.indicatorLabelPoint,getTransform(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(t),verticalAlign:v?y:"middle",align:v?"center":y});var _={x:d,y:p,style:{fill:c}},x={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,S),m.animateTo(x,S)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var T=0;Tr[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,h=[];(t||useHoverLinkOnHandle(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var p=compressBatches(c,h);this._dispatchHighDown("downplay",makeHighDownBatch(p[0],n)),this._dispatchHighDown("highlight",makeHighDownBatch(p[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t=e.target,n=this.visualMapModel;if(t&&null!=getECData(t).dataIndex){var i=getECData(t),r=this.ecModel.getSeriesByIndex(i.seriesIndex);if(n.isTargetSeries(r)){var a=r.getData(i.dataType),o=a.get(n.getDataDimension(a),i.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=clone(e)},t.prototype.getValueState=function(e){var t=VisualMapping.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(i){var r=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){VisualMapping.findPieceIndex(t,n)===e&&r.push(i)}),this),t.push({seriesId:i.id,dataIndex:r})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:n}}function s(r,a){var o=i.getRepresentValue({interval:r});a||(a=i.getValueState(o));var s=e(o,a);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=inheritDefaultOption(VisualMapModel.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(VisualMapModel),resetMethods={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;r=Math.max(parseInt(r,10),1),t.splitNumber=r;for(var a=(i[1]-i[0])/r;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function normalizeReverse(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}ComponentModel.registerClass(PiecewiseModel);var PiecewiseVisualMapView=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return __extends(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,r=i.getFont(),a=i.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,o),each(l.viewPieceList,(function(i){var l=i.piece,u=new Group;u.onclick=bind(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var p=this.visualMapModel.getValueState(h);u.add(new ZRText({style:{x:"right"===o?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:o,font:r,fill:a,opacity:"outOfRange"===p?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,c,o),box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:makeHighDownBatch(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return getItemAlign(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,r){if(t){var a=new Group,o=this.visualMapModel.textStyleModel;a.add(new ZRText({style:{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:t,font:o.getFont(),fill:o.getTextColor()}})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),i=e.get("orient"),r=e.get("inverse");return("horizontal"===i?r:!r)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(createSymbol(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=clone(n.selected),r=t.getSelectedMapKey(e);"single"===n.selectedMode?(i[r]=!0,each(i,(function(e,t){i[t]=t===r}))):i[r]=!i[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})},t.type="visualMap.piecewise",t}(VisualMapView);ComponentView.registerClass(PiecewiseVisualMapView),registerPreprocessor(visualMapPreprocessor);var DEFAULT_OPTION={label:{enabled:!0},decal:{show:!1}},inner$n=makeInner(),decalPaletteScope={};function ariaVisual(e,t){var n=e.getModel("aria");if(n.get("enabled")){var i=clone(DEFAULT_OPTION);merge(i.label,e.getLocaleModel().get("aria"),!1),merge(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var t=createHashMap();e.eachSeries((function(e){if(e.useColorPaletteOnData){var n=t.get(e.type);n||(n={},t.set(e.type,n)),inner$n(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if("function"!=typeof t.enableAriaDecal){var n=t.getData();if(t.useColorPaletteOnData){var i=t.getRawData(),r={},a=inner$n(t).scope;n.each((function(e){var t=n.getRawIndex(e);r[t]=e}));var o=i.count();i.each((function(e){var s=r[e],l=i.getName(e)||e+"",c=getDecalFromPalette(t.ecModel,l,a,o),h=n.getItemVisual(s,"decal");n.setItemVisual(s,"decal",u(h,c))}))}else{var s=getDecalFromPalette(t.ecModel,t.name,decalPaletteScope,e.getSeriesCount()),l=n.getVisual("decal");n.setVisual("decal",u(l,s))}}else t.enableAriaDecal();function u(e,t){var n=e?extend(extend({},t),e):t;return n.dirty=!0,n}}))}}(),function(){var i=e.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=defaults(a.option,i),!a.get("enabled"))return;var o=t.getZr().dom;if(a.get("description"))return void o.setAttribute("aria-label",a.get("description"));var s,l=e.getSeriesCount(),u=a.get(["data","maxCount"])||10,c=a.get(["series","maxCount"])||10,h=Math.min(l,c);if(l<1)return;var p=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();if(p){var d=a.get(["general","withTitle"]);s=r(d,{title:p})}else s=a.get(["general","withoutTitle"]);var f=[],g=l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]);s+=r(g,{seriesCount:l}),e.eachSeries((function(t,n){if(n1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(_=t.subType,e.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var s=t.getData();if(s.count()>u)i+=r(a.get(["data","partialData"]),{displayCnt:u});else i+=a.get(["data","allData"]);for(var c=[],p=0;p-EPSILON$4}function pathHasFill(e){var t=e.fill;return null!=t&&t!==NONE}function pathHasStroke(e){var t=e.stroke;return null!=t&&t!==NONE}function setTransform(e,t){t&&attr(e,"transform","matrix("+round3(t[0])+","+round3(t[1])+","+round3(t[2])+","+round3(t[3])+","+round4(t[4])+","+round4(t[5])+")")}function attr(e,t,n){(!n||"linear"!==n.type&&"radial"!==n.type)&&e.setAttribute(t,n)}function attrXLink(e,t,n){e.setAttributeNS("http://www.w3.org/1999/xlink",t,n)}function attrXML(e,t,n){e.setAttributeNS("http://www.w3.org/XML/1998/namespace",t,n)}function bindStyle(e,t,n){var i=null==t.opacity?1:t.opacity;if(pathHasFill(t)){var r=t.fill;attr(e,"fill",r="transparent"===r?NONE:r),attr(e,"fill-opacity",(null!=t.fillOpacity?t.fillOpacity*i:i)+"")}else attr(e,"fill",NONE);if(pathHasStroke(t)){var a=t.stroke;attr(e,"stroke",a="transparent"===a?NONE:a);var o=t.lineWidth,s=t.strokeNoScale?n.getLineScale():1;attr(e,"stroke-width",(s?o/s:0)+""),attr(e,"paint-order",t.strokeFirst?"stroke":"fill"),attr(e,"stroke-opacity",(null!=t.strokeOpacity?t.strokeOpacity*i:i)+"");var l=t.lineDash&&o>0&&normalizeLineDash(t.lineDash,o);if(l){var u=t.lineDashOffset;s&&1!==s&&(l=map(l,(function(e){return e/s})),u&&(u=mathRound(u/=s))),attr(e,"stroke-dasharray",l.join(",")),attr(e,"stroke-dashoffset",(u||0)+"")}else attr(e,"stroke-dasharray","");t.lineCap&&attr(e,"stroke-linecap",t.lineCap),t.lineJoin&&attr(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&attr(e,"stroke-miterlimit",t.miterLimit+"")}else attr(e,"stroke",NONE)}var SVGPathRebuilder=function(){function e(){}return e.prototype.reset=function(){this._d=[],this._str=""},e.prototype.moveTo=function(e,t){this._add("M",e,t)},e.prototype.lineTo=function(e,t){this._add("L",e,t)},e.prototype.bezierCurveTo=function(e,t,n,i,r,a){this._add("C",e,t,n,i,r,a)},e.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},e.prototype.arc=function(e,t,n,i,r,a){this.ellipse(e,t,n,n,0,i,r,a)},e.prototype.ellipse=function(e,t,n,i,r,a,o,s){var l=0===this._d.length,u=o-a,c=!s,h=Math.abs(u),p=isAroundZero$1(h-PI2$a)||(c?u>=PI2$a:-u>=PI2$a),d=u>0?u%PI2$a:u%PI2$a+PI2$a,f=!1;f=!!p||!isAroundZero$1(h)&&d>=PI$a==!!c;var g=round4(e+n*mathCos$4(a)),m=round4(t+i*mathSin$4(a));p&&(u=c?PI2$a-1e-4:1e-4-PI2$a,f=!0,l&&this._d.push("M",g,m));var y=round4(e+n*mathCos$4(a+u)),v=round4(t+i*mathSin$4(a+u));if(isNaN(g)||isNaN(m)||isNaN(n)||isNaN(i)||isNaN(r)||isNaN(degree)||isNaN(y)||isNaN(v))return"";this._d.push("A",round4(n),round4(i),mathRound(r*degree),+f,+c,y,v)},e.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("L",e+n,t),this._add("L",e+n,t+i),this._add("L",e,t+i),this._add("L",e,t)},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,i,r,a,o,s,l){this._d.push(e);for(var u=1;u=i&&l+1>=r){for(var u=[],c=0;c=i&&h+1>=r)return buildValues(l.components);s[o]=l}else s[o]=void 0}a++}for(;a<=o;){var p=h();if(p)return p}}function extractCommon(e,t,n,i,r){for(var a=t.length,o=n.length,s=e.newPos,l=s-i,u=0;s+1=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.doUpdate=function(e,t){if(e){var n=this.getDefs(!1);if(e[this._domName]&&n.contains(e[this._domName]))"function"==typeof t&&t(e);else{var i=this.add(e);i&&(e[this._domName]=i)}}},e.prototype.add=function(e){return null},e.prototype.addDom=function(e){var t=this.getDefs(!0);e.parentNode!==t&&t.appendChild(e)},e.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},e.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return each(this._tagNames,(function(n){for(var i=e.getElementsByTagName(n),r=0;r-1){var s=parse(o)[3],l=toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s+"")}else a.setAttribute("stop-color",n[i].color);t.appendChild(a)}e.__dom=t},t.prototype.markUsed=function(t){if(t.style){var n=t.style.fill;n&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom),(n=t.style.stroke)&&n.__dom&&e.prototype.markDomUsed.call(this,n.__dom)}},t}(Definable);function isPattern(e){return e&&(!!e.image||!!e.svgElement)}var patternDomMap=new WeakMap,PatternManager=function(e){function t(t,n){return e.call(this,t,n,["pattern"],"__pattern_in_use__")||this}return __extends(t,e),t.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var n=this;each(["fill","stroke"],(function(i){var r=t.style[i];if(isPattern(r)){var a=n.getDefs(!0),o=patternDomMap.get(r);o?a.contains(o)||n.addDom(o):o=n.add(r),n.markUsed(t);var s=o.getAttribute("id");e.setAttribute(i,"url(#"+s+")")}}))}},t.prototype.add=function(e){if(isPattern(e)){var t=this.createElement("pattern");return e.id=null==e.id?this.nextId++:e.id,t.setAttribute("id","zr"+this._zrId+"-pattern-"+e.id),t.setAttribute("x","0"),t.setAttribute("y","0"),t.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(e,t),this.addDom(t),t}},t.prototype.update=function(e){if(isPattern(e)){var t=this;this.doUpdate(e,(function(){var n=patternDomMap.get(e);t.updateDom(e,n)}))}},t.prototype.updateDom=function(e,t){var n=e.svgElement;if(n instanceof SVGElement)n.parentNode!==t&&(t.innerHTML="",t.appendChild(n),t.setAttribute("width",e.svgWidth+""),t.setAttribute("height",e.svgHeight+""));else{var i=void 0,r=t.getElementsByTagName("image");if(r.length){if(!e.image)return void t.removeChild(r[0]);i=r[0]}else e.image&&(i=this.createElement("image"));if(i){var a=void 0;if("string"==typeof e.image?a=e.image:e.image instanceof HTMLImageElement?a=e.image.src:e.image instanceof HTMLCanvasElement&&(a=e.image.toDataURL()),a){i.setAttribute("href",a),i.setAttribute("x","0"),i.setAttribute("y","0");var o=createOrUpdateImage(a,i,{dirty:function(){}},(function(e){t.setAttribute("width",e.width+""),t.setAttribute("height",e.height+"")}));o&&o.width&&o.height&&(t.setAttribute("width",o.width+""),t.setAttribute("height",o.height+"")),t.appendChild(i)}}}var s="translate("+(e.x||0)+", "+(e.y||0)+") rotate("+(e.rotation||0)/Math.PI*180+") scale("+(e.scaleX||1)+", "+(e.scaleY||1)+")";t.setAttribute("patternTransform",s),patternDomMap.set(e,t)},t.prototype.markUsed=function(t){t.style&&(isPattern(t.style.fill)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.fill)),isPattern(t.style.stroke)&&e.prototype.markDomUsed.call(this,patternDomMap.get(t.style.stroke)))},t}(Definable);function generateClipPathsKey(e){var t=[];if(e)for(var n=0;n0}var ClippathManager=function(e){function t(t,n){var i=e.call(this,t,n,"clipPath","__clippath_in_use__")||this;return i._refGroups={},i._keyDuplicateCount={},i}return __extends(t,e),t.prototype.markAllUnused=function(){for(var t in e.prototype.markAllUnused.call(this),this._refGroups)this.markDomUnused(this._refGroups[t]);this._keyDuplicateCount={}},t.prototype._getClipPathGroup=function(e,t){if(hasClipPath(e)){var n=e.__clipPaths,i=this._keyDuplicateCount,r=generateClipPathsKey(n);return isClipPathChanged(n,t&&t.__clipPaths)&&(i[r]=i[r]||0,i[r]&&(r+="-"+i[r]),i[r]++),this._refGroups[r]||(this._refGroups[r]=this.createElement("g"))}},t.prototype.update=function(e,t){var n=this._getClipPathGroup(e,t);return n&&(this.markDomUsed(n),this.updateDom(n,e.__clipPaths)),n},t.prototype.updateDom=function(e,t){if(t&&t.length>0){var n=this.getDefs(!0),i=t[0],r=void 0,a=void 0;i._dom?(a=i._dom.getAttribute("id"),r=i._dom,n.contains(r)||n.appendChild(r)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(r=this.createElement("clipPath")).setAttribute("id",a),n.appendChild(r),i._dom=r),this.getSvgProxy(i).brush(i);var o=this.getSvgElement(i);r.innerHTML="",r.appendChild(o),e.setAttribute("clip-path","url(#"+a+")"),t.length>1&&this.updateDom(r,t.slice(1))}else e&&e.setAttribute("clip-path","none")},t.prototype.markUsed=function(t){var n=this;t.__clipPaths&&each(t.__clipPaths,(function(t){t._dom&&e.prototype.markDomUsed.call(n,t._dom)}))},t.prototype.removeUnused=function(){e.prototype.removeUnused.call(this);var t={};for(var n in this._refGroups){var i=this._refGroups[n];this.isDomUnused(i)?i.parentNode&&i.parentNode.removeChild(i):t[n]=i}this._refGroups=t},t}(Definable),ShadowManager=function(e){function t(t,n){var i=e.call(this,t,n,["filter"],"__filter_in_use__","_shadowDom")||this;return i._shadowDomMap={},i._shadowDomPool=[],i}return __extends(t,e),t.prototype._getFromPool=function(){var e=this._shadowDomPool.pop();if(!e){(e=this.createElement("filter")).setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++);var t=this.createElement("feDropShadow");e.appendChild(t),this.addDom(e)}return e},t.prototype.update=function(e,t){if(hasShadow(t.style)){var n=getShadowKey(t),i=t._shadowDom=this._shadowDomMap[n];i||(i=this._getFromPool(),this._shadowDomMap[n]=i),this.updateDom(e,t,i)}else this.remove(e,t)},t.prototype.remove=function(e,t){null!=t._shadowDom&&(t._shadowDom=null,e.style.filter="")},t.prototype.updateDom=function(e,t,n){var i=n.children[0],r=t.style,a=t.getGlobalScale(),o=a[0],s=a[1];if(o&&s){var l=r.shadowOffsetX||0,u=r.shadowOffsetY||0,c=r.shadowBlur,h=r.shadowColor;i.setAttribute("dx",l/o+""),i.setAttribute("dy",u/s+""),i.setAttribute("flood-color",h);var p=c/2/o+" "+c/2/s;i.setAttribute("stdDeviation",p),n.setAttribute("x","-100%"),n.setAttribute("y","-100%"),n.setAttribute("width","300%"),n.setAttribute("height","300%"),t._shadowDom=n;var d=n.getAttribute("id");e.style.filter="url(#"+d+")"}},t.prototype.removeUnused=function(){if(this.getDefs(!1)){var e=this._shadowDomPool;for(var t in this._shadowDomMap){var n=this._shadowDomMap[t];e.push(n)}this._shadowDomMap={}}},t}(Definable);function hasShadow(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function getShadowKey(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}function parseInt10$1(e){return parseInt(e,10)}function getSvgProxy(e){return e instanceof Path?svgPath:e instanceof ZRImage?svgImage:e instanceof TSpan?svgText:svgPath}function checkParentAvailable(e,t){return t&&e&&t.parentNode!==e}function insertAfter(e,t,n){if(checkParentAvailable(e,t)&&n){var i=n.nextSibling;i?e.insertBefore(t,i):e.appendChild(t)}}function prepend(e,t){if(checkParentAvailable(e,t)){var n=e.firstChild;n?e.insertBefore(t,n):e.appendChild(t)}}function remove(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function removeFromMyParent(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function getSvgElement(e){return e.__svgEl}var SVGPainter=function(){function e(e,t,n,i){this.type="svg",this.refreshHover=createMethodNotSupport("refreshHover"),this.pathToImage=createMethodNotSupport("pathToImage"),this.configLayer=createMethodNotSupport("configLayer"),this.root=e,this.storage=t,this._opts=n=extend({},n||{});var r=createElement("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=createElement("g");r.appendChild(a);var o=createElement("g");r.appendChild(o),this._gradientManager=new GradientManager(i,o),this._patternManager=new PatternManager(i,o),this._clipPathManager=new ClippathManager(i,o),this._shadowManager=new ShadowManager(i,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(n.width,n.height),this._visibleList=[]}return e.prototype.getType=function(){return"svg"},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.getSvgRoot=function(){return this._svgRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},e.prototype.setBackgroundColor=function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=createElement("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},e.prototype.createSVGElement=function(e){return createElement(e)},e.prototype.paintOne=function(e){var t=getSvgProxy(e);return t&&t.brush(e),getSvgElement(e)},e.prototype._paintList=function(e){var t=this._gradientManager,n=this._patternManager,i=this._clipPathManager,r=this._shadowManager;t.markAllUnused(),n.markAllUnused(),i.markAllUnused(),r.markAllUnused();for(var a=this._svgRoot,o=this._visibleList,s=e.length,l=[],u=0;u=0;--n)if(t[n]===e)return!0;return!1}),i}return null}return n[0]},e.prototype.resize=function(e,t){var n=this._viewport;n.style.display="none";var i=this._opts;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=this._getSize(0),t=this._getSize(1),n.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=n.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e+""),a.setAttribute("height",t+"")}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype._getSize=function(e){var t=this._opts,n=["width","height"][e],i=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[n]&&"auto"!==t[n])return parseFloat(t[n]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[i]||parseInt10$1(s[n])||parseInt10$1(o.style[n]))-(parseInt10$1(s[r])||0)-(parseInt10$1(s[a])||0)|0},e.prototype.dispose=function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},e.prototype.clear=function(){var e=this._viewport;e&&e.parentNode&&e.parentNode.removeChild(e)},e.prototype.toDataURL=function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/>\n\r<"))},e}();function createMethodNotSupport(e){return function(){logError('In SVG mode painter not support method "'+e+'"')}}registerPainter("svg",SVGPainter);export{Axis,List,Model,PRIORITY,color,connect,dataTool,dependencies,disConnect,disconnect,dispose$1 as dispose,env,extendChartView,extendComponentModel,extendComponentView,extendSeriesModel,format$1 as format,getCoordinateSystemDimensions,getInstanceByDom,getInstanceById,getMap,graphic$1 as graphic,helper,init$1 as init,brushSingle as innerDrawElementOnCanvas,matrix,number,parseGeoJSON,parseGeoJson,registerAction,registerCoordinateSystem,registerLayout,registerLoading,registerLocale,registerMap,registerPostInit,registerPostUpdate,registerPreprocessor,registerProcessor,registerTheme,registerTransform,registerVisual,setCanvasCreator,throttle,time,ecUtil as util,vector,version$1 as version,zrender}; \ No newline at end of file diff --git a/dist/echarts.js b/dist/echarts.js index 0f9c9c4ff3..49a10dcb37 100644 --- a/dist/echarts.js +++ b/dist/echarts.js @@ -189,7 +189,7 @@ } if (typeof console !== 'undefined') { - console.error.apply(args); + console.error.apply(console, args); } } @@ -3698,7 +3698,7 @@ this._target = target; this._loop = loop; - if (loop) { + if (loop && additiveTo) { logError('Can\' use additive animation on looped animation.'); return; } @@ -15433,7 +15433,7 @@ ZRender.prototype.refreshHoverImmediately = function () { this._needsRefreshHover = false; - if (this.painter.refreshHover) { + if (this.painter.refreshHover && this.painter.getType() === 'canvas') { this.painter.refreshHover(); } }; @@ -15537,7 +15537,7 @@ painterCtors[name] = Ctor; } - var version = '5.0.0'; + var version = '5.0.1'; var zrender = /*#__PURE__*/Object.freeze({ __proto__: null, init: init, @@ -18822,7 +18822,7 @@ var fullDayFormatter = '{yyyy}-{MM}-{dd}'; var fullLeveledFormatter = { year: '{yyyy}', - month: '{yyyy}:{MM}', + month: '{yyyy}-{MM}', day: fullDayFormatter, hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, @@ -28495,7 +28495,7 @@ var wmUniqueIndex = Math.round(Math.random() * 9); - var WeakMap$1 = function () { + var WeakMap = function () { function WeakMap() { this._id = '__ec_inner_' + wmUniqueIndex++; } @@ -28794,7 +28794,7 @@ return symbolPath; } - var decalMap = new WeakMap$1(); + var decalMap = new WeakMap(); var decalCache = new LRU(100); var decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'dashLineOffset', 'maxTileWidth', 'maxTileHeight']; @@ -29177,7 +29177,7 @@ var isObject$2 = isObject; var version$1 = '5.0.0'; var dependencies = { - zrender: '5.0.0' + zrender: '5.0.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_SERIES_FILTER = 800; @@ -65918,7 +65918,7 @@ var current = e.target; var eventData; - while ((eventData = getECData(current).eventData) == null) { + while (current && (eventData = getECData(current).eventData) == null) { current = current.__hostTarget || current.parent; } @@ -79413,6 +79413,10 @@ return value.type === 'radial'; } + function isGradient(value) { + return value && (value.type === 'linear' || value.type === 'radial'); + } + var GradientManager = function (_super) { __extends(GradientManager, _super); @@ -79426,7 +79430,7 @@ each(['fill', 'stroke'], function (fillOrStroke) { var value = displayable.style[fillOrStroke]; - if (value && (value.type === 'linear' || value.type === 'radial')) { + if (isGradient(value)) { var gradient = value; var defs = that_1.getDefs(true); var dom = void 0; @@ -79469,6 +79473,10 @@ }; GradientManager.prototype.update = function (gradient) { + if (!isGradient(gradient)) { + return; + } + var that = this; this.doUpdate(gradient, function () { var dom = gradient.__dom; @@ -79694,7 +79702,7 @@ } if (isPattern(displayable.style.stroke)) { - _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill)); + _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke)); } } }; diff --git a/dist/echarts.js.map b/dist/echarts.js.map index 70b35d96e1..7b4c94d87f 100644 --- a/dist/echarts.js.map +++ b/dist/echarts.js.map @@ -1 +1 @@ -{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DILIMITER_REG","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","nodeParsers","SVGParser","_defs","_root","_isDefine","_isText","xml","viewBox","getAttribute","parseAttributes","_parseNode","viewBoxRect","viewBoxTransform","viewBoxArr","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","defineParsers","def","_parseText","_textX","_textY","inheritStyle","textStyle","fontSize","fontFamily","fontStyle","fontWeight","internalField","circle","line","pointsStr","pointsArr","parsePoints","polygon","polyline","img","gradient","_parseGradientColorStops","offsetStr","stopColor","__inheritedStyle","pointsString","attributesMap","defs","onlyInlineStyle","zrStyle","parseTransformAttribute","parseStyleAttribute","svgAttrName","attrValue","getPaint","urlRegex","urlMatch","url","transformRegex","transformOps_1","valueArr","styleRegex","styleList","styleRegResult","exec","parseSVG","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CMD$3","PI2$6","PROP_XY","PROP_WH","tmpArr","aroundEqual","pathToBezierCurves","bezierArray","currentSubpath","createNewSubpath","addLine","addArc","tan","c1","s1","c2","s2","x4","y4","hx","hy","nextAngle","alignSubpath","subpath1","subpath2","shorterPath","shorterLen","shorterBezierCount","eachCurveSubDivCount","newSubpath","remained","tmpSegX","tmpSegY","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastX","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","centroid","signedArea","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","score","newArr","findBestMorphingRotation","fromArr","toArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","tmpArr_1","sa","ca","newX1","newY1","i_1","to","morphPath","fromPath","toPath","animationOpts","fromPathProxy","toPathProxy","isIndividualMorphingPath","__oldBuildPath","fromBezierCurves","toBezierCurves","morphingData","becomeIndividualMorphingPath","oldDone","oldAborted","oldDuring","__morphT","restoreIndividualMorphingPath","morphingPathBuildPath","__morphingData","newCp","item","morphT","updateIndividualMorphingPath","morphingPath","isCombiningPath","__combiningSubList","isInAnyMorphing","combine","fromPathList","copyPropsIfDivided","fromIndividuals","separateCount","fromCombiningSubList","dividingMethod","toPathSplittedList","divideShape","doneCount","abortedCalled","morphAnimationOpts","restoreCombiningPath","becomeCombiningPath","toIndividuals","count","combiningSubList","updateCombiningPathSubList","combiningPath","__oldAddSelfToZr","__oldRemoveSelfFromZr","combiningAddSelfToZr","combiningRemoveSelfFromZr","combiningChildrenRef","combiningPathSubListAddRemoveWithZr","method","separate","toPathList","toPathListLen","copyProps","duplicateShape","splitShape","resultPaths","toPathShape","splitPropIdx","propWH","propXY","subWH","xyCurr","subShape","splitted","endAngleNormalized","normalizeRadian$1","angleCurr","ctor","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","seriesIndices","airaOption","enabled","mergeTheme","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","setItemVisualFromData","PI2$7","CMD$4","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpArr$1","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","getType","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap$1","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","finderOpt","fromResult","toResult","toSeries","dimension","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","getLayoutOnAxis","baseAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","RegExp","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","getValue","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","dimLoose","sampleLog","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_1","errMsg_2","comparator","item0","item1","orderDef","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$8","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","IndicatorAxis","radiusExtent","Radar","radarModel","_indicatorAxes","getIndicatorModels","indicatorModel","indicatorAxis","getIndicatorAxes","indicatorIndex","coordToPoint","minRadianDiff","closestAxis","closestAxisIdx","viewSize","indicatorAxes","radarSeries","increaseInterval","fixedMin","fixedMax","nicedSplitNumber","pixel","radarList","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","indicator","axisBuilderAttrs$1","RadarView","_buildAxes","_buildSplitLineAndArea","axisBuilders","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","getColorIndex","areaOrLine","areaOrLineColorList","ticksRadius","realSplitNumber_1","axesTicksPoints","prevPoints","RadarSeriesModel","nameToDisplay","getTooltipPosition","radarIndex","normalizeSymbolSize","RadarView$1","createSymbol$1","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","radarLayout","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","polarIndex","geoCoord","points$1","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","geoCoordMap","fixGeoCoords","points$2","fixDiaoyuIsland","inner$6","geoJSONLoader","load","mapRecord","parsed","regionName","specialArea","getBoundingRect$1","regionRect","inner$7","geoSVGLoader","originRoot","buildGraphic","makeGraphic","hostKey","rootMap","originRootHostKey","removeGraphic","loaders","geoSourceManager","regionsMap","nameCoordMap","mapRecords","singleSource","results","mapNotExistsError","MapSeries","needsDrawMap","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","getMapType","getHostGeoModel","geoIndex","getRegionModel","seriesNames","otherIndex","originalData","setZoom","setCenter","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","areaColor","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","getFixedItemStyle","MapDraw","_controller","_controllerHost","_regionsGroup","mapOrGeoModel","fromView","isGeo","mapSeries","_updateBackground","regionsGroup","transformInfo","getTransformInfo","isFirstDraw","targetScaleX","targetScaleY","roamTransform","isVisualEncodedByVisualMap","regionGroup","compoundPath","regionModel","itemStyleModel","emphasisItemStyleModel","blurItemStyleModel","selectItemStyleModel","rawScaleX","rawScaleY","rawX","rawY","transformPoint","interior","points_1","showLabel","isDataNaN","centerPt","regionModel_1","groupRegions","__regions","_updateController","_updateMapSelectHandler","_mapName","getZoom","makeActionBase","_mouseDownFlag","getViewRectAfterRoam","mapDraw","MapView","mapModel","_mapDraw","_renderSymbols","originalDataIndex","fullData","mainSeries","fullIndex_1","updateCenterAndZoom","previousZoom","getCenter","fixX","fixY","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_viewRect","rawTransform","_updateTransform","centerCoord","_center","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","defaultCenter","roamTransformable","rawTransformable","_rawTransform","noRoam","getCoordSys","Geo","invertLongitute","_nameCoordMap","_regionsMap","_invertLongitute","containCoord","getRegionByCoord","addGeoCoord","getGeoCoord","getCoordSys$1","geoModel","resizeGeo","leftTop","rightBottom","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","inner$8","linkList","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","depth","viewChildren","isExpand","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","getAncestorsIndices","currNode","getDescendantIndices","childNode","getLevelModel","levelModels","isAncestorOf","isDescendantOf","Tree","_nodes","getNodeByDataIndex","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","addChild","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","getOrient","realRoot","edgeShape","edgeForkPosition","roam","nodeScaleRatio","curveness","init$2","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","getViewRect$1","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","symbolNeedsDraw$1","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","groupZoom","roamZoom","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","__radialOldRawX","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","rootLayout","isLeft","labelRotateRadian","focusDataIndices","drawEdge","__edge","parentEl","curvature","getEdgeShape","childLayout","removeAnimationOpt","sourceEdge","layoutOpt","radialCoor1","radialCoor2","radialCoor3","radialCoor4","eachAfter","eachBefore","treeLayout","commonLayout","separation$1","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","resetViewRoot","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","getViewRoot","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","normalStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","itemWidth","availableSize","itemNode","makeItemPoints","onclick","packEventData","itemHeight","selfType","AnimationWrap","_elExistsMap","_finishedCallback","checkTerminate","createWrap","Group$1","Rect$1","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z_BASE","Z_BG","Z_CONTENT","getStateItemStyle","getItemStyleNormal","inner$9","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","_doAnimation","renderFinally","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","els","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","renderContent","useUpperLabel","processInvisible","visualBorderColor","selectStyle","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","iconChar","isShow","addDrillDownIcon","textEmphasisState","lasts","prepareAnimationWhenHasOld","calculateZ","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","zInLevel","zb","noop$1","actionTypes","i$1","handleRootToNode","originViewRoot","each$4","isObject$4","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","inner$a","treemapVisual","travelTree","designatedVisual","viewRootAncestors","nodeLayout","nodeItemStyleModel","visuals","buildVisuals","thisNodeColor","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","mathMax$7","mathMin$7","each$5","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","treemapLayout","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","worst","orderBy","overLeafDepth","sort$1","statistic","filterByThreshold","orderedChildren","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","getNodeByIndex","addEdge","n1","n2","edgesMap","GraphEdge","outEdges","inEdges","getEdgeByIndex","getEdge","eachEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","degree","inDegree","outDegree","getAdjacentDataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getGraphicEl","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","GraphSeriesModel","getCategoriesData","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryIdx","categoryModel","oldGetModel","newGetModel","newPathArr","getGraph","getEdgeData","sourceName","nodeMarkup","categoriesData","circular","rotateLabel","initLayout","repulsion","gravity","friction","edgeLength","layoutAnimation","edgeSymbol","edgeSymbolSize","edgeLabel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","getNodeGlobalScale","v3","v2DistSquare","mathAbs$2","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide$1","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","forceLayout","_startForceLayoutIteration","warmUp","_layouting","setFixed","setUnfixed","circularRotateLabel","categoryFilter","graphSeries","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryStyle","visualList","normalize$2","graphEdgeVisual","simpleLayout","simpleLayoutEdge","graphSimpleLayout","PI$7","_symbolRadiansHalf","circularLayout","basedOn","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","graphCircularLayout","scaleAndAdd$1","inNodes","pp","initialFriction","beforeStepCallback","afterStepCallback","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","nodeDataExtent_1","edgeDataExtent_1","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getViewRect$2","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","GaugeSeriesModel","icon","PointerShape","PointerPath","parsePosition","formatLabel","PI2$9","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","FunnelSeriesModel","minSize","funnelAlign","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","getViewRect$3","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelIndex","parallelOption","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","each$6","mathMin$8","mathMax$8","mathFloor$2","mathCeil$1","round$2","PI$8","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","layoutExtent","axisCount","axisExpandWidth","restrict$1","axisExpandCount","axisExpandable","axisExpandWindow","winSize","axisExpandCenter","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","eachActiveState","dataDimensions","axisModels","hasActiveSet","hasAxisBrushed","activeState","getActiveState","axisLayout","getAxisLayout","getSlidedAxisExpandWindow","behavior","pointCoord","triggerArea","useJump","winSize2","create$2","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","defaultOption$1","areaSelectStyle","realtime","ParallelModel","_initDimensions","setAxisExpand","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","actionInfo$1","parallelAxisModel","BRUSH_PANEL_GLOBAL","mathMin$9","mathMax$9","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","parallelAxisId","CLICK_THRESHOLD","ParallelView","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","triggerOn","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","theActiveState","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","DEFAULT_SMOOTH","ParallelView$1","_dataGroup","dataGroup","makeSeriesScope$2","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","opacityAccessPath$1","parallelVisual","opacityMap","active","inactive","itemOpacity","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","localX","localY","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","sourceColor","targetColor","dragX","dragY","createGridClipShape$1","sankeyLayout","getViewRect$4","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","center$1","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","WhiskerBoxCommonMixin","xAxisType","yAxisType","addOrdinal","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotVisual","each$7","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","availableWidth","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","low","high","itemNameFormatter","outlier","boxplotTransform","CandlestickSeriesModel","getShadowDim","brushRect","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","createNormalBox$1","setBoxCommon","createLarge$1","NormalBoxPathShape","NormalBoxPath","__simpleBox","transInit$1","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","setLargeStyle$1","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","LargeArr$1","candlestickLayout","candleWidth","calculateCandleWidth","openDim","closeDim","lowestDim","highestDim","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","getSign","makeBrushRect","pmin","pmax","EffectScatterSeriesModel","effectType","showEffectOn","rippleEffect","period","EFFECT_RIPPLE_NUMBER","normalizeSymbolSize$1","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","EffectScatterView","effectSymbolDraw","_updateGroupTransform","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","getLineCoordsCount","getLineCoords","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","CoordSys","effect","constantSpeed","trailLength","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","delayExpr","_updateAnimationPoints","_getLineLength","_period","delayNum","__t","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt$1","__lastT","Polyline$1","_createPolyline","hoverLineStyle","lineEmphasisState","EffectPolyline","accLenArr","_length","_offsets","offsets","LargeLinesPathShape","LargeLinesPath","LargeLineDraw","lineEl","linesLayout","isPolyline","isLarge","lineCoords","totalCoordsCount","LinesView","_updateLineDraw","_lastZlevel","_showEffect","notInIndividual_1","otherSeriesModel","hasEffect","_hasEffet","_isPolyline","normalize$3","linesVisual","HeatmapSeriesModel","blurSize","pointSize","maxOpacity","minOpacity","GRADIENT_LEVELS","HeatmapLayer","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_incrementalDisplayable","_renderOnCartesianAndCalendar","_renderOnGeo","dataDimX","dataDimY","dataToRect","contentShape","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","PictorialBarSeriesModel","symbolPosition","symbolMargin","symbolRepeat","symbolRepeatDirection","symbolClip","symbolBoundingData","symbolPatternSize","BAR_BORDER_WIDTH_QUERY$1","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","updateCommon$1","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","categorySize","parsedSymbolSize","unitLength","pathLen","absBoundingLength","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","updateAttr","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","pathes","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","SingleAxis","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","getCoordSys$2","singleModel","create$3","singles","layout$2","positionMap","directionMap","axisBuilderAttrs$2","selfBuilderAttrs$1","SingleAxisView","axisElementBuilders$1","SingleAxisModel","findPointFromSeries","isStacked","inner$b","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$c","each$8","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","inner$d","clone$3","bind$1","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","elOption","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","XY","WH","SingleAxisPointer","getPointDimIndex","pointerShapeBuilder$1","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","getLayerSeries","lenCount","indexArr","timeDim","layerSeries","index1","index2","nearestIdx","pointNum","theValue","singleAxisIndex","ThemeRiverView","layersSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","layerGroup","createGridClipShape$2","themeRiverLayout","doThemeRiverLayout","layerPoints","singleLayer","computeBaseline","baseLine","baseY0","layerIndex","sums","temp","SunburstSeriesModel","completeTreeValue$1","renderLabelForZeroData","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_ecModel","labelMinAngle","isNormalShown","labelStateModel","isShown","getLabelAttr","sectorState","labelColor","labelPadding","rotateType","stateAttr","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","handleHighlight","UNHIGHLIGHT_ACTION","SunburstView","newRoot","newChildren","oldChildren","_oldChildren","renderRollUp","newNode","virtualPiece","targetFound","RADIAN$2","sunburstLayout","rootDepth","initChildren$1","renderRollupNode","rPerLevel","rStart","rEnd","siblingAngle_1","sortOrder","sort$2","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","dataToCoordSize$1","geoPrepareCustom","dataToCoordSize$2","singlePrepareCustom","dataToCoordSize$3","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","deprecatedLogs","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","warnDeprecated","deprecated","insteadApproach","inner$e","TRANSFORM_PROPS","transformPropNamesStr","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","GROUP_DIFF_PREFIX","attachedTxInfoTmp","LEGACY_TRANSFORM_PROPS","tmpTransformable","prepareCustoms","CustomSeriesModel","currentZLevel","currentZ","CustomSeriesView","customSeries","renderItem","makeRenderItem","doRemoveEl","createOrUpdateItem","morphPreparation_1","MorphPreparation","createGetKey","findAndAddFrom","hasFrom","removeElementDirectly","applyMorphing","oldIndices","newLen","setIncrementalAndHoverLayer","elementName","diffByDimName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","isMorphTo","styleOpt","attachedTxInfo","isTextContent","transFromProps","allPropsFinal","elDisplayable","prepareShapeOrExtraTransitionFrom","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareTransformAllPropsFinal","txCfgOpt","textOptionStyle","decalPattern","decalObj","isPath$1","__decalPattern","prepareStyleTransitionFrom","applyPropsFinal","applyTransitionFrom","originalDecalObj","userDuring","cfgDuringCall","duringCall","mainAttr","morphFromEl","attrOpt","elPropsInAttr","transFromPropsInAttr","enterFrom","enterFromKeys","transitionKeys","elVal","checkNonStyleTansitionRefer","elPropsInAttrKeys","isNonStyleTransitionEnabled","leaveTo","leaveToProps","getOrCreateLeaveToPropsFromEl","leaveToPropsInAttr","leaveToKeys","allProps","allPropsInAttr","keysInAttr","checkTransformPropRefer","fromTransformable","calcOldElLocalTransformBasedOnNewElParent","setTransformPropToTransitionFrom","setLagecyTransformProp","setTransformProp","fromEl","fromElStyle","transFromStyleProps","animationStyleProps","styleKeys","leaveToStyleProps","newEl","tmpM","oldGlobalTransform","newParent","optVal","usedIn","innerEl","tmpDuringScope","customDuringAPI","assertNotReserved","isShapeDirty","getShape","isStyleDirty","setExtra","getExtra","newstUserDuring","scopeUserDuring","updateElOnState","elStateOpt","isRoot","existingEmphasisState","updateZ$1","optZ2","updateZForEachState","retrieveStateOption","targetProps","legacyName","legacyArr","xyName","transitionFrom","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currDataIndexInside","currItemModel","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","morphPreparation","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","elIsNewCreated","canMorph","morph","thisElIsMorphTo","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","pendingAllPropsFinal","addTo","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","processAddUpdate","processRemove","childOption","_fromList","_toList","_toElOptionList","_allPropsFinalList","_toDataIndices","_morphConfigList","_transOpt","_type","fromList","toList","toListLen","fromListLen","toIdx","_oneToOneForSingleTo","fromSingleSegLen","fromIdxStart","fromCount","_manyToOneForSingleTo","toSingleSegLen","toIdxStart","fromIdx","toCount","_oneToManyForSingleFrom","toElOption","toDataIndex","elAnimationConfig","_getOrCreateMorphConfig","morphDuration","combineResult","copyPropsWhenDivided","_processResultIndividuals","morphFrom","combineFromList","separateToList","separateResult","combineSeparateResult","isSeparate","fromIndividual","toIndividual","morphConfigList","delayOption","srcPath","tarPath","willClone","getSeriesStackId$1","getAxisKey$1","barLayoutPolar","calRadialBar","clampLayout","radiusSpan","angleSpan","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","angleAxisExtraOption","radiusAxisExtraOption","RadiusAxis","radiusToData","inner$f","AngleAxis","angleToData","Polar","_radiusAxis","_angleAxis","maxAngle","getCoordSys$3","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","elementList$1","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","axisBuilderAttrs$3","selfBuilderAttrs$2","RadiusAxisView","newAxisGroup","axisAngle","layoutAxis","axisElementBuilders$2","prevRadius","PolarAxisPointer","coordValue","pointerShapeBuilder$2","getLabelPosition","GeoView","_handleRegionClick","updateSelectStatus","geoId","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","makeAction","PROXIMATE_ONE_DAY","Calendar","calendarModel","_rangeInfo","_sw","_sh","_orient","getFirstDayOfWeek","_firstDayOfWeek","getDateInfo","mStr","dStr","getDay","formatedDate","getNextNDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","cellSize","getCellSize","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tl","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","getCoordSys$4","normalizedRange","rangeStr","firstDay","setMonth","parsedRange","reversed","startDateNum","endDateNum","dateNum","fweek","lweek","nthDay","calendarList","calendarSeries","CalendarModel","mergeAndNormalizeLayoutParams","raw","cellSizeArr","MONTH_TEXT","EN","CN","WEEK_TEXT","CalendarView","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","weekText","inner$g","_nonShapeGraphicElements","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elExisting","parentId","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","createEl$1","removeEl","textContentExisting","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","layout$3","viewportSize","makeBackground","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","tooltipModel","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","each$9","inner$h","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","dataZoomModel","percentRange","getPercentRange","clear$1","snapshots","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SelectDataZoomModel","SelectDataZoomView","each$a","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","_dataExtent","percentExtent","percentWindow","valueWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","eachAxisModel","proxyList","valueRange","each$b","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers$1","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","ratioX","ratioY","visibility","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$c","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","each$d","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","PRIORITY_BRUSH","layoutCovers","brushModel","brushSelected","throttleDelay","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushView","$from","ICON_TYPES","BrushFeature","isBrushed","_brushMode","command","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","controlPosition","itemStyleEmphasis","labelNormal","excludeLabelAttr","currentIndex","setCurrentIndex","isIndexMax","setPlayState","playState","TimelineModel","_initData","autoPlay","getPlayState","dataArr","_names","processedDataArr","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","PI$9","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","labelPosOpt","getViewRect$5","parsedLabelPos","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","playPosition","prevBtnPosition","nextBtnPosition","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","createScaleByModel$1","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","makeBtn","_handlePlayClick","willRotate","iconSize","btn","makeControlIcon","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","fillLabel","inner$i","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$j","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","inner$k","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","toSymbolRotate","toSymbolSize","optData","dimValueGetter$1","MarkAreaModel","inner$l","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","allSelect","inverseSelect","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","curry$1","each$e","Group$2","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendSymbolType","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams$1","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","Group$3","WH$1","XY$1","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","zoomLock","brushSelect","Rect$2","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","InsideZoomModel","disabled","inner$m","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","dispatchAction$1","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","each$f","visualMapPreprocessor","has$1","pieces","splitList","calculable","VISUAL_PRIORITY","isTargetSeries","getDataDimension","getVisualMeta","getColorVisual","concreteDim","resultVisual","visualDefault","defaultOption$2","mapVisual$1","isArray$1","each$g","asc$2","linearMap$1","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getTargetSeriesIndices","optionSeriesIndex","is","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","optDim","listDimensions","completeSingle","completeInactive","completeController","stateExist","stateAbsent","optExist","optAbsent","defa","symbolExists","symbolSizeExists","max_1","setSelected","getSelected","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","linearMap$2","each$h","mathMin$a","mathMax$a","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","getCursor$1","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","currValue","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","hoverLinkDataSize","hoverLinkOnHandle","actionInfo$2","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","itemSymbol","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","DEFAULT_OPTION","inner$n","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$a","PI2$a","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","getElementsByTagName","defs_1","doUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,C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Content":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n var zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n });\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n var length = len;\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n var lengthSquare = lenSquare;\r\n function mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n }\r\n function div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n }\r\n function dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n }\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n });\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n var _calcOut = [];\r\n function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n }\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut$1 = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\n function isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n }\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n function clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n }\n\n var matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n });\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n }\r\n function fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n }\r\n var fastMapToColor = fastLerp;\r\n function lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n }\r\n var mapToColor = lerp$1;\r\n function modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n }\r\n function modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\r\n function random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n }\n\n var color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n });\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n }\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\r\n function extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n }\r\n function mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n var DILIMITER_REG = /[\\s,]+/;\r\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\r\n var nodeParsers;\r\n var SVGParser = (function () {\r\n function SVGParser() {\r\n this._defs = {};\r\n this._root = null;\r\n this._isDefine = false;\r\n this._isText = false;\r\n }\r\n SVGParser.prototype.parse = function (xml, opt) {\r\n opt = opt || {};\r\n var svg = parseXML(xml);\r\n if (!svg) {\r\n throw new Error('Illegal svg');\r\n }\r\n var root = new Group();\r\n this._root = root;\r\n var viewBox = svg.getAttribute('viewBox') || '';\r\n var width = parseFloat((svg.getAttribute('width') || opt.width));\r\n var height = parseFloat((svg.getAttribute('height') || opt.height));\r\n isNaN(width) && (width = null);\r\n isNaN(height) && (height = null);\r\n parseAttributes(svg, root, null, true);\r\n var child = svg.firstChild;\r\n while (child) {\r\n this._parseNode(child, root);\r\n child = child.nextSibling;\r\n }\r\n var viewBoxRect;\r\n var viewBoxTransform;\r\n if (viewBox) {\r\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG);\r\n if (viewBoxArr.length >= 4) {\r\n viewBoxRect = {\r\n x: parseFloat((viewBoxArr[0] || 0)),\r\n y: parseFloat((viewBoxArr[1] || 0)),\r\n width: parseFloat(viewBoxArr[2]),\r\n height: parseFloat(viewBoxArr[3])\r\n };\r\n }\r\n }\r\n if (viewBoxRect && width != null && height != null) {\r\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\r\n if (!opt.ignoreViewBox) {\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n }\r\n if (!opt.ignoreRootClip && width != null && height != null) {\r\n root.setClipPath(new Rect({\r\n shape: { x: 0, y: 0, width: width, height: height }\r\n }));\r\n }\r\n return {\r\n root: root,\r\n width: width,\r\n height: height,\r\n viewBoxRect: viewBoxRect,\r\n viewBoxTransform: viewBoxTransform\r\n };\r\n };\r\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\r\n var nodeName = xmlNode.nodeName.toLowerCase();\r\n if (nodeName === 'defs') {\r\n this._isDefine = true;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = true;\r\n }\r\n var el;\r\n if (this._isDefine) {\r\n var parser = defineParsers[nodeName];\r\n if (parser) {\r\n var def = parser.call(this, xmlNode);\r\n var id = xmlNode.getAttribute('id');\r\n if (id) {\r\n this._defs[id] = def;\r\n }\r\n }\r\n }\r\n else {\r\n var parser = nodeParsers[nodeName];\r\n if (parser) {\r\n el = parser.call(this, xmlNode, parentGroup);\r\n parentGroup.add(el);\r\n }\r\n }\r\n if (el) {\r\n var child = xmlNode.firstChild;\r\n while (child) {\r\n if (child.nodeType === 1) {\r\n this._parseNode(child, el);\r\n }\r\n if (child.nodeType === 3 && this._isText) {\r\n this._parseText(child, el);\r\n }\r\n child = child.nextSibling;\r\n }\r\n }\r\n if (nodeName === 'defs') {\r\n this._isDefine = false;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = false;\r\n }\r\n };\r\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\r\n if (xmlNode.nodeType === 1) {\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n this._textX += parseFloat(dx);\r\n this._textY += parseFloat(dy);\r\n }\r\n var text = new TSpan({\r\n style: {\r\n text: xmlNode.textContent\r\n },\r\n x: this._textX || 0,\r\n y: this._textY || 0\r\n });\r\n inheritStyle(parentGroup, text);\r\n parseAttributes(xmlNode, text, this._defs);\r\n var textStyle = text.style;\r\n var fontSize = textStyle.fontSize;\r\n if (fontSize && fontSize < 9) {\r\n textStyle.fontSize = 9;\r\n text.scaleX *= fontSize / 9;\r\n text.scaleY *= fontSize / 9;\r\n }\r\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\r\n textStyle.fontStyle,\r\n textStyle.fontWeight,\r\n (textStyle.fontSize || 12) + 'px',\r\n textStyle.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n textStyle.font = font;\r\n var rect = text.getBoundingRect();\r\n this._textX += rect.width;\r\n parentGroup.add(text);\r\n return text;\r\n };\r\n SVGParser.internalField = (function () {\r\n nodeParsers = {\r\n 'g': function (xmlNode, parentGroup) {\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'rect': function (xmlNode, parentGroup) {\r\n var rect = new Rect();\r\n inheritStyle(parentGroup, rect);\r\n parseAttributes(xmlNode, rect, this._defs);\r\n rect.setShape({\r\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\r\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\r\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\r\n height: parseFloat(xmlNode.getAttribute('height') || '0')\r\n });\r\n return rect;\r\n },\r\n 'circle': function (xmlNode, parentGroup) {\r\n var circle = new Circle();\r\n inheritStyle(parentGroup, circle);\r\n parseAttributes(xmlNode, circle, this._defs);\r\n circle.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n r: parseFloat(xmlNode.getAttribute('r') || '0')\r\n });\r\n return circle;\r\n },\r\n 'line': function (xmlNode, parentGroup) {\r\n var line = new Line();\r\n inheritStyle(parentGroup, line);\r\n parseAttributes(xmlNode, line, this._defs);\r\n line.setShape({\r\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\r\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\r\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\r\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\r\n });\r\n return line;\r\n },\r\n 'ellipse': function (xmlNode, parentGroup) {\r\n var ellipse = new Ellipse();\r\n inheritStyle(parentGroup, ellipse);\r\n parseAttributes(xmlNode, ellipse, this._defs);\r\n ellipse.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\r\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\r\n });\r\n return ellipse;\r\n },\r\n 'polygon': function (xmlNode, parentGroup) {\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polygon = new Polygon({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n inheritStyle(parentGroup, polygon);\r\n parseAttributes(xmlNode, polygon, this._defs);\r\n return polygon;\r\n },\r\n 'polyline': function (xmlNode, parentGroup) {\r\n var path = new Path();\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polyline = new Polyline({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n return polyline;\r\n },\r\n 'image': function (xmlNode, parentGroup) {\r\n var img = new ZRImage();\r\n inheritStyle(parentGroup, img);\r\n parseAttributes(xmlNode, img, this._defs);\r\n img.setStyle({\r\n image: xmlNode.getAttribute('xlink:href'),\r\n x: +xmlNode.getAttribute('x'),\r\n y: +xmlNode.getAttribute('y'),\r\n width: +xmlNode.getAttribute('width'),\r\n height: +xmlNode.getAttribute('height')\r\n });\r\n return img;\r\n },\r\n 'text': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x') || '0';\r\n var y = xmlNode.getAttribute('y') || '0';\r\n var dx = xmlNode.getAttribute('dx') || '0';\r\n var dy = xmlNode.getAttribute('dy') || '0';\r\n this._textX = parseFloat(x) + parseFloat(dx);\r\n this._textY = parseFloat(y) + parseFloat(dy);\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'tspan': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x');\r\n var y = xmlNode.getAttribute('y');\r\n if (x != null) {\r\n this._textX = parseFloat(x);\r\n }\r\n if (y != null) {\r\n this._textY = parseFloat(y);\r\n }\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n this._textX += dx;\r\n this._textY += dy;\r\n return g;\r\n },\r\n 'path': function (xmlNode, parentGroup) {\r\n var d = xmlNode.getAttribute('d') || '';\r\n var path = createFromString(d);\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n return path;\r\n }\r\n };\r\n })();\r\n return SVGParser;\r\n }());\r\n var defineParsers = {\r\n 'lineargradient': function (xmlNode) {\r\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\r\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\r\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\r\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\r\n var gradient = new LinearGradient(x1, y1, x2, y2);\r\n _parseGradientColorStops(xmlNode, gradient);\r\n return gradient;\r\n }\r\n };\r\n function _parseGradientColorStops(xmlNode, gradient) {\r\n var stop = xmlNode.firstChild;\r\n while (stop) {\r\n if (stop.nodeType === 1) {\r\n var offsetStr = stop.getAttribute('offset');\r\n var offset = void 0;\r\n if (offsetStr.indexOf('%') > 0) {\r\n offset = parseInt(offsetStr, 10) / 100;\r\n }\r\n else if (offsetStr) {\r\n offset = parseFloat(offsetStr);\r\n }\r\n else {\r\n offset = 0;\r\n }\r\n var stopColor = stop.getAttribute('stop-color') || '#000000';\r\n gradient.colorStops.push({\r\n offset: offset,\r\n color: stopColor\r\n });\r\n }\r\n stop = stop.nextSibling;\r\n }\r\n }\r\n function inheritStyle(parent, child) {\r\n if (parent && parent.__inheritedStyle) {\r\n if (!child.__inheritedStyle) {\r\n child.__inheritedStyle = {};\r\n }\r\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\r\n }\r\n }\r\n function parsePoints(pointsString) {\r\n var list = trim(pointsString).split(DILIMITER_REG);\r\n var points = [];\r\n for (var i = 0; i < list.length; i += 2) {\r\n var x = parseFloat(list[i]);\r\n var y = parseFloat(list[i + 1]);\r\n points.push([x, y]);\r\n }\r\n return points;\r\n }\r\n var attributesMap = {\r\n 'fill': 'fill',\r\n 'stroke': 'stroke',\r\n 'stroke-width': 'lineWidth',\r\n 'opacity': 'opacity',\r\n 'fill-opacity': 'fillOpacity',\r\n 'stroke-opacity': 'strokeOpacity',\r\n 'stroke-dasharray': 'lineDash',\r\n 'stroke-dashoffset': 'lineDashOffset',\r\n 'stroke-linecap': 'lineCap',\r\n 'stroke-linejoin': 'lineJoin',\r\n 'stroke-miterlimit': 'miterLimit',\r\n 'font-family': 'fontFamily',\r\n 'font-size': 'fontSize',\r\n 'font-style': 'fontStyle',\r\n 'font-weight': 'fontWeight',\r\n 'text-align': 'textAlign',\r\n 'alignment-baseline': 'textBaseline'\r\n };\r\n function parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\r\n var disp = el;\r\n var zrStyle = disp.__inheritedStyle || {};\r\n if (xmlNode.nodeType === 1) {\r\n parseTransformAttribute(xmlNode, el);\r\n extend(zrStyle, parseStyleAttribute(xmlNode));\r\n if (!onlyInlineStyle) {\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName)) {\r\n var attrValue = xmlNode.getAttribute(svgAttrName);\r\n if (attrValue != null) {\r\n zrStyle[attributesMap[svgAttrName]] = attrValue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n disp.style = disp.style || {};\r\n zrStyle.fill != null && (disp.style.fill = getPaint(zrStyle.fill, defs));\r\n zrStyle.stroke != null && (disp.style.stroke = getPaint(zrStyle.stroke, defs));\r\n each([\r\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = parseFloat(zrStyle[propName]));\r\n });\r\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\r\n zrStyle.textBaseline = 'alphabetic';\r\n }\r\n if (zrStyle.textBaseline === 'alphabetic') {\r\n zrStyle.textBaseline = 'bottom';\r\n }\r\n if (zrStyle.textAlign === 'start') {\r\n zrStyle.textAlign = 'left';\r\n }\r\n if (zrStyle.textAlign === 'end') {\r\n zrStyle.textAlign = 'right';\r\n }\r\n each(['lineDashOffset', 'lineCap', 'lineJoin',\r\n 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = zrStyle[propName]);\r\n });\r\n if (zrStyle.lineDash) {\r\n disp.style.lineDash = map(trim(zrStyle.lineDash).split(DILIMITER_REG), function (str) {\r\n return parseFloat(str);\r\n });\r\n }\r\n disp.__inheritedStyle = zrStyle;\r\n }\r\n var urlRegex = /url\\(\\s*#(.*?)\\)/;\r\n function getPaint(str, defs) {\r\n var urlMatch = defs && str && str.match(urlRegex);\r\n if (urlMatch) {\r\n var url = trim(urlMatch[1]);\r\n var def = defs[url];\r\n return def;\r\n }\r\n return str;\r\n }\r\n var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\r\n function parseTransformAttribute(xmlNode, node) {\r\n var transform = xmlNode.getAttribute('transform');\r\n if (transform) {\r\n transform = transform.replace(/,/g, ' ');\r\n var transformOps_1 = [];\r\n var m = null;\r\n transform.replace(transformRegex, function (str, type, value) {\r\n transformOps_1.push(type, value);\r\n return '';\r\n });\r\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\r\n var value = transformOps_1[i];\r\n var type = transformOps_1[i - 1];\r\n var valueArr = void 0;\r\n m = m || create$1();\r\n switch (type) {\r\n case 'translate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n translate(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\r\n break;\r\n case 'scale':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n scale$1(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\r\n break;\r\n case 'rotate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n rotate(m, m, parseFloat(valueArr[0]));\r\n break;\r\n case 'skew':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n console.warn('Skew transform is not supported yet');\r\n break;\r\n case 'matrix':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n m[0] = parseFloat(valueArr[0]);\r\n m[1] = parseFloat(valueArr[1]);\r\n m[2] = parseFloat(valueArr[2]);\r\n m[3] = parseFloat(valueArr[3]);\r\n m[4] = parseFloat(valueArr[4]);\r\n m[5] = parseFloat(valueArr[5]);\r\n break;\r\n }\r\n }\r\n node.setLocalTransform(m);\r\n }\r\n }\r\n var styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\r\n function parseStyleAttribute(xmlNode) {\r\n var style = xmlNode.getAttribute('style');\r\n var result = {};\r\n if (!style) {\r\n return result;\r\n }\r\n var styleList = {};\r\n styleRegex.lastIndex = 0;\r\n var styleRegResult;\r\n while ((styleRegResult = styleRegex.exec(style)) != null) {\r\n styleList[styleRegResult[1]] = styleRegResult[2];\r\n }\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\r\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\r\n }\r\n }\r\n return result;\r\n }\r\n function makeViewBoxTransform(viewBoxRect, width, height) {\r\n var scaleX = width / viewBoxRect.width;\r\n var scaleY = height / viewBoxRect.height;\r\n var scale = Math.min(scaleX, scaleY);\r\n return {\r\n scale: scale,\r\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2,\r\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2\r\n };\r\n }\r\n function parseSVG(xml, opt) {\r\n var parser = new SVGParser();\r\n return parser.parse(xml, opt);\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CMD$3 = PathProxy.CMD;\r\n var PI2$6 = Math.PI * 2;\r\n var PROP_XY = ['x', 'y'];\r\n var PROP_WH = ['width', 'height'];\r\n var tmpArr = [];\r\n function aroundEqual(a, b) {\r\n return Math.abs(a - b) < 1e-5;\r\n }\r\n function pathToBezierCurves(path) {\r\n var data = path.data;\r\n var len = path.len();\r\n var bezierArray = [];\r\n var currentSubpath;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n function createNewSubpath(x, y) {\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n currentSubpath = [x, y];\r\n }\r\n function addLine(x0, y0, x1, y1) {\r\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\r\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\r\n }\r\n }\r\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\r\n var delta = Math.abs(endAngle - startAngle);\r\n var len = Math.tan(delta / 4) * 4 / 3;\r\n var dir = endAngle < startAngle ? -1 : 1;\r\n var c1 = Math.cos(startAngle);\r\n var s1 = Math.sin(startAngle);\r\n var c2 = Math.cos(endAngle);\r\n var s2 = Math.sin(endAngle);\r\n var x1 = c1 * rx + cx;\r\n var y1 = s1 * ry + cy;\r\n var x4 = c2 * rx + cx;\r\n var y4 = s2 * ry + cy;\r\n var hx = rx * len * dir;\r\n var hy = ry * len * dir;\r\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\r\n }\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n if (cmd === CMD$3.L || cmd === CMD$3.C || cmd === CMD$3.Q) {\r\n currentSubpath = [x0, y0];\r\n }\r\n }\r\n switch (cmd) {\r\n case CMD$3.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n createNewSubpath(x0, y0);\r\n break;\r\n case CMD$3.L:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n addLine(xi, yi, x1, y1);\r\n xi = x1;\r\n yi = y1;\r\n break;\r\n case CMD$3.C:\r\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\r\n break;\r\n case CMD$3.Q:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n x1 = Math.cos(startAngle) * rx + cx;\r\n y1 = Math.sin(startAngle) * ry + cy;\r\n if (isFirst) {\r\n x0 = x1;\r\n y0 = y1;\r\n createNewSubpath(x0, y0);\r\n }\r\n else {\r\n addLine(xi, yi, x1, y1);\r\n }\r\n xi = Math.cos(endAngle) * rx + cx;\r\n yi = Math.sin(endAngle) * ry + cy;\r\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\r\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\r\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\r\n : Math.min(angle + step, endAngle);\r\n addArc(angle, nextAngle, cx, cy, rx, ry);\r\n }\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n x1 = x0 + data[i++];\r\n y1 = y0 + data[i++];\r\n createNewSubpath(x1, y0);\r\n addLine(x1, y0, x1, y1);\r\n addLine(x1, y1, x0, y1);\r\n addLine(x0, y1, x0, y0);\r\n addLine(x0, y0, x1, y0);\r\n break;\r\n case CMD$3.Z:\r\n currentSubpath && addLine(xi, yi, x0, y0);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n return bezierArray;\r\n }\r\n function alignSubpath(subpath1, subpath2) {\r\n var len1 = subpath1.length;\r\n var len2 = subpath2.length;\r\n if (len1 === len2) {\r\n return [subpath1, subpath2];\r\n }\r\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\r\n var shorterLen = Math.min(len1, len2);\r\n var diff = Math.abs(len2 - len1) / 6;\r\n var shorterBezierCount = (shorterLen - 2) / 6;\r\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\r\n var newSubpath = [shorterPath[0], shorterPath[1]];\r\n var remained = diff;\r\n var tmpSegX = [];\r\n var tmpSegY = [];\r\n for (var i = 2; i < shorterLen;) {\r\n var x0 = shorterPath[i - 2];\r\n var y0 = shorterPath[i - 1];\r\n var x1 = shorterPath[i++];\r\n var y1 = shorterPath[i++];\r\n var x2 = shorterPath[i++];\r\n var y2 = shorterPath[i++];\r\n var x3 = shorterPath[i++];\r\n var y3 = shorterPath[i++];\r\n if (remained <= 0) {\r\n newSubpath.push(x1, y1, x2, y2, x3, y3);\r\n continue;\r\n }\r\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\r\n for (var k = 1; k <= actualSubDivCount; k++) {\r\n var p = k / actualSubDivCount;\r\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\r\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\r\n x0 = tmpSegX[3];\r\n y0 = tmpSegY[3];\r\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\r\n x1 = tmpSegX[5];\r\n y1 = tmpSegY[5];\r\n x2 = tmpSegX[6];\r\n y2 = tmpSegY[6];\r\n }\r\n remained -= actualSubDivCount - 1;\r\n }\r\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\r\n }\r\n function createSubpath(lastSubpathSubpath, otherSubpath) {\r\n var len = lastSubpathSubpath.length;\r\n var lastX = lastSubpathSubpath[len - 2];\r\n var lastY = lastSubpathSubpath[len - 1];\r\n var newSubpath = [];\r\n for (var i = 0; i < otherSubpath.length;) {\r\n newSubpath[i++] = lastX;\r\n newSubpath[i++] = lastY;\r\n }\r\n return newSubpath;\r\n }\r\n function alignBezierCurves(array1, array2) {\r\n var _a;\r\n var lastSubpath1;\r\n var lastSubpath2;\r\n var newArray1 = [];\r\n var newArray2 = [];\r\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\r\n var subpath1 = array1[i];\r\n var subpath2 = array2[i];\r\n var newSubpath1 = void 0;\r\n var newSubpath2 = void 0;\r\n if (!subpath1) {\r\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\r\n newSubpath2 = subpath2;\r\n }\r\n else if (!subpath2) {\r\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\r\n newSubpath1 = subpath1;\r\n }\r\n else {\r\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\r\n lastSubpath1 = newSubpath1;\r\n lastSubpath2 = newSubpath2;\r\n }\r\n newArray1.push(newSubpath1);\r\n newArray2.push(newSubpath2);\r\n }\r\n return [newArray1, newArray2];\r\n }\r\n function centroid(array) {\r\n var signedArea = 0;\r\n var cx = 0;\r\n var cy = 0;\r\n var len = array.length;\r\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\r\n var x0 = array[j];\r\n var y0 = array[j + 1];\r\n var x1 = array[i];\r\n var y1 = array[i + 1];\r\n var a = x0 * y1 - x1 * y0;\r\n signedArea += a;\r\n cx += (x0 + x1) * a;\r\n cy += (y0 + y1) * a;\r\n }\r\n if (signedArea === 0) {\r\n return [array[0] || 0, array[1] || 0];\r\n }\r\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\r\n }\r\n function findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\r\n var bezierCount = (fromSubBeziers.length - 2) / 6;\r\n var bestScore = Infinity;\r\n var bestOffset = 0;\r\n var len = fromSubBeziers.length;\r\n var len2 = len - 2;\r\n for (var offset = 0; offset < bezierCount; offset++) {\r\n var cursorOffset = offset * 6;\r\n var score = 0;\r\n for (var k = 0; k < len; k += 2) {\r\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\r\n var x0 = fromSubBeziers[idx] - fromCp[0];\r\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\r\n var x1 = toSubBeziers[k] - toCp[0];\r\n var y1 = toSubBeziers[k + 1] - toCp[1];\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestOffset = offset;\r\n }\r\n }\r\n return bestOffset;\r\n }\r\n function reverse(array) {\r\n var newArr = [];\r\n var len = array.length;\r\n for (var i = 0; i < len; i += 2) {\r\n newArr[i] = array[len - i - 2];\r\n newArr[i + 1] = array[len - i - 1];\r\n }\r\n return newArr;\r\n }\r\n function findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\r\n var result = [];\r\n var fromNeedsReverse;\r\n for (var i = 0; i < fromArr.length; i++) {\r\n var fromSubpathBezier = fromArr[i];\r\n var toSubpathBezier = toArr[i];\r\n var fromCp = centroid(fromSubpathBezier);\r\n var toCp = centroid(toSubpathBezier);\r\n if (fromNeedsReverse == null) {\r\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\r\n }\r\n var newFromSubpathBezier = [];\r\n var newToSubpathBezier = [];\r\n var bestAngle = 0;\r\n var bestScore = Infinity;\r\n var tmpArr_1 = [];\r\n var len = fromSubpathBezier.length;\r\n if (fromNeedsReverse) {\r\n fromSubpathBezier = reverse(fromSubpathBezier);\r\n }\r\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\r\n var len2 = len - 2;\r\n for (var k = 0; k < len2; k += 2) {\r\n var idx = (offset + k) % len2 + 2;\r\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\r\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\r\n }\r\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\r\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\r\n if (searchAngleIteration > 0) {\r\n var step = searchAngleRange / searchAngleIteration;\r\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n var score = 0;\r\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\r\n var x0 = newFromSubpathBezier[k];\r\n var y0 = newFromSubpathBezier[k + 1];\r\n var x1 = toSubpathBezier[k] - toCp[0];\r\n var y1 = toSubpathBezier[k + 1] - toCp[1];\r\n var newX1 = x1 * ca - y1 * sa;\r\n var newY1 = x1 * sa + y1 * ca;\r\n tmpArr_1[k] = newX1;\r\n tmpArr_1[k + 1] = newY1;\r\n var dx = newX1 - x0;\r\n var dy = newY1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestAngle = angle;\r\n for (var m = 0; m < tmpArr_1.length; m++) {\r\n newToSubpathBezier[m] = tmpArr_1[m];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\r\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\r\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\r\n }\r\n }\r\n result.push({\r\n from: newFromSubpathBezier,\r\n to: newToSubpathBezier,\r\n fromCp: fromCp,\r\n toCp: toCp,\r\n rotation: -bestAngle\r\n });\r\n }\r\n return result;\r\n }\r\n function morphPath(fromPath, toPath, animationOpts) {\r\n var fromPathProxy;\r\n var toPathProxy;\r\n if (!fromPath || !toPath) {\r\n return toPath;\r\n }\r\n !fromPath.path && fromPath.createPathProxy();\r\n fromPathProxy = fromPath.path;\r\n fromPathProxy.beginPath();\r\n fromPath.buildPath(fromPathProxy, fromPath.shape);\r\n !toPath.path && toPath.createPathProxy();\r\n toPathProxy = toPath.path;\r\n toPathProxy === fromPathProxy && (toPathProxy = new PathProxy(false));\r\n toPathProxy.beginPath();\r\n if (isIndividualMorphingPath(toPath)) {\r\n toPath.__oldBuildPath(toPathProxy, toPath.shape);\r\n }\r\n else {\r\n toPath.buildPath(toPathProxy, toPath.shape);\r\n }\r\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\r\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\r\n becomeIndividualMorphingPath(toPath, morphingData, 0);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n toPath.animateTo({\r\n __morphT: 1\r\n }, defaults({\r\n during: function (p) {\r\n toPath.dirtyShape();\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n restoreIndividualMorphingPath(toPath);\r\n toPath.createPathProxy();\r\n toPath.dirtyShape();\r\n oldDone && oldDone();\r\n },\r\n aborted: function () {\r\n oldAborted && oldAborted();\r\n }\r\n }, animationOpts));\r\n return toPath;\r\n }\r\n function morphingPathBuildPath(path) {\r\n var morphingData = this.__morphingData;\r\n var t = this.__morphT;\r\n var onet = 1 - t;\r\n var newCp = [];\r\n for (var i = 0; i < morphingData.length; i++) {\r\n var item = morphingData[i];\r\n var from = item.from;\r\n var to = item.to;\r\n var angle = item.rotation * t;\r\n var fromCp = item.fromCp;\r\n var toCp = item.toCp;\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n lerp(newCp, fromCp, toCp, t);\r\n for (var m = 0; m < from.length; m += 2) {\r\n var x0 = from[m];\r\n var y0 = from[m + 1];\r\n var x1 = to[m];\r\n var y1 = to[m + 1];\r\n var x = x0 * onet + x1 * t;\r\n var y = y0 * onet + y1 * t;\r\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\r\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\r\n }\r\n for (var m = 0; m < from.length;) {\r\n if (m === 0) {\r\n path.moveTo(tmpArr[m++], tmpArr[m++]);\r\n }\r\n path.bezierCurveTo(tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++]);\r\n }\r\n }\r\n }\r\n function becomeIndividualMorphingPath(path, morphingData, morphT) {\r\n if (isIndividualMorphingPath(path)) {\r\n updateIndividualMorphingPath(path, morphingData, morphT);\r\n return;\r\n }\r\n var morphingPath = path;\r\n morphingPath.__oldBuildPath = morphingPath.buildPath;\r\n morphingPath.buildPath = morphingPathBuildPath;\r\n updateIndividualMorphingPath(morphingPath, morphingData, morphT);\r\n }\r\n function updateIndividualMorphingPath(morphingPath, morphingData, morphT) {\r\n morphingPath.__morphingData = morphingData;\r\n morphingPath.__morphT = morphT;\r\n }\r\n function restoreIndividualMorphingPath(path) {\r\n if (isIndividualMorphingPath(path)) {\r\n path.buildPath = path.__oldBuildPath;\r\n path.__oldBuildPath = path.__morphingData = null;\r\n }\r\n }\r\n function isIndividualMorphingPath(path) {\r\n return path.__oldBuildPath != null;\r\n }\r\n function isCombiningPath(path) {\r\n return !!path.__combiningSubList;\r\n }\r\n function isInAnyMorphing(path) {\r\n return isIndividualMorphingPath(path) || isCombiningPath(path);\r\n }\r\n function combine(fromPathList, toPath, animationOpts, copyPropsIfDivided) {\r\n var fromIndividuals = [];\r\n var separateCount = 0;\r\n for (var i = 0; i < fromPathList.length; i++) {\r\n var fromPath = fromPathList[i];\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n for (var j = 0; j < fromCombiningSubList.length; j++) {\r\n fromIndividuals.push(fromCombiningSubList[j]);\r\n }\r\n separateCount += fromCombiningSubList.length;\r\n }\r\n else {\r\n fromIndividuals.push(fromPath);\r\n separateCount++;\r\n }\r\n }\r\n if (!separateCount) {\r\n return;\r\n }\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var toPathSplittedList = divideShape(toPath, separateCount, dividingMethod);\r\n assert(toPathSplittedList.length === separateCount);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n var doneCount = 0;\r\n var abortedCalled = false;\r\n var morphAnimationOpts = defaults({\r\n during: function (p) {\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n doneCount++;\r\n if (doneCount === toPathSplittedList.length) {\r\n restoreCombiningPath(toPath);\r\n oldDone && oldDone();\r\n }\r\n },\r\n aborted: function () {\r\n if (!abortedCalled) {\r\n abortedCalled = true;\r\n oldAborted && oldAborted();\r\n }\r\n }\r\n }, animationOpts);\r\n for (var i = 0; i < separateCount; i++) {\r\n var from = fromIndividuals[i];\r\n var to = toPathSplittedList[i];\r\n copyPropsIfDivided && copyPropsIfDivided(toPath, to, true);\r\n morphPath(from, to, morphAnimationOpts);\r\n }\r\n becomeCombiningPath(toPath, toPathSplittedList);\r\n return {\r\n fromIndividuals: fromIndividuals,\r\n toIndividuals: toPathSplittedList,\r\n count: separateCount\r\n };\r\n }\r\n function becomeCombiningPath(path, combiningSubList) {\r\n if (isCombiningPath(path)) {\r\n updateCombiningPathSubList(path, combiningSubList);\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, combiningSubList);\r\n combiningPath.__oldAddSelfToZr = path.addSelfToZr;\r\n combiningPath.__oldRemoveSelfFromZr = path.removeSelfFromZr;\r\n combiningPath.addSelfToZr = combiningAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningRemoveSelfFromZr;\r\n combiningPath.__oldBuildPath = combiningPath.buildPath;\r\n combiningPath.buildPath = noop;\r\n combiningPath.childrenRef = combiningChildrenRef;\r\n }\r\n function restoreCombiningPath(path) {\r\n if (!isCombiningPath(path)) {\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, null);\r\n combiningPath.addSelfToZr = combiningPath.__oldAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningPath.__oldRemoveSelfFromZr;\r\n combiningPath.buildPath = combiningPath.__oldBuildPath;\r\n combiningPath.childrenRef =\r\n combiningPath.__combiningSubList =\r\n combiningPath.__oldAddSelfToZr =\r\n combiningPath.__oldRemoveSelfFromZr =\r\n combiningPath.__oldBuildPath = null;\r\n }\r\n function updateCombiningPathSubList(combiningPath, combiningSubList) {\r\n if (combiningPath.__combiningSubList !== combiningSubList) {\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'removeSelfFromZr');\r\n combiningPath.__combiningSubList = combiningSubList;\r\n if (combiningSubList) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n combiningSubList[i].parent = combiningPath;\r\n }\r\n }\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'addSelfToZr');\r\n }\r\n }\r\n function combiningAddSelfToZr(zr) {\r\n this.__oldAddSelfToZr(zr);\r\n combiningPathSubListAddRemoveWithZr(this, 'addSelfToZr');\r\n }\r\n function combiningPathSubListAddRemoveWithZr(path, method) {\r\n var combiningSubList = path.__combiningSubList;\r\n var zr = path.__zr;\r\n if (combiningSubList && zr) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child[method](zr);\r\n }\r\n }\r\n }\r\n function combiningRemoveSelfFromZr(zr) {\r\n this.__oldRemoveSelfFromZr(zr);\r\n var combiningSubList = this.__combiningSubList;\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n }\r\n function combiningChildrenRef() {\r\n return this.__combiningSubList;\r\n }\r\n function separate(fromPath, toPathList, animationOpts, copyPropsIfDivided) {\r\n var toPathListLen = toPathList.length;\r\n var fromPathList;\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var copyProps = false;\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n if (fromCombiningSubList.length === toPathListLen) {\r\n fromPathList = fromCombiningSubList;\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n assert(fromPathList.length === toPathListLen);\r\n for (var i = 0; i < toPathListLen; i++) {\r\n if (copyProps && copyPropsIfDivided) {\r\n copyPropsIfDivided(fromPath, fromPathList[i], false);\r\n }\r\n morphPath(fromPathList[i], toPathList[i], animationOpts);\r\n }\r\n return {\r\n fromIndividuals: fromPathList,\r\n toIndividuals: toPathList,\r\n count: toPathListLen\r\n };\r\n }\r\n function divideShape(path, separateCount, dividingMethod) {\r\n return dividingMethod === 'duplicate'\r\n ? duplicateShape(path, separateCount)\r\n : splitShape(path, separateCount);\r\n }\r\n function splitShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n if (separateCount === 1) {\r\n return duplicateShape(path, separateCount);\r\n }\r\n if (path instanceof Rect) {\r\n var toPathShape = path.shape;\r\n var splitPropIdx = toPathShape.height > toPathShape.width ? 1 : 0;\r\n var propWH = PROP_WH[splitPropIdx];\r\n var propXY = PROP_XY[splitPropIdx];\r\n var subWH = toPathShape[propWH] / separateCount;\r\n var xyCurr = toPathShape[propXY];\r\n for (var i = 0; i < separateCount; i++, xyCurr += subWH) {\r\n var subShape = {\r\n x: toPathShape.x,\r\n y: toPathShape.y,\r\n width: toPathShape.width,\r\n height: toPathShape.height\r\n };\r\n subShape[propXY] = xyCurr;\r\n subShape[propWH] = i < separateCount - 1\r\n ? subWH\r\n : toPathShape[propXY] + toPathShape[propWH] - xyCurr;\r\n var splitted = new Rect({ shape: subShape });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else if (path instanceof Sector) {\r\n var toPathShape = path.shape;\r\n var clockwise = toPathShape.clockwise;\r\n var startAngle = toPathShape.startAngle;\r\n var endAngle = toPathShape.endAngle;\r\n var endAngleNormalized = normalizeRadian$1(startAngle, toPathShape.endAngle, clockwise);\r\n var step = (endAngleNormalized - startAngle) / separateCount;\r\n var angleCurr = startAngle;\r\n for (var i = 0; i < separateCount; i++, angleCurr += step) {\r\n var splitted = new Sector({\r\n shape: {\r\n cx: toPathShape.cx,\r\n cy: toPathShape.cy,\r\n r: toPathShape.r,\r\n r0: toPathShape.r0,\r\n clockwise: clockwise,\r\n startAngle: angleCurr,\r\n endAngle: i === separateCount - 1 ? endAngle : angleCurr + step\r\n }\r\n });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else {\r\n return duplicateShape(path, separateCount);\r\n }\r\n return resultPaths;\r\n }\r\n function duplicateShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n var ctor = path.constructor;\r\n for (var i = 0; i < separateCount; i++) {\r\n var sub = new ctor({\r\n shape: clone(path.shape)\r\n });\r\n resultPaths.push(sub);\r\n }\r\n return resultPaths;\r\n }\r\n function normalizeRadian$1(start, end, clockwise) {\r\n return end + PI2$6 * (Math[clockwise ? 'ceil' : 'floor']((start - end) / PI2$6));\r\n }\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n var instances = {};\r\n function delInstance(id) {\r\n delete instances[id];\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover) {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n }\r\n function dispose(zr) {\r\n zr.dispose();\r\n }\r\n function disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n }\r\n function getInstance(id) {\r\n return instances[id];\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\r\n var version = '5.0.0';\n\n var zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n });\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n }\r\n function getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n var MAX_SAFE_INTEGER = 9007199254740991;\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n }\r\n function reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n });\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function compressBatches(batchA, batchB) {\r\n var mapA = {};\r\n var mapB = {};\r\n makeMap(batchA || [], mapA);\r\n makeMap(batchB || [], mapB, mapA);\r\n return [mapToArray(mapA), mapToArray(mapB)];\r\n function makeMap(sourceBatch, map, otherMap) {\r\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\r\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\r\n if (seriesId == null) {\r\n return;\r\n }\r\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\r\n var otherDataIndices = otherMap && otherMap[seriesId];\r\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\r\n var dataIndex = dataIndices[j];\r\n if (otherDataIndices && otherDataIndices[dataIndex]) {\r\n otherDataIndices[dataIndex] = null;\r\n }\r\n else {\r\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\r\n }\r\n }\r\n }\r\n }\r\n function mapToArray(map, isData) {\r\n var result = [];\r\n for (var i in map) {\r\n if (map.hasOwnProperty(i) && map[i] != null) {\r\n if (isData) {\r\n result.push(+i);\r\n }\r\n else {\r\n var dataIndices = mapToArray(map[i], true);\r\n dataIndices.length && result.push({ seriesId: i, dataIndex: dataIndices });\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n var MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n }\r\n function groupData(array, getKey) {\r\n var buckets = createHashMap();\r\n var keys = [];\r\n each(array, function (item) {\r\n var key = getKey(item);\r\n (buckets.get(key)\r\n || (keys.push(key), buckets.set(key, []))).push(item);\r\n });\r\n return {\r\n keys: keys,\r\n buckets: buckets\r\n };\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n var mathMax$4 = Math.max;\r\n var mathMin$4 = Math.min;\r\n var _customShapeMap = {};\r\n function extendShape(opts) {\r\n return Path.extend(opts);\r\n }\r\n var extendPathFromString = extendFromString;\r\n function extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n }\r\n function registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n }\r\n function getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n }\r\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n var mergePath$1 = mergePath;\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n function subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n var subPixelOptimize$1 = subPixelOptimize;\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n }\r\n function applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n }\r\n function transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\r\n function clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n }\r\n function clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n }\r\n function createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n }\r\n function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n }\r\n function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n }\r\n function nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n }\r\n registerShape('circle', Circle);\r\n registerShape('ellipse', Ellipse);\r\n registerShape('sector', Sector);\r\n registerShape('ring', Ring);\r\n registerShape('polygon', Polygon);\r\n registerShape('polyline', Polyline);\r\n registerShape('rect', Rect);\r\n registerShape('line', Line);\r\n registerShape('bezierCurve', BezierCurve);\r\n registerShape('arc', Arc);\n\n var graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n });\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}:{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n function toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n function makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n }\r\n function getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n }\r\n function formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n }\r\n function capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\r\n function windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n }\n\n var formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n });\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var box = boxLayout;\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getAvailableSize(positionInfo, containerRect, margin) {\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var x = parsePercent$2(positionInfo.left, containerWidth);\r\n var y = parsePercent$2(positionInfo.top, containerHeight);\r\n var x2 = parsePercent$2(positionInfo.right, containerWidth);\r\n var y2 = parsePercent$2(positionInfo.bottom, containerHeight);\r\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\r\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\r\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\r\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\r\n margin = normalizeCssArray$1(margin || 0);\r\n return {\r\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\r\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\r\n };\r\n }\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n }\r\n function sizeCalculable(option, hvIdx) {\r\n return option[HV_NAMES[hvIdx][0]] != null\r\n || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null);\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n }\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\r\n function normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n }\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\r\n function getRawValueParser(type) {\r\n return valueParserMap.get(type);\r\n }\r\n var ORDER_COMPARISON_OP_MAP = {\r\n lt: function (lval, rval) { return lval < rval; },\r\n lte: function (lval, rval) { return lval <= rval; },\r\n gt: function (lval, rval) { return lval > rval; },\r\n gte: function (lval, rval) { return lval >= rval; }\r\n };\r\n var FilterOrderComparator = (function () {\r\n function FilterOrderComparator(op, rval) {\r\n if (typeof rval !== 'number') {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\r\n }\r\n throwError(errMsg);\r\n }\r\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterOrderComparator.prototype.evaluate = function (lval) {\r\n return typeof lval === 'number'\r\n ? this._opFn(lval, this._rvalFloat)\r\n : this._opFn(numericToNumber(lval), this._rvalFloat);\r\n };\r\n return FilterOrderComparator;\r\n }());\r\n var SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n }());\r\n var FilterEqualityComparator = (function () {\r\n function FilterEqualityComparator(isEq, rval) {\r\n this._rval = rval;\r\n this._isEQ = isEq;\r\n this._rvalTypeof = typeof rval;\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterEqualityComparator.prototype.evaluate = function (lval) {\r\n var eqResult = lval === this._rval;\r\n if (!eqResult) {\r\n var lvalTypeof = typeof lval;\r\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\r\n eqResult = numericToNumber(lval) === this._rvalFloat;\r\n }\r\n }\r\n return this._isEQ ? eqResult : !eqResult;\r\n };\r\n return FilterEqualityComparator;\r\n }());\r\n function createFilterComparator(op, rval) {\r\n return (op === 'eq' || op === 'ne')\r\n ? new FilterEqualityComparator(op === 'eq', rval)\r\n : hasOwn(ORDER_COMPARISON_OP_MAP, op)\r\n ? new FilterOrderComparator(op, rval)\r\n : null;\r\n }\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n var TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\n var TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n };\r\n var TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\n var TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n };\r\n var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\n var HTML_GAPS = [0, 10, 20, 30];\r\n var RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n }\r\n var builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n };\r\n function buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n }\r\n function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n }\r\n function getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n }\r\n function wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n }\r\n function wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n }\r\n function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n }\r\n function wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n }\r\n function wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\r\n function getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n }\r\n var TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n }());\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n var ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\n var RATE = '\\0__throttleRate';\r\n var THROTTLE_TYPE = '\\0__throttleType';\r\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\r\n function createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n }\r\n function clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function setItemVisualFromData(data, dataIndex, key, value) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n style[data.getVisual('drawType')] = value;\r\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\r\n break;\r\n case 'opacity':\r\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\r\n break;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n data.setItemVisual(dataIndex, key, value);\r\n break;\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$7 = Math.PI * 2;\r\n var CMD$4 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$7 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$7;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$7;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$7 >= startAngle && angle + PI2$7 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$4.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$4.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$4.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$4.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr$1 = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap$1 = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap$1();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version$1 = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.0'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances$1 = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances$1[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function getLayoutOnAxis(opt) {\r\n var params = [];\r\n var baseAxis = opt.axis;\r\n var axisKey = 'axis0';\r\n if (baseAxis.type !== 'category') {\r\n return;\r\n }\r\n var bandWidth = baseAxis.getBandWidth();\r\n for (var i = 0; i < opt.count || 0; i++) {\r\n params.push(defaults({\r\n bandWidth: bandWidth,\r\n axisKey: axisKey,\r\n stackId: STACK_PREFIX + i\r\n }, opt));\r\n }\r\n var widthAndOffsets = doCalBarWidthAndOffset(params);\r\n var result = [];\r\n for (var i = 0; i < opt.count; i++) {\r\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\r\n item.offsetCenter = item.offset + item.width / 2;\r\n result.push(item);\r\n }\r\n return result;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n function createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n }\r\n var dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n };\r\n function createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n }\r\n function mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n }\n\n var helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n });\n\n var EPSILON$3 = 1e-8;\r\n function isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n }\r\n function contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n }\n\n var Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n }());\n\n function decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n }\r\n function decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n }\r\n function parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n }\n\n var inner$4 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var parseGeoJson = parseGeoJSON;\r\n var number = {};\r\n each([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n ], function (name) {\r\n number[name] = numberUtil[name];\r\n });\r\n var format$1 = {};\r\n each([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n ], function (name) {\r\n format$1[name] = formatUtil[name];\r\n });\r\n var time = {\r\n parse: parseDate,\r\n format: format\r\n };\r\n var ecUtil = {};\r\n each([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n ], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n });\r\n var GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n ];\r\n var graphic$1 = {};\r\n each(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n });\n\n var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\r\n value: 'eq',\r\n '<': 'lt',\r\n '<=': 'lte',\r\n '>': 'gt',\r\n '>=': 'gte',\r\n '=': 'eq',\r\n '!=': 'ne',\r\n '<>': 'ne'\r\n };\r\n var RegExpEvaluator = (function () {\r\n function RegExpEvaluator(rVal) {\r\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal)\r\n : isRegExp(rVal) ? rVal\r\n : null;\r\n if (condValue == null) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n RegExpEvaluator.prototype.evaluate = function (lVal) {\r\n var type = typeof lVal;\r\n return type === 'string' ? this._condVal.test(lVal)\r\n : type === 'number' ? this._condVal.test(lVal + '')\r\n : false;\r\n };\r\n return RegExpEvaluator;\r\n }());\r\n var ConstConditionInternal = (function () {\r\n function ConstConditionInternal() {\r\n }\r\n ConstConditionInternal.prototype.evaluate = function () {\r\n return this.value;\r\n };\r\n return ConstConditionInternal;\r\n }());\r\n var AndConditionInternal = (function () {\r\n function AndConditionInternal() {\r\n }\r\n AndConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (!children[i].evaluate()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return AndConditionInternal;\r\n }());\r\n var OrConditionInternal = (function () {\r\n function OrConditionInternal() {\r\n }\r\n OrConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].evaluate()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return OrConditionInternal;\r\n }());\r\n var NotConditionInternal = (function () {\r\n function NotConditionInternal() {\r\n }\r\n NotConditionInternal.prototype.evaluate = function () {\r\n return !this.child.evaluate();\r\n };\r\n return NotConditionInternal;\r\n }());\r\n var RelationalConditionInternal = (function () {\r\n function RelationalConditionInternal() {\r\n }\r\n RelationalConditionInternal.prototype.evaluate = function () {\r\n var needParse = !!this.valueParser;\r\n var getValue = this.getValue;\r\n var tarValRaw = getValue(this.valueGetterParam);\r\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\r\n for (var i = 0; i < this.subCondList.length; i++) {\r\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return RelationalConditionInternal;\r\n }());\r\n function parseOption(exprOption, getters) {\r\n if (exprOption === true || exprOption === false) {\r\n var cond = new ConstConditionInternal();\r\n cond.value = exprOption;\r\n return cond;\r\n }\r\n var errMsg = '';\r\n if (!isObjectNotArray(exprOption)) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n if (exprOption.and) {\r\n return parseAndOrOption('and', exprOption, getters);\r\n }\r\n else if (exprOption.or) {\r\n return parseAndOrOption('or', exprOption, getters);\r\n }\r\n else if (exprOption.not) {\r\n return parseNotOption(exprOption, getters);\r\n }\r\n return parseRelationalOption(exprOption, getters);\r\n }\r\n function parseAndOrOption(op, exprOption, getters) {\r\n var subOptionArr = exprOption[op];\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isArray(subOptionArr)) {\r\n throwError(errMsg);\r\n }\r\n if (!subOptionArr.length) {\r\n throwError(errMsg);\r\n }\r\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\r\n cond.children = map(subOptionArr, function (subOption) { return parseOption(subOption, getters); });\r\n if (!cond.children.length) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n }\r\n function parseNotOption(exprOption, getters) {\r\n var subOption = exprOption.not;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isObjectNotArray(subOption)) {\r\n throwError(errMsg);\r\n }\r\n var cond = new NotConditionInternal();\r\n cond.child = parseOption(subOption, getters);\r\n if (!cond.child) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n }\r\n function parseRelationalOption(exprOption, getters) {\r\n var errMsg = '';\r\n var valueGetterParam = getters.prepareGetValue(exprOption);\r\n var subCondList = [];\r\n var exprKeys = keys(exprOption);\r\n var parserName = exprOption.parser;\r\n var valueParser = parserName ? getRawValueParser(parserName) : null;\r\n for (var i = 0; i < exprKeys.length; i++) {\r\n var keyRaw = exprKeys[i];\r\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\r\n continue;\r\n }\r\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw)\r\n ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw]\r\n : keyRaw;\r\n var condValueRaw = exprOption[keyRaw];\r\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\r\n var evaluator = createFilterComparator(op, condValueParsed)\r\n || (op === 'reg' && new RegExpEvaluator(condValueParsed));\r\n if (!evaluator) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n subCondList.push(evaluator);\r\n }\r\n if (!subCondList.length) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var cond = new RelationalConditionInternal();\r\n cond.valueGetterParam = valueGetterParam;\r\n cond.valueParser = valueParser;\r\n cond.getValue = getters.getValue;\r\n cond.subCondList = subCondList;\r\n return cond;\r\n }\r\n function isObjectNotArray(val) {\r\n return isObject(val) && !isArrayLike(val);\r\n }\r\n var ConditionalExpressionParsed = (function () {\r\n function ConditionalExpressionParsed(exprOption, getters) {\r\n this._cond = parseOption(exprOption, getters);\r\n }\r\n ConditionalExpressionParsed.prototype.evaluate = function () {\r\n return this._cond.evaluate();\r\n };\r\n return ConditionalExpressionParsed;\r\n }());\r\n function parseConditionalExpression(exprOption, getters) {\r\n return new ConditionalExpressionParsed(exprOption, getters);\r\n }\n\n var filterTransform = {\r\n type: 'echarts:filter',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var rawItem;\r\n var condition = parseConditionalExpression(params.config, {\r\n valueGetterAttrMap: createHashMap({ dimension: true }),\r\n prepareGetValue: function (exprOption) {\r\n var errMsg = '';\r\n var dimLoose = exprOption.dimension;\r\n if (!hasOwn(exprOption, 'dimension')) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n return { dimIdx: dimInfo.index };\r\n },\r\n getValue: function (param) {\r\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\r\n }\r\n });\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n rawItem = upstream.getRawDataItem(i);\r\n if (condition.evaluate()) {\r\n resultData.push(rawItem);\r\n }\r\n }\r\n return {\r\n data: resultData\r\n };\r\n }\r\n };\n\n var sampleLog = '';\r\n if (__DEV__) {\r\n sampleLog = [\r\n 'Valid config is like:',\r\n '{ dimension: \"age\", order: \"asc\" }',\r\n 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'\r\n ].join(' ');\r\n }\r\n var sortTransform = {\r\n type: 'echarts:sort',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var config = params.config;\r\n var errMsg = '';\r\n var orderExprList = normalizeToArray(config);\r\n if (!orderExprList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Empty `config` in sort transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var orderDefList = [];\r\n each(orderExprList, function (orderExpr) {\r\n var dimLoose = orderExpr.dimension;\r\n var order = orderExpr.order;\r\n var parserName = orderExpr.parser;\r\n var incomparable = orderExpr.incomparable;\r\n if (dimLoose == null) {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (incomparable && (incomparable !== 'min' && incomparable !== 'max')) {\r\n var errMsg_1 = '';\r\n if (__DEV__) {\r\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\r\n }\r\n throwError(errMsg_1);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n var errMsg_2 = '';\r\n if (__DEV__) {\r\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\r\n }\r\n throwError(errMsg_2);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n var parser = parserName ? getRawValueParser(parserName) : null;\r\n if (parserName && !parser) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n orderDefList.push({\r\n dimIdx: dimInfo.index,\r\n parser: parser,\r\n comparator: new SortOrderComparator(order, incomparable)\r\n });\r\n });\r\n var sourceFormat = upstream.sourceFormat;\r\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (__DEV__) {\r\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n resultData.push(upstream.getRawDataItem(i));\r\n }\r\n resultData.sort(function (item0, item1) {\r\n for (var i = 0; i < orderDefList.length; i++) {\r\n var orderDef = orderDefList[i];\r\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\r\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\r\n if (orderDef.parser) {\r\n val0 = orderDef.parser(val0);\r\n val1 = orderDef.parser(val1);\r\n }\r\n var result = orderDef.comparator.evaluate(val0, val1);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n return 0;\r\n });\r\n return {\r\n data: resultData\r\n };\r\n }\r\n };\n\n registerTransform(filterTransform);\r\n registerTransform(sortTransform);\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$5 = Math.min;\r\n var mathMax$5 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n }\r\n function collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n }\r\n function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n }\r\n function collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n }\r\n function getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n }\r\n function checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n }\r\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$5 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$6 = Math.max;\r\n var mathMin$6 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$8 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$8;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$8 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$8 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$8 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ScatterSeriesModel);\n\n var BOOST_SIZE_THRESHOLD = 4;\r\n var LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n }());\r\n var LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n }(Path));\r\n var LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n }());\n\n var ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(ScatterView);\n\n registerLayout(pointsLayout('scatter'));\n\n var IndicatorAxis = (function (_super) {\r\n __extends(IndicatorAxis, _super);\r\n function IndicatorAxis(dim, scale, radiusExtent) {\r\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\r\n _this.type = 'value';\r\n _this.angle = 0;\r\n _this.name = '';\r\n return _this;\r\n }\r\n return IndicatorAxis;\r\n }(Axis));\n\n var Radar = (function () {\r\n function Radar(radarModel, ecModel, api) {\r\n this.dimensions = [];\r\n this._model = radarModel;\r\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\r\n var dim = 'indicator_' + idx;\r\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());\r\n indicatorAxis.name = indicatorModel.get('name');\r\n indicatorAxis.model = indicatorModel;\r\n indicatorModel.axis = indicatorAxis;\r\n this.dimensions.push(dim);\r\n return indicatorAxis;\r\n }, this);\r\n this.resize(radarModel, api);\r\n }\r\n Radar.prototype.getIndicatorAxes = function () {\r\n return this._indicatorAxes;\r\n };\r\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\r\n };\r\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n var angle = indicatorAxis.angle;\r\n var x = this.cx + coord * Math.cos(angle);\r\n var y = this.cy - coord * Math.sin(angle);\r\n return [x, y];\r\n };\r\n Radar.prototype.pointToData = function (pt) {\r\n var dx = pt[0] - this.cx;\r\n var dy = pt[1] - this.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx);\r\n var minRadianDiff = Infinity;\r\n var closestAxis;\r\n var closestAxisIdx = -1;\r\n for (var i = 0; i < this._indicatorAxes.length; i++) {\r\n var indicatorAxis = this._indicatorAxes[i];\r\n var diff = Math.abs(radian - indicatorAxis.angle);\r\n if (diff < minRadianDiff) {\r\n closestAxis = indicatorAxis;\r\n closestAxisIdx = i;\r\n minRadianDiff = diff;\r\n }\r\n }\r\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\r\n };\r\n Radar.prototype.resize = function (radarModel, api) {\r\n var center = radarModel.get('center');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\r\n this.cx = parsePercent$2(center[0], viewWidth);\r\n this.cy = parsePercent$2(center[1], viewHeight);\r\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\r\n var radius = radarModel.get('radius');\r\n if (typeof radius === 'string' || typeof radius === 'number') {\r\n radius = [0, radius];\r\n }\r\n this.r0 = parsePercent$2(radius[0], viewSize);\r\n this.r = parsePercent$2(radius[1], viewSize);\r\n each(this._indicatorAxes, function (indicatorAxis, idx) {\r\n indicatorAxis.setExtent(this.r0, this.r);\r\n var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);\r\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\r\n indicatorAxis.angle = angle;\r\n }, this);\r\n };\r\n Radar.prototype.update = function (ecModel, api) {\r\n var indicatorAxes = this._indicatorAxes;\r\n var radarModel = this._model;\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\r\n if (radarSeries.get('coordinateSystem') !== 'radar'\r\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\r\n return;\r\n }\r\n var data = radarSeries.getData();\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\r\n });\r\n }, this);\r\n var splitNumber = radarModel.get('splitNumber');\r\n function increaseInterval(interval) {\r\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10));\r\n var f = interval / exp10;\r\n if (f === 2) {\r\n f = 5;\r\n }\r\n else {\r\n f *= 2;\r\n }\r\n return f * exp10;\r\n }\r\n each(indicatorAxes, function (indicatorAxis, idx) {\r\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\r\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\r\n var axisModel = indicatorAxis.model;\r\n var scale = indicatorAxis.scale;\r\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\r\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\r\n var interval = scale.getInterval();\r\n if (fixedMin != null && fixedMax != null) {\r\n scale.setExtent(+fixedMin, +fixedMax);\r\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\r\n }\r\n else if (fixedMin != null) {\r\n var max = void 0;\r\n do {\r\n max = fixedMin + interval * splitNumber;\r\n scale.setExtent(+fixedMin, max);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\r\n }\r\n else if (fixedMax != null) {\r\n var min = void 0;\r\n do {\r\n min = fixedMax - interval * splitNumber;\r\n scale.setExtent(min, +fixedMax);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\r\n }\r\n else {\r\n var nicedSplitNumber = scale.getTicks().length - 1;\r\n if (nicedSplitNumber > splitNumber) {\r\n interval = increaseInterval(interval);\r\n }\r\n var max = Math.ceil(rawExtent[1] / interval) * interval;\r\n var min = round$1(max - interval * splitNumber);\r\n scale.setExtent(min, max);\r\n scale.setInterval(interval);\r\n }\r\n });\r\n };\r\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Radar.create = function (ecModel, api) {\r\n var radarList = [];\r\n ecModel.eachComponent('radar', function (radarModel) {\r\n var radar = new Radar(radarModel, ecModel, api);\r\n radarList.push(radar);\r\n radarModel.coordinateSystem = radar;\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries) {\r\n if (radarSeries.get('coordinateSystem') === 'radar') {\r\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\r\n }\r\n });\r\n return radarList;\r\n };\r\n Radar.dimensions = [];\r\n return Radar;\r\n }());\r\n CoordinateSystemManager.register('radar', Radar);\n\n var valueAxisDefault = axisDefault.value;\r\n function defaultsShow(opt, show) {\r\n return defaults({\r\n show: show\r\n }, opt);\r\n }\r\n var RadarModel = (function (_super) {\r\n __extends(RadarModel, _super);\r\n function RadarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarModel.type;\r\n return _this;\r\n }\r\n RadarModel.prototype.optionUpdated = function () {\r\n var boundaryGap = this.get('boundaryGap');\r\n var splitNumber = this.get('splitNumber');\r\n var scale = this.get('scale');\r\n var axisLine = this.get('axisLine');\r\n var axisTick = this.get('axisTick');\r\n var axisLabel = this.get('axisLabel');\r\n var nameTextStyle = this.get('axisName');\r\n var showName = this.get(['axisName', 'show']);\r\n var nameFormatter = this.get(['axisName', 'formatter']);\r\n var nameGap = this.get('axisNameGap');\r\n var triggerEvent = this.get('triggerEvent');\r\n var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) {\r\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\r\n indicatorOpt.min = 0;\r\n }\r\n else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\r\n indicatorOpt.max = 0;\r\n }\r\n var iNameTextStyle = nameTextStyle;\r\n if (indicatorOpt.color != null) {\r\n iNameTextStyle = defaults({\r\n color: indicatorOpt.color\r\n }, nameTextStyle);\r\n }\r\n var innerIndicatorOpt = merge(clone(indicatorOpt), {\r\n boundaryGap: boundaryGap,\r\n splitNumber: splitNumber,\r\n scale: scale,\r\n axisLine: axisLine,\r\n axisTick: axisTick,\r\n axisLabel: axisLabel,\r\n name: indicatorOpt.text,\r\n nameLocation: 'end',\r\n nameGap: nameGap,\r\n nameTextStyle: iNameTextStyle,\r\n triggerEvent: triggerEvent\r\n }, false);\r\n if (!showName) {\r\n innerIndicatorOpt.name = '';\r\n }\r\n if (typeof nameFormatter === 'string') {\r\n var indName = innerIndicatorOpt.name;\r\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\r\n }\r\n else if (typeof nameFormatter === 'function') {\r\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\r\n }\r\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\r\n mixin(model, AxisModelCommonMixin.prototype);\r\n model.mainType = 'radar';\r\n model.componentIndex = this.componentIndex;\r\n return model;\r\n }, this);\r\n this._indicatorModels = indicatorModels;\r\n };\r\n RadarModel.prototype.getIndicatorModels = function () {\r\n return this._indicatorModels;\r\n };\r\n RadarModel.type = 'radar';\r\n RadarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '75%',\r\n startAngle: 90,\r\n axisName: {\r\n show: true\r\n },\r\n boundaryGap: [0, 0],\r\n splitNumber: 5,\r\n axisNameGap: 15,\r\n scale: false,\r\n shape: 'polygon',\r\n axisLine: merge({\r\n lineStyle: {\r\n color: '#bbb'\r\n }\r\n }, valueAxisDefault.axisLine),\r\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\r\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\r\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\r\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\r\n indicator: []\r\n };\r\n return RadarModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(RadarModel);\n\n var axisBuilderAttrs$1 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var RadarView = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (radarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n this._buildAxes(radarModel);\r\n this._buildSplitLineAndArea(radarModel);\r\n };\r\n RadarView.prototype._buildAxes = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n var axisBuilders = map(indicatorAxes, function (indicatorAxis) {\r\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\r\n position: [radar.cx, radar.cy],\r\n rotation: indicatorAxis.angle,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1\r\n });\r\n return axisBuilder;\r\n });\r\n each(axisBuilders, function (axisBuilder) {\r\n each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder);\r\n this.group.add(axisBuilder.getGroup());\r\n }, this);\r\n };\r\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n if (!indicatorAxes.length) {\r\n return;\r\n }\r\n var shape = radarModel.get('shape');\r\n var splitLineModel = radarModel.getModel('splitLine');\r\n var splitAreaModel = radarModel.getModel('splitArea');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var showSplitLine = splitLineModel.get('show');\r\n var showSplitArea = splitAreaModel.get('show');\r\n var splitLineColors = lineStyleModel.get('color');\r\n var splitAreaColors = areaStyleModel.get('color');\r\n var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors];\r\n var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\r\n var splitLines = [];\r\n var splitAreas = [];\r\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\r\n var colorIndex = idx % areaOrLineColorList.length;\r\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\r\n return colorIndex;\r\n }\r\n if (shape === 'circle') {\r\n var ticksRadius = indicatorAxes[0].getTicksCoords();\r\n var cx = radar.cx;\r\n var cy = radar.cy;\r\n for (var i = 0; i < ticksRadius.length; i++) {\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r: ticksRadius[i].coord\r\n }\r\n }));\r\n }\r\n if (showSplitArea && i < ticksRadius.length - 1) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\r\n splitAreas[colorIndex].push(new Ring({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r0: ticksRadius[i].coord,\r\n r: ticksRadius[i + 1].coord\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n else {\r\n var realSplitNumber_1;\r\n var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) {\r\n var ticksCoords = indicatorAxis.getTicksCoords();\r\n realSplitNumber_1 = realSplitNumber_1 == null\r\n ? ticksCoords.length - 1\r\n : Math.min(ticksCoords.length - 1, realSplitNumber_1);\r\n return map(ticksCoords, function (tickCoord) {\r\n return radar.coordToPoint(tickCoord.coord, idx);\r\n });\r\n });\r\n var prevPoints = [];\r\n for (var i = 0; i <= realSplitNumber_1; i++) {\r\n var points = [];\r\n for (var j = 0; j < indicatorAxes.length; j++) {\r\n points.push(axesTicksPoints[j][i]);\r\n }\r\n if (points[0]) {\r\n points.push(points[0].slice());\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.error('Can\\'t draw value axis ' + i);\r\n }\r\n }\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n }\r\n if (showSplitArea && prevPoints) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\r\n splitAreas[colorIndex].push(new Polygon({\r\n shape: {\r\n points: points.concat(prevPoints)\r\n }\r\n }));\r\n }\r\n prevPoints = points.slice().reverse();\r\n }\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n each(splitAreas, function (splitAreas, idx) {\r\n this.group.add(mergePath$1(splitAreas, {\r\n style: defaults({\r\n stroke: 'none',\r\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\r\n }, areaStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n each(splitLines, function (splitLines, idx) {\r\n this.group.add(mergePath$1(splitLines, {\r\n style: defaults({\r\n fill: 'none',\r\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n }(ComponentView));\r\n ComponentView.registerClass(RadarView);\n\n var RadarSeriesModel = (function (_super) {\r\n __extends(RadarSeriesModel, _super);\r\n function RadarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n RadarSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n generateCoord: 'indicator_',\r\n generateCoordCount: Infinity\r\n });\r\n };\r\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n var name = this.getData().getName(dataIndex);\r\n var nameToDisplay = name === '' ? this.name : name;\r\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: nameToDisplay,\r\n sortBlocks: true,\r\n blocks: map(indicatorAxes, function (axis) {\r\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\r\n return createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: markerColor,\r\n name: axis.name,\r\n value: val,\r\n sortParam: val\r\n });\r\n })\r\n });\r\n };\r\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var data_1 = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var values = data_1.getValues(map(coordSys.dimensions, function (dim) {\r\n return data_1.mapDimension(dim);\r\n }), dataIndex);\r\n for (var i = 0, len = values.length; i < len; i++) {\r\n if (!isNaN(values[i])) {\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\r\n }\r\n }\r\n }\r\n };\r\n RadarSeriesModel.type = 'series.radar';\r\n RadarSeriesModel.dependencies = ['radar'];\r\n RadarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'radar',\r\n legendHoverLink: true,\r\n radarIndex: 0,\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n label: {\r\n position: 'top'\r\n },\r\n symbol: 'emptyCircle',\r\n symbolSize: 4\r\n };\r\n return RadarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(RadarSeriesModel);\n\n function normalizeSymbolSize(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n }\r\n var RadarView$1 = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var polar = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n function createSymbol$1(data, idx) {\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n if (symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2);\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\r\n symbolPath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 100,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2,\r\n rotation: symbolRotate * Math.PI / 180 || 0\r\n });\r\n return symbolPath;\r\n }\r\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\r\n symbolGroup.removeAll();\r\n for (var i = 0; i < newPoints.length - 1; i++) {\r\n var symbolPath = createSymbol$1(data, idx);\r\n if (symbolPath) {\r\n symbolPath.__dimIdx = i;\r\n if (oldPoints[i]) {\r\n symbolPath.setPosition(oldPoints[i]);\r\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\r\n x: newPoints[i][0],\r\n y: newPoints[i][1]\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n symbolPath.setPosition(newPoints[i]);\r\n }\r\n symbolGroup.add(symbolPath);\r\n }\r\n }\r\n }\r\n function getInitialPoints(points) {\r\n return map(points, function (pt) {\r\n return [polar.cx, polar.cy];\r\n });\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var points = data.getItemLayout(idx);\r\n if (!points) {\r\n return;\r\n }\r\n var polygon = new Polygon();\r\n var polyline = new Polyline();\r\n var target = {\r\n shape: {\r\n points: points\r\n }\r\n };\r\n polygon.shape.points = getInitialPoints(points);\r\n polyline.shape.points = getInitialPoints(points);\r\n initProps(polygon, target, seriesModel, idx);\r\n initProps(polyline, target, seriesModel, idx);\r\n var itemGroup = new Group();\r\n var symbolGroup = new Group();\r\n itemGroup.add(polyline);\r\n itemGroup.add(polygon);\r\n itemGroup.add(symbolGroup);\r\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\r\n data.setItemGraphicEl(idx, itemGroup);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var target = {\r\n shape: {\r\n points: data.getItemLayout(newIdx)\r\n }\r\n };\r\n if (!target.shape.points) {\r\n return;\r\n }\r\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\r\n updateProps(polyline, target, seriesModel);\r\n updateProps(polygon, target, seriesModel);\r\n data.setItemGraphicEl(newIdx, itemGroup);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n data.eachItemGraphicEl(function (itemGroup, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var itemStyle = data.getItemVisual(idx, 'style');\r\n var color = itemStyle.fill;\r\n group.add(itemGroup);\r\n polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), {\r\n fill: 'none',\r\n stroke: color\r\n }));\r\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\r\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\r\n var areaStyleModel = itemModel.getModel('areaStyle');\r\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\r\n polygon.ignore = polygonIgnore;\r\n each(['emphasis', 'select', 'blur'], function (stateName) {\r\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\r\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\r\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\r\n });\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: color,\r\n opacity: 0.7,\r\n decal: itemStyle.decal\r\n }));\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n symbolGroup.eachChild(function (symbolPath) {\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, itemStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(itemStyle);\r\n symbolPath.setColor(color);\r\n }\r\n var pathEmphasisState = symbolPath.ensureState('emphasis');\r\n pathEmphasisState.style = clone(itemHoverStyle);\r\n var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);\r\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\r\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n labelDimIndex: symbolPath.__dimIdx,\r\n defaultText: defaultText,\r\n inheritColor: color,\r\n defaultOpacity: itemStyle.opacity\r\n });\r\n });\r\n enableHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n });\r\n this._data = data;\r\n };\r\n RadarView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n }(ChartView));\r\n ChartView.registerClass(RadarView$1);\n\n function radarLayout(ecModel) {\r\n ecModel.eachSeriesByType('radar', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var axes = coordSys.getIndicatorAxes();\r\n each(axes, function (axis, axisIndex) {\r\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\r\n points[dataIndex] = points[dataIndex] || [];\r\n var point = coordSys.dataToPoint(val, axisIndex);\r\n points[dataIndex][axisIndex] = isValidPoint(point)\r\n ? point : getValueMissingPoint(coordSys);\r\n });\r\n });\r\n data.each(function (idx) {\r\n var firstPoint = find(points[idx], function (point) {\r\n return isValidPoint(point);\r\n }) || getValueMissingPoint(coordSys);\r\n points[idx].push(firstPoint.slice());\r\n data.setItemLayout(idx, points[idx]);\r\n });\r\n });\r\n }\r\n function isValidPoint(point) {\r\n return !isNaN(point[0]) && !isNaN(point[1]);\r\n }\r\n function getValueMissingPoint(coordSys) {\r\n return [coordSys.cx, coordSys.cy];\r\n }\n\n function radarBackwardCompat(option) {\r\n var polarOptArr = option.polar;\r\n if (polarOptArr) {\r\n if (!isArray(polarOptArr)) {\r\n polarOptArr = [polarOptArr];\r\n }\r\n var polarNotRadar_1 = [];\r\n each(polarOptArr, function (polarOpt, idx) {\r\n if (polarOpt.indicator) {\r\n if (polarOpt.type && !polarOpt.shape) {\r\n polarOpt.shape = polarOpt.type;\r\n }\r\n option.radar = option.radar || [];\r\n if (!isArray(option.radar)) {\r\n option.radar = [option.radar];\r\n }\r\n option.radar.push(polarOpt);\r\n }\r\n else {\r\n polarNotRadar_1.push(polarOpt);\r\n }\r\n });\r\n option.polar = polarNotRadar_1;\r\n }\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\r\n seriesOpt.radarIndex = seriesOpt.polarIndex;\r\n }\r\n });\r\n }\n\n registerLayout(radarLayout);\r\n registerProcessor(dataFilter('radar'));\r\n registerPreprocessor(radarBackwardCompat);\n\n var geoCoord = [126, 25];\r\n var points$1 = [\r\n [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7],\r\n [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]],\r\n [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]],\r\n [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]],\r\n [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]],\r\n [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]],\r\n [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]],\r\n [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]],\r\n [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]],\r\n [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]],\r\n [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]],\r\n [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]],\r\n [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4],\r\n [1, 92.4], [1, 3.5], [0, 3.5]]\r\n ];\r\n for (var i = 0; i < points$1.length; i++) {\r\n for (var k = 0; k < points$1[i].length; k++) {\r\n points$1[i][k][0] /= 10.5;\r\n points$1[i][k][1] /= -10.5 / 0.75;\r\n points$1[i][k][0] += geoCoord[0];\r\n points$1[i][k][1] += geoCoord[1];\r\n }\r\n }\r\n function fixNanhai(mapType, regions) {\r\n if (mapType === 'china') {\r\n regions.push(new Region('南海诸岛', map(points$1, function (exterior) {\r\n return {\r\n type: 'polygon',\r\n exterior: exterior\r\n };\r\n }), geoCoord));\r\n }\r\n }\n\n var coordsOffsetMap = {\r\n '南海诸岛': [32, 80],\r\n '广东': [0, -10],\r\n '香港': [10, 5],\r\n '澳门': [-10, 10],\r\n '天津': [5, 5]\r\n };\r\n function fixTextCoords(mapType, region) {\r\n if (mapType === 'china') {\r\n var coordFix = coordsOffsetMap[region.name];\r\n if (coordFix) {\r\n var cp = region.center;\r\n cp[0] += coordFix[0] / 10.5;\r\n cp[1] += -coordFix[1] / (10.5 / 0.75);\r\n }\r\n }\r\n }\n\n var geoCoordMap = {\r\n 'Russia': [100, 60],\r\n 'United States': [-99, 38],\r\n 'United States of America': [-99, 38]\r\n };\r\n function fixGeoCoords(mapType, region) {\r\n if (mapType === 'world') {\r\n var geoCoord = geoCoordMap[region.name];\r\n if (geoCoord) {\r\n var cp = region.center;\r\n cp[0] = geoCoord[0];\r\n cp[1] = geoCoord[1];\r\n }\r\n }\r\n }\n\n var points$2 = [\r\n [\r\n [123.45165252685547, 25.73527164402261],\r\n [123.49731445312499, 25.73527164402261],\r\n [123.49731445312499, 25.750734064600884],\r\n [123.45165252685547, 25.750734064600884],\r\n [123.45165252685547, 25.73527164402261]\r\n ]\r\n ];\r\n function fixDiaoyuIsland(mapType, region) {\r\n if (mapType === 'china' && region.name === '台湾') {\r\n region.geometries.push({\r\n type: 'polygon',\r\n exterior: points$2[0]\r\n });\r\n }\r\n }\n\n var inner$6 = makeInner();\r\n var geoJSONLoader = {\r\n load: function (mapName, mapRecord, nameProperty) {\r\n var parsed = inner$6(mapRecord).parsed;\r\n if (parsed) {\r\n return parsed;\r\n }\r\n var specialAreas = mapRecord.specialAreas || {};\r\n var geoJSON = mapRecord.geoJSON;\r\n var regions;\r\n try {\r\n regions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];\r\n }\r\n catch (e) {\r\n throw new Error('Invalid geoJson format\\n' + e.message);\r\n }\r\n fixNanhai(mapName, regions);\r\n each(regions, function (region) {\r\n var regionName = region.name;\r\n fixTextCoords(mapName, region);\r\n fixGeoCoords(mapName, region);\r\n fixDiaoyuIsland(mapName, region);\r\n var specialArea = specialAreas[regionName];\r\n if (specialArea) {\r\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\r\n }\r\n });\r\n return (inner$6(mapRecord).parsed = {\r\n regions: regions,\r\n boundingRect: getBoundingRect$1(regions)\r\n });\r\n }\r\n };\r\n function getBoundingRect$1(regions) {\r\n var rect;\r\n for (var i = 0; i < regions.length; i++) {\r\n var regionRect = regions[i].getBoundingRect();\r\n rect = rect || regionRect.clone();\r\n rect.union(regionRect);\r\n }\r\n return rect;\r\n }\n\n var inner$7 = makeInner();\r\n var geoSVGLoader = {\r\n load: function (mapName, mapRecord) {\r\n var originRoot = inner$7(mapRecord).originRoot;\r\n if (originRoot) {\r\n return {\r\n root: originRoot,\r\n boundingRect: inner$7(mapRecord).boundingRect\r\n };\r\n }\r\n var graphic = buildGraphic(mapRecord);\r\n inner$7(mapRecord).originRoot = graphic.root;\r\n inner$7(mapRecord).boundingRect = graphic.boundingRect;\r\n return graphic;\r\n },\r\n makeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap || (field.rootMap = createHashMap());\r\n var root = rootMap.get(hostKey);\r\n if (root) {\r\n return root;\r\n }\r\n var originRoot = field.originRoot;\r\n var boundingRect = field.boundingRect;\r\n if (!field.originRootHostKey) {\r\n field.originRootHostKey = hostKey;\r\n root = originRoot;\r\n }\r\n else {\r\n root = buildGraphic(mapRecord, boundingRect).root;\r\n }\r\n return rootMap.set(hostKey, root);\r\n },\r\n removeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap;\r\n rootMap && rootMap.removeKey(hostKey);\r\n if (hostKey === field.originRootHostKey) {\r\n field.originRootHostKey = null;\r\n }\r\n }\r\n };\r\n function buildGraphic(mapRecord, boundingRect) {\r\n var svgXML = mapRecord.svgXML;\r\n var result;\r\n var root;\r\n try {\r\n result = svgXML && parseSVG(svgXML, {\r\n ignoreViewBox: true,\r\n ignoreRootClip: true\r\n }) || {};\r\n root = result.root;\r\n assert(root != null);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid svg format\\n' + e.message);\r\n }\r\n var svgWidth = result.width;\r\n var svgHeight = result.height;\r\n var viewBoxRect = result.viewBoxRect;\r\n if (!boundingRect) {\r\n boundingRect = (svgWidth == null || svgHeight == null)\r\n ? root.getBoundingRect()\r\n : new BoundingRect(0, 0, 0, 0);\r\n if (svgWidth != null) {\r\n boundingRect.width = svgWidth;\r\n }\r\n if (svgHeight != null) {\r\n boundingRect.height = svgHeight;\r\n }\r\n }\r\n if (viewBoxRect) {\r\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height);\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n root.setClipPath(new Rect({\r\n shape: boundingRect.plain()\r\n }));\r\n return {\r\n root: root,\r\n boundingRect: boundingRect\r\n };\r\n }\n\n var loaders = {\r\n geoJSON: geoJSONLoader,\r\n svg: geoSVGLoader\r\n };\r\n var geoSourceManager = {\r\n load: function (mapName, nameMap, nameProperty) {\r\n var regions = [];\r\n var regionsMap = createHashMap();\r\n var nameCoordMap = createHashMap();\r\n var boundingRect;\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var singleSource = loaders[record.type].load(mapName, record, nameProperty);\r\n each(singleSource.regions, function (region) {\r\n var regionName = region.name;\r\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\r\n region = region.cloneShallow(regionName = nameMap[regionName]);\r\n }\r\n regions.push(region);\r\n regionsMap.set(regionName, region);\r\n nameCoordMap.set(regionName, region.center);\r\n });\r\n var rect = singleSource.boundingRect;\r\n if (rect) {\r\n boundingRect\r\n ? boundingRect.union(rect)\r\n : (boundingRect = rect.clone());\r\n }\r\n });\r\n return {\r\n regions: regions,\r\n regionsMap: regionsMap,\r\n nameCoordMap: nameCoordMap,\r\n boundingRect: boundingRect || new BoundingRect(0, 0, 0, 0)\r\n };\r\n },\r\n makeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n var results = [];\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && results.push(method(mapName, record, hostKey));\r\n });\r\n return results;\r\n },\r\n removeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && method(mapName, record, hostKey);\r\n });\r\n }\r\n };\r\n function mapNotExistsError(mapName) {\r\n if (__DEV__) {\r\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\r\n }\r\n }\r\n function retrieveMap(mapName) {\r\n var mapRecords = mapDataStorage.retrieveMap(mapName) || [];\r\n if (__DEV__) {\r\n if (!mapRecords.length) {\r\n mapNotExistsError(mapName);\r\n }\r\n }\r\n return mapRecords;\r\n }\n\n var MapSeries = (function (_super) {\r\n __extends(MapSeries, _super);\r\n function MapSeries() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapSeries.type;\r\n _this.needsDrawMap = false;\r\n _this.seriesGroup = [];\r\n _this.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var name_1 = this.getData().getName(dataIndex);\r\n var geo = this.coordinateSystem;\r\n var region = geo.getRegion(name_1);\r\n return region && geo.dataToPoint(region.center);\r\n }\r\n };\r\n return _this;\r\n }\r\n MapSeries.prototype.getInitialData = function (option) {\r\n var data = createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n var dataNameMap = createHashMap();\r\n var toAppendNames = [];\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n var name_2 = data.getName(i);\r\n dataNameMap.set(name_2, true);\r\n }\r\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\r\n each(geoSource.regions, function (region) {\r\n var name = region.name;\r\n if (!dataNameMap.get(name)) {\r\n toAppendNames.push(name);\r\n }\r\n });\r\n data.appendValues([], toAppendNames);\r\n return data;\r\n };\r\n MapSeries.prototype.getHostGeoModel = function () {\r\n var geoIndex = this.option.geoIndex;\r\n return geoIndex != null\r\n ? this.ecModel.getComponent('geo', geoIndex)\r\n : null;\r\n };\r\n MapSeries.prototype.getMapType = function () {\r\n return (this.getHostGeoModel() || this).option.map;\r\n };\r\n MapSeries.prototype.getRawValue = function (dataIndex) {\r\n var data = this.getData();\r\n return data.get(data.mapDimension('value'), dataIndex);\r\n };\r\n MapSeries.prototype.getRegionModel = function (regionName) {\r\n var data = this.getData();\r\n return data.getItemModel(data.indexOfName(regionName));\r\n };\r\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var seriesGroup = this.seriesGroup;\r\n var seriesNames = [];\r\n for (var i = 0; i < seriesGroup.length; i++) {\r\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\r\n var valueDim = data.mapDimension('value');\r\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\r\n seriesNames.push(seriesGroup[i].name);\r\n }\r\n }\r\n return createTooltipMarkup('section', {\r\n header: seriesNames.join(', '),\r\n noHeader: !seriesNames.length,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: name, value: value\r\n })]\r\n });\r\n };\r\n MapSeries.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n MapSeries.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n MapSeries.type = 'series.map';\r\n MapSeries.dependencies = ['geo'];\r\n MapSeries.layoutMode = 'box';\r\n MapSeries.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'geo',\r\n map: '',\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: 0.75,\r\n showLegendSymbol: true,\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n selectedMode: true,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n areaColor: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n areaColor: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n nameProperty: 'name'\r\n };\r\n return MapSeries;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(MapSeries);\n\n var ATTR = '\\0_ec_interaction_mutex';\r\n function take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n }\r\n function release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n }\r\n function isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n }\r\n function getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n }\r\n registerAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\n var RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n }(Eventful));\r\n function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n }\r\n function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n }\r\n function isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n }\n\n function updateViewOnPan(controllerHost, dx, dy) {\r\n var target = controllerHost.target;\r\n target.x += dx;\r\n target.y += dy;\r\n target.dirty();\r\n }\r\n function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\r\n var target = controllerHost.target;\r\n var zoomLimit = controllerHost.zoomLimit;\r\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\r\n }\r\n var zoomScale = newZoom / controllerHost.zoom;\r\n controllerHost.zoom = newZoom;\r\n target.x -= (zoomX - target.x) * (zoomScale - 1);\r\n target.y -= (zoomY - target.y) * (zoomScale - 1);\r\n target.scaleX *= zoomScale;\r\n target.scaleY *= zoomScale;\r\n target.dirty();\r\n }\n\n var IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\n function onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n }\n\n function getFixedItemStyle(model) {\r\n var itemStyle = model.getItemStyle();\r\n var areaColor = model.get('areaColor');\r\n if (areaColor != null) {\r\n itemStyle.fill = areaColor;\r\n }\r\n return itemStyle;\r\n }\r\n var MapDraw = (function () {\r\n function MapDraw(api) {\r\n var group = new Group();\r\n this.uid = getUID('ec_map_draw');\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = { target: group };\r\n this.group = group;\r\n group.add(this._regionsGroup = new Group());\r\n group.add(this._backgroundGroup = new Group());\r\n }\r\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\r\n var isGeo = mapOrGeoModel.mainType === 'geo';\r\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\r\n isGeo && ecModel.eachComponent({ mainType: 'series', subType: 'map' }, function (mapSeries) {\r\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\r\n data = mapSeries.getData();\r\n }\r\n });\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n this._updateBackground(geo);\r\n var regionsGroup = this._regionsGroup;\r\n var group = this.group;\r\n var transformInfo = geo.getTransformInfo();\r\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\r\n var targetScaleX;\r\n var targetScaleY;\r\n if (isFirstDraw) {\r\n group.transform = transformInfo.roamTransform;\r\n group.decomposeTransform();\r\n group.dirty();\r\n }\r\n else {\r\n var target = new Transformable();\r\n target.transform = transformInfo.roamTransform;\r\n target.decomposeTransform();\r\n var props = {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n x: target.x,\r\n y: target.y\r\n };\r\n targetScaleX = target.scaleX;\r\n targetScaleY = target.scaleY;\r\n updateProps(group, props, mapOrGeoModel);\r\n }\r\n regionsGroup.removeAll();\r\n var nameMap = createHashMap();\r\n var isVisualEncodedByVisualMap = data\r\n && data.getVisual('visualMeta')\r\n && data.getVisual('visualMeta').length > 0;\r\n each(geo.regions, function (region) {\r\n var regionGroup = nameMap.get(region.name)\r\n || nameMap.set(region.name, new Group());\r\n var compoundPath = new CompoundPath({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n paths: []\r\n }\r\n });\r\n regionGroup.add(compoundPath);\r\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\r\n var itemStyleModel = regionModel.getModel('itemStyle');\r\n var emphasisModel = regionModel.getModel('emphasis');\r\n var emphasisItemStyleModel = emphasisModel.getModel('itemStyle');\r\n var blurItemStyleModel = regionModel.getModel(['blur', 'itemStyle']);\r\n var selectItemStyleModel = regionModel.getModel(['select', 'itemStyle']);\r\n var itemStyle = getFixedItemStyle(itemStyleModel);\r\n var emphasisItemStyle = getFixedItemStyle(emphasisItemStyleModel);\r\n var blurItemStyle = getFixedItemStyle(blurItemStyleModel);\r\n var selectItemStyle = getFixedItemStyle(selectItemStyleModel);\r\n var dataIdx;\r\n if (data) {\r\n dataIdx = data.indexOfName(region.name);\r\n var style = data.getItemVisual(dataIdx, 'style');\r\n var decal = data.getItemVisual(dataIdx, 'decal');\r\n if (isVisualEncodedByVisualMap && style.fill) {\r\n itemStyle.fill = style.fill;\r\n }\r\n if (decal) {\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n }\r\n var sx = transformInfo.rawScaleX;\r\n var sy = transformInfo.rawScaleY;\r\n var offsetX = transformInfo.rawX;\r\n var offsetY = transformInfo.rawY;\r\n var transformPoint = function (point) {\r\n return [\r\n point[0] * sx + offsetX,\r\n point[1] * sy + offsetY\r\n ];\r\n };\r\n each(region.geometries, function (geometry) {\r\n if (geometry.type !== 'polygon') {\r\n return;\r\n }\r\n var points = [];\r\n for (var i = 0; i < geometry.exterior.length; ++i) {\r\n points.push(transformPoint(geometry.exterior[i]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\r\n var interior = geometry.interiors[i];\r\n var points_1 = [];\r\n for (var j = 0; j < interior.length; ++j) {\r\n points_1.push(transformPoint(interior[j]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points_1\r\n }\r\n }));\r\n }\r\n });\r\n compoundPath.setStyle(itemStyle);\r\n compoundPath.style.strokeNoScale = true;\r\n compoundPath.culling = true;\r\n compoundPath.ensureState('emphasis').style = emphasisItemStyle;\r\n compoundPath.ensureState('blur').style = blurItemStyle;\r\n compoundPath.ensureState('select').style = selectItemStyle;\r\n var showLabel = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n if (regionModel.get(stateName === 'normal' ? ['label', 'show'] : [stateName, 'label', 'show'])) {\r\n showLabel = true;\r\n break;\r\n }\r\n }\r\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\r\n var itemLayout = data && data.getItemLayout(dataIdx);\r\n if ((isGeo || isDataNaN && (showLabel))\r\n || (itemLayout && itemLayout.showLabel)) {\r\n var query = !isGeo ? dataIdx : region.name;\r\n var labelFetcher = void 0;\r\n if (!data || dataIdx >= 0) {\r\n labelFetcher = mapOrGeoModel;\r\n }\r\n var centerPt = transformPoint(region.center);\r\n var textEl = new ZRText({\r\n x: centerPt[0],\r\n y: centerPt[1],\r\n scaleX: 1 / group.scaleX,\r\n scaleY: 1 / group.scaleY,\r\n z2: 10,\r\n silent: true\r\n });\r\n setLabelStyle(textEl, getLabelStatesModels(regionModel), {\r\n labelFetcher: labelFetcher,\r\n labelDataIndex: query,\r\n defaultText: region.name\r\n }, { normal: {\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n } });\r\n compoundPath.setTextContent(textEl);\r\n compoundPath.setTextConfig({\r\n local: true\r\n });\r\n compoundPath.disableLabelAnimation = true;\r\n if (!isFirstDraw) {\r\n updateProps(textEl, {\r\n scaleX: 1 / targetScaleX,\r\n scaleY: 1 / targetScaleY\r\n }, mapOrGeoModel);\r\n }\r\n }\r\n if (data) {\r\n data.setItemGraphicEl(dataIdx, regionGroup);\r\n }\r\n else {\r\n var regionModel_1 = mapOrGeoModel.getRegionModel(region.name);\r\n getECData(compoundPath).eventData = {\r\n componentType: 'geo',\r\n componentIndex: mapOrGeoModel.componentIndex,\r\n geoIndex: mapOrGeoModel.componentIndex,\r\n name: region.name,\r\n region: (regionModel_1 && regionModel_1.option) || {}\r\n };\r\n }\r\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\r\n groupRegions.push(region);\r\n regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\r\n enableHoverEmphasis(regionGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n regionsGroup.add(regionGroup);\r\n });\r\n this._updateController(mapOrGeoModel, ecModel, api);\r\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\r\n };\r\n MapDraw.prototype.remove = function () {\r\n this._regionsGroup.removeAll();\r\n this._backgroundGroup.removeAll();\r\n this._controller.dispose();\r\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\r\n this._mapName = null;\r\n this._controllerHost = null;\r\n };\r\n MapDraw.prototype._updateBackground = function (geo) {\r\n var mapName = geo.map;\r\n if (this._mapName !== mapName) {\r\n each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\r\n this._backgroundGroup.add(root);\r\n }, this);\r\n }\r\n this._mapName = mapName;\r\n };\r\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\r\n controllerHost.zoom = geo.getZoom();\r\n controller.enable(mapOrGeoModel.get('roam') || false);\r\n var mainType = mapOrGeoModel.mainType;\r\n function makeActionBase() {\r\n var action = {\r\n type: 'geoRoam',\r\n componentType: mainType\r\n };\r\n action[mainType + 'Id'] = mapOrGeoModel.id;\r\n return action;\r\n }\r\n controller.off('pan').on('pan', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n dx: e.dx,\r\n dy: e.dy\r\n }));\r\n }, this);\r\n controller.off('zoom').on('zoom', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n }));\r\n var group = this.group;\r\n this._regionsGroup.traverse(function (el) {\r\n var textContent = el.getTextContent();\r\n if (textContent) {\r\n textContent.scaleX = 1 / group.scaleX;\r\n textContent.scaleY = 1 / group.scaleY;\r\n textContent.markRedraw();\r\n }\r\n });\r\n }, this);\r\n controller.setPointerChecker(function (e, x, y) {\r\n return geo.getViewRectAfterRoam().contain(x, y)\r\n && !onIrrelevantElement(e, api, mapOrGeoModel);\r\n });\r\n };\r\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\r\n var mapDraw = this;\r\n regionsGroup.off('mousedown');\r\n if (mapOrGeoModel.get('selectedMode')) {\r\n regionsGroup.on('mousedown', function () {\r\n mapDraw._mouseDownFlag = true;\r\n });\r\n regionsGroup.on('click', function (e) {\r\n if (!mapDraw._mouseDownFlag) {\r\n return;\r\n }\r\n mapDraw._mouseDownFlag = false;\r\n });\r\n }\r\n };\r\n return MapDraw;\r\n }());\n\n var MapView = (function (_super) {\r\n __extends(MapView, _super);\r\n function MapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapView.type;\r\n return _this;\r\n }\r\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\r\n if (payload && payload.type === 'mapToggleSelect'\r\n && payload.from === this.uid) {\r\n return;\r\n }\r\n var group = this.group;\r\n group.removeAll();\r\n if (mapModel.getHostGeoModel()) {\r\n return;\r\n }\r\n if (!(payload && payload.type === 'geoRoam'\r\n && payload.componentType === 'series'\r\n && payload.seriesId === mapModel.id)) {\r\n if (mapModel.needsDrawMap) {\r\n var mapDraw = this._mapDraw || new MapDraw(api);\r\n group.add(mapDraw.group);\r\n mapDraw.draw(mapModel, ecModel, api, this, payload);\r\n this._mapDraw = mapDraw;\r\n }\r\n else {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n }\r\n else {\r\n var mapDraw = this._mapDraw;\r\n mapDraw && group.add(mapDraw.group);\r\n }\r\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')\r\n && this._renderSymbols(mapModel, ecModel, api);\r\n };\r\n MapView.prototype.remove = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n this.group.removeAll();\r\n };\r\n MapView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n };\r\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\r\n var originalData = mapModel.originalData;\r\n var group = this.group;\r\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n var layout = originalData.getItemLayout(originalDataIndex);\r\n if (!layout || !layout.point) {\r\n return;\r\n }\r\n var point = layout.point;\r\n var offset = layout.offset;\r\n var circle = new Circle({\r\n style: {\r\n fill: mapModel.getData().getVisual('style').fill\r\n },\r\n shape: {\r\n cx: point[0] + offset * 9,\r\n cy: point[1],\r\n r: 3\r\n },\r\n silent: true,\r\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\r\n });\r\n if (!offset) {\r\n var fullData = mapModel.mainSeries.getData();\r\n var name_1 = originalData.getName(originalDataIndex);\r\n var fullIndex_1 = fullData.indexOfName(name_1);\r\n var itemModel = originalData.getItemModel(originalDataIndex);\r\n var labelModel = itemModel.getModel('label');\r\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\r\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\r\n labelFetcher: {\r\n getFormattedLabel: function (idx, state) {\r\n return mapModel.getFormattedLabel(fullIndex_1, state);\r\n }\r\n }\r\n });\r\n circle.disableLabelAnimation = true;\r\n if (!labelModel.get('position')) {\r\n circle.setTextConfig({\r\n position: 'bottom'\r\n });\r\n }\r\n regionGroup.onHoverStateChange = function (toState) {\r\n circle.useState(toState);\r\n };\r\n }\r\n group.add(circle);\r\n });\r\n };\r\n MapView.type = 'map';\r\n return MapView;\r\n }(ChartView));\r\n ChartView.registerClass(MapView);\n\n function updateCenterAndZoom(view, payload, zoomLimit) {\r\n var previousZoom = view.getZoom();\r\n var center = view.getCenter();\r\n var zoom = payload.zoom;\r\n var point = view.dataToPoint(center);\r\n if (payload.dx != null && payload.dy != null) {\r\n point[0] -= payload.dx;\r\n point[1] -= payload.dy;\r\n view.setCenter(view.pointToData(point));\r\n }\r\n if (zoom != null) {\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\r\n }\r\n view.scaleX *= zoom;\r\n view.scaleY *= zoom;\r\n var fixX = (payload.originX - view.x) * (zoom - 1);\r\n var fixY = (payload.originY - view.y) * (zoom - 1);\r\n view.x -= fixX;\r\n view.y -= fixY;\r\n view.updateTransform();\r\n view.setCenter(view.pointToData(point));\r\n view.setZoom(zoom * previousZoom);\r\n }\r\n return {\r\n center: view.getCenter(),\r\n zoom: view.getZoom()\r\n };\r\n }\n\n registerAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n var geo = componentModel.coordinateSystem;\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\r\n componentModel.setCenter\r\n && componentModel.setCenter(res.center);\r\n componentModel.setZoom\r\n && componentModel.setZoom(res.zoom);\r\n if (componentType === 'series') {\r\n each(componentModel.seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n });\r\n });\n\n var v2ApplyTransform = applyTransform;\r\n var View = (function (_super) {\r\n __extends(View, _super);\r\n function View(name) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'view';\r\n _this.dimensions = ['x', 'y'];\r\n _this._roamTransformable = new Transformable();\r\n _this._rawTransformable = new Transformable();\r\n _this.name = name;\r\n return _this;\r\n }\r\n View.prototype.setBoundingRect = function (x, y, width, height) {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n };\r\n View.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n View.prototype.setViewRect = function (x, y, width, height) {\r\n this.transformTo(x, y, width, height);\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n };\r\n View.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var rawTransform = this._rawTransformable;\r\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransform.decomposeTransform();\r\n this._updateTransform();\r\n };\r\n View.prototype.setCenter = function (centerCoord) {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n this._center = centerCoord;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.setZoom = function (zoom) {\r\n zoom = zoom || 1;\r\n var zoomLimit = this.zoomLimit;\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n this._zoom = zoom;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.getDefaultCenter = function () {\r\n var rawRect = this.getBoundingRect();\r\n var cx = rawRect.x + rawRect.width / 2;\r\n var cy = rawRect.y + rawRect.height / 2;\r\n return [cx, cy];\r\n };\r\n View.prototype.getCenter = function () {\r\n return this._center || this.getDefaultCenter();\r\n };\r\n View.prototype.getZoom = function () {\r\n return this._zoom || 1;\r\n };\r\n View.prototype.getRoamTransform = function () {\r\n return this._roamTransformable.getLocalTransform();\r\n };\r\n View.prototype._updateCenterAndZoom = function () {\r\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n var roamTransform = this._roamTransformable;\r\n var defaultCenter = this.getDefaultCenter();\r\n var center = this.getCenter();\r\n var zoom = this.getZoom();\r\n center = applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix);\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n this._updateTransform();\r\n };\r\n View.prototype._updateTransform = function () {\r\n var roamTransformable = this._roamTransformable;\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1());\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n this.invTransform = this.invTransform || [];\r\n invert(this.invTransform, this.transform);\r\n this.decomposeTransform();\r\n };\r\n View.prototype.getTransformInfo = function () {\r\n var roamTransform = this._roamTransformable.transform;\r\n var rawTransformable = this._rawTransformable;\r\n return {\r\n roamTransform: roamTransform ? slice(roamTransform) : create$1(),\r\n rawScaleX: rawTransformable.scaleX,\r\n rawScaleY: rawTransformable.scaleY,\r\n rawX: rawTransformable.x,\r\n rawY: rawTransformable.y\r\n };\r\n };\r\n View.prototype.getViewRect = function () {\r\n return this._viewRect;\r\n };\r\n View.prototype.getViewRectAfterRoam = function () {\r\n var rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n };\r\n View.prototype.dataToPoint = function (data, noRoam, out) {\r\n var transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform\r\n ? v2ApplyTransform(out, data, transform)\r\n : copy(out, data);\r\n };\r\n View.prototype.pointToData = function (point) {\r\n var invTransform = this.invTransform;\r\n return invTransform\r\n ? v2ApplyTransform([], point, invTransform)\r\n : [point[0], point[1]];\r\n };\r\n View.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n View.prototype.containPoint = function (point) {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n };\r\n View.dimensions = ['x', 'y'];\r\n return View;\r\n }(Transformable));\r\n function getCoordSys(finder) {\r\n var seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem : null;\r\n }\n\n var Geo = (function (_super) {\r\n __extends(Geo, _super);\r\n function Geo(name, map, nameMap, invertLongitute) {\r\n var _this = _super.call(this, name) || this;\r\n _this.dimensions = ['lng', 'lat'];\r\n _this.type = 'geo';\r\n _this.map = map;\r\n var source = geoSourceManager.load(map, nameMap);\r\n _this._nameCoordMap = source.nameCoordMap;\r\n _this._regionsMap = source.regionsMap;\r\n _this._invertLongitute = invertLongitute == null ? true : invertLongitute;\r\n _this.regions = source.regions;\r\n _this._rect = source.boundingRect;\r\n return _this;\r\n }\r\n Geo.prototype.containCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Geo.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var invertLongitute = this._invertLongitute;\r\n rect = rect.clone();\r\n if (invertLongitute) {\r\n rect.y = -rect.y - rect.height;\r\n }\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransformable.decomposeTransform();\r\n if (invertLongitute) {\r\n rawTransformable.scaleY = -rawTransformable.scaleY;\r\n }\r\n rawTransformable.updateTransform();\r\n this._updateTransform();\r\n };\r\n Geo.prototype.getRegion = function (name) {\r\n return this._regionsMap.get(name);\r\n };\r\n Geo.prototype.getRegionByCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return regions[i];\r\n }\r\n }\r\n };\r\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\r\n this._nameCoordMap.set(name, geoCoord);\r\n };\r\n Geo.prototype.getGeoCoord = function (name) {\r\n return this._nameCoordMap.get(name);\r\n };\r\n Geo.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\r\n if (typeof data === 'string') {\r\n data = this.getGeoCoord(data);\r\n }\r\n if (data) {\r\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\r\n }\r\n };\r\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n return Geo;\r\n }(View));\r\n mixin(Geo, View);\r\n function getCoordSys$1(finder) {\r\n var geoModel = finder.geoModel;\r\n var seriesModel = finder.seriesModel;\r\n return geoModel\r\n ? geoModel.coordinateSystem\r\n : seriesModel\r\n ? (seriesModel.coordinateSystem\r\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem)\r\n : null;\r\n }\n\n function resizeGeo(geoModel, api) {\r\n var boundingCoords = geoModel.get('boundingCoords');\r\n if (boundingCoords != null) {\r\n var leftTop = boundingCoords[0];\r\n var rightBottom = boundingCoords[1];\r\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\r\n if (__DEV__) {\r\n console.error('Invalid boundingCoords');\r\n }\r\n }\r\n else {\r\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\r\n }\r\n }\r\n var rect = this.getBoundingRect();\r\n var centerOption = geoModel.get('layoutCenter');\r\n var sizeOption = geoModel.get('layoutSize');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var aspect = rect.width / rect.height * this.aspectScale;\r\n var useCenterAndSize = false;\r\n var center;\r\n var size;\r\n if (centerOption && sizeOption) {\r\n center = [\r\n parsePercent$2(centerOption[0], viewWidth),\r\n parsePercent$2(centerOption[1], viewHeight)\r\n ];\r\n size = parsePercent$2(sizeOption, Math.min(viewWidth, viewHeight));\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n var viewRect;\r\n if (useCenterAndSize) {\r\n viewRect = {};\r\n if (aspect > 1) {\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n }\r\n else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n }\r\n else {\r\n var boxLayoutOption = geoModel.getBoxLayoutParams();\r\n boxLayoutOption.aspect = aspect;\r\n viewRect = getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n this.setCenter(geoModel.get('center'));\r\n this.setZoom(geoModel.get('zoom'));\r\n }\r\n function setGeoCoords(geo, model) {\r\n each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n }\r\n var GeoCreator = (function () {\r\n function GeoCreator() {\r\n this.dimensions = Geo.prototype.dimensions;\r\n }\r\n GeoCreator.prototype.create = function (ecModel, api) {\r\n var geoList = [];\r\n ecModel.eachComponent('geo', function (geoModel, idx) {\r\n var name = geoModel.get('map');\r\n var aspectScale = geoModel.get('aspectScale');\r\n var invertLongitute = true;\r\n var mapRecords = mapDataStorage.retrieveMap(name);\r\n if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') {\r\n aspectScale == null && (aspectScale = 1);\r\n invertLongitute = false;\r\n }\r\n else {\r\n aspectScale == null && (aspectScale = 0.75);\r\n }\r\n var geo = new Geo(name + idx, name, geoModel.get('nameMap'), invertLongitute);\r\n geo.aspectScale = aspectScale;\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo);\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel;\r\n geo.resize = resizeGeo;\r\n geo.resize(geoModel, api);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n if (coordSys === 'geo') {\r\n var geoIndex = seriesModel.get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n });\r\n var mapModelGroupBySeries = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n var mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n var nameMapList = map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n var geo = new Geo(mapType, mapType, mergeAll(nameMapList));\r\n geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo);\r\n geo.resize = resizeGeo;\r\n geo.aspectScale = mapSeries[0].get('aspectScale');\r\n geo.resize(mapSeries[0], api);\r\n each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n return geoList;\r\n };\r\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap) {\r\n var regionsArr = (originRegionArr || []).slice();\r\n var dataNameMap = createHashMap();\r\n for (var i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n var source = geoSourceManager.load(mapName, nameMap);\r\n each(source.regions, function (region) {\r\n var name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({ name: name });\r\n });\r\n return regionsArr;\r\n };\r\n return GeoCreator;\r\n }());\r\n var geoCreator = new GeoCreator();\r\n registerCoordinateSystem('geo', geoCreator);\n\n function mapSymbolLayout(ecModel) {\r\n var processedMapType = {};\r\n ecModel.eachSeriesByType('map', function (mapSeries) {\r\n var mapType = mapSeries.getMapType();\r\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\r\n return;\r\n }\r\n var mapSymbolOffsets = {};\r\n each(mapSeries.seriesGroup, function (subMapSeries) {\r\n var geo = subMapSeries.coordinateSystem;\r\n var data = subMapSeries.originalData;\r\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var name = data.getName(idx);\r\n var region = geo.getRegion(name);\r\n if (!region || isNaN(value)) {\r\n return;\r\n }\r\n var offset = mapSymbolOffsets[name] || 0;\r\n var point = geo.dataToPoint(region.center);\r\n mapSymbolOffsets[name] = offset + 1;\r\n data.setItemLayout(idx, {\r\n point: point,\r\n offset: offset\r\n });\r\n });\r\n }\r\n });\r\n var data = mapSeries.getData();\r\n data.each(function (idx) {\r\n var name = data.getName(idx);\r\n var layout = data.getItemLayout(idx) || {};\r\n layout.showLabel = !mapSymbolOffsets[name];\r\n data.setItemLayout(idx, layout);\r\n });\r\n processedMapType[mapType] = true;\r\n });\r\n }\n\n function dataStatistics(datas, statisticType) {\r\n var dataNameMap = {};\r\n each(datas, function (data) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + data.getName(idx);\r\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\r\n if (!isNaN(value)) {\r\n dataNameMap[mapKey].push(value);\r\n }\r\n });\r\n });\r\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + datas[0].getName(idx);\r\n var sum = 0;\r\n var min = Infinity;\r\n var max = -Infinity;\r\n var len = dataNameMap[mapKey].length;\r\n for (var i = 0; i < len; i++) {\r\n min = Math.min(min, dataNameMap[mapKey][i]);\r\n max = Math.max(max, dataNameMap[mapKey][i]);\r\n sum += dataNameMap[mapKey][i];\r\n }\r\n var result;\r\n if (statisticType === 'min') {\r\n result = min;\r\n }\r\n else if (statisticType === 'max') {\r\n result = max;\r\n }\r\n else if (statisticType === 'average') {\r\n result = sum / len;\r\n }\r\n else {\r\n result = sum;\r\n }\r\n return len === 0 ? NaN : result;\r\n });\r\n }\r\n function mapDataStatistic(ecModel) {\r\n var seriesGroups = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n var hostGeoModel = seriesModel.getHostGeoModel();\r\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\r\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\r\n });\r\n each(seriesGroups, function (seriesList, key) {\r\n var data = dataStatistics(map(seriesList, function (seriesModel) {\r\n return seriesModel.getData();\r\n }), seriesList[0].get('mapValueCalculation'));\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].originalData = seriesList[i].getData();\r\n }\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].seriesGroup = seriesList;\r\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\r\n seriesList[i].setData(data.cloneShallow());\r\n seriesList[i].mainSeries = seriesList[0];\r\n }\r\n });\r\n }\n\n registerLayout(mapSymbolLayout);\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\r\n createLegacyDataSelectAction('map', registerAction);\n\n var inner$8 = makeInner();\r\n function linkList(opt) {\r\n var mainData = opt.mainData;\r\n var datas = opt.datas;\r\n if (!datas) {\r\n datas = { main: mainData };\r\n opt.datasAttr = { main: 'data' };\r\n }\r\n opt.datas = opt.mainData = null;\r\n linkAll(mainData, datas, opt);\r\n each(datas, function (data) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n });\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n });\r\n assert(datas[mainData.dataType] === mainData);\r\n }\r\n function transferInjection(opt, res) {\r\n if (isMainData(this)) {\r\n var datas = extend({}, inner$8(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n }\r\n else {\r\n linkSingle(res, this.dataType, inner$8(this).mainData, opt);\r\n }\r\n return res;\r\n }\r\n function changeInjection(opt, res) {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n }\r\n function cloneShallowInjection(opt, res) {\r\n each(inner$8(res).datas, function (data, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n }\r\n function getLinkedData(dataType) {\r\n var mainData = inner$8(this).mainData;\r\n return (dataType == null || mainData == null)\r\n ? mainData\r\n : inner$8(mainData).datas[dataType];\r\n }\r\n function getLinkedDataAll() {\r\n var mainData = inner$8(this).mainData;\r\n return (mainData == null)\r\n ? [{ data: mainData }]\r\n : map(keys(inner$8(mainData).datas), function (type) {\r\n return {\r\n type: type,\r\n data: inner$8(mainData).datas[type]\r\n };\r\n });\r\n }\r\n function isMainData(data) {\r\n return inner$8(data).mainData === data;\r\n }\r\n function linkAll(mainData, datas, opt) {\r\n inner$8(mainData).datas = {};\r\n each(datas, function (data, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n }\r\n function linkSingle(data, dataType, mainData, opt) {\r\n inner$8(mainData).datas[dataType] = data;\r\n inner$8(data).mainData = mainData;\r\n data.dataType = dataType;\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n }\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n }\n\n var TreeNode = (function () {\r\n function TreeNode(name, hostTree) {\r\n this.depth = 0;\r\n this.height = 0;\r\n this.dataIndex = -1;\r\n this.children = [];\r\n this.viewChildren = [];\r\n this.isExpand = false;\r\n this.name = name || '';\r\n this.hostTree = hostTree;\r\n }\r\n TreeNode.prototype.isRemoved = function () {\r\n return this.dataIndex < 0;\r\n };\r\n TreeNode.prototype.eachNode = function (options, cb, context) {\r\n if (typeof options === 'function') {\r\n context = cb;\r\n cb = options;\r\n options = null;\r\n }\r\n options = options || {};\r\n if (isString(options)) {\r\n options = { order: options };\r\n }\r\n var order = options.order || 'preorder';\r\n var children = this[options.attr || 'children'];\r\n var suppressVisitSub;\r\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\r\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\r\n children[i].eachNode(options, cb, context);\r\n }\r\n order === 'postorder' && cb.call(context, this);\r\n };\r\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\r\n var height = 0;\r\n this.depth = depth;\r\n for (var i = 0; i < this.children.length; i++) {\r\n var child = this.children[i];\r\n child.updateDepthAndHeight(depth + 1);\r\n if (child.height > height) {\r\n height = child.height;\r\n }\r\n }\r\n this.height = height + 1;\r\n };\r\n TreeNode.prototype.getNodeById = function (id) {\r\n if (this.getId() === id) {\r\n return this;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].getNodeById(id);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.contains = function (node) {\r\n if (node === this) {\r\n return true;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].contains(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.getAncestors = function (includeSelf) {\r\n var ancestors = [];\r\n var node = includeSelf ? this : this.parentNode;\r\n while (node) {\r\n ancestors.push(node);\r\n node = node.parentNode;\r\n }\r\n ancestors.reverse();\r\n return ancestors;\r\n };\r\n TreeNode.prototype.getAncestorsIndices = function () {\r\n var indices = [];\r\n var currNode = this;\r\n while (currNode) {\r\n indices.push(currNode.dataIndex);\r\n currNode = currNode.parentNode;\r\n }\r\n indices.reverse();\r\n return indices;\r\n };\r\n TreeNode.prototype.getDescendantIndices = function () {\r\n var indices = [];\r\n this.eachNode(function (childNode) {\r\n indices.push(childNode.dataIndex);\r\n });\r\n return indices;\r\n };\r\n TreeNode.prototype.getValue = function (dimension) {\r\n var data = this.hostTree.data;\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n };\r\n TreeNode.prototype.setLayout = function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\r\n };\r\n TreeNode.prototype.getLayout = function () {\r\n return this.hostTree.data.getItemLayout(this.dataIndex);\r\n };\r\n TreeNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var hostTree = this.hostTree;\r\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n TreeNode.prototype.getLevelModel = function () {\r\n return (this.hostTree.levelModels || [])[this.depth];\r\n };\r\n TreeNode.prototype.setVisual = function (key, value) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\r\n };\r\n TreeNode.prototype.getVisual = function (key) {\r\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\r\n };\r\n TreeNode.prototype.getRawIndex = function () {\r\n return this.hostTree.data.getRawIndex(this.dataIndex);\r\n };\r\n TreeNode.prototype.getId = function () {\r\n return this.hostTree.data.getId(this.dataIndex);\r\n };\r\n TreeNode.prototype.isAncestorOf = function (node) {\r\n var parent = node.parentNode;\r\n while (parent) {\r\n if (parent === this) {\r\n return true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return false;\r\n };\r\n TreeNode.prototype.isDescendantOf = function (node) {\r\n return node !== this && node.isAncestorOf(this);\r\n };\r\n return TreeNode;\r\n }());\r\n var Tree = (function () {\r\n function Tree(hostModel) {\r\n this.type = 'tree';\r\n this._nodes = [];\r\n this.hostModel = hostModel;\r\n }\r\n Tree.prototype.eachNode = function (options, cb, context) {\r\n this.root.eachNode(options, cb, context);\r\n };\r\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\r\n var rawIndex = this.data.getRawIndex(dataIndex);\r\n return this._nodes[rawIndex];\r\n };\r\n Tree.prototype.getNodeById = function (name) {\r\n return this.root.getNodeById(name);\r\n };\r\n Tree.prototype.update = function () {\r\n var data = this.data;\r\n var nodes = this._nodes;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Tree.prototype.clearLayouts = function () {\r\n this.data.clearItemLayouts();\r\n };\r\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\r\n var tree = new Tree(hostModel);\r\n var listData = [];\r\n var dimMax = 1;\r\n buildHierarchy(dataRoot);\r\n function buildHierarchy(dataNode, parentNode) {\r\n var value = dataNode.value;\r\n dimMax = Math.max(dimMax, isArray(value) ? value.length : 1);\r\n listData.push(dataNode);\r\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\r\n parentNode\r\n ? addChild(node, parentNode)\r\n : (tree.root = node);\r\n tree._nodes.push(node);\r\n var children = dataNode.children;\r\n if (children) {\r\n for (var i = 0; i < children.length; i++) {\r\n buildHierarchy(children[i], node);\r\n }\r\n }\r\n }\r\n tree.root.updateDepthAndHeight(0);\r\n var dimensionsInfo = createDimensions(listData, {\r\n coordDimensions: ['value'],\r\n dimensionsCount: dimMax\r\n });\r\n var list = new List(dimensionsInfo, hostModel);\r\n list.initData(listData);\r\n beforeLink && beforeLink(list);\r\n linkList({\r\n mainData: list,\r\n struct: tree,\r\n structAttr: 'tree'\r\n });\r\n tree.update();\r\n return tree;\r\n };\r\n return Tree;\r\n }());\r\n function addChild(child, node) {\r\n var children = node.children;\r\n if (child.parentNode === node) {\r\n return;\r\n }\r\n children.push(child);\r\n child.parentNode = node;\r\n }\n\n var TreeSeriesModel = (function (_super) {\r\n __extends(TreeSeriesModel, _super);\r\n function TreeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.hasSymbolVisual = true;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n TreeSeriesModel.prototype.getInitialData = function (option) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n var leaves = option.leaves || {};\r\n var leavesModel = new Model(leaves, this, this.ecModel);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n if (!node.children.length || !node.isExpand) {\r\n model.parentModel = leavesModel;\r\n }\r\n return model;\r\n });\r\n }\r\n var treeDepth = 0;\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n var expandAndCollapse = option.expandAndCollapse;\r\n var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0)\r\n ? option.initialTreeDepth : treeDepth;\r\n tree.root.eachNode('preorder', function (node) {\r\n var item = node.hostTree.data.getRawDataItem(node.dataIndex);\r\n node.isExpand = (item && item.collapsed != null)\r\n ? !item.collapsed\r\n : node.depth <= expandTreeDepth;\r\n });\r\n return tree.data;\r\n };\r\n TreeSeriesModel.prototype.getOrient = function () {\r\n var orient = this.get('orient');\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n }\r\n else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n return orient;\r\n };\r\n TreeSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n TreeSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var tree = this.getData().tree;\r\n var realRoot = tree.root.children[0];\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n var value = node.getValue();\r\n var name = node.name;\r\n while (node && (node !== realRoot)) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value) || value == null\r\n });\r\n };\r\n TreeSeriesModel.type = 'series.tree';\r\n TreeSeriesModel.layoutMode = 'box';\r\n TreeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n layout: 'orthogonal',\r\n edgeShape: 'curve',\r\n edgeForkPosition: '50%',\r\n roam: false,\r\n nodeScaleRatio: 0.4,\r\n center: null,\r\n zoom: 1,\r\n orient: 'LR',\r\n symbol: 'emptyCircle',\r\n symbolSize: 7,\r\n expandAndCollapse: true,\r\n initialTreeDepth: 2,\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n label: {\r\n show: true\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 700,\r\n animationDurationUpdate: 500\r\n };\r\n return TreeSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(TreeSeriesModel);\n\n function init$2(inRoot) {\r\n var root = inRoot;\r\n root.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: root,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: 0,\r\n thread: null\r\n };\r\n var nodes = [root];\r\n var node;\r\n var children;\r\n while (node = nodes.pop()) {\r\n children = node.children;\r\n if (node.isExpand && children.length) {\r\n var n = children.length;\r\n for (var i = n - 1; i >= 0; i--) {\r\n var child = children[i];\r\n child.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: child,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: i,\r\n thread: null\r\n };\r\n nodes.push(child);\r\n }\r\n }\r\n }\r\n }\r\n function firstWalk(node, separation) {\r\n var children = node.isExpand ? node.children : [];\r\n var siblings = node.parentNode.children;\r\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\r\n if (children.length) {\r\n executeShifts(node);\r\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\r\n if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\r\n }\r\n else {\r\n node.hierNode.prelim = midPoint;\r\n }\r\n }\r\n else if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n }\r\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\r\n }\r\n function secondWalk(node) {\r\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\r\n node.setLayout({ x: nodeX }, true);\r\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\r\n }\r\n function separation(cb) {\r\n return arguments.length ? cb : defaultSeparation;\r\n }\r\n function radialCoordinate(rad, r) {\r\n rad -= Math.PI / 2;\r\n return {\r\n x: r * Math.cos(rad),\r\n y: r * Math.sin(rad)\r\n };\r\n }\r\n function getViewRect$1(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function executeShifts(node) {\r\n var children = node.children;\r\n var n = children.length;\r\n var shift = 0;\r\n var change = 0;\r\n while (--n >= 0) {\r\n var child = children[n];\r\n child.hierNode.prelim += shift;\r\n child.hierNode.modifier += shift;\r\n change += child.hierNode.change;\r\n shift += child.hierNode.shift + change;\r\n }\r\n }\r\n function apportion(subtreeV, subtreeW, ancestor, separation) {\r\n if (subtreeW) {\r\n var nodeOutRight = subtreeV;\r\n var nodeInRight = subtreeV;\r\n var nodeOutLeft = nodeInRight.parentNode.children[0];\r\n var nodeInLeft = subtreeW;\r\n var sumOutRight = nodeOutRight.hierNode.modifier;\r\n var sumInRight = nodeInRight.hierNode.modifier;\r\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\r\n var sumInLeft = nodeInLeft.hierNode.modifier;\r\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\r\n nodeOutRight = nextRight(nodeOutRight);\r\n nodeOutLeft = nextLeft(nodeOutLeft);\r\n nodeOutRight.hierNode.ancestor = subtreeV;\r\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim\r\n - sumInRight + separation(nodeInLeft, nodeInRight);\r\n if (shift > 0) {\r\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\r\n sumInRight += shift;\r\n sumOutRight += shift;\r\n }\r\n sumInLeft += nodeInLeft.hierNode.modifier;\r\n sumInRight += nodeInRight.hierNode.modifier;\r\n sumOutRight += nodeOutRight.hierNode.modifier;\r\n sumOutLeft += nodeOutLeft.hierNode.modifier;\r\n }\r\n if (nodeInLeft && !nextRight(nodeOutRight)) {\r\n nodeOutRight.hierNode.thread = nodeInLeft;\r\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\r\n }\r\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\r\n nodeOutLeft.hierNode.thread = nodeInRight;\r\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\r\n ancestor = subtreeV;\r\n }\r\n }\r\n return ancestor;\r\n }\r\n function nextRight(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\r\n }\r\n function nextLeft(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\r\n }\r\n function nextAncestor(nodeInLeft, node, ancestor) {\r\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode\r\n ? nodeInLeft.hierNode.ancestor : ancestor;\r\n }\r\n function moveSubtree(wl, wr, shift) {\r\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\r\n wr.hierNode.change -= change;\r\n wr.hierNode.shift += shift;\r\n wr.hierNode.modifier += shift;\r\n wr.hierNode.prelim += shift;\r\n wl.hierNode.change += change;\r\n }\r\n function defaultSeparation(node1, node2) {\r\n return node1.parentNode === node2.parentNode ? 1 : 2;\r\n }\n\n var TreeEdgeShape = (function () {\r\n function TreeEdgeShape() {\r\n this.parentPoint = [];\r\n this.childPoints = [];\r\n }\r\n return TreeEdgeShape;\r\n }());\r\n var TreePath = (function (_super) {\r\n __extends(TreePath, _super);\r\n function TreePath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n TreePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n TreePath.prototype.getDefaultShape = function () {\r\n return new TreeEdgeShape();\r\n };\r\n TreePath.prototype.buildPath = function (ctx, shape) {\r\n var childPoints = shape.childPoints;\r\n var childLen = childPoints.length;\r\n var parentPoint = shape.parentPoint;\r\n var firstChildPos = childPoints[0];\r\n var lastChildPos = childPoints[childLen - 1];\r\n if (childLen === 1) {\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\r\n return;\r\n }\r\n var orient = shape.orient;\r\n var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;\r\n var otherDim = 1 - forkDim;\r\n var forkPosition = parsePercent$2(shape.forkPosition, 1);\r\n var tmpPoint = [];\r\n tmpPoint[forkDim] = parentPoint[forkDim];\r\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\r\n tmpPoint[forkDim] = firstChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n tmpPoint[forkDim] = lastChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\r\n for (var i = 1; i < childLen - 1; i++) {\r\n var point = childPoints[i];\r\n ctx.moveTo(point[0], point[1]);\r\n tmpPoint[forkDim] = point[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n }\r\n };\r\n return TreePath;\r\n }(Path));\r\n var TreeView = (function (_super) {\r\n __extends(TreeView, _super);\r\n function TreeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreeView.type;\r\n _this._mainGroup = new Group();\r\n return _this;\r\n }\r\n TreeView.prototype.init = function (ecModel, api) {\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: this.group\r\n };\r\n this.group.add(this._mainGroup);\r\n };\r\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var group = this._mainGroup;\r\n var layout = seriesModel.get('layout');\r\n if (layout === 'radial') {\r\n group.x = layoutInfo.x + layoutInfo.width / 2;\r\n group.y = layoutInfo.y + layoutInfo.height / 2;\r\n }\r\n else {\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n }\r\n this._updateViewCoordSys(seriesModel);\r\n this._updateController(seriesModel, ecModel, api);\r\n var oldData = this._data;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (symbolNeedsDraw$1(data, newIdx)) {\r\n updateNode(data, newIdx, null, group, seriesModel);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!symbolNeedsDraw$1(data, newIdx)) {\r\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n return;\r\n }\r\n updateNode(data, newIdx, symbolEl, group, seriesModel);\r\n })\r\n .remove(function (oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (symbolEl) {\r\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n }\r\n })\r\n .execute();\r\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\r\n this._updateNodeAndLinkScale(seriesModel);\r\n if (seriesModel.get('expandAndCollapse') === true) {\r\n data.eachItemGraphicEl(function (el, dataIndex) {\r\n el.off('click').on('click', function () {\r\n api.dispatchAction({\r\n type: 'treeExpandAndCollapse',\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndex\r\n });\r\n });\r\n });\r\n }\r\n this._data = data;\r\n };\r\n TreeView.prototype._updateViewCoordSys = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n data.each(function (idx) {\r\n var layout = data.getItemLayout(idx);\r\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\r\n points.push([+layout.x, +layout.y]);\r\n }\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(points, min, max);\r\n var oldMin = this._min;\r\n var oldMax = this._max;\r\n if (max[0] - min[0] === 0) {\r\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\r\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\r\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\r\n }\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n this.group.attr({\r\n x: viewCoordSys.x,\r\n y: viewCoordSys.y,\r\n scaleX: viewCoordSys.scaleX,\r\n scaleY: viewCoordSys.scaleY\r\n });\r\n this._min = min;\r\n this._max = max;\r\n };\r\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale(seriesModel);\r\n api.updateLabelLayout();\r\n });\r\n };\r\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var nodeScale = this._getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = this._nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX || 1;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n };\r\n TreeView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n TreeView.prototype.remove = function () {\r\n this._mainGroup.removeAll();\r\n this._data = null;\r\n };\r\n TreeView.type = 'tree';\r\n return TreeView;\r\n }(ChartView));\r\n function symbolNeedsDraw$1(data, dataIndex) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return layout\r\n && !isNaN(layout.x) && !isNaN(layout.y);\r\n }\r\n function updateNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var isInit = !symbolEl;\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var itemModel = node.getModel();\r\n var visualColor = node.getVisual('style').fill;\r\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0\r\n ? visualColor : '#fff';\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceLayout = source.getLayout();\r\n var sourceOldLayout = sourceSymbolEl\r\n ? {\r\n x: sourceSymbolEl.__oldX,\r\n y: sourceSymbolEl.__oldY,\r\n rawX: sourceSymbolEl.__radialOldRawX,\r\n rawY: sourceSymbolEl.__radialOldRawY\r\n }\r\n : sourceLayout;\r\n var targetLayout = node.getLayout();\r\n if (isInit) {\r\n symbolEl = new Symbol(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n symbolEl.x = sourceOldLayout.x;\r\n symbolEl.y = sourceOldLayout.y;\r\n }\r\n else {\r\n symbolEl.updateData(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n }\r\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\r\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\r\n symbolEl.__radialRawX = targetLayout.rawX;\r\n symbolEl.__radialRawY = targetLayout.rawY;\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(dataIndex, symbolEl);\r\n symbolEl.__oldX = symbolEl.x;\r\n symbolEl.__oldY = symbolEl.y;\r\n updateProps(symbolEl, {\r\n x: targetLayout.x,\r\n y: targetLayout.y\r\n }, seriesModel);\r\n var symbolPath = symbolEl.getSymbolPath();\r\n if (seriesModel.get('layout') === 'radial') {\r\n var realRoot = virtualRoot.children[0];\r\n var rootLayout = realRoot.getLayout();\r\n var length_1 = realRoot.children.length;\r\n var rad = void 0;\r\n var isLeft = void 0;\r\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\r\n var center = {\r\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\r\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\r\n };\r\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n isLeft = center.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {\r\n isLeft = targetLayout.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n isLeft = targetLayout.x > rootLayout.x;\r\n if (!isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n var normalLabelModel = itemModel.getModel('label');\r\n var rotate = normalLabelModel.get('rotate');\r\n var labelRotateRadian = rotate * (Math.PI / 180);\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n symbolPath.setTextConfig({\r\n position: normalLabelModel.get('position') || textPosition,\r\n rotation: rotate == null ? -rad : labelRotateRadian,\r\n origin: 'center'\r\n });\r\n textContent.setStyle('verticalAlign', 'middle');\r\n }\r\n }\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n if (focusDataIndices) {\r\n getECData(symbolEl).focus = focusDataIndices;\r\n }\r\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\r\n if (symbolEl.__edge) {\r\n symbolEl.onHoverStateChange = function (toState) {\r\n if (toState !== 'blur') {\r\n var parentEl = node.parentNode\r\n && data.getItemGraphicEl(node.parentNode.dataIndex);\r\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\r\n setStatesFlag(symbolEl.__edge, toState);\r\n }\r\n }\r\n };\r\n }\r\n }\r\n function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\r\n var itemModel = node.getModel();\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layout = seriesModel.get('layout');\r\n var orient = seriesModel.getOrient();\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\r\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\r\n var edge = symbolEl.__edge;\r\n if (edgeShape === 'curve') {\r\n if (node.parentNode && node.parentNode !== virtualRoot) {\r\n if (!edge) {\r\n edge = symbolEl.__edge = new BezierCurve({\r\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\r\n }, seriesModel);\r\n }\r\n }\r\n else if (edgeShape === 'polyline') {\r\n if (layout === 'orthogonal') {\r\n if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {\r\n var children = node.children;\r\n var childPoints = [];\r\n for (var i = 0; i < children.length; i++) {\r\n var childLayout = children[i].getLayout();\r\n childPoints.push([childLayout.x, childLayout.y]);\r\n }\r\n if (!edge) {\r\n edge = symbolEl.__edge = new TreePath({\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: [[targetLayout.x, targetLayout.y]],\r\n orient: orient,\r\n forkPosition: edgeForkPosition\r\n }\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: childPoints\r\n }\r\n }, seriesModel);\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\r\n }\r\n }\r\n }\r\n if (edge) {\r\n edge.useStyle(defaults({\r\n strokeNoScale: true, fill: null\r\n }, lineStyle));\r\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\r\n setDefaultStateProxy(edge);\r\n group.add(edge);\r\n }\r\n }\r\n function removeNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceLayout;\r\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\r\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\r\n }\r\n var removeAnimationOpt = {\r\n duration: seriesModel.get('animationDurationUpdate'),\r\n easing: seriesModel.get('animationEasingUpdate')\r\n };\r\n removeElement(symbolEl, {\r\n x: sourceLayout.x + 1,\r\n y: sourceLayout.y + 1\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(symbolEl);\r\n data.setItemGraphicEl(dataIndex, null);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n symbolEl.fadeOut(null, {\r\n fadeLabel: true,\r\n animation: removeAnimationOpt\r\n });\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceEdge = sourceSymbolEl.__edge;\r\n var edge = symbolEl.__edge\r\n || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layoutOpt = seriesModel.get('layout');\r\n var orient = seriesModel.get('orient');\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n if (edge) {\r\n if (edgeShape === 'curve') {\r\n removeElement(edge, {\r\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\r\n removeElement(edge, {\r\n shape: {\r\n parentPoint: [sourceLayout.x, sourceLayout.y],\r\n childPoints: [[sourceLayout.x, sourceLayout.y]]\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n }\r\n }\r\n function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n var x1;\r\n var x2;\r\n var y1;\r\n var y2;\r\n if (layoutOpt === 'radial') {\r\n x1 = sourceLayout.rawX;\r\n y1 = sourceLayout.rawY;\r\n x2 = targetLayout.rawX;\r\n y2 = targetLayout.rawY;\r\n var radialCoor1 = radialCoordinate(x1, y1);\r\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\r\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\r\n var radialCoor4 = radialCoordinate(x2, y2);\r\n return {\r\n x1: radialCoor1.x || 0,\r\n y1: radialCoor1.y || 0,\r\n x2: radialCoor4.x || 0,\r\n y2: radialCoor4.y || 0,\r\n cpx1: radialCoor2.x || 0,\r\n cpy1: radialCoor2.y || 0,\r\n cpx2: radialCoor3.x || 0,\r\n cpy2: radialCoor3.y || 0\r\n };\r\n }\r\n else {\r\n x1 = sourceLayout.x;\r\n y1 = sourceLayout.y;\r\n x2 = targetLayout.x;\r\n y2 = targetLayout.y;\r\n if (orient === 'LR' || orient === 'RL') {\r\n cpx1 = x1 + (x2 - x1) * curvature;\r\n cpy1 = y1;\r\n cpx2 = x2 + (x1 - x2) * curvature;\r\n cpy2 = y2;\r\n }\r\n if (orient === 'TB' || orient === 'BT') {\r\n cpx1 = x1;\r\n cpy1 = y1 + (y2 - y1) * curvature;\r\n cpx2 = x2;\r\n cpy2 = y2 + (y1 - y2) * curvature;\r\n }\r\n }\r\n return {\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n };\r\n }\r\n ChartView.registerClass(TreeView);\n\n registerAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var dataIndex = payload.dataIndex;\r\n var tree = seriesModel.getData().tree;\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n });\r\n registerAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n update: 'none'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\n\n function eachAfter(root, callback, separation) {\r\n var nodes = [root];\r\n var next = [];\r\n var node;\r\n while (node = nodes.pop()) {\r\n next.push(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = 0; i < children.length; i++) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n while (node = next.pop()) {\r\n callback(node, separation);\r\n }\r\n }\r\n function eachBefore(root, callback) {\r\n var nodes = [root];\r\n var node;\r\n while (node = nodes.pop()) {\r\n callback(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n }\n\n function treeLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n commonLayout(seriesModel, api);\r\n });\r\n }\r\n function commonLayout(seriesModel, api) {\r\n var layoutInfo = getViewRect$1(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var layout = seriesModel.get('layout');\r\n var width = 0;\r\n var height = 0;\r\n var separation$1 = null;\r\n if (layout === 'radial') {\r\n width = 2 * Math.PI;\r\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\r\n separation$1 = separation(function (node1, node2) {\r\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\r\n });\r\n }\r\n else {\r\n width = layoutInfo.width;\r\n height = layoutInfo.height;\r\n separation$1 = separation();\r\n }\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var realRoot = virtualRoot.children[0];\r\n if (realRoot) {\r\n init$2(virtualRoot);\r\n eachAfter(realRoot, firstWalk, separation$1);\r\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\r\n eachBefore(realRoot, secondWalk);\r\n var left_1 = realRoot;\r\n var right_1 = realRoot;\r\n var bottom_1 = realRoot;\r\n eachBefore(realRoot, function (node) {\r\n var x = node.getLayout().x;\r\n if (x < left_1.getLayout().x) {\r\n left_1 = node;\r\n }\r\n if (x > right_1.getLayout().x) {\r\n right_1 = node;\r\n }\r\n if (node.depth > bottom_1.depth) {\r\n bottom_1 = node;\r\n }\r\n });\r\n var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2;\r\n var tx_1 = delta - left_1.getLayout().x;\r\n var kx_1 = 0;\r\n var ky_1 = 0;\r\n var coorX_1 = 0;\r\n var coorY_1 = 0;\r\n if (layout === 'radial') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = (node.depth - 1) * ky_1;\r\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\r\n node.setLayout({ x: finalCoor.x, y: finalCoor.y, rawX: coorX_1, rawY: coorY_1 }, true);\r\n });\r\n }\r\n else {\r\n var orient_1 = seriesModel.getOrient();\r\n if (orient_1 === 'RL' || orient_1 === 'LR') {\r\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\r\n kx_1 = width / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\r\n coorX_1 = orient_1 === 'LR'\r\n ? (node.depth - 1) * kx_1\r\n : width - (node.depth - 1) * kx_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n else if (orient_1 === 'TB' || orient_1 === 'BT') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = orient_1 === 'TB'\r\n ? (node.depth - 1) * ky_1\r\n : height - (node.depth - 1) * ky_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n }\r\n }\r\n }\n\n function treeVisual(ecModel) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n }\n\n registerLayout(treeLayout);\r\n registerVisual(treeVisual);\n\n function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\r\n if (payload && indexOf(validPayloadTypes, payload.type) >= 0) {\r\n var root = seriesModel.getData().tree.root;\r\n var targetNode = payload.targetNode;\r\n if (typeof targetNode === 'string') {\r\n targetNode = root.getNodeById(targetNode);\r\n }\r\n if (targetNode && root.contains(targetNode)) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n var targetNodeId = payload.targetNodeId;\r\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n }\r\n }\r\n function getPathToRoot(node) {\r\n var path = [];\r\n while (node) {\r\n node = node.parentNode;\r\n node && path.push(node);\r\n }\r\n return path.reverse();\r\n }\r\n function aboveViewRoot(viewRoot, node) {\r\n var viewPath = getPathToRoot(viewRoot);\r\n return indexOf(viewPath, node) >= 0;\r\n }\r\n function wrapTreePathInfo(node, seriesModel) {\r\n var treePathInfo = [];\r\n while (node) {\r\n var nodeDataIndex = node.dataIndex;\r\n treePathInfo.push({\r\n name: node.name,\r\n dataIndex: nodeDataIndex,\r\n value: seriesModel.getRawValue(nodeDataIndex)\r\n });\r\n node = node.parentNode;\r\n }\r\n treePathInfo.reverse();\r\n return treePathInfo;\r\n }\n\n function enableAriaDecalForTree(seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n var decalPaletteScope = {};\r\n tree.eachNode(function (node) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\r\n node.setVisual('decal', decal);\r\n });\r\n }\n\n var TreemapSeriesModel = (function (_super) {\r\n __extends(TreemapSeriesModel, _super);\r\n function TreemapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapSeriesModel.type;\r\n _this.preventUsingHoverLayer = true;\r\n return _this;\r\n }\r\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n completeTreeValue(root);\r\n var levels = option.levels || [];\r\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\r\n var designatedVisualModel = new Model({ itemStyle: designatedVisualItemStyle }, this, ecModel);\r\n levels = option.levels = setDefault(levels, ecModel);\r\n var levelModels = map(levels || [], function (levelDefine) {\r\n return new Model(levelDefine, designatedVisualModel, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n model.parentModel = levelModel || designatedVisualModel;\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n TreemapSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\r\n this.layoutInfo = this.layoutInfo || {};\r\n extend(this.layoutInfo, layoutInfo);\r\n };\r\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\r\n var idIndexMap = this._idIndexMap;\r\n if (!idIndexMap) {\r\n idIndexMap = this._idIndexMap = createHashMap();\r\n this._idIndexMapCount = 0;\r\n }\r\n var index = idIndexMap.get(id);\r\n if (index == null) {\r\n idIndexMap.set(id, index = this._idIndexMapCount++);\r\n }\r\n return index;\r\n };\r\n TreemapSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n TreemapSeriesModel.type = 'series.treemap';\r\n TreemapSeriesModel.layoutMode = 'box';\r\n TreemapSeriesModel.defaultOption = {\r\n progressive: 0,\r\n left: 'center',\r\n top: 'middle',\r\n width: '80%',\r\n height: '80%',\r\n sort: true,\r\n clipWindow: 'origin',\r\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\r\n leafDepth: null,\r\n drillDownIcon: '▶',\r\n zoomToNodeRatio: 0.32 * 0.32,\r\n roam: true,\r\n nodeClick: 'zoomToNode',\r\n animation: true,\r\n animationDurationUpdate: 900,\r\n animationEasing: 'quinticInOut',\r\n breadcrumb: {\r\n show: true,\r\n height: 22,\r\n left: 'center',\r\n top: 'bottom',\r\n emptyItemWidth: 25,\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.7)',\r\n textStyle: {\r\n color: '#fff'\r\n }\r\n }\r\n },\r\n label: {\r\n show: true,\r\n distance: 0,\r\n padding: 5,\r\n position: 'inside',\r\n color: '#fff',\r\n overflow: 'truncate'\r\n },\r\n upperLabel: {\r\n show: false,\r\n position: [0, '50%'],\r\n height: 20,\r\n overflow: 'truncate',\r\n verticalAlign: 'middle'\r\n },\r\n itemStyle: {\r\n color: null,\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n borderWidth: 0,\r\n gapWidth: 0,\r\n borderColor: '#fff',\r\n borderColorSaturation: null\r\n },\r\n emphasis: {\r\n upperLabel: {\r\n show: true,\r\n position: [0, '50%'],\r\n ellipsis: true,\r\n verticalAlign: 'middle'\r\n }\r\n },\r\n visualDimension: 0,\r\n visualMin: null,\r\n visualMax: null,\r\n color: [],\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n colorMappingBy: 'index',\r\n visibleMin: 10,\r\n childrenVisibleMin: null,\r\n levels: []\r\n };\r\n return TreemapSeriesModel;\r\n }(SeriesModel));\r\n function completeTreeValue(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n }\r\n function setDefault(levels, ecModel) {\r\n var globalColorList = normalizeToArray(ecModel.get('color'));\r\n var globalDecalList = normalizeToArray(ecModel.get('decals'));\r\n if (!globalColorList) {\r\n return;\r\n }\r\n levels = levels || [];\r\n var hasColorDefine;\r\n var hasDecalDefine;\r\n each(levels, function (levelDefine) {\r\n var model = new Model(levelDefine);\r\n var modelColor = model.get('color');\r\n var modelDecal = model.get('decal');\r\n if (model.get(['itemStyle', 'color'])\r\n || (modelColor && modelColor !== 'none')) {\r\n hasColorDefine = true;\r\n }\r\n if (model.get(['itemStyle', 'decal'])\r\n || (modelDecal && modelDecal !== 'none')) {\r\n hasDecalDefine = true;\r\n }\r\n });\r\n var level0 = levels[0] || (levels[0] = {});\r\n if (!hasColorDefine) {\r\n level0.color = globalColorList.slice();\r\n }\r\n if (!hasDecalDefine && globalDecalList) {\r\n level0.decal = globalDecalList.slice();\r\n }\r\n return levels;\r\n }\r\n SeriesModel.registerClass(TreemapSeriesModel);\n\n var TEXT_PADDING = 8;\r\n var ITEM_GAP = 8;\r\n var ARRAY_LENGTH = 5;\r\n var Breadcrumb = (function () {\r\n function Breadcrumb(containerGroup) {\r\n this.group = new Group();\r\n containerGroup.add(this.group);\r\n }\r\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\r\n var model = seriesModel.getModel('breadcrumb');\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n var normalStyleModel = model.getModel('itemStyle');\r\n var textStyleModel = normalStyleModel.getModel('textStyle');\r\n var layoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\r\n positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n };\r\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\r\n for (var node = targetNode; node; node = node.parentNode) {\r\n var text = convertOptionIdName(node.getModel().get('name'), '');\r\n var textRect = textStyleModel.getTextRect(text);\r\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n };\r\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\r\n var lastX = 0;\r\n var emptyItemWidth = layoutParam.emptyItemWidth;\r\n var height = seriesModel.get(['breadcrumb', 'height']);\r\n var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box);\r\n var totalWidth = layoutParam.totalWidth;\r\n var renderList = layoutParam.renderList;\r\n for (var i = renderList.length - 1; i >= 0; i--) {\r\n var item = renderList[i];\r\n var itemNode = item.node;\r\n var itemWidth = item.width;\r\n var text = item.text;\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n var el = new Polygon({\r\n shape: {\r\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\r\n },\r\n style: defaults(normalStyleModel.getItemStyle(), {\r\n lineJoin: 'bevel'\r\n }),\r\n textContent: new ZRText({\r\n style: {\r\n text: text,\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z: 10,\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n el.disableLabelAnimation = true;\r\n this.group.add(el);\r\n packEventData(el, seriesModel, itemNode);\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n };\r\n Breadcrumb.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n return Breadcrumb;\r\n }());\r\n function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\r\n var points = [\r\n [head ? x : x - ARRAY_LENGTH, y],\r\n [x + itemWidth, y],\r\n [x + itemWidth, y + itemHeight],\r\n [head ? x : x - ARRAY_LENGTH, y + itemHeight]\r\n ];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n }\r\n function packEventData(el, seriesModel, itemNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.componentIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb',\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n }\n\n var AnimationWrap = (function () {\r\n function AnimationWrap() {\r\n this._storage = [];\r\n this._elExistsMap = {};\r\n }\r\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\r\n if (this._elExistsMap[el.id]) {\r\n return false;\r\n }\r\n this._elExistsMap[el.id] = true;\r\n this._storage.push({\r\n el: el,\r\n target: target,\r\n duration: duration,\r\n delay: delay,\r\n easing: easing\r\n });\r\n return true;\r\n };\r\n AnimationWrap.prototype.finished = function (callback) {\r\n this._finishedCallback = callback;\r\n return this;\r\n };\r\n AnimationWrap.prototype.start = function () {\r\n var _this = this;\r\n var count = this._storage.length;\r\n var checkTerminate = function () {\r\n count--;\r\n if (count <= 0) {\r\n _this._storage.length = 0;\r\n _this._elExistsMap = {};\r\n _this._finishedCallback && _this._finishedCallback();\r\n }\r\n };\r\n for (var i = 0, len = this._storage.length; i < len; i++) {\r\n var item = this._storage[i];\r\n item.el.animateTo(item.target, {\r\n duration: item.duration,\r\n delay: item.delay,\r\n easing: item.easing,\r\n setToFinal: true,\r\n done: checkTerminate,\r\n aborted: checkTerminate\r\n });\r\n }\r\n return this;\r\n };\r\n return AnimationWrap;\r\n }());\r\n function createWrap() {\r\n return new AnimationWrap();\r\n }\n\n var Group$1 = Group;\r\n var Rect$1 = Rect;\r\n var DRAG_THRESHOLD = 3;\r\n var PATH_LABEL_NOAMAL = 'label';\r\n var PATH_UPPERLABEL_NORMAL = 'upperLabel';\r\n var Z_BASE = 10;\r\n var Z_BG = 1;\r\n var Z_CONTENT = 2;\r\n var getStateItemStyle = makeStyleMapper([\r\n ['fill', 'color'],\r\n ['stroke', 'strokeColor'],\r\n ['lineWidth', 'strokeWidth'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor']\r\n ]);\r\n var getItemStyleNormal = function (model) {\r\n var itemStyle = getStateItemStyle(model);\r\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\r\n return itemStyle;\r\n };\r\n var inner$9 = makeInner();\r\n var TreemapView = (function (_super) {\r\n __extends(TreemapView, _super);\r\n function TreemapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapView.type;\r\n _this._state = 'ready';\r\n _this._storage = createStorage();\r\n return _this;\r\n }\r\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var models = ecModel.findComponents({\r\n mainType: 'series', subType: 'treemap', query: payload\r\n });\r\n if (indexOf(models, seriesModel) < 0) {\r\n return;\r\n }\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var payloadType = payload && payload.type;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var isInit = !this._oldTree;\r\n var thisStorage = this._storage;\r\n var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)\r\n ? {\r\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\r\n direction: payload.direction\r\n }\r\n : null;\r\n var containerGroup = this._giveContainerGroup(layoutInfo);\r\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\r\n (!isInit && (!payloadType\r\n || payloadType === 'treemapZoomToNode'\r\n || payloadType === 'treemapRootToNode'))\r\n ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)\r\n : renderResult.renderFinally();\r\n this._resetController(api);\r\n this._renderBreadcrumb(seriesModel, api, targetInfo);\r\n };\r\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\r\n var containerGroup = this._containerGroup;\r\n if (!containerGroup) {\r\n containerGroup = this._containerGroup = new Group$1();\r\n this._initEvents(containerGroup);\r\n this.group.add(containerGroup);\r\n }\r\n containerGroup.x = layoutInfo.x;\r\n containerGroup.y = layoutInfo.y;\r\n return containerGroup;\r\n };\r\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\r\n var thisTree = seriesModel.getData().tree;\r\n var oldTree = this._oldTree;\r\n var lastsForAnimation = createStorage();\r\n var thisStorage = createStorage();\r\n var oldStorage = this._storage;\r\n var willInvisibleEls = [];\r\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\r\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\r\n }\r\n dualTravel(thisTree.root ? [thisTree.root] : [], (oldTree && oldTree.root) ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\r\n var willDeleteEls = clearStorage(oldStorage);\r\n this._oldTree = thisTree;\r\n this._storage = thisStorage;\r\n return {\r\n lastsForAnimation: lastsForAnimation,\r\n willDeleteEls: willDeleteEls,\r\n renderFinally: renderFinally\r\n };\r\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\r\n if (sameTree) {\r\n oldViewChildren = thisViewChildren;\r\n each(thisViewChildren, function (child, index) {\r\n !child.isRemoved() && processNode(index, index);\r\n });\r\n }\r\n else {\r\n (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n }\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIndex, oldIndex) {\r\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\r\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\r\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\r\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\r\n }\r\n }\r\n function clearStorage(storage) {\r\n var willDeleteEls = createStorage();\r\n storage && each(storage, function (store, storageName) {\r\n var delEls = willDeleteEls[storageName];\r\n each(store, function (el) {\r\n el && (delEls.push(el), inner$9(el).willDelete = true);\r\n });\r\n });\r\n return willDeleteEls;\r\n }\r\n function renderFinally() {\r\n each(willDeleteEls, function (els) {\r\n each(els, function (el) {\r\n el.parent && el.parent.remove(el);\r\n });\r\n });\r\n each(willInvisibleEls, function (el) {\r\n el.invisible = true;\r\n el.dirty();\r\n });\r\n }\r\n };\r\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\r\n if (!seriesModel.get('animation')) {\r\n return;\r\n }\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n var easingOption = seriesModel.get('animationEasing');\r\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\r\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\r\n var animationWrap = createWrap();\r\n each(renderResult.willDeleteEls, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n if (el.invisible) {\r\n return;\r\n }\r\n var parent = el.parent;\r\n var target;\r\n var innerStore = inner$9(parent);\r\n if (reRoot && reRoot.direction === 'drillDown') {\r\n target = parent === reRoot.rootNodeGroup\r\n ? {\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: innerStore.nodeWidth,\r\n height: innerStore.nodeHeight\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }\r\n : { style: { opacity: 0 } };\r\n }\r\n else {\r\n var targetX = 0;\r\n var targetY = 0;\r\n if (!innerStore.willDelete) {\r\n targetX = innerStore.nodeWidth / 2;\r\n targetY = innerStore.nodeHeight / 2;\r\n }\r\n target = storageName === 'nodeGroup'\r\n ? { x: targetX, y: targetY, style: { opacity: 0 } }\r\n : {\r\n shape: { x: targetX, y: targetY, width: 0, height: 0 },\r\n style: { opacity: 0 }\r\n };\r\n }\r\n target && animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n });\r\n each(this._storage, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\r\n var target = {};\r\n if (!last) {\r\n return;\r\n }\r\n if (el instanceof Group) {\r\n if (last.oldX != null) {\r\n target.x = el.x;\r\n target.y = el.y;\r\n el.x = last.oldX;\r\n el.y = last.oldY;\r\n }\r\n }\r\n else {\r\n if (last.oldShape) {\r\n target.shape = extend({}, el.shape);\r\n el.setShape(last.oldShape);\r\n }\r\n if (last.fadein) {\r\n el.setStyle('opacity', 0);\r\n target.style = { opacity: 1 };\r\n }\r\n else if (el.style.opacity !== 1) {\r\n target.style = { opacity: 1 };\r\n }\r\n }\r\n animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n }, this);\r\n this._state = 'animating';\r\n animationWrap\r\n .finished(bind(function () {\r\n this._state = 'ready';\r\n renderResult.renderFinally();\r\n }, this))\r\n .start();\r\n };\r\n TreemapView.prototype._resetController = function (api) {\r\n var controller = this._controller;\r\n if (!controller) {\r\n controller = this._controller = new RoamController(api.getZr());\r\n controller.enable(this.seriesModel.get('roam'));\r\n controller.on('pan', bind(this._onPan, this));\r\n controller.on('zoom', bind(this._onZoom, this));\r\n }\r\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\r\n controller.setPointerChecker(function (e, x, y) {\r\n return rect.contain(x, y);\r\n });\r\n };\r\n TreemapView.prototype._clearController = function () {\r\n var controller = this._controller;\r\n if (controller) {\r\n controller.dispose();\r\n controller = null;\r\n }\r\n };\r\n TreemapView.prototype._onPan = function (e) {\r\n if (this._state !== 'animating'\r\n && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n this.api.dispatchAction({\r\n type: 'treemapMove',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rootLayout.x + e.dx, y: rootLayout.y + e.dy,\r\n width: rootLayout.width, height: rootLayout.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._onZoom = function (e) {\r\n var mouseX = e.originX;\r\n var mouseY = e.originY;\r\n if (this._state !== 'animating') {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\r\n var layoutInfo = this.seriesModel.layoutInfo;\r\n mouseX -= layoutInfo.x;\r\n mouseY -= layoutInfo.y;\r\n var m = create$1();\r\n translate(m, m, [-mouseX, -mouseY]);\r\n scale$1(m, m, [e.scale, e.scale]);\r\n translate(m, m, [mouseX, mouseY]);\r\n rect.applyTransform(m);\r\n this.api.dispatchAction({\r\n type: 'treemapRender',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rect.x, y: rect.y,\r\n width: rect.width, height: rect.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._initEvents = function (containerGroup) {\r\n var _this = this;\r\n containerGroup.on('click', function (e) {\r\n if (_this._state !== 'ready') {\r\n return;\r\n }\r\n var nodeClick = _this.seriesModel.get('nodeClick', true);\r\n if (!nodeClick) {\r\n return;\r\n }\r\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\r\n if (!targetInfo) {\r\n return;\r\n }\r\n var node = targetInfo.node;\r\n if (node.getLayout().isLeafRoot) {\r\n _this._rootToNode(targetInfo);\r\n }\r\n else {\r\n if (nodeClick === 'zoomToNode') {\r\n _this._zoomToNode(targetInfo);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\r\n var link = itemModel.get('link', true);\r\n var linkTarget = itemModel.get('target', true) || 'blank';\r\n link && windowOpen(link, linkTarget);\r\n }\r\n }\r\n }, this);\r\n };\r\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\r\n var _this = this;\r\n if (!targetInfo) {\r\n targetInfo = seriesModel.get('leafDepth', true) != null\r\n ? { node: seriesModel.getViewRoot() }\r\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\r\n if (!targetInfo) {\r\n targetInfo = { node: seriesModel.getData().tree.root };\r\n }\r\n }\r\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group)))\r\n .render(seriesModel, api, targetInfo.node, function (node) {\r\n if (_this._state !== 'animating') {\r\n aboveViewRoot(seriesModel.getViewRoot(), node)\r\n ? _this._rootToNode({ node: node })\r\n : _this._zoomToNode({ node: node });\r\n }\r\n });\r\n };\r\n TreemapView.prototype.remove = function () {\r\n this._clearController();\r\n this._containerGroup && this._containerGroup.removeAll();\r\n this._storage = createStorage();\r\n this._state = 'ready';\r\n this._breadcrumb && this._breadcrumb.remove();\r\n };\r\n TreemapView.prototype.dispose = function () {\r\n this._clearController();\r\n };\r\n TreemapView.prototype._zoomToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapZoomToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype._rootToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapRootToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype.findTarget = function (x, y) {\r\n var targetInfo;\r\n var viewRoot = this.seriesModel.getViewRoot();\r\n viewRoot.eachNode({ attr: 'viewChildren', order: 'preorder' }, function (node) {\r\n var bgEl = this._storage.background[node.getRawIndex()];\r\n if (bgEl) {\r\n var point = bgEl.transformCoordToLocal(x, y);\r\n var shape = bgEl.shape;\r\n if (shape.x <= point[0]\r\n && point[0] <= shape.x + shape.width\r\n && shape.y <= point[1]\r\n && point[1] <= shape.y + shape.height) {\r\n targetInfo = {\r\n node: node,\r\n offsetX: point[0],\r\n offsetY: point[1]\r\n };\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }, this);\r\n return targetInfo;\r\n };\r\n TreemapView.type = 'treemap';\r\n return TreemapView;\r\n }(ChartView));\r\n function createStorage() {\r\n return {\r\n nodeGroup: [],\r\n background: [],\r\n content: []\r\n };\r\n }\r\n function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\r\n if (!thisNode) {\r\n return;\r\n }\r\n var thisLayout = thisNode.getLayout();\r\n var data = seriesModel.getData();\r\n var nodeModel = thisNode.getModel();\r\n data.setItemGraphicEl(thisNode.dataIndex, null);\r\n if (!thisLayout || !thisLayout.isInView) {\r\n return;\r\n }\r\n var thisWidth = thisLayout.width;\r\n var thisHeight = thisLayout.height;\r\n var borderWidth = thisLayout.borderWidth;\r\n var thisInvisible = thisLayout.invisible;\r\n var thisRawIndex = thisNode.getRawIndex();\r\n var oldRawIndex = oldNode && oldNode.getRawIndex();\r\n var thisViewChildren = thisNode.viewChildren;\r\n var upperHeight = thisLayout.upperHeight;\r\n var isParent = thisViewChildren && thisViewChildren.length;\r\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\r\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\r\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\r\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\r\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\r\n var group = giveGraphic('nodeGroup', Group$1);\r\n if (!group) {\r\n return;\r\n }\r\n parentGroup.add(group);\r\n group.x = thisLayout.x || 0;\r\n group.y = thisLayout.y || 0;\r\n group.markRedraw();\r\n inner$9(group).nodeWidth = thisWidth;\r\n inner$9(group).nodeHeight = thisHeight;\r\n if (thisLayout.isAboveViewRoot) {\r\n return group;\r\n }\r\n var bg = giveGraphic('background', Rect$1, depth, Z_BG);\r\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\r\n var focus = nodeModel.get(['emphasis', 'focus']);\r\n var blurScope = nodeModel.get(['emphasis', 'blurScope']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? thisNode.getAncestorsIndices()\r\n : focus === 'descendant' ? thisNode.getDescendantIndices() : null;\r\n if (isParent) {\r\n if (isHighDownDispatcher(group)) {\r\n setAsHighDownDispatcher(group, false);\r\n }\r\n if (bg) {\r\n setAsHighDownDispatcher(bg, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, bg);\r\n enableHoverFocus(bg, focusDataIndices || focus, blurScope);\r\n }\r\n }\r\n else {\r\n var content = giveGraphic('content', Rect$1, depth, Z_CONTENT);\r\n content && renderContent(group, content);\r\n if (bg && isHighDownDispatcher(bg)) {\r\n setAsHighDownDispatcher(bg, false);\r\n }\r\n setAsHighDownDispatcher(group, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, group);\r\n enableHoverFocus(group, focusDataIndices || focus, blurScope);\r\n }\r\n return group;\r\n function renderBackground(group, bg, useUpperLabel) {\r\n var ecData = getECData(bg);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius });\r\n if (thisInvisible) {\r\n processInvisible(bg);\r\n }\r\n else {\r\n bg.invisible = false;\r\n var style = thisNode.getVisual('style');\r\n var visualBorderColor = style.stroke;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualBorderColor;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\r\n if (useUpperLabel) {\r\n var upperLabelWidth = thisWidth - 2 * borderWidth;\r\n prepareText(bg, visualBorderColor, upperLabelWidth, upperHeight, style.opacity, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight });\r\n }\r\n else {\r\n bg.removeTextContent();\r\n }\r\n bg.setStyle(normalStyle);\r\n bg.ensureState('emphasis').style = emphasisStyle;\r\n bg.ensureState('blur').style = blurStyle;\r\n bg.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(bg);\r\n }\r\n group.add(bg);\r\n }\r\n function renderContent(group, content) {\r\n var ecData = getECData(content);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\r\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\r\n content.culling = true;\r\n content.setShape({\r\n x: borderWidth,\r\n y: borderWidth,\r\n width: contentWidth,\r\n height: contentHeight,\r\n r: borderRadius\r\n });\r\n if (thisInvisible) {\r\n processInvisible(content);\r\n }\r\n else {\r\n content.invisible = false;\r\n var nodeStyle = thisNode.getVisual('style');\r\n var visualColor = nodeStyle.fill;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualColor;\r\n normalStyle.decal = nodeStyle.decal;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n prepareText(content, visualColor, contentWidth, nodeStyle.opacity);\r\n content.setStyle(normalStyle);\r\n content.ensureState('emphasis').style = emphasisStyle;\r\n content.ensureState('blur').style = blurStyle;\r\n content.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(content);\r\n }\r\n group.add(content);\r\n }\r\n function processInvisible(element) {\r\n !element.invisible && willInvisibleEls.push(element);\r\n }\r\n function prepareText(rectEl, visualColor, visualOpacity, width, height, upperLabelRect) {\r\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\r\n var text = retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, normalLabelModel.get('formatter')), convertOptionIdName(nodeModel.get('name'), null));\r\n if (!upperLabelRect && thisLayout.isLeafRoot) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n var isShow = normalLabelModel.getShallow('show');\r\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\r\n defaultText: isShow ? text : null,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: thisNode.dataIndex\r\n });\r\n var textEl = rectEl.getTextContent();\r\n var textStyle = textEl.style;\r\n var textPadding = normalizeCssArray(textStyle.padding || 0);\r\n if (upperLabelRect) {\r\n rectEl.setTextConfig({\r\n layoutRect: upperLabelRect\r\n });\r\n textEl.disableLabelLayout = true;\r\n }\r\n textEl.beforeUpdate = function () {\r\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\r\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\r\n if (textStyle.width !== width || textStyle.height !== height) {\r\n textEl.setStyle({\r\n width: width,\r\n height: height\r\n });\r\n }\r\n };\r\n textStyle.truncateMinChar = 2;\r\n textStyle.lineOverflow = 'truncate';\r\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\r\n var textEmphasisState = textEl.getState('emphasis');\r\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\r\n }\r\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\r\n var text = style ? style.text : null;\r\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n style.text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n }\r\n function giveGraphic(storageName, Ctor, depth, z) {\r\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\r\n var lasts = lastsForAnimation[storageName];\r\n if (element) {\r\n oldStorage[storageName][oldRawIndex] = null;\r\n prepareAnimationWhenHasOld(lasts, element);\r\n }\r\n else if (!thisInvisible) {\r\n element = new Ctor();\r\n if (element instanceof Displayable) {\r\n element.z = calculateZ(depth, z);\r\n }\r\n prepareAnimationWhenNoOld(lasts, element);\r\n }\r\n return (thisStorage[storageName][thisRawIndex] = element);\r\n }\r\n function prepareAnimationWhenHasOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n if (element instanceof Group$1) {\r\n lastCfg.oldX = element.x;\r\n lastCfg.oldY = element.y;\r\n }\r\n else {\r\n lastCfg.oldShape = extend({}, element.shape);\r\n }\r\n }\r\n function prepareAnimationWhenNoOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n var parentNode = thisNode.parentNode;\r\n var isGroup = element instanceof Group;\r\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\r\n var parentOldX = 0;\r\n var parentOldY = 0;\r\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\r\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\r\n parentOldX = parentOldBg.oldShape.width;\r\n parentOldY = parentOldBg.oldShape.height;\r\n }\r\n if (isGroup) {\r\n lastCfg.oldX = 0;\r\n lastCfg.oldY = parentOldY;\r\n }\r\n else {\r\n lastCfg.oldShape = { x: parentOldX, y: parentOldY, width: 0, height: 0 };\r\n }\r\n }\r\n lastCfg.fadein = !isGroup;\r\n }\r\n }\r\n function calculateZ(depth, zInLevel) {\r\n var zb = depth * Z_BASE + zInLevel;\r\n return (zb - 1) / zb;\r\n }\r\n ChartView.registerClass(TreemapView);\n\n var noop$1 = function () { };\r\n var actionTypes = [\r\n 'treemapZoomToNode',\r\n 'treemapRender',\r\n 'treemapMove'\r\n ];\r\n for (var i$1 = 0; i$1 < actionTypes.length; i$1++) {\r\n registerAction({\r\n type: actionTypes[i$1],\r\n update: 'updateView'\r\n }, noop$1);\r\n }\r\n registerAction({ type: 'treemapRootToNode', update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'treemap', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n });\n\n var each$4 = each;\r\n var isObject$4 = isObject;\r\n var CATEGORY_DEFAULT_VISUAL_INDEX = -1;\r\n var VisualMapping = (function () {\r\n function VisualMapping(option) {\r\n var mappingMethod = option.mappingMethod;\r\n var visualType = option.type;\r\n var thisOption = this.option = clone(option);\r\n this.type = visualType;\r\n this.mappingMethod = mappingMethod;\r\n this._normalizeData = normalizers[mappingMethod];\r\n var visualHandler = VisualMapping.visualHandlers[visualType];\r\n this.applyVisual = visualHandler.applyVisual;\r\n this.getColorMapper = visualHandler.getColorMapper;\r\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\r\n if (mappingMethod === 'piecewise') {\r\n normalizeVisualRange(thisOption);\r\n preprocessForPiecewise(thisOption);\r\n }\r\n else if (mappingMethod === 'category') {\r\n thisOption.categories\r\n ? preprocessForSpecifiedCategory(thisOption)\r\n : normalizeVisualRange(thisOption, true);\r\n }\r\n else {\r\n assert(mappingMethod !== 'linear' || thisOption.dataExtent);\r\n normalizeVisualRange(thisOption);\r\n }\r\n }\r\n VisualMapping.prototype.mapValueToVisual = function (value) {\r\n var normalized = this._normalizeData(value);\r\n return this._normalizedToVisual(normalized, value);\r\n };\r\n VisualMapping.prototype.getNormalizer = function () {\r\n return bind(this._normalizeData, this);\r\n };\r\n VisualMapping.listVisualTypes = function () {\r\n return keys(VisualMapping.visualHandlers);\r\n };\r\n VisualMapping.isValidType = function (visualType) {\r\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\r\n };\r\n VisualMapping.eachVisual = function (visual, callback, context) {\r\n if (isObject(visual)) {\r\n each(visual, callback, context);\r\n }\r\n else {\r\n callback.call(context, visual);\r\n }\r\n };\r\n VisualMapping.mapVisual = function (visual, callback, context) {\r\n var isPrimary;\r\n var newVisual = isArray(visual)\r\n ? []\r\n : isObject(visual)\r\n ? {}\r\n : (isPrimary = true, null);\r\n VisualMapping.eachVisual(visual, function (v, key) {\r\n var newVal = callback.call(context, v, key);\r\n isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal);\r\n });\r\n return newVisual;\r\n };\r\n VisualMapping.retrieveVisuals = function (obj) {\r\n var ret = {};\r\n var hasVisual;\r\n obj && each$4(VisualMapping.visualHandlers, function (h, visualType) {\r\n if (obj.hasOwnProperty(visualType)) {\r\n ret[visualType] = obj[visualType];\r\n hasVisual = true;\r\n }\r\n });\r\n return hasVisual ? ret : null;\r\n };\r\n VisualMapping.prepareVisualTypes = function (visualTypes) {\r\n if (isArray(visualTypes)) {\r\n visualTypes = visualTypes.slice();\r\n }\r\n else if (isObject$4(visualTypes)) {\r\n var types_1 = [];\r\n each$4(visualTypes, function (item, type) {\r\n types_1.push(type);\r\n });\r\n visualTypes = types_1;\r\n }\r\n else {\r\n return [];\r\n }\r\n visualTypes.sort(function (type1, type2) {\r\n return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)\r\n ? 1 : -1;\r\n });\r\n return visualTypes;\r\n };\r\n VisualMapping.dependsOn = function (visualType1, visualType2) {\r\n return visualType2 === 'color'\r\n ? !!(visualType1 && visualType1.indexOf(visualType2) === 0)\r\n : visualType1 === visualType2;\r\n };\r\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\r\n var possibleI;\r\n var abs = Infinity;\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var pieceValue = pieceList[i].value;\r\n if (pieceValue != null) {\r\n if (pieceValue === value\r\n || (typeof pieceValue === 'string' && pieceValue === value + '')) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(pieceValue, i);\r\n }\r\n }\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var piece = pieceList[i];\r\n var interval = piece.interval;\r\n var close_1 = piece.close;\r\n if (interval) {\r\n if (interval[0] === -Infinity) {\r\n if (littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n }\r\n else if (interval[1] === Infinity) {\r\n if (littleThan(close_1[0], interval[0], value)) {\r\n return i;\r\n }\r\n }\r\n else if (littleThan(close_1[0], interval[0], value)\r\n && littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(interval[0], i);\r\n findClosestWhenOutside && updatePossible(interval[1], i);\r\n }\r\n }\r\n if (findClosestWhenOutside) {\r\n return value === Infinity\r\n ? pieceList.length - 1\r\n : value === -Infinity\r\n ? 0\r\n : possibleI;\r\n }\r\n function updatePossible(val, index) {\r\n var newAbs = Math.abs(val - value);\r\n if (newAbs < abs) {\r\n abs = newAbs;\r\n possibleI = index;\r\n }\r\n }\r\n };\r\n VisualMapping.visualHandlers = {\r\n color: {\r\n applyVisual: makeApplyVisual('color'),\r\n getColorMapper: function () {\r\n var thisOption = this.option;\r\n return bind(thisOption.mappingMethod === 'category'\r\n ? function (value, isNormalized) {\r\n !isNormalized && (value = this._normalizeData(value));\r\n return doMapCategory.call(this, value);\r\n }\r\n : function (value, isNormalized, out) {\r\n var returnRGBArray = !!out;\r\n !isNormalized && (value = this._normalizeData(value));\r\n out = fastLerp(value, thisOption.parsedVisual, out);\r\n return returnRGBArray ? out : stringify(out, 'rgba');\r\n }, this);\r\n },\r\n _normalizedToVisual: {\r\n linear: function (normalized) {\r\n return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n colorHue: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, value);\r\n }),\r\n colorSaturation: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, value);\r\n }),\r\n colorLightness: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, null, value);\r\n }),\r\n colorAlpha: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyAlpha(color$1, value);\r\n }),\r\n decal: {\r\n applyVisual: makeApplyVisual('decal'),\r\n _normalizedToVisual: {\r\n linear: null,\r\n category: doMapCategory,\r\n piecewise: null,\r\n fixed: null\r\n }\r\n },\r\n opacity: {\r\n applyVisual: makeApplyVisual('opacity'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n },\r\n liftZ: {\r\n applyVisual: makeApplyVisual('liftZ'),\r\n _normalizedToVisual: {\r\n linear: doMapFixed,\r\n category: doMapFixed,\r\n piecewise: doMapFixed,\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbol: {\r\n applyVisual: function (value, getter, setter) {\r\n var symbolCfg = this.mapValueToVisual(value);\r\n setter('symbol', symbolCfg);\r\n },\r\n _normalizedToVisual: {\r\n linear: doMapToArray,\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = doMapToArray.call(this, normalized);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbolSize: {\r\n applyVisual: makeApplyVisual('symbolSize'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n }\r\n };\r\n return VisualMapping;\r\n }());\r\n function preprocessForPiecewise(thisOption) {\r\n var pieceList = thisOption.pieceList;\r\n thisOption.hasSpecialVisual = false;\r\n each(pieceList, function (piece, index) {\r\n piece.originIndex = index;\r\n if (piece.visual != null) {\r\n thisOption.hasSpecialVisual = true;\r\n }\r\n });\r\n }\r\n function preprocessForSpecifiedCategory(thisOption) {\r\n var categories = thisOption.categories;\r\n var categoryMap = thisOption.categoryMap = {};\r\n var visual = thisOption.visual;\r\n each$4(categories, function (cate, index) {\r\n categoryMap[cate] = index;\r\n });\r\n if (!isArray(visual)) {\r\n var visualArr_1 = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v, cate) {\r\n var index = categoryMap[cate];\r\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\r\n });\r\n }\r\n else {\r\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\r\n }\r\n visual = setVisualToOption(thisOption, visualArr_1);\r\n }\r\n for (var i = categories.length - 1; i >= 0; i--) {\r\n if (visual[i] == null) {\r\n delete categoryMap[categories[i]];\r\n categories.pop();\r\n }\r\n }\r\n }\r\n function normalizeVisualRange(thisOption, isCategory) {\r\n var visual = thisOption.visual;\r\n var visualArr = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v) {\r\n visualArr.push(v);\r\n });\r\n }\r\n else if (visual != null) {\r\n visualArr.push(visual);\r\n }\r\n var doNotNeedPair = { color: 1, symbol: 1 };\r\n if (!isCategory\r\n && visualArr.length === 1\r\n && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\r\n visualArr[1] = visualArr[0];\r\n }\r\n setVisualToOption(thisOption, visualArr);\r\n }\r\n function makePartialColorVisualHandler(applyValue) {\r\n return {\r\n applyVisual: function (value, getter, setter) {\r\n var colorChannel = this.mapValueToVisual(value);\r\n setter('color', applyValue(getter('color'), colorChannel));\r\n },\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n };\r\n }\r\n function doMapToArray(normalized) {\r\n var visual = this.option.visual;\r\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};\r\n }\r\n function makeApplyVisual(visualType) {\r\n return function (value, getter, setter) {\r\n setter(visualType, this.mapValueToVisual(value));\r\n };\r\n }\r\n function doMapCategory(normalized) {\r\n var visual = this.option.visual;\r\n return visual[(this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)\r\n ? normalized % visual.length\r\n : normalized];\r\n }\r\n function doMapFixed() {\r\n return this.option.visual[0];\r\n }\r\n function createNormalizedToNumericVisual(sourceExtent) {\r\n return {\r\n linear: function (normalized) {\r\n return linearMap(normalized, sourceExtent, this.option.visual, true);\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n };\r\n }\r\n function getSpecifiedVisual(value) {\r\n var thisOption = this.option;\r\n var pieceList = thisOption.pieceList;\r\n if (thisOption.hasSpecialVisual) {\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\r\n var piece = pieceList[pieceIndex];\r\n if (piece && piece.visual) {\r\n return piece.visual[this.type];\r\n }\r\n }\r\n }\r\n function setVisualToOption(thisOption, visualArr) {\r\n thisOption.visual = visualArr;\r\n if (thisOption.type === 'color') {\r\n thisOption.parsedVisual = map(visualArr, function (item) {\r\n return parse(item);\r\n });\r\n }\r\n return visualArr;\r\n }\r\n var normalizers = {\r\n linear: function (value) {\r\n return linearMap(value, this.option.dataExtent, [0, 1], true);\r\n },\r\n piecewise: function (value) {\r\n var pieceList = this.option.pieceList;\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\r\n if (pieceIndex != null) {\r\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\r\n }\r\n },\r\n category: function (value) {\r\n var index = this.option.categories\r\n ? this.option.categoryMap[value]\r\n : value;\r\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\r\n },\r\n fixed: noop\r\n };\r\n function littleThan(close, a, b) {\r\n return close ? a <= b : a < b;\r\n }\n\n var ITEM_STYLE_NORMAL = 'itemStyle';\r\n var inner$a = makeInner();\r\n var treemapVisual = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel) {\r\n var tree = seriesModel.getData().tree;\r\n var root = tree.root;\r\n if (root.isRemoved()) {\r\n return;\r\n }\r\n travelTree(root, {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\r\n }\r\n };\r\n function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\r\n var nodeModel = node.getModel();\r\n var nodeLayout = node.getLayout();\r\n var data = node.hostTree.data;\r\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\r\n return;\r\n }\r\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\r\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n var borderColor = nodeItemStyleModel.get('borderColor');\r\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\r\n var thisNodeColor;\r\n if (borderColorSaturation != null) {\r\n thisNodeColor = calculateColor(visuals);\r\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\r\n }\r\n existsStyle.stroke = borderColor;\r\n var viewChildren = node.viewChildren;\r\n if (!viewChildren || !viewChildren.length) {\r\n thisNodeColor = calculateColor(visuals);\r\n existsStyle.fill = thisNodeColor;\r\n }\r\n else {\r\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\r\n each(viewChildren, function (child, index) {\r\n if (child.depth >= viewRootAncestors.length\r\n || child === viewRootAncestors[child.depth]) {\r\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\r\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\r\n }\r\n });\r\n }\r\n }\r\n function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\r\n var visuals = extend({}, designatedVisual);\r\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\r\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\r\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\r\n var val = nodeItemStyleModel.get(visualName);\r\n designatedVisualItemStyle[visualName] = null;\r\n val != null && (visuals[visualName] = val);\r\n });\r\n return visuals;\r\n }\r\n function calculateColor(visuals) {\r\n var color = getValueVisualDefine(visuals, 'color');\r\n if (color) {\r\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\r\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\r\n if (colorSaturation) {\r\n color = modifyHSL(color, null, null, colorSaturation);\r\n }\r\n if (colorAlpha) {\r\n color = modifyAlpha(color, colorAlpha);\r\n }\r\n return color;\r\n }\r\n }\r\n function calculateBorderColor(borderColorSaturation, thisNodeColor) {\r\n return thisNodeColor != null\r\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation)\r\n : null;\r\n }\r\n function getValueVisualDefine(visuals, name) {\r\n var value = visuals[name];\r\n if (value != null && value !== 'none') {\r\n return value;\r\n }\r\n }\r\n function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\r\n if (!viewChildren || !viewChildren.length) {\r\n return;\r\n }\r\n var rangeVisual = getRangeVisual(nodeModel, 'color')\r\n || (visuals.color != null\r\n && visuals.color !== 'none'\r\n && (getRangeVisual(nodeModel, 'colorAlpha')\r\n || getRangeVisual(nodeModel, 'colorSaturation')));\r\n if (!rangeVisual) {\r\n return;\r\n }\r\n var visualMin = nodeModel.get('visualMin');\r\n var visualMax = nodeModel.get('visualMax');\r\n var dataExtent = nodeLayout.dataExtent.slice();\r\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\r\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\r\n var colorMappingBy = nodeModel.get('colorMappingBy');\r\n var opt = {\r\n type: rangeVisual.name,\r\n dataExtent: dataExtent,\r\n visual: rangeVisual.range\r\n };\r\n if (opt.type === 'color'\r\n && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\r\n opt.mappingMethod = 'category';\r\n opt.loop = true;\r\n }\r\n else {\r\n opt.mappingMethod = 'linear';\r\n }\r\n var mapping = new VisualMapping(opt);\r\n inner$a(mapping).drColorMappingBy = colorMappingBy;\r\n return mapping;\r\n }\r\n function getRangeVisual(nodeModel, name) {\r\n var range = nodeModel.get(name);\r\n return (isArray(range) && range.length) ? {\r\n name: name,\r\n range: range\r\n } : null;\r\n }\r\n function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\r\n var childVisuals = extend({}, visuals);\r\n if (mapping) {\r\n var mappingType = mapping.type;\r\n var colorMappingBy = mappingType === 'color' && inner$a(mapping).drColorMappingBy;\r\n var value = colorMappingBy === 'index'\r\n ? index\r\n : colorMappingBy === 'id'\r\n ? seriesModel.mapIdToIndex(child.getId())\r\n : child.getValue(nodeModel.get('visualDimension'));\r\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\r\n }\r\n return childVisuals;\r\n }\n\n var mathMax$7 = Math.max;\r\n var mathMin$7 = Math.min;\r\n var retrieveValue = retrieve;\r\n var each$5 = each;\r\n var PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\r\n var PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\r\n var PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\r\n var PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\r\n var treemapLayout = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel, ecModel, api, payload) {\r\n var ecWidth = api.getWidth();\r\n var ecHeight = api.getHeight();\r\n var seriesOption = seriesModel.option;\r\n var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n var size = seriesOption.size || [];\r\n var containerWidth = parsePercent$2(retrieveValue(layoutInfo.width, size[0]), ecWidth);\r\n var containerHeight = parsePercent$2(retrieveValue(layoutInfo.height, size[1]), ecHeight);\r\n var payloadType = payload && payload.type;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')\r\n ? payload.rootRect : null;\r\n var viewRoot = seriesModel.getViewRoot();\r\n var viewAbovePath = getPathToRoot(viewRoot);\r\n if (payloadType !== 'treemapMove') {\r\n var rootSize = payloadType === 'treemapZoomToNode'\r\n ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight)\r\n : rootRect\r\n ? [rootRect.width, rootRect.height]\r\n : [containerWidth, containerHeight];\r\n var sort_1 = seriesOption.sort;\r\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\r\n sort_1 = 'desc';\r\n }\r\n var options = {\r\n squareRatio: seriesOption.squareRatio,\r\n sort: sort_1,\r\n leafDepth: seriesOption.leafDepth\r\n };\r\n viewRoot.hostTree.clearLayouts();\r\n var viewRootLayout_1 = {\r\n x: 0,\r\n y: 0,\r\n width: rootSize[0],\r\n height: rootSize[1],\r\n area: rootSize[0] * rootSize[1]\r\n };\r\n viewRoot.setLayout(viewRootLayout_1);\r\n squarify(viewRoot, options, false, 0);\r\n viewRootLayout_1 = viewRoot.getLayout();\r\n each$5(viewAbovePath, function (node, index) {\r\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\r\n node.setLayout(extend({\r\n dataExtent: [childValue, childValue],\r\n borderWidth: 0,\r\n upperHeight: 0\r\n }, viewRootLayout_1));\r\n });\r\n }\r\n var treeRoot = seriesModel.getData().tree.root;\r\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\r\n seriesModel.setLayoutInfo(layoutInfo);\r\n prunning(treeRoot, new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\r\n }\r\n };\r\n function squarify(node, options, hideChildren, depth) {\r\n var width;\r\n var height;\r\n if (node.isRemoved()) {\r\n return;\r\n }\r\n var thisLayout = node.getLayout();\r\n width = thisLayout.width;\r\n height = thisLayout.height;\r\n var nodeModel = node.getModel();\r\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\r\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\r\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\r\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\r\n var layoutOffset = borderWidth - halfGapWidth;\r\n var layoutOffsetUpper = upperHeight - halfGapWidth;\r\n node.setLayout({\r\n borderWidth: borderWidth,\r\n upperHeight: upperHeight,\r\n upperLabelHeight: upperLabelHeight\r\n }, true);\r\n width = mathMax$7(width - 2 * layoutOffset, 0);\r\n height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0);\r\n var totalArea = width * height;\r\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\r\n if (!viewChildren.length) {\r\n return;\r\n }\r\n var rect = { x: layoutOffset, y: layoutOffsetUpper, width: width, height: height };\r\n var rowFixedLength = mathMin$7(width, height);\r\n var best = Infinity;\r\n var row = [];\r\n row.area = 0;\r\n for (var i = 0, len = viewChildren.length; i < len;) {\r\n var child = viewChildren[i];\r\n row.push(child);\r\n row.area += child.getLayout().area;\r\n var score = worst(row, rowFixedLength, options.squareRatio);\r\n if (score <= best) {\r\n i++;\r\n best = score;\r\n }\r\n else {\r\n row.area -= row.pop().getLayout().area;\r\n position(row, rowFixedLength, rect, halfGapWidth, false);\r\n rowFixedLength = mathMin$7(rect.width, rect.height);\r\n row.length = row.area = 0;\r\n best = Infinity;\r\n }\r\n }\r\n if (row.length) {\r\n position(row, rowFixedLength, rect, halfGapWidth, true);\r\n }\r\n if (!hideChildren) {\r\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\r\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\r\n hideChildren = true;\r\n }\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n squarify(viewChildren[i], options, hideChildren, depth + 1);\r\n }\r\n }\r\n function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\r\n var viewChildren = node.children || [];\r\n var orderBy = options.sort;\r\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\r\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\r\n if (hideChildren && !overLeafDepth) {\r\n return (node.viewChildren = []);\r\n }\r\n viewChildren = filter(viewChildren, function (child) {\r\n return !child.isRemoved();\r\n });\r\n sort$1(viewChildren, orderBy);\r\n var info = statistic(nodeModel, viewChildren, orderBy);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n var area = viewChildren[i].getValue() / info.sum * totalArea;\r\n viewChildren[i].setLayout({\r\n area: area\r\n });\r\n }\r\n if (overLeafDepth) {\r\n viewChildren.length && node.setLayout({\r\n isLeafRoot: true\r\n }, true);\r\n viewChildren.length = 0;\r\n }\r\n node.viewChildren = viewChildren;\r\n node.setLayout({\r\n dataExtent: info.dataExtent\r\n }, true);\r\n return viewChildren;\r\n }\r\n function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\r\n if (!orderBy) {\r\n return sum;\r\n }\r\n var visibleMin = nodeModel.get('visibleMin');\r\n var len = orderedChildren.length;\r\n var deletePoint = len;\r\n for (var i = len - 1; i >= 0; i--) {\r\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\r\n if (value / sum * totalArea < visibleMin) {\r\n deletePoint = i;\r\n sum -= value;\r\n }\r\n }\r\n orderBy === 'asc'\r\n ? orderedChildren.splice(0, len - deletePoint)\r\n : orderedChildren.splice(deletePoint, len - deletePoint);\r\n return sum;\r\n }\r\n function sort$1(viewChildren, orderBy) {\r\n if (orderBy) {\r\n viewChildren.sort(function (a, b) {\r\n var diff = orderBy === 'asc'\r\n ? a.getValue() - b.getValue()\r\n : b.getValue() - a.getValue();\r\n return diff === 0\r\n ? (orderBy === 'asc'\r\n ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex)\r\n : diff;\r\n });\r\n }\r\n return viewChildren;\r\n }\r\n function statistic(nodeModel, children, orderBy) {\r\n var sum = 0;\r\n for (var i = 0, len = children.length; i < len; i++) {\r\n sum += children[i].getValue();\r\n }\r\n var dimension = nodeModel.get('visualDimension');\r\n var dataExtent;\r\n if (!children || !children.length) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n else if (dimension === 'value' && orderBy) {\r\n dataExtent = [\r\n children[children.length - 1].getValue(),\r\n children[0].getValue()\r\n ];\r\n orderBy === 'asc' && dataExtent.reverse();\r\n }\r\n else {\r\n dataExtent = [Infinity, -Infinity];\r\n each$5(children, function (child) {\r\n var value = child.getValue(dimension);\r\n value < dataExtent[0] && (dataExtent[0] = value);\r\n value > dataExtent[1] && (dataExtent[1] = value);\r\n });\r\n }\r\n return { sum: sum, dataExtent: dataExtent };\r\n }\r\n function worst(row, rowFixedLength, ratio) {\r\n var areaMax = 0;\r\n var areaMin = Infinity;\r\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\r\n area = row[i].getLayout().area;\r\n if (area) {\r\n area < areaMin && (areaMin = area);\r\n area > areaMax && (areaMax = area);\r\n }\r\n }\r\n var squareArea = row.area * row.area;\r\n var f = rowFixedLength * rowFixedLength * ratio;\r\n return squareArea\r\n ? mathMax$7((f * areaMax) / squareArea, squareArea / (f * areaMin))\r\n : Infinity;\r\n }\r\n function position(row, rowFixedLength, rect, halfGapWidth, flush) {\r\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\r\n var idx1WhenH = 1 - idx0WhenH;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var last = rect[xy[idx0WhenH]];\r\n var rowOtherLength = rowFixedLength\r\n ? row.area / rowFixedLength : 0;\r\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\r\n rowOtherLength = rect[wh[idx1WhenH]];\r\n }\r\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\r\n var node = row[i];\r\n var nodeLayout = {};\r\n var step = rowOtherLength\r\n ? node.getLayout().area / rowOtherLength : 0;\r\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0);\r\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\r\n var modWH = (i === rowLen - 1 || remain < step) ? remain : step;\r\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0);\r\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2);\r\n nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2);\r\n last += modWH;\r\n node.setLayout(nodeLayout, true);\r\n }\r\n rect[xy[idx1WhenH]] += rowOtherLength;\r\n rect[wh[idx1WhenH]] -= rowOtherLength;\r\n }\r\n function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\r\n var currNode = (targetInfo || {}).node;\r\n var defaultSize = [containerWidth, containerHeight];\r\n if (!currNode || currNode === viewRoot) {\r\n return defaultSize;\r\n }\r\n var parent;\r\n var viewArea = containerWidth * containerHeight;\r\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\r\n while (parent = currNode.parentNode) {\r\n var sum = 0;\r\n var siblings = parent.children;\r\n for (var i = 0, len = siblings.length; i < len; i++) {\r\n sum += siblings[i].getValue();\r\n }\r\n var currNodeValue = currNode.getValue();\r\n if (currNodeValue === 0) {\r\n return defaultSize;\r\n }\r\n area *= sum / currNodeValue;\r\n var parentModel = parent.getModel();\r\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\r\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\r\n area += 4 * borderWidth * borderWidth\r\n + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\r\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\r\n currNode = parent;\r\n }\r\n area < viewArea && (area = viewArea);\r\n var scale = Math.pow(area / viewArea, 0.5);\r\n return [containerWidth * scale, containerHeight * scale];\r\n }\r\n function calculateRootPosition(layoutInfo, rootRect, targetInfo) {\r\n if (rootRect) {\r\n return { x: rootRect.x, y: rootRect.y };\r\n }\r\n var defaultPosition = { x: 0, y: 0 };\r\n if (!targetInfo) {\r\n return defaultPosition;\r\n }\r\n var targetNode = targetInfo.node;\r\n var layout = targetNode.getLayout();\r\n if (!layout) {\r\n return defaultPosition;\r\n }\r\n var targetCenter = [layout.width / 2, layout.height / 2];\r\n var node = targetNode;\r\n while (node) {\r\n var nodeLayout = node.getLayout();\r\n targetCenter[0] += nodeLayout.x;\r\n targetCenter[1] += nodeLayout.y;\r\n node = node.parentNode;\r\n }\r\n return {\r\n x: layoutInfo.width / 2 - targetCenter[0],\r\n y: layoutInfo.height / 2 - targetCenter[1]\r\n };\r\n }\r\n function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\r\n var nodeLayout = node.getLayout();\r\n var nodeInViewAbovePath = viewAbovePath[depth];\r\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\r\n if ((nodeInViewAbovePath && !isAboveViewRoot)\r\n || (depth === viewAbovePath.length && node !== viewRoot)) {\r\n return;\r\n }\r\n node.setLayout({\r\n isInView: true,\r\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\r\n isAboveViewRoot: isAboveViewRoot\r\n }, true);\r\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\r\n each$5(node.viewChildren || [], function (child) {\r\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\r\n });\r\n }\r\n function getUpperLabelHeight(model) {\r\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\r\n }\n\n registerVisual(treemapVisual);\r\n registerLayout(treemapLayout);\n\n function generateNodeKey(id) {\r\n return '_EC_' + id;\r\n }\r\n var Graph = (function () {\r\n function Graph(directed) {\r\n this.type = 'graph';\r\n this.nodes = [];\r\n this.edges = [];\r\n this._nodesMap = {};\r\n this._edgesMap = {};\r\n this._directed = directed || false;\r\n }\r\n Graph.prototype.isDirected = function () {\r\n return this._directed;\r\n };\r\n Graph.prototype.addNode = function (id, dataIndex) {\r\n id = id == null ? ('' + dataIndex) : ('' + id);\r\n var nodesMap = this._nodesMap;\r\n if (nodesMap[generateNodeKey(id)]) {\r\n if (__DEV__) {\r\n console.error('Graph nodes have duplicate name or id');\r\n }\r\n return;\r\n }\r\n var node = new GraphNode(id, dataIndex);\r\n node.hostGraph = this;\r\n this.nodes.push(node);\r\n nodesMap[generateNodeKey(id)] = node;\r\n return node;\r\n };\r\n Graph.prototype.getNodeByIndex = function (dataIndex) {\r\n var rawIdx = this.data.getRawIndex(dataIndex);\r\n return this.nodes[rawIdx];\r\n };\r\n Graph.prototype.getNodeById = function (id) {\r\n return this._nodesMap[generateNodeKey(id)];\r\n };\r\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\r\n var nodesMap = this._nodesMap;\r\n var edgesMap = this._edgesMap;\r\n if (typeof n1 === 'number') {\r\n n1 = this.nodes[n1];\r\n }\r\n if (typeof n2 === 'number') {\r\n n2 = this.nodes[n2];\r\n }\r\n if (!(n1 instanceof GraphNode)) {\r\n n1 = nodesMap[generateNodeKey(n1)];\r\n }\r\n if (!(n2 instanceof GraphNode)) {\r\n n2 = nodesMap[generateNodeKey(n2)];\r\n }\r\n if (!n1 || !n2) {\r\n return;\r\n }\r\n var key = n1.id + '-' + n2.id;\r\n var edge = new GraphEdge(n1, n2, dataIndex);\r\n edge.hostGraph = this;\r\n if (this._directed) {\r\n n1.outEdges.push(edge);\r\n n2.inEdges.push(edge);\r\n }\r\n n1.edges.push(edge);\r\n if (n1 !== n2) {\r\n n2.edges.push(edge);\r\n }\r\n this.edges.push(edge);\r\n edgesMap[key] = edge;\r\n return edge;\r\n };\r\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\r\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\r\n return this.edges[rawIdx];\r\n };\r\n Graph.prototype.getEdge = function (n1, n2) {\r\n if (n1 instanceof GraphNode) {\r\n n1 = n1.id;\r\n }\r\n if (n2 instanceof GraphNode) {\r\n n2 = n2.id;\r\n }\r\n var edgesMap = this._edgesMap;\r\n if (this._directed) {\r\n return edgesMap[n1 + '-' + n2];\r\n }\r\n else {\r\n return edgesMap[n1 + '-' + n2]\r\n || edgesMap[n2 + '-' + n1];\r\n }\r\n };\r\n Graph.prototype.eachNode = function (cb, context) {\r\n var nodes = this.nodes;\r\n var len = nodes.length;\r\n for (var i = 0; i < len; i++) {\r\n if (nodes[i].dataIndex >= 0) {\r\n cb.call(context, nodes[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.eachEdge = function (cb, context) {\r\n var edges = this.edges;\r\n var len = edges.length;\r\n for (var i = 0; i < len; i++) {\r\n if (edges[i].dataIndex >= 0\r\n && edges[i].node1.dataIndex >= 0\r\n && edges[i].node2.dataIndex >= 0) {\r\n cb.call(context, edges[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\r\n if (!(startNode instanceof GraphNode)) {\r\n startNode = this._nodesMap[generateNodeKey(startNode)];\r\n }\r\n if (!startNode) {\r\n return;\r\n }\r\n var edgeType = direction === 'out'\r\n ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');\r\n for (var i = 0; i < this.nodes.length; i++) {\r\n this.nodes[i].__visited = false;\r\n }\r\n if (cb.call(context, startNode, null)) {\r\n return;\r\n }\r\n var queue = [startNode];\r\n while (queue.length) {\r\n var currentNode = queue.shift();\r\n var edges = currentNode[edgeType];\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n var otherNode = e.node1 === currentNode\r\n ? e.node2 : e.node1;\r\n if (!otherNode.__visited) {\r\n if (cb.call(context, otherNode, currentNode)) {\r\n return;\r\n }\r\n queue.push(otherNode);\r\n otherNode.__visited = true;\r\n }\r\n }\r\n }\r\n };\r\n Graph.prototype.update = function () {\r\n var data = this.data;\r\n var edgeData = this.edgeData;\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n edgeData.filterSelf(function (idx) {\r\n var edge = edges[edgeData.getRawIndex(idx)];\r\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\r\n });\r\n for (var i = 0, len = edges.length; i < len; i++) {\r\n edges[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = edgeData.count(); i < len; i++) {\r\n edges[edgeData.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Graph.prototype.clone = function () {\r\n var graph = new Graph(this._directed);\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\r\n }\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\r\n }\r\n return graph;\r\n };\r\n return Graph;\r\n }());\r\n var GraphNode = (function () {\r\n function GraphNode(id, dataIndex) {\r\n this.inEdges = [];\r\n this.outEdges = [];\r\n this.edges = [];\r\n this.dataIndex = -1;\r\n this.id = id == null ? '' : id;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphNode.prototype.degree = function () {\r\n return this.edges.length;\r\n };\r\n GraphNode.prototype.inDegree = function () {\r\n return this.inEdges.length;\r\n };\r\n GraphNode.prototype.outDegree = function () {\r\n return this.outEdges.length;\r\n };\r\n GraphNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphNode.prototype.getAdjacentDataIndices = function () {\r\n var dataIndices = {\r\n edge: [],\r\n node: []\r\n };\r\n for (var i = 0; i < this.edges.length; i++) {\r\n var adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n dataIndices.edge.push(adjacentEdge.dataIndex);\r\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\r\n }\r\n return dataIndices;\r\n };\r\n return GraphNode;\r\n }());\r\n var GraphEdge = (function () {\r\n function GraphEdge(n1, n2, dataIndex) {\r\n this.dataIndex = -1;\r\n this.node1 = n1;\r\n this.node2 = n2;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphEdge.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphEdge.prototype.getAdjacentDataIndices = function () {\r\n return {\r\n edge: [this.dataIndex],\r\n node: [this.node1.dataIndex, this.node2.dataIndex]\r\n };\r\n };\r\n return GraphEdge;\r\n }());\r\n function createGraphDataProxyMixin(hostName, dataName) {\r\n return {\r\n getValue: function (dimension) {\r\n var data = this[hostName][dataName];\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n },\r\n setVisual: function (key, value) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\r\n },\r\n getVisual: function (key) {\r\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\r\n },\r\n setLayout: function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\r\n },\r\n getLayout: function () {\r\n return this[hostName][dataName].getItemLayout(this.dataIndex);\r\n },\r\n getGraphicEl: function () {\r\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\r\n },\r\n getRawIndex: function () {\r\n return this[hostName][dataName].getRawIndex(this.dataIndex);\r\n }\r\n };\r\n }\r\n mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\r\n mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\n\n function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\r\n var graph = new Graph(directed);\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(retrieve(nodes[i].id, nodes[i].name, i), i);\r\n }\r\n var linkNameList = [];\r\n var validEdges = [];\r\n var linkCount = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n var link = edges[i];\r\n var source = link.source;\r\n var target = link.target;\r\n if (graph.addEdge(source, target, linkCount)) {\r\n validEdges.push(link);\r\n linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\r\n linkCount++;\r\n }\r\n }\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n var nodeData;\r\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\r\n nodeData = createListFromArray(nodes, seriesModel);\r\n }\r\n else {\r\n var coordSysCtor = CoordinateSystemManager.get(coordSys);\r\n var coordDimensions = coordSysCtor\r\n ? (coordSysCtor.dimensions || []) : [];\r\n if (indexOf(coordDimensions, 'value') < 0) {\r\n coordDimensions.concat(['value']);\r\n }\r\n var dimensionNames = createDimensions(nodes, {\r\n coordDimensions: coordDimensions\r\n });\r\n nodeData = new List(dimensionNames, seriesModel);\r\n nodeData.initData(nodes);\r\n }\r\n var edgeData = new List(['value'], seriesModel);\r\n edgeData.initData(validEdges, linkNameList);\r\n beforeLink && beforeLink(nodeData, edgeData);\r\n linkList({\r\n mainData: nodeData,\r\n struct: graph,\r\n structAttr: 'graph',\r\n datas: { node: nodeData, edge: edgeData },\r\n datasAttr: { node: 'data', edge: 'edgeData' }\r\n });\r\n graph.update();\r\n return graph;\r\n }\n\n var KEY_DELIMITER = '-->';\r\n var getAutoCurvenessParams = function (seriesModel) {\r\n return seriesModel.get('autoCurveness') || null;\r\n };\r\n var createCurveness = function (seriesModel, appendLength) {\r\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\r\n var length = 20;\r\n var curvenessList = [];\r\n if (typeof autoCurvenessParmas === 'number') {\r\n length = autoCurvenessParmas;\r\n }\r\n else if (isArray(autoCurvenessParmas)) {\r\n seriesModel.__curvenessList = autoCurvenessParmas;\r\n return;\r\n }\r\n if (appendLength > length) {\r\n length = appendLength;\r\n }\r\n var len = length % 2 ? length + 2 : length + 3;\r\n curvenessList = [];\r\n for (var i = 0; i < len; i++) {\r\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\r\n }\r\n seriesModel.__curvenessList = curvenessList;\r\n };\r\n var getKeyOfEdges = function (n1, n2, seriesModel) {\r\n var source = [n1.id, n1.dataIndex].join('.');\r\n var target = [n2.id, n2.dataIndex].join('.');\r\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\r\n };\r\n var getOppositeKey = function (key) {\r\n var keys = key.split(KEY_DELIMITER);\r\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\r\n };\r\n var getEdgeFromMap = function (edge, seriesModel) {\r\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n return seriesModel.__edgeMap[key];\r\n };\r\n var getTotalLengthBetweenNodes = function (edge, seriesModel) {\r\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\r\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\r\n return len + lenV;\r\n };\r\n var getEdgeMapLengthWithKey = function (key, seriesModel) {\r\n var edgeMap = seriesModel.__edgeMap;\r\n return edgeMap[key] ? edgeMap[key].length : 0;\r\n };\r\n function initCurvenessList(seriesModel) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n seriesModel.__curvenessList = [];\r\n seriesModel.__edgeMap = {};\r\n createCurveness(seriesModel);\r\n }\r\n function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n var key = getKeyOfEdges(n1, n2, seriesModel);\r\n var edgeMap = seriesModel.__edgeMap;\r\n var oppositeEdges = edgeMap[getOppositeKey(key)];\r\n if (edgeMap[key] && !oppositeEdges) {\r\n edgeMap[key].isForward = true;\r\n }\r\n else if (oppositeEdges && edgeMap[key]) {\r\n oppositeEdges.isForward = true;\r\n edgeMap[key].isForward = false;\r\n }\r\n edgeMap[key] = edgeMap[key] || [];\r\n edgeMap[key].push(index);\r\n }\r\n function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\r\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\r\n var isArrayParam = isArray(autoCurvenessParams);\r\n if (!autoCurvenessParams) {\r\n return null;\r\n }\r\n var edgeArray = getEdgeFromMap(edge, seriesModel);\r\n if (!edgeArray) {\r\n return null;\r\n }\r\n var edgeIndex = -1;\r\n for (var i = 0; i < edgeArray.length; i++) {\r\n if (edgeArray[i] === index) {\r\n edgeIndex = i;\r\n break;\r\n }\r\n }\r\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\r\n createCurveness(seriesModel, totalLen);\r\n edge.lineStyle = edge.lineStyle || {};\r\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n var curvenessList = seriesModel.__curvenessList;\r\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\r\n if (!edgeArray.isForward) {\r\n var oppositeKey = getOppositeKey(curKey);\r\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\r\n var resValue = curvenessList[edgeIndex + len + parityCorrection];\r\n if (needReverse) {\r\n if (isArrayParam) {\r\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n else {\r\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return curvenessList[edgeIndex + len + parityCorrection];\r\n }\r\n }\r\n else {\r\n return curvenessList[parityCorrection + edgeIndex];\r\n }\r\n }\n\n var GraphSeriesModel = (function (_super) {\r\n __extends(GraphSeriesModel, _super);\r\n function GraphSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n GraphSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n var self = this;\r\n function getCategoriesData() {\r\n return self._categoriesData;\r\n }\r\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\r\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\r\n defaultEmphasis(option, 'edgeLabel', ['show']);\r\n };\r\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var edges = option.edges || option.links || [];\r\n var nodes = option.data || option.nodes || [];\r\n var self = this;\r\n if (nodes && edges) {\r\n initCurvenessList(this);\r\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\r\n each(graph.edges, function (edge) {\r\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\r\n }, this);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model) {\r\n var categoriesModels = self._categoriesModels;\r\n var categoryIdx = model.getShallow('category');\r\n var categoryModel = categoriesModels[categoryIdx];\r\n if (categoryModel) {\r\n categoryModel.parentModel = model.parentModel;\r\n model.parentModel = categoryModel;\r\n }\r\n return model;\r\n });\r\n var oldGetModel = Model.prototype.getModel;\r\n function newGetModel(path, parentModel) {\r\n var model = oldGetModel.call(this, path, parentModel);\r\n model.resolveParentPath = resolveParentPath;\r\n return model;\r\n }\r\n edgeData.wrapMethod('getItemModel', function (model) {\r\n model.resolveParentPath = resolveParentPath;\r\n model.getModel = newGetModel;\r\n return model;\r\n });\r\n function resolveParentPath(pathArr) {\r\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\r\n var newPathArr = pathArr.slice();\r\n if (pathArr[0] === 'label') {\r\n newPathArr[0] = 'edgeLabel';\r\n }\r\n else if (pathArr[1] === 'label') {\r\n newPathArr[1] = 'edgeLabel';\r\n }\r\n return newPathArr;\r\n }\r\n return pathArr;\r\n }\r\n }\r\n };\r\n GraphSeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n GraphSeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n GraphSeriesModel.prototype.getCategoriesData = function () {\r\n return this._categoriesData;\r\n };\r\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n if (dataType === 'edge') {\r\n var nodeData = this.getData();\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\r\n var sourceName = nodeData.getName(edge.node1.dataIndex);\r\n var targetName = nodeData.getName(edge.node2.dataIndex);\r\n var nameArr = [];\r\n sourceName != null && nameArr.push(sourceName);\r\n targetName != null && nameArr.push(targetName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > '),\r\n value: params.value,\r\n noValue: params.value == null\r\n });\r\n }\r\n var nodeMarkup = defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n return nodeMarkup;\r\n };\r\n GraphSeriesModel.prototype._updateCategoriesData = function () {\r\n var categories = map(this.option.categories || [], function (category) {\r\n return category.value != null ? category : extend({\r\n value: 0\r\n }, category);\r\n });\r\n var categoriesData = new List(['value'], this);\r\n categoriesData.initData(categories);\r\n this._categoriesData = categoriesData;\r\n this._categoriesModels = categoriesData.mapArray(function (idx) {\r\n return categoriesData.getItemModel(idx);\r\n });\r\n };\r\n GraphSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GraphSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\r\n return _super.prototype.isAnimationEnabled.call(this)\r\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\r\n };\r\n GraphSeriesModel.type = 'series.graph';\r\n GraphSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n legendHoverLink: true,\r\n layout: null,\r\n focusNodeAdjacency: false,\r\n circular: {\r\n rotateLabel: false\r\n },\r\n force: {\r\n initLayout: null,\r\n repulsion: [0, 50],\r\n gravity: 0.1,\r\n friction: 0.6,\r\n edgeLength: 30,\r\n layoutAnimation: true\r\n },\r\n left: 'center',\r\n top: 'center',\r\n symbol: 'circle',\r\n symbolSize: 10,\r\n edgeSymbol: ['none', 'none'],\r\n edgeSymbolSize: 10,\r\n edgeLabel: {\r\n position: 'middle',\r\n distance: 5\r\n },\r\n draggable: false,\r\n roam: false,\r\n center: null,\r\n zoom: 1,\r\n nodeScaleRatio: 0.6,\r\n label: {\r\n show: false,\r\n formatter: '{b}'\r\n },\r\n itemStyle: {},\r\n lineStyle: {\r\n color: '#aaa',\r\n width: 1,\r\n opacity: 0.5\r\n },\r\n emphasis: {\r\n scale: true,\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return GraphSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(GraphSeriesModel);\n\n var straightLineProto = Line.prototype;\r\n var bezierCurveProto = BezierCurve.prototype;\r\n var StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n }());\r\n var CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n }(StraightLineShape));\r\n function isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n }\r\n var ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n }(Path));\n\n var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\n function makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n }\r\n function createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n }\r\n function createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n }\r\n function setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n }\r\n var Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n }(Group));\n\n var LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n }());\r\n function isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n }\r\n function makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n }\r\n function isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n }\r\n function lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n }\n\n function getNodeGlobalScale(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n }\r\n function getSymbolSize(node) {\r\n var symbolSize = node.getVisual('symbolSize');\r\n if (symbolSize instanceof Array) {\r\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\r\n }\r\n return +symbolSize;\r\n }\n\n var v1 = [];\r\n var v2 = [];\r\n var v3 = [];\r\n var quadraticAt$1 = quadraticAt;\r\n var v2DistSquare = distSquare;\r\n var mathAbs$2 = Math.abs;\r\n function intersectCurveCircle(curvePoints, center, radius) {\r\n var p0 = curvePoints[0];\r\n var p1 = curvePoints[1];\r\n var p2 = curvePoints[2];\r\n var d = Infinity;\r\n var t;\r\n var radiusSquare = radius * radius;\r\n var interval = 0.1;\r\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\r\n v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t);\r\n v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t);\r\n var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare);\r\n if (diff < d) {\r\n d = diff;\r\n t = _t;\r\n }\r\n }\r\n for (var i = 0; i < 32; i++) {\r\n var next = t + interval;\r\n v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t);\r\n v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t);\r\n v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next);\r\n v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next);\r\n var diff = v2DistSquare(v2, center) - radiusSquare;\r\n if (mathAbs$2(diff) < 1e-2) {\r\n break;\r\n }\r\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\r\n interval /= 2;\r\n if (diff < 0) {\r\n if (nextDiff >= 0) {\r\n t = t + interval;\r\n }\r\n else {\r\n t = t - interval;\r\n }\r\n }\r\n else {\r\n if (nextDiff >= 0) {\r\n t = t - interval;\r\n }\r\n else {\r\n t = t + interval;\r\n }\r\n }\r\n }\r\n return t;\r\n }\r\n function adjustEdge(graph, scale) {\r\n var tmp0 = [];\r\n var quadraticSubdivide$1 = quadraticSubdivide;\r\n var pts = [[], [], []];\r\n var pts2 = [[], []];\r\n var v = [];\r\n scale /= 2;\r\n graph.eachEdge(function (edge, idx) {\r\n var linePoints = edge.getLayout();\r\n var fromSymbol = edge.getVisual('fromSymbol');\r\n var toSymbol = edge.getVisual('toSymbol');\r\n if (!linePoints.__original) {\r\n linePoints.__original = [\r\n clone$1(linePoints[0]),\r\n clone$1(linePoints[1])\r\n ];\r\n if (linePoints[2]) {\r\n linePoints.__original.push(clone$1(linePoints[2]));\r\n }\r\n }\r\n var originalPoints = linePoints.__original;\r\n if (linePoints[2] != null) {\r\n copy(pts[0], originalPoints[0]);\r\n copy(pts[1], originalPoints[2]);\r\n copy(pts[2], originalPoints[1]);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[0][0] = tmp0[3];\r\n pts[1][0] = tmp0[4];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[0][1] = tmp0[3];\r\n pts[1][1] = tmp0[4];\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[1][0] = tmp0[1];\r\n pts[2][0] = tmp0[2];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[1][1] = tmp0[1];\r\n pts[2][1] = tmp0[2];\r\n }\r\n copy(linePoints[0], pts[0]);\r\n copy(linePoints[1], pts[2]);\r\n copy(linePoints[2], pts[1]);\r\n }\r\n else {\r\n copy(pts2[0], originalPoints[0]);\r\n copy(pts2[1], originalPoints[1]);\r\n sub(v, pts2[1], pts2[0]);\r\n normalize(v, v);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\r\n }\r\n copy(linePoints[0], pts2[0]);\r\n copy(linePoints[1], pts2[1]);\r\n }\r\n });\r\n }\n\n function isViewCoordSys(coordSys) {\r\n return coordSys.type === 'view';\r\n }\r\n var GraphView = (function (_super) {\r\n __extends(GraphView, _super);\r\n function GraphView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphView.type;\r\n return _this;\r\n }\r\n GraphView.prototype.init = function (ecModel, api) {\r\n var symbolDraw = new SymbolDraw();\r\n var lineDraw = new LineDraw();\r\n var group = this.group;\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: group\r\n };\r\n group.add(symbolDraw.group);\r\n group.add(lineDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineDraw = lineDraw;\r\n this._firstRender = true;\r\n };\r\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n this._model = seriesModel;\r\n var symbolDraw = this._symbolDraw;\r\n var lineDraw = this._lineDraw;\r\n var group = this.group;\r\n if (isViewCoordSys(coordSys)) {\r\n var groupNewProp = {\r\n x: coordSys.x, y: coordSys.y,\r\n scaleX: coordSys.scaleX, scaleY: coordSys.scaleY\r\n };\r\n if (this._firstRender) {\r\n group.attr(groupNewProp);\r\n }\r\n else {\r\n updateProps(group, groupNewProp, seriesModel);\r\n }\r\n }\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n var data = seriesModel.getData();\r\n symbolDraw.updateData(data);\r\n var edgeData = seriesModel.getEdgeData();\r\n lineDraw.updateData(edgeData);\r\n this._updateNodeAndLinkScale();\r\n this._updateController(seriesModel, ecModel, api);\r\n clearTimeout(this._layoutTimeout);\r\n var forceLayout = seriesModel.forceLayout;\r\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\r\n if (forceLayout) {\r\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n }\r\n data.graph.eachNode(function (node) {\r\n var idx = node.dataIndex;\r\n var el = node.getGraphicEl();\r\n var itemModel = node.getModel();\r\n el.off('drag').off('dragend');\r\n var draggable = itemModel.get('draggable');\r\n if (draggable) {\r\n el.on('drag', function () {\r\n if (forceLayout) {\r\n forceLayout.warmUp();\r\n !_this._layouting\r\n && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n forceLayout.setFixed(idx);\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n }\r\n }).on('dragend', function () {\r\n if (forceLayout) {\r\n forceLayout.setUnfixed(idx);\r\n }\r\n });\r\n }\r\n el.setDraggable(draggable && !!forceLayout);\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = node.getAdjacentDataIndices();\r\n }\r\n });\r\n data.graph.eachEdge(function (edge) {\r\n var el = edge.getGraphicEl();\r\n var focus = edge.getModel().get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = {\r\n edge: [edge.dataIndex],\r\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\r\n };\r\n }\r\n });\r\n var circularRotateLabel = seriesModel.get('layout') === 'circular'\r\n && seriesModel.get(['circular', 'rotateLabel']);\r\n var cx = data.getLayout('cx');\r\n var cy = data.getLayout('cy');\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelRotate = itemModel.get(['label', 'rotate']) || 0;\r\n var symbolPath = el.getSymbolPath();\r\n if (circularRotateLabel) {\r\n var pos = data.getItemLayout(idx);\r\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n var isLeft = pos[0] < cx;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n symbolPath.setTextConfig({\r\n rotation: -rad,\r\n position: textPosition,\r\n origin: 'center'\r\n });\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\r\n position: textPosition\r\n });\r\n }\r\n else {\r\n symbolPath.setTextConfig({\r\n rotation: labelRotate *= Math.PI / 180\r\n });\r\n }\r\n });\r\n this._firstRender = false;\r\n };\r\n GraphView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\r\n var self = this;\r\n (function step() {\r\n forceLayout.step(function (stopped) {\r\n self.updateLayout(self._model);\r\n (self._layouting = !stopped) && (layoutAnimation\r\n ? (self._layoutTimeout = setTimeout(step, 16))\r\n : step());\r\n });\r\n })();\r\n };\r\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\r\n controller.disable();\r\n return;\r\n }\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale();\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n _this._lineDraw.updateLayout();\r\n api.updateLabelLayout();\r\n });\r\n };\r\n GraphView.prototype._updateNodeAndLinkScale = function () {\r\n var seriesModel = this._model;\r\n var data = seriesModel.getData();\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n GraphView.prototype.updateLayout = function (seriesModel) {\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n this._symbolDraw.updateLayout();\r\n this._lineDraw.updateLayout();\r\n };\r\n GraphView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove();\r\n this._lineDraw && this._lineDraw.remove();\r\n };\r\n GraphView.type = 'graph';\r\n return GraphView;\r\n }(ChartView));\r\n ChartView.registerClass(GraphView);\n\n registerAction({\r\n type: 'focusNodeAdjacency',\r\n event: 'focusNodeAdjacency',\r\n update: 'series:focusNodeAdjacency'\r\n }, function () { });\r\n registerAction({\r\n type: 'unfocusNodeAdjacency',\r\n event: 'unfocusNodeAdjacency',\r\n update: 'series:unfocusNodeAdjacency'\r\n }, function () { });\n\n var actionInfo = {\r\n type: 'graphRoam',\r\n event: 'graphRoam',\r\n update: 'none'\r\n };\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\n\n function categoryFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var categoriesData = graphSeries.getCategoriesData();\r\n var graph = graphSeries.getGraph();\r\n var data = graph.data;\r\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n data.filterSelf(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var category = model.getShallow('category');\r\n if (category != null) {\r\n if (typeof category === 'number') {\r\n category = categoryNames[category];\r\n }\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n });\r\n }\n\n function categoryVisual(ecModel) {\r\n var paletteScope = {};\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var categoriesData = seriesModel.getCategoriesData();\r\n var data = seriesModel.getData();\r\n var categoryNameIdxMap = {};\r\n categoriesData.each(function (idx) {\r\n var name = categoriesData.getName(idx);\r\n categoryNameIdxMap['ec-' + name] = idx;\r\n var itemModel = categoriesData.getItemModel(idx);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\r\n }\r\n categoriesData.setItemVisual(idx, 'style', style);\r\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < symbolVisualList.length; i++) {\r\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\r\n if (symbolVisual != null) {\r\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\r\n }\r\n }\r\n });\r\n if (categoriesData.count()) {\r\n data.each(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var categoryIdx = model.getShallow('category');\r\n if (categoryIdx != null) {\r\n if (typeof categoryIdx === 'string') {\r\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\r\n }\r\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\r\n var style = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(style, categoryStyle);\r\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < visualList.length; i++) {\r\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\n\n function normalize$2(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n }\r\n function graphEdgeVisual(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var edgeData = seriesModel.getEdgeData();\r\n var symbolType = normalize$2(seriesModel.get('edgeSymbol'));\r\n var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize'));\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n edgeData.each(function (idx) {\r\n var itemModel = edgeData.getItemModel(idx);\r\n var edge = graph.getEdgeByIndex(idx);\r\n var symbolType = normalize$2(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true));\r\n var style = itemModel.getModel('lineStyle').getLineStyle();\r\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n switch (existsStyle.stroke) {\r\n case 'source': {\r\n var nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n case 'target': {\r\n var nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n }\n\n function simpleLayout(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var graph = seriesModel.getGraph();\r\n graph.eachNode(function (node) {\r\n var model = node.getModel();\r\n node.setLayout([+model.get('x'), +model.get('y')]);\r\n });\r\n simpleLayoutEdge(graph, seriesModel);\r\n }\r\n function simpleLayoutEdge(graph, seriesModel) {\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var points = [p1, p2];\r\n if (+curveness) {\r\n points.push([\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness\r\n ]);\r\n }\r\n edge.setLayout(points);\r\n });\r\n }\n\n function graphSimpleLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var layout = seriesModel.get('layout');\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n var data_1 = seriesModel.getData();\r\n var dimensions_1 = [];\r\n each(coordSys.dimensions, function (coordDim) {\r\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\r\n });\r\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\r\n var value = [];\r\n var hasValue = false;\r\n for (var i = 0; i < dimensions_1.length; i++) {\r\n var val = data_1.get(dimensions_1[i], dataIndex);\r\n if (!isNaN(val)) {\r\n hasValue = true;\r\n }\r\n value.push(val);\r\n }\r\n if (hasValue) {\r\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\r\n }\r\n else {\r\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\r\n }\r\n }\r\n simpleLayoutEdge(data_1.graph, seriesModel);\r\n }\r\n else if (!layout || layout === 'none') {\r\n simpleLayout(seriesModel);\r\n }\r\n });\r\n }\n\n var PI$7 = Math.PI;\r\n var _symbolRadiansHalf = [];\r\n function circularLayout(seriesModel, basedOn) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var rect = coordSys.getBoundingRect();\r\n var nodeData = seriesModel.getData();\r\n var graph = nodeData.graph;\r\n var cx = rect.width / 2 + rect.x;\r\n var cy = rect.height / 2 + rect.y;\r\n var r = Math.min(rect.width, rect.height) / 2;\r\n var count = nodeData.count();\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n if (!count) {\r\n return;\r\n }\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var cp1;\r\n var x12 = (p1[0] + p2[0]) / 2;\r\n var y12 = (p1[1] + p2[1]) / 2;\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [\r\n cx * curveness + x12 * (1 - curveness),\r\n cy * curveness + y12 * (1 - curveness)\r\n ];\r\n }\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n }\r\n var _layoutNodesBasedOn = {\r\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var angle = 0;\r\n var sum = nodeData.getSum('value');\r\n var unitAngle = Math.PI * 2 / (sum || count);\r\n graph.eachNode(function (node) {\r\n var value = node.getValue('value');\r\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n },\r\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n graph.eachNode(function (node) {\r\n var symbolSize = getSymbolSize(node);\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n symbolSize *= nodeScale;\r\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$7 / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n var halfRemainRadian = (2 * PI$7 - sumRadian) / count / 2;\r\n var angle = 0;\r\n graph.eachNode(function (node) {\r\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n }\r\n };\n\n function graphCircularLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n if (seriesModel.get('layout') === 'circular') {\r\n circularLayout(seriesModel, 'symbolSize');\r\n }\r\n });\r\n }\n\n var scaleAndAdd$1 = scaleAndAdd;\r\n function forceLayout(inNodes, inEdges, opts) {\r\n var nodes = inNodes;\r\n var edges = inEdges;\r\n var rect = opts.rect;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var center = [rect.x + width / 2, rect.y + height / 2];\r\n var gravity = opts.gravity == null ? 0.1 : opts.gravity;\r\n for (var i = 0; i < nodes.length; i++) {\r\n var n = nodes[i];\r\n if (!n.p) {\r\n n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\r\n }\r\n n.pp = clone$1(n.p);\r\n n.edges = null;\r\n }\r\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\r\n var friction = initialFriction;\r\n var beforeStepCallback;\r\n var afterStepCallback;\r\n return {\r\n warmUp: function () {\r\n friction = initialFriction * 0.8;\r\n },\r\n setFixed: function (idx) {\r\n nodes[idx].fixed = true;\r\n },\r\n setUnfixed: function (idx) {\r\n nodes[idx].fixed = false;\r\n },\r\n beforeStep: function (cb) {\r\n beforeStepCallback = cb;\r\n },\r\n afterStep: function (cb) {\r\n afterStepCallback = cb;\r\n },\r\n step: function (cb) {\r\n beforeStepCallback && beforeStepCallback(nodes, edges);\r\n var v12 = [];\r\n var nLen = nodes.length;\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n if (e.ignoreForceLayout) {\r\n continue;\r\n }\r\n var n1 = e.n1;\r\n var n2 = e.n2;\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12) - e.d;\r\n var w = n2.w / (n1.w + n2.w);\r\n if (isNaN(w)) {\r\n w = 0;\r\n }\r\n normalize(v12, v12);\r\n !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction);\r\n !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction);\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v12, center, n.p);\r\n scaleAndAdd$1(n.p, n.p, v12, gravity * friction);\r\n }\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n1 = nodes[i];\r\n for (var j = i + 1; j < nLen; j++) {\r\n var n2 = nodes[j];\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12);\r\n if (d === 0) {\r\n set(v12, Math.random() - 0.5, Math.random() - 0.5);\r\n d = 1;\r\n }\r\n var repFact = (n1.rep + n2.rep) / d / d;\r\n !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact);\r\n !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact);\r\n }\r\n }\r\n var v = [];\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v, n.p, n.pp);\r\n scaleAndAdd$1(n.p, n.p, v, friction);\r\n copy(n.pp, n.p);\r\n }\r\n }\r\n friction = friction * 0.992;\r\n var finished = friction < 0.01;\r\n afterStepCallback && afterStepCallback(nodes, edges, finished);\r\n cb && cb(finished);\r\n }\r\n };\r\n }\n\n function graphForceLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var coordSys = graphSeries.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n if (graphSeries.get('layout') === 'force') {\r\n var preservedPoints_1 = graphSeries.preservedPoints || {};\r\n var graph_1 = graphSeries.getGraph();\r\n var nodeData_1 = graph_1.data;\r\n var edgeData = graph_1.edgeData;\r\n var forceModel = graphSeries.getModel('force');\r\n var initLayout = forceModel.get('initLayout');\r\n if (graphSeries.preservedPoints) {\r\n nodeData_1.each(function (idx) {\r\n var id = nodeData_1.getId(idx);\r\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\r\n });\r\n }\r\n else if (!initLayout || initLayout === 'none') {\r\n simpleLayout(graphSeries);\r\n }\r\n else if (initLayout === 'circular') {\r\n circularLayout(graphSeries, 'value');\r\n }\r\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\r\n var edgeDataExtent_1 = edgeData.getDataExtent('value');\r\n var repulsion = forceModel.get('repulsion');\r\n var edgeLength = forceModel.get('edgeLength');\r\n var repulsionArr_1 = isArray(repulsion)\r\n ? repulsion : [repulsion, repulsion];\r\n var edgeLengthArr_1 = isArray(edgeLength)\r\n ? edgeLength : [edgeLength, edgeLength];\r\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\r\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\r\n var point = nodeData_1.getItemLayout(idx);\r\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\r\n if (isNaN(rep)) {\r\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\r\n }\r\n return {\r\n w: rep,\r\n rep: rep,\r\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\r\n p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point\r\n };\r\n });\r\n var edges = edgeData.mapArray('value', function (value, idx) {\r\n var edge = graph_1.getEdgeByIndex(idx);\r\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\r\n if (isNaN(d)) {\r\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\r\n }\r\n var edgeModel = edge.getModel();\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\r\n return {\r\n n1: nodes_1[edge.node1.dataIndex],\r\n n2: nodes_1[edge.node2.dataIndex],\r\n d: d,\r\n curveness: curveness,\r\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\r\n };\r\n });\r\n var rect = coordSys.getBoundingRect();\r\n var forceInstance = forceLayout(nodes_1, edges, {\r\n rect: rect,\r\n gravity: forceModel.get('gravity'),\r\n friction: forceModel.get('friction')\r\n });\r\n forceInstance.beforeStep(function (nodes, edges) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (nodes[i].fixed) {\r\n copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\r\n }\r\n }\r\n });\r\n forceInstance.afterStep(function (nodes, edges, stopped) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (!nodes[i].fixed) {\r\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\r\n }\r\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\r\n }\r\n for (var i = 0, l = edges.length; i < l; i++) {\r\n var e = edges[i];\r\n var edge = graph_1.getEdgeByIndex(i);\r\n var p1 = e.n1.p;\r\n var p2 = e.n2.p;\r\n var points = edge.getLayout();\r\n points = points ? points.slice() : [];\r\n points[0] = points[0] || [];\r\n points[1] = points[1] || [];\r\n copy(points[0], p1);\r\n copy(points[1], p2);\r\n if (+e.curveness) {\r\n points[2] = [\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness\r\n ];\r\n }\r\n edge.setLayout(points);\r\n }\r\n });\r\n graphSeries.forceLayout = forceInstance;\r\n graphSeries.preservedPoints = preservedPoints_1;\r\n forceInstance.step();\r\n }\r\n else {\r\n graphSeries.forceLayout = null;\r\n }\r\n });\r\n }\n\n function getViewRect$2(seriesModel, api, aspect) {\r\n var option = extend(seriesModel.getBoxLayoutParams(), {\r\n aspect: aspect\r\n });\r\n return getLayoutRect(option, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function createViewCoordSys(ecModel, api) {\r\n var viewList = [];\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var coordSysType = seriesModel.get('coordinateSystem');\r\n if (!coordSysType || coordSysType === 'view') {\r\n var data_1 = seriesModel.getData();\r\n var positions = data_1.mapArray(function (idx) {\r\n var itemModel = data_1.getItemModel(idx);\r\n return [+itemModel.get('x'), +itemModel.get('y')];\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(positions, min, max);\r\n if (max[0] - min[0] === 0) {\r\n max[0] += 1;\r\n min[0] -= 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n max[1] += 1;\r\n min[1] -= 1;\r\n }\r\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\r\n var viewRect = getViewRect$2(seriesModel, api, aspect);\r\n if (isNaN(aspect)) {\r\n min = [viewRect.x, viewRect.y];\r\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\r\n }\r\n var bbWidth = max[0] - min[0];\r\n var bbHeight = max[1] - min[1];\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\r\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n viewList.push(viewCoordSys);\r\n }\r\n });\r\n return viewList;\r\n }\n\n registerProcessor(categoryFilter);\r\n registerVisual(categoryVisual);\r\n registerVisual(graphEdgeVisual);\r\n registerLayout(graphSimpleLayout);\r\n registerLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);\r\n registerLayout(graphForceLayout);\r\n registerCoordinateSystem('graphView', {\r\n dimensions: View.dimensions,\r\n create: createViewCoordSys\r\n });\n\n var GaugeSeriesModel = (function (_super) {\r\n __extends(GaugeSeriesModel, _super);\r\n function GaugeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeSeriesModel.type;\r\n _this.visualStyleAccessPath = 'itemStyle';\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, ['value']);\r\n };\r\n GaugeSeriesModel.type = 'series.gauge';\r\n GaugeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n legendHoverLink: true,\r\n radius: '75%',\r\n startAngle: 225,\r\n endAngle: -45,\r\n clockwise: true,\r\n min: 0,\r\n max: 100,\r\n splitNumber: 10,\r\n axisLine: {\r\n show: true,\r\n roundCap: false,\r\n lineStyle: {\r\n color: [[1, '#E6EBF8']],\r\n width: 10\r\n }\r\n },\r\n progress: {\r\n show: false,\r\n overlap: true,\r\n width: 10,\r\n roundCap: false,\r\n clip: true\r\n },\r\n splitLine: {\r\n show: true,\r\n length: 10,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 3,\r\n type: 'solid'\r\n }\r\n },\r\n axisTick: {\r\n show: true,\r\n splitNumber: 5,\r\n length: 6,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n distance: 15,\r\n color: '#464646',\r\n fontSize: 12\r\n },\r\n pointer: {\r\n icon: null,\r\n offsetCenter: [0, 0],\r\n show: true,\r\n length: '60%',\r\n width: 6,\r\n keepAspect: false\r\n },\r\n anchor: {\r\n show: false,\r\n showAbove: false,\r\n size: 6,\r\n icon: 'circle',\r\n offsetCenter: [0, 0],\r\n keepAspect: false,\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 0,\r\n borderColor: '#5470c6'\r\n }\r\n },\r\n title: {\r\n show: true,\r\n offsetCenter: [0, '20%'],\r\n color: '#464646',\r\n fontSize: 16,\r\n valueAnimation: false\r\n },\r\n detail: {\r\n show: true,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 0,\r\n borderColor: '#ccc',\r\n width: 100,\r\n height: null,\r\n padding: [5, 10],\r\n offsetCenter: [0, '40%'],\r\n color: '#464646',\r\n fontSize: 30,\r\n fontWeight: 'bold',\r\n lineHeight: 30,\r\n valueAnimation: false\r\n }\r\n };\r\n return GaugeSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(GaugeSeriesModel);\n\n var PointerShape = (function () {\r\n function PointerShape() {\r\n this.angle = 0;\r\n this.width = 10;\r\n this.r = 10;\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n return PointerShape;\r\n }());\r\n var PointerPath = (function (_super) {\r\n __extends(PointerPath, _super);\r\n function PointerPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'pointer';\r\n return _this;\r\n }\r\n PointerPath.prototype.getDefaultShape = function () {\r\n return new PointerShape();\r\n };\r\n PointerPath.prototype.buildPath = function (ctx, shape) {\r\n var mathCos = Math.cos;\r\n var mathSin = Math.sin;\r\n var r = shape.r;\r\n var width = shape.width;\r\n var angle = shape.angle;\r\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\r\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\r\n angle = shape.angle - Math.PI / 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\r\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\r\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\r\n ctx.lineTo(x, y);\r\n };\r\n return PointerPath;\r\n }(Path));\n\n function parsePosition(seriesModel, api) {\r\n var center = seriesModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], api.getWidth());\r\n var cy = parsePercent$2(center[1], api.getHeight());\r\n var r = parsePercent$2(seriesModel.get('radius'), size / 2);\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r: r\r\n };\r\n }\r\n function formatLabel(value, labelFormatter) {\r\n var label = value == null ? '' : (value + '');\r\n if (labelFormatter) {\r\n if (typeof labelFormatter === 'string') {\r\n label = labelFormatter.replace('{value}', label);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n label = labelFormatter(value);\r\n }\r\n }\r\n return label;\r\n }\r\n var PI2$9 = Math.PI * 2;\r\n var GaugeView = (function (_super) {\r\n __extends(GaugeView, _super);\r\n function GaugeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeView.type;\r\n return _this;\r\n }\r\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\r\n var posInfo = parsePosition(seriesModel, api);\r\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\r\n this._data = seriesModel.getData();\r\n };\r\n GaugeView.prototype.dispose = function () { };\r\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\r\n var group = this.group;\r\n var clockwise = seriesModel.get('clockwise');\r\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\r\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\r\n var axisLineModel = seriesModel.getModel('axisLine');\r\n var roundCap = axisLineModel.get('roundCap');\r\n var MainPath = roundCap ? SausagePath : Sector;\r\n var showAxis = axisLineModel.get('show');\r\n var lineStyleModel = axisLineModel.getModel('lineStyle');\r\n var axisLineWidth = lineStyleModel.get('width');\r\n var angleRangeSpan = !((endAngle - startAngle) % PI2$9) && endAngle !== startAngle\r\n ? PI2$9 : (endAngle - startAngle) % PI2$9;\r\n var prevEndAngle = startAngle;\r\n for (var i = 0; showAxis && i < colorList.length; i++) {\r\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\r\n endAngle = startAngle + angleRangeSpan * percent;\r\n var sector = new MainPath({\r\n shape: {\r\n startAngle: prevEndAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: posInfo.r - axisLineWidth,\r\n r: posInfo.r\r\n },\r\n silent: true\r\n });\r\n sector.setStyle({\r\n fill: colorList[i][1]\r\n });\r\n sector.setStyle(lineStyleModel.getLineStyle(['color', 'width']));\r\n group.add(sector);\r\n prevEndAngle = endAngle;\r\n }\r\n var getColor = function (percent) {\r\n if (percent <= 0) {\r\n return colorList[0][1];\r\n }\r\n var i;\r\n for (i = 0; i < colorList.length; i++) {\r\n if (colorList[i][0] >= percent\r\n && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\r\n return colorList[i][1];\r\n }\r\n }\r\n return colorList[i - 1][1];\r\n };\r\n if (!clockwise) {\r\n var tmp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp;\r\n }\r\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\r\n this._renderAnchor(seriesModel, posInfo);\r\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n };\r\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var cx = posInfo.cx;\r\n var cy = posInfo.cy;\r\n var r = posInfo.r;\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var splitLineModel = seriesModel.getModel('splitLine');\r\n var tickModel = seriesModel.getModel('axisTick');\r\n var labelModel = seriesModel.getModel('axisLabel');\r\n var splitNumber = seriesModel.get('splitNumber');\r\n var subSplitNumber = tickModel.get('splitNumber');\r\n var splitLineLen = parsePercent$2(splitLineModel.get('length'), r);\r\n var tickLen = parsePercent$2(tickModel.get('length'), r);\r\n var angle = startAngle;\r\n var step = (endAngle - startAngle) / splitNumber;\r\n var subStep = step / subSplitNumber;\r\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\r\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\r\n var splitLineDistance = splitLineModel.get('distance');\r\n var unitX;\r\n var unitY;\r\n for (var i = 0; i <= splitNumber; i++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n if (splitLineModel.get('show')) {\r\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\r\n var splitLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - splitLineLen - distance) + cx,\r\n y2: unitY * (r - splitLineLen - distance) + cy\r\n },\r\n style: splitLineStyle,\r\n silent: true\r\n });\r\n if (splitLineStyle.stroke === 'auto') {\r\n splitLine.setStyle({\r\n stroke: getColor(i / splitNumber)\r\n });\r\n }\r\n group.add(splitLine);\r\n }\r\n if (labelModel.get('show')) {\r\n var distance = labelModel.get('distance') + splitLineDistance;\r\n var label = formatLabel(round$1(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\r\n var autoColor = getColor(i / splitNumber);\r\n group.add(new ZRText({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: unitX * (r - splitLineLen - distance) + cx,\r\n y: unitY * (r - splitLineLen - distance) + cy,\r\n verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'),\r\n align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true\r\n }));\r\n }\r\n if (tickModel.get('show') && i !== splitNumber) {\r\n var distance = tickModel.get('distance');\r\n distance = distance ? distance + axisLineWidth : axisLineWidth;\r\n for (var j = 0; j <= subSplitNumber; j++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n var tickLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - tickLen - distance) + cx,\r\n y2: unitY * (r - tickLen - distance) + cy\r\n },\r\n silent: true,\r\n style: tickLineStyle\r\n });\r\n if (tickLineStyle.stroke === 'auto') {\r\n tickLine.setStyle({\r\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\r\n });\r\n }\r\n group.add(tickLine);\r\n angle += subStep;\r\n }\r\n angle -= subStep;\r\n }\r\n else {\r\n angle += step;\r\n }\r\n }\r\n };\r\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n var oldProgressData = this._progressEls;\r\n var progressList = [];\r\n var showPointer = seriesModel.get(['pointer', 'show']);\r\n var progressModel = seriesModel.getModel('progress');\r\n var showProgress = progressModel.get('show');\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var valueExtent = [minVal, maxVal];\r\n var angleExtent = [startAngle, endAngle];\r\n function createPointer(idx, angle) {\r\n var itemModel = data.getItemModel(idx);\r\n var pointerModel = itemModel.getModel('pointer');\r\n var pointerWidth = parsePercent$2(pointerModel.get('width'), posInfo.r);\r\n var pointerLength = parsePercent$2(pointerModel.get('length'), posInfo.r);\r\n var pointerStr = seriesModel.get(['pointer', 'icon']);\r\n var pointerOffset = pointerModel.get('offsetCenter');\r\n var pointerKeepAspect = pointerModel.get('keepAspect');\r\n var pointer;\r\n if (pointerStr) {\r\n pointer = createSymbol(pointerStr, parsePercent$2(pointerOffset[0], posInfo.r) - pointerWidth / 2, parsePercent$2(pointerOffset[1], posInfo.r) - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\r\n }\r\n else {\r\n pointer = new PointerPath({\r\n shape: {\r\n angle: -Math.PI / 2,\r\n width: parsePercent$2(pointerModel.get('width'), posInfo.r),\r\n r: parsePercent$2(pointerModel.get('length'), posInfo.r)\r\n }\r\n });\r\n }\r\n pointer.rotation = -(angle + Math.PI / 2);\r\n pointer.x = posInfo.cx;\r\n pointer.y = posInfo.cy;\r\n return pointer;\r\n }\r\n function createProgress(idx, endAngle) {\r\n var roundCap = progressModel.get('roundCap');\r\n var ProgressPath = roundCap ? SausagePath : Sector;\r\n var isOverlap = progressModel.get('overlap');\r\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\r\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\r\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\r\n var progress = new ProgressPath({\r\n shape: {\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: r0,\r\n r: r\r\n }\r\n });\r\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\r\n return progress;\r\n }\r\n if (showProgress || showPointer) {\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n if (showPointer) {\r\n var pointer = createPointer(idx, startAngle);\r\n initProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(idx, pointer);\r\n }\r\n if (showProgress) {\r\n var progress = createProgress(idx, startAngle);\r\n var isClip = progressModel.get('clip');\r\n initProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[idx] = progress;\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n if (showPointer) {\r\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\r\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\r\n var pointer = createPointer(newIdx, previousRotate);\r\n pointer.rotation = previousRotate;\r\n updateProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(newIdx, pointer);\r\n }\r\n if (showProgress) {\r\n var previousProgress = oldProgressData[oldIdx];\r\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\r\n var progress = createProgress(newIdx, previousEndAngle);\r\n var isClip = progressModel.get('clip');\r\n updateProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[newIdx] = progress;\r\n }\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n if (showPointer) {\r\n var pointer = data.getItemGraphicEl(idx);\r\n pointer.useStyle(data.getItemVisual(idx, 'style'));\r\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\r\n if (pointer.style.fill === 'auto') {\r\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\r\n }\r\n pointer.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(pointer, itemModel);\r\n enableHoverEmphasis(pointer, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n if (showProgress) {\r\n var progress = progressList[idx];\r\n progress.useStyle(data.getItemVisual(idx, 'style'));\r\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\r\n progress.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(progress, itemModel);\r\n enableHoverEmphasis(progress, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n });\r\n this._progressEls = progressList;\r\n }\r\n };\r\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\r\n var anchorModel = seriesModel.getModel('anchor');\r\n var showAnchor = anchorModel.get('show');\r\n if (showAnchor) {\r\n var anchorSize = anchorModel.get('size');\r\n var anchorType = anchorModel.get('icon');\r\n var offsetCenter = anchorModel.get('offsetCenter');\r\n var anchorKeepAspect = anchorModel.get('keepAspect');\r\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$2(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$2(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\r\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\r\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\r\n this.group.add(anchor);\r\n }\r\n };\r\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\r\n var _this = this;\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var contentGroup = new Group();\r\n var newTitleEls = [];\r\n var newDetailEls = [];\r\n var hasAnimation = seriesModel.isAnimationEnabled();\r\n data.diff(this._data)\r\n .add(function (idx) {\r\n newTitleEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n newDetailEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n })\r\n .update(function (idx, oldIdx) {\r\n newTitleEls[idx] = _this._titleEls[oldIdx];\r\n newDetailEls[idx] = _this._detailEls[oldIdx];\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var value = data.get(valueDim, idx);\r\n var itemGroup = new Group();\r\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\r\n var itemTitleModel = itemModel.getModel('title');\r\n if (itemTitleModel.get('show')) {\r\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\r\n var titleX = posInfo.cx + parsePercent$2(titleOffsetCenter[0], posInfo.r);\r\n var titleY = posInfo.cy + parsePercent$2(titleOffsetCenter[1], posInfo.r);\r\n var labelEl = newTitleEls[idx];\r\n labelEl.attr({\r\n style: createTextStyle(itemTitleModel, {\r\n x: titleX,\r\n y: titleY,\r\n text: data.getName(idx),\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: autoColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemTitleModel }, seriesModel.getRawValue(idx), function () { return data.getName(idx); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n var itemDetailModel = itemModel.getModel('detail');\r\n if (itemDetailModel.get('show')) {\r\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\r\n var detailX = posInfo.cx + parsePercent$2(detailOffsetCenter[0], posInfo.r);\r\n var detailY = posInfo.cy + parsePercent$2(detailOffsetCenter[1], posInfo.r);\r\n var width = parsePercent$2(itemDetailModel.get('width'), posInfo.r);\r\n var height = parsePercent$2(itemDetailModel.get('height'), posInfo.r);\r\n var detailColor = (seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor);\r\n var labelEl = newDetailEls[idx];\r\n var formatter_1 = itemDetailModel.get('formatter');\r\n labelEl.attr({\r\n style: createTextStyle(itemDetailModel, {\r\n x: detailX,\r\n y: detailY,\r\n text: formatLabel(value, formatter_1),\r\n width: isNaN(width) ? null : width,\r\n height: isNaN(height) ? null : height,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: detailColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemDetailModel }, seriesModel.getRawValue(idx), function (value) { return formatLabel(value, formatter_1); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n contentGroup.add(itemGroup);\r\n });\r\n this.group.add(contentGroup);\r\n this._titleEls = newTitleEls;\r\n this._detailEls = newDetailEls;\r\n };\r\n GaugeView.type = 'gauge';\r\n return GaugeView;\r\n }(ChartView));\r\n ChartView.registerClass(GaugeView);\n\n var FunnelSeriesModel = (function (_super) {\r\n __extends(FunnelSeriesModel, _super);\r\n function FunnelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n FunnelSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueDim = data.mapDimension('value');\r\n var sum = data.getSum(valueDim);\r\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n FunnelSeriesModel.type = 'series.funnel';\r\n FunnelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n minSize: '0%',\r\n maxSize: '100%',\r\n sort: 'descending',\r\n orient: 'vertical',\r\n gap: 0,\r\n funnelAlign: 'center',\r\n label: {\r\n show: true,\r\n position: 'outer'\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 20,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n itemStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return FunnelSeriesModel;\r\n }(SeriesModel));\r\n ComponentModel.registerClass(FunnelSeriesModel);\n\n var opacityAccessPath = ['itemStyle', 'opacity'];\r\n var FunnelPiece = (function (_super) {\r\n __extends(FunnelPiece, _super);\r\n function FunnelPiece(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var polygon = _this;\r\n var labelLine = new Polyline();\r\n var text = new ZRText();\r\n polygon.setTextContent(text);\r\n _this.setTextGuideLine(labelLine);\r\n _this.updateData(data, idx, true);\r\n return _this;\r\n }\r\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\r\n var polygon = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var opacity = itemModel.get(opacityAccessPath);\r\n opacity = opacity == null ? 1 : opacity;\r\n polygon.useStyle(data.getItemVisual(idx, 'style'));\r\n polygon.style.lineJoin = 'round';\r\n if (firstCreate) {\r\n polygon.setShape({\r\n points: layout.points\r\n });\r\n polygon.style.opacity = 0;\r\n initProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n updateProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n },\r\n shape: {\r\n points: layout.points\r\n }\r\n }, seriesModel, idx);\r\n }\r\n setStatesStylesFromModel(polygon, itemModel);\r\n this._updateLabel(data, idx);\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n FunnelPiece.prototype._updateLabel = function (data, idx) {\r\n var polygon = this;\r\n var labelLine = this.getTextGuideLine();\r\n var labelText = polygon.getTextContent();\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var labelLayout = layout.label;\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style.fill;\r\n setLabelStyle(labelText, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: data.getName(idx)\r\n }, { normal: {\r\n align: labelLayout.textAlign,\r\n verticalAlign: labelLayout.verticalAlign\r\n } });\r\n polygon.setTextConfig({\r\n local: true,\r\n inside: !!labelLayout.inside,\r\n insideStroke: visualColor,\r\n outsideFill: visualColor\r\n });\r\n var linePoints = labelLayout.linePoints;\r\n labelLine.setShape({\r\n points: linePoints\r\n });\r\n polygon.textGuideLineConfig = {\r\n anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null\r\n };\r\n updateProps(labelText, {\r\n style: {\r\n x: labelLayout.x,\r\n y: labelLayout.y\r\n }\r\n }, seriesModel, idx);\r\n labelText.attr({\r\n rotation: labelLayout.rotation,\r\n originX: labelLayout.x,\r\n originY: labelLayout.y,\r\n z2: 10\r\n });\r\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor\r\n });\r\n };\r\n return FunnelPiece;\r\n }(Polygon));\r\n var FunnelView = (function (_super) {\r\n __extends(FunnelView, _super);\r\n function FunnelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelView.type;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var funnelPiece = new FunnelPiece(data, idx);\r\n data.setItemGraphicEl(idx, funnelPiece);\r\n group.add(funnelPiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piece = oldData.getItemGraphicEl(oldIdx);\r\n piece.updateData(data, newIdx);\r\n group.add(piece);\r\n data.setItemGraphicEl(newIdx, piece);\r\n })\r\n .remove(function (idx) {\r\n var piece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piece, seriesModel, idx);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n FunnelView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n FunnelView.prototype.dispose = function () { };\r\n FunnelView.type = 'funnel';\r\n return FunnelView;\r\n }(ChartView));\r\n ChartView.registerClass(FunnelView);\n\n function getViewRect$3(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function getSortedIndices(data, sort) {\r\n var valueDim = data.mapDimension('value');\r\n var valueArr = data.mapArray(valueDim, function (val) {\r\n return val;\r\n });\r\n var indices = [];\r\n var isAscending = sort === 'ascending';\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n indices[i] = i;\r\n }\r\n if (typeof sort === 'function') {\r\n indices.sort(sort);\r\n }\r\n else if (sort !== 'none') {\r\n indices.sort(function (a, b) {\r\n return isAscending\r\n ? valueArr[a] - valueArr[b]\r\n : valueArr[b] - valueArr[a];\r\n });\r\n }\r\n return indices;\r\n }\r\n function labelLayout(data) {\r\n var seriesModel = data.hostModel;\r\n var orient = seriesModel.get('orient');\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var layout = data.getItemLayout(idx);\r\n var points = layout.points;\r\n var isLabelInside = labelPosition === 'inner'\r\n || labelPosition === 'inside' || labelPosition === 'center'\r\n || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\r\n var textAlign;\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n if (isLabelInside) {\r\n if (labelPosition === 'insideLeft') {\r\n textX = (points[0][0] + points[3][0]) / 2 + 5;\r\n textY = (points[0][1] + points[3][1]) / 2;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'insideRight') {\r\n textX = (points[1][0] + points[2][0]) / 2 - 5;\r\n textY = (points[1][1] + points[2][1]) / 2;\r\n textAlign = 'right';\r\n }\r\n else {\r\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\r\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\r\n textAlign = 'center';\r\n }\r\n linePoints = [\r\n [textX, textY], [textX, textY]\r\n ];\r\n }\r\n else {\r\n var x1 = void 0;\r\n var y1 = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var labelLineLen = labelLineModel.get('length');\r\n if (__DEV__) {\r\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'left';\r\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\r\n }\r\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'bottom';\r\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\r\n }\r\n }\r\n if (labelPosition === 'left') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n else if (labelPosition === 'right') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'top') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'bottom') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'rightTop') {\r\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\r\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'top';\r\n }\r\n }\r\n else if (labelPosition === 'rightBottom') {\r\n x1 = points[2][0];\r\n y1 = points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'bottom';\r\n }\r\n }\r\n else if (labelPosition === 'leftTop') {\r\n x1 = points[0][0];\r\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (labelPosition === 'leftBottom') {\r\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\r\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n }\r\n if (orient === 'horizontal') {\r\n x2 = x1;\r\n textX = x2;\r\n }\r\n else {\r\n y2 = y1;\r\n textY = y2;\r\n }\r\n linePoints = [[x1, y1], [x2, y2]];\r\n }\r\n layout.label = {\r\n linePoints: linePoints,\r\n x: textX,\r\n y: textY,\r\n verticalAlign: 'middle',\r\n textAlign: textAlign,\r\n inside: isLabelInside\r\n };\r\n });\r\n }\r\n function funnelLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var sort = seriesModel.get('sort');\r\n var viewRect = getViewRect$3(seriesModel, api);\r\n var orient = seriesModel.get('orient');\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var indices = getSortedIndices(data, sort);\r\n var x = viewRect.x;\r\n var y = viewRect.y;\r\n var sizeExtent = orient === 'horizontal' ? [\r\n parsePercent$2(seriesModel.get('minSize'), viewHeight),\r\n parsePercent$2(seriesModel.get('maxSize'), viewHeight)\r\n ] : [\r\n parsePercent$2(seriesModel.get('minSize'), viewWidth),\r\n parsePercent$2(seriesModel.get('maxSize'), viewWidth)\r\n ];\r\n var dataExtent = data.getDataExtent(valueDim);\r\n var min = seriesModel.get('min');\r\n var max = seriesModel.get('max');\r\n if (min == null) {\r\n min = Math.min(dataExtent[0], 0);\r\n }\r\n if (max == null) {\r\n max = dataExtent[1];\r\n }\r\n var funnelAlign = seriesModel.get('funnelAlign');\r\n var gap = seriesModel.get('gap');\r\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\r\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\r\n var getLinePoints = function (idx, offset) {\r\n if (orient === 'horizontal') {\r\n var val_1 = data.get(valueDim, idx) || 0;\r\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\r\n var y0 = void 0;\r\n switch (funnelAlign) {\r\n case 'top':\r\n y0 = y;\r\n break;\r\n case 'center':\r\n y0 = y + (viewHeight - itemHeight) / 2;\r\n break;\r\n case 'bottom':\r\n y0 = y + (viewHeight - itemHeight);\r\n break;\r\n }\r\n return [\r\n [offset, y0],\r\n [offset, y0 + itemHeight]\r\n ];\r\n }\r\n var val = data.get(valueDim, idx) || 0;\r\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\r\n var x0;\r\n switch (funnelAlign) {\r\n case 'left':\r\n x0 = x;\r\n break;\r\n case 'center':\r\n x0 = x + (viewWidth - itemWidth) / 2;\r\n break;\r\n case 'right':\r\n x0 = x + viewWidth - itemWidth;\r\n break;\r\n }\r\n return [\r\n [x0, offset],\r\n [x0 + itemWidth, offset]\r\n ];\r\n };\r\n if (sort === 'ascending') {\r\n itemSize = -itemSize;\r\n gap = -gap;\r\n if (orient === 'horizontal') {\r\n x += viewWidth;\r\n }\r\n else {\r\n y += viewHeight;\r\n }\r\n indices = indices.reverse();\r\n }\r\n for (var i = 0; i < indices.length; i++) {\r\n var idx = indices[i];\r\n var nextIdx = indices[i + 1];\r\n var itemModel = data.getItemModel(idx);\r\n if (orient === 'horizontal') {\r\n var width = itemModel.get(['itemStyle', 'width']);\r\n if (width == null) {\r\n width = itemSize;\r\n }\r\n else {\r\n width = parsePercent$2(width, viewWidth);\r\n if (sort === 'ascending') {\r\n width = -width;\r\n }\r\n }\r\n var start = getLinePoints(idx, x);\r\n var end = getLinePoints(nextIdx, x + width);\r\n x += width + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n else {\r\n var height = itemModel.get(['itemStyle', 'height']);\r\n if (height == null) {\r\n height = itemSize;\r\n }\r\n else {\r\n height = parsePercent$2(height, viewHeight);\r\n if (sort === 'ascending') {\r\n height = -height;\r\n }\r\n }\r\n var start = getLinePoints(idx, y);\r\n var end = getLinePoints(nextIdx, y + height);\r\n y += height + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n }\r\n labelLayout(data);\r\n });\r\n }\n\n registerLayout(funnelLayout);\r\n registerProcessor(dataFilter('funnel'));\n\n function parallelPreprocessor(option) {\r\n createParallelIfNeeded(option);\r\n mergeAxisOptionFromParallel(option);\r\n }\r\n function createParallelIfNeeded(option) {\r\n if (option.parallel) {\r\n return;\r\n }\r\n var hasParallelSeries = false;\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'parallel') {\r\n hasParallelSeries = true;\r\n }\r\n });\r\n if (hasParallelSeries) {\r\n option.parallel = [{}];\r\n }\r\n }\r\n function mergeAxisOptionFromParallel(option) {\r\n var axes = normalizeToArray(option.parallelAxis);\r\n each(axes, function (axisOption) {\r\n if (!isObject(axisOption)) {\r\n return;\r\n }\r\n var parallelIndex = axisOption.parallelIndex || 0;\r\n var parallelOption = normalizeToArray(option.parallel)[parallelIndex];\r\n if (parallelOption && parallelOption.parallelAxisDefault) {\r\n merge(axisOption, parallelOption.parallelAxisDefault, false);\r\n }\r\n });\r\n }\n\n var ParallelAxis = (function (_super) {\r\n __extends(ParallelAxis, _super);\r\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.axisIndex = axisIndex;\r\n return _this;\r\n }\r\n ParallelAxis.prototype.isHorizontal = function () {\r\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\r\n };\r\n return ParallelAxis;\r\n }(Axis));\n\n function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n }\r\n function getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n }\r\n function restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n }\n\n var each$6 = each;\r\n var mathMin$8 = Math.min;\r\n var mathMax$8 = Math.max;\r\n var mathFloor$2 = Math.floor;\r\n var mathCeil$1 = Math.ceil;\r\n var round$2 = round$1;\r\n var PI$8 = Math.PI;\r\n var Parallel = (function () {\r\n function Parallel(parallelModel, ecModel, api) {\r\n this.type = 'parallel';\r\n this._axesMap = createHashMap();\r\n this._axesLayout = {};\r\n this.dimensions = parallelModel.dimensions;\r\n this._model = parallelModel;\r\n this._init(parallelModel, ecModel, api);\r\n }\r\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\r\n var dimensions = parallelModel.dimensions;\r\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\r\n each$6(dimensions, function (dim, idx) {\r\n var axisIndex = parallelAxisIndex[idx];\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = axisModel.coordinateSystem = this;\r\n }, this);\r\n };\r\n Parallel.prototype.update = function (ecModel, api) {\r\n this._updateAxesFromSeries(this._model, ecModel);\r\n };\r\n Parallel.prototype.containPoint = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var axisBase = layoutInfo.axisBase;\r\n var layoutBase = layoutInfo.layoutBase;\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var pAxis = point[1 - pixelDimIndex];\r\n var pLayout = point[pixelDimIndex];\r\n return pAxis >= axisBase\r\n && pAxis <= axisBase + layoutInfo.axisLength\r\n && pLayout >= layoutBase\r\n && pLayout <= layoutBase + layoutInfo.layoutLength;\r\n };\r\n Parallel.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!parallelModel.contains(seriesModel, ecModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n each$6(this.dimensions, function (dim) {\r\n var axis = this._axesMap.get(dim);\r\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\r\n niceScaleExtent(axis.scale, axis.model);\r\n }, this);\r\n }, this);\r\n };\r\n Parallel.prototype.resize = function (parallelModel, api) {\r\n this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._layoutAxes();\r\n };\r\n Parallel.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Parallel.prototype._makeLayoutInfo = function () {\r\n var parallelModel = this._model;\r\n var rect = this._rect;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var layout = parallelModel.get('layout');\r\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\r\n var layoutLength = rect[wh[pixelDimIndex]];\r\n var layoutExtent = [0, layoutLength];\r\n var axisCount = this.dimensions.length;\r\n var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent);\r\n var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\r\n var axisExpandable = parallelModel.get('axisExpandable')\r\n && axisCount > 3\r\n && axisCount > axisExpandCount\r\n && axisExpandCount > 1\r\n && axisExpandWidth > 0\r\n && layoutLength > 0;\r\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\r\n var winSize;\r\n if (!axisExpandWindow) {\r\n winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\r\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2);\r\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n else {\r\n winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\r\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\r\n var winInnerIndices = [\r\n mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,\r\n mathCeil$1(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1\r\n ];\r\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\r\n return {\r\n layout: layout,\r\n pixelDimIndex: pixelDimIndex,\r\n layoutBase: rect[xy[pixelDimIndex]],\r\n layoutLength: layoutLength,\r\n axisBase: rect[xy[1 - pixelDimIndex]],\r\n axisLength: rect[wh[1 - pixelDimIndex]],\r\n axisExpandable: axisExpandable,\r\n axisExpandWidth: axisExpandWidth,\r\n axisCollapseWidth: axisCollapseWidth,\r\n axisExpandWindow: axisExpandWindow,\r\n axisCount: axisCount,\r\n winInnerIndices: winInnerIndices,\r\n axisExpandWindow0Pos: axisExpandWindow0Pos\r\n };\r\n };\r\n Parallel.prototype._layoutAxes = function () {\r\n var rect = this._rect;\r\n var axes = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var layoutInfo = this._makeLayoutInfo();\r\n var layout = layoutInfo.layout;\r\n axes.each(function (axis) {\r\n var axisExtent = [0, layoutInfo.axisLength];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\r\n });\r\n each$6(dimensions, function (dim, idx) {\r\n var posInfo = (layoutInfo.axisExpandable\r\n ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\r\n var positionTable = {\r\n horizontal: {\r\n x: posInfo.position,\r\n y: layoutInfo.axisLength\r\n },\r\n vertical: {\r\n x: 0,\r\n y: posInfo.position\r\n }\r\n };\r\n var rotationTable = {\r\n horizontal: PI$8 / 2,\r\n vertical: 0\r\n };\r\n var position = [\r\n positionTable[layout].x + rect.x,\r\n positionTable[layout].y + rect.y\r\n ];\r\n var rotation = rotationTable[layout];\r\n var transform = create$1();\r\n rotate(transform, transform, rotation);\r\n translate(transform, transform, position);\r\n this._axesLayout[dim] = {\r\n position: position,\r\n rotation: rotation,\r\n transform: transform,\r\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\r\n axisLabelShow: posInfo.axisLabelShow,\r\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\r\n tickDirection: 1,\r\n labelDirection: 1\r\n };\r\n }, this);\r\n };\r\n Parallel.prototype.getAxis = function (dim) {\r\n return this._axesMap.get(dim);\r\n };\r\n Parallel.prototype.dataToPoint = function (value, dim) {\r\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\r\n };\r\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\r\n start == null && (start = 0);\r\n end == null && (end = data.count());\r\n var axesMap = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var dataDimensions = [];\r\n var axisModels = [];\r\n each(dimensions, function (axisDim) {\r\n dataDimensions.push(data.mapDimension(axisDim));\r\n axisModels.push(axesMap.get(axisDim).model);\r\n });\r\n var hasActiveSet = this.hasAxisBrushed();\r\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\r\n var activeState = void 0;\r\n if (!hasActiveSet) {\r\n activeState = 'normal';\r\n }\r\n else {\r\n activeState = 'active';\r\n var values = data.getValues(dataDimensions, dataIndex);\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n var state = axisModels[j].getActiveState(values[j]);\r\n if (state === 'inactive') {\r\n activeState = 'inactive';\r\n break;\r\n }\r\n }\r\n }\r\n callback(activeState, dataIndex);\r\n }\r\n };\r\n Parallel.prototype.hasAxisBrushed = function () {\r\n var dimensions = this.dimensions;\r\n var axesMap = this._axesMap;\r\n var hasActiveSet = false;\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\r\n hasActiveSet = true;\r\n }\r\n }\r\n return hasActiveSet;\r\n };\r\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\r\n var axisLayout = this._axesLayout[dim];\r\n return applyTransform$1([coord, 0], axisLayout.transform);\r\n };\r\n Parallel.prototype.getAxisLayout = function (dim) {\r\n return clone(this._axesLayout[dim]);\r\n };\r\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\r\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\r\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\r\n if (!this.containPoint(point)) {\r\n return { behavior: 'none', axisExpandWindow: axisExpandWindow };\r\n }\r\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\r\n var delta;\r\n var behavior = 'slide';\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var triggerArea = this._model.get('axisExpandSlideTriggerArea');\r\n var useJump = triggerArea[0] != null;\r\n if (axisCollapseWidth) {\r\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * triggerArea[2];\r\n }\r\n else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * (1 - triggerArea[2]);\r\n }\r\n else {\r\n (delta = pointCoord - winSize * triggerArea[1]) >= 0\r\n && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0\r\n && (delta = 0);\r\n }\r\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\r\n delta\r\n ? sliderMove(delta, axisExpandWindow, extent, 'all')\r\n : (behavior = 'none');\r\n }\r\n else {\r\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\r\n var pos = extent[1] * pointCoord / winSize2;\r\n axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)];\r\n axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2);\r\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\r\n }\r\n return {\r\n axisExpandWindow: axisExpandWindow,\r\n behavior: behavior\r\n };\r\n };\r\n return Parallel;\r\n }());\r\n function restrict$1(len, extent) {\r\n return mathMin$8(mathMax$8(len, extent[0]), extent[1]);\r\n }\r\n function layoutAxisWithoutExpand(axisIndex, layoutInfo) {\r\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\r\n return {\r\n position: step * axisIndex,\r\n axisNameAvailableWidth: step,\r\n axisLabelShow: true\r\n };\r\n }\r\n function layoutAxisWithExpand(axisIndex, layoutInfo) {\r\n var layoutLength = layoutInfo.layoutLength;\r\n var axisExpandWidth = layoutInfo.axisExpandWidth;\r\n var axisCount = layoutInfo.axisCount;\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var winInnerIndices = layoutInfo.winInnerIndices;\r\n var position;\r\n var axisNameAvailableWidth = axisCollapseWidth;\r\n var axisLabelShow = false;\r\n var nameTruncateMaxWidth;\r\n if (axisIndex < winInnerIndices[0]) {\r\n position = axisIndex * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n else if (axisIndex <= winInnerIndices[1]) {\r\n position = layoutInfo.axisExpandWindow0Pos\r\n + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\r\n axisNameAvailableWidth = axisExpandWidth;\r\n axisLabelShow = true;\r\n }\r\n else {\r\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n return {\r\n position: position,\r\n axisNameAvailableWidth: axisNameAvailableWidth,\r\n axisLabelShow: axisLabelShow,\r\n nameTruncateMaxWidth: nameTruncateMaxWidth\r\n };\r\n }\n\n function create$2(ecModel, api) {\r\n var coordSysList = [];\r\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\r\n var coordSys = new Parallel(parallelModel, ecModel, api);\r\n coordSys.name = 'parallel_' + idx;\r\n coordSys.resize(parallelModel, api);\r\n parallelModel.coordinateSystem = coordSys;\r\n coordSys.model = parallelModel;\r\n coordSysList.push(coordSys);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'parallel') {\r\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\r\n }\r\n });\r\n return coordSysList;\r\n }\r\n CoordinateSystemManager.register('parallel', { create: create$2 });\n\n var ParallelAxisModel = (function (_super) {\r\n __extends(ParallelAxisModel, _super);\r\n function ParallelAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisModel.type;\r\n _this.activeIntervals = [];\r\n return _this;\r\n }\r\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\r\n return makeStyleMapper([\r\n ['fill', 'color'],\r\n ['lineWidth', 'borderWidth'],\r\n ['stroke', 'borderColor'],\r\n ['width', 'width'],\r\n ['opacity', 'opacity']\r\n ])(this.getModel('areaSelectStyle'));\r\n };\r\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\r\n var activeIntervals = this.activeIntervals = clone(intervals);\r\n if (activeIntervals) {\r\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\r\n asc(activeIntervals[i]);\r\n }\r\n }\r\n };\r\n ParallelAxisModel.prototype.getActiveState = function (value) {\r\n var activeIntervals = this.activeIntervals;\r\n if (!activeIntervals.length) {\r\n return 'normal';\r\n }\r\n if (value == null || isNaN(+value)) {\r\n return 'inactive';\r\n }\r\n if (activeIntervals.length === 1) {\r\n var interval = activeIntervals[0];\r\n if (interval[0] <= value && value <= interval[1]) {\r\n return 'active';\r\n }\r\n }\r\n else {\r\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\r\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\r\n return 'active';\r\n }\r\n }\r\n }\r\n return 'inactive';\r\n };\r\n return ParallelAxisModel;\r\n }(ComponentModel));\r\n var defaultOption$1 = {\r\n type: 'value',\r\n areaSelectStyle: {\r\n width: 20,\r\n borderWidth: 1,\r\n borderColor: 'rgba(160,197,232)',\r\n color: 'rgba(160,197,232)',\r\n opacity: 0.3\r\n },\r\n realtime: true,\r\n z: 10\r\n };\r\n ComponentModel.registerClass(ParallelAxisModel);\r\n mixin(ParallelAxisModel, AxisModelCommonMixin);\r\n axisModelCreator('parallel', ParallelAxisModel, defaultOption$1);\n\n var ParallelModel = (function (_super) {\r\n __extends(ParallelModel, _super);\r\n function ParallelModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelModel.type;\r\n return _this;\r\n }\r\n ParallelModel.prototype.init = function () {\r\n _super.prototype.init.apply(this, arguments);\r\n this.mergeOption({});\r\n };\r\n ParallelModel.prototype.mergeOption = function (newOption) {\r\n var thisOption = this.option;\r\n newOption && merge(thisOption, newOption, true);\r\n this._initDimensions();\r\n };\r\n ParallelModel.prototype.contains = function (model, ecModel) {\r\n var parallelIndex = model.get('parallelIndex');\r\n return parallelIndex != null\r\n && ecModel.getComponent('parallel', parallelIndex) === this;\r\n };\r\n ParallelModel.prototype.setAxisExpand = function (opt) {\r\n each([\r\n 'axisExpandable',\r\n 'axisExpandCenter',\r\n 'axisExpandCount',\r\n 'axisExpandWidth',\r\n 'axisExpandWindow'\r\n ], function (name) {\r\n if (opt.hasOwnProperty(name)) {\r\n this.option[name] = opt[name];\r\n }\r\n }, this);\r\n };\r\n ParallelModel.prototype._initDimensions = function () {\r\n var dimensions = this.dimensions = [];\r\n var parallelAxisIndex = this.parallelAxisIndex = [];\r\n var axisModels = filter(this.ecModel.queryComponents({ mainType: 'parallelAxis' }), function (axisModel) {\r\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\r\n }, this);\r\n each(axisModels, function (axisModel) {\r\n dimensions.push('dim' + axisModel.get('dim'));\r\n parallelAxisIndex.push(axisModel.componentIndex);\r\n });\r\n };\r\n ParallelModel.type = 'parallel';\r\n ParallelModel.dependencies = ['parallelAxis'];\r\n ParallelModel.layoutMode = 'box';\r\n ParallelModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n layout: 'horizontal',\r\n axisExpandable: false,\r\n axisExpandCenter: null,\r\n axisExpandCount: 0,\r\n axisExpandWidth: 50,\r\n axisExpandRate: 17,\r\n axisExpandDebounce: 50,\r\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\r\n axisExpandTriggerOn: 'click',\r\n parallelAxisDefault: null\r\n };\r\n return ParallelModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ParallelModel);\n\n var actionInfo$1 = {\r\n type: 'axisAreaSelect',\r\n event: 'axisAreaSelected'\r\n };\r\n registerAction(actionInfo$1, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallelAxis', query: payload }, function (parallelAxisModel) {\r\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\r\n });\r\n });\r\n registerAction('parallelAxisExpand', function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallel', query: payload }, function (parallelModel) {\r\n parallelModel.setAxisExpand(payload);\r\n });\r\n });\n\n var BRUSH_PANEL_GLOBAL = true;\r\n var mathMin$9 = Math.min;\r\n var mathMax$9 = Math.max;\r\n var mathPow$2 = Math.pow;\r\n var COVER_Z = 10000;\r\n var UNSELECT_THRESHOLD = 6;\r\n var MIN_RESIZE_LINE_WIDTH = 6;\r\n var MUTEX_RESOURCE_KEY = 'globalPan';\r\n var DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n };\r\n var CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n };\r\n var DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n };\r\n var baseUID = 0;\r\n var BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n }(Eventful));\r\n function createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n }\r\n function endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n }\r\n function updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n }\r\n function updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n }\r\n function updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n }\r\n function getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n }\r\n function getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n }\r\n function getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n }\r\n function clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n }\r\n function trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n }\r\n function shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n }\r\n function getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n }\r\n function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n }\r\n function updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n }\r\n function updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n }\r\n function updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n }\r\n function makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n }\r\n function formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$9(x, x2), mathMin$9(y, y2)];\r\n var max = [mathMax$9(x, x2), mathMax$9(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n }\r\n function getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n }\r\n function getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n }\r\n function getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n }\r\n function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n }\r\n function clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n }\r\n function pointsToRect(points) {\r\n var xmin = mathMin$9(points[0][0], points[1][0]);\r\n var ymin = mathMin$9(points[0][1], points[1][1]);\r\n var xmax = mathMax$9(points[0][0], points[1][0]);\r\n var ymax = mathMax$9(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n }\r\n function resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n }\r\n function preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n }\r\n function mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n }\r\n function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n }\r\n function determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n }\r\n var pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n };\r\n function handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n }\r\n function isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n }\r\n var coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n };\r\n function getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n }\n\n function makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n }\r\n function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n }\r\n function makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n }\r\n function normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n }\n\n var elementList = ['axisLine', 'axisTickLabel', 'axisName'];\r\n var ParallelAxisView = (function (_super) {\r\n __extends(ParallelAxisView, _super);\r\n function ParallelAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisView.type;\r\n return _this;\r\n }\r\n ParallelAxisView.prototype.init = function (ecModel, api) {\r\n _super.prototype.init.apply(this, arguments);\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this));\r\n };\r\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\r\n return;\r\n }\r\n this.axisModel = axisModel;\r\n this.api = api;\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\r\n var coordSys = coordSysModel.coordinateSystem;\r\n var areaSelectStyle = axisModel.getAreaSelectStyle();\r\n var areaWidth = areaSelectStyle.width;\r\n var dim = axisModel.axis.dim;\r\n var axisLayout = coordSys.getAxisLayout(dim);\r\n var builderOpt = extend({ strokeContainThreshold: areaWidth }, axisLayout);\r\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\r\n each(elementList, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n };\r\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\r\n var extent = axisModel.axis.getExtent();\r\n var extentLen = extent[1] - extent[0];\r\n var extra = Math.min(30, Math.abs(extentLen) * 0.1);\r\n var rect = BoundingRect.create({\r\n x: extent[0],\r\n y: -areaWidth / 2,\r\n width: extentLen,\r\n height: areaWidth\r\n });\r\n rect.x -= extra;\r\n rect.width += 2 * extra;\r\n this._brushController\r\n .mount({\r\n enableGlobalPan: true,\r\n rotation: builderOpt.rotation,\r\n x: builderOpt.position[0],\r\n y: builderOpt.position[1]\r\n })\r\n .setPanels([{\r\n panelId: 'pl',\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)\r\n }])\r\n .enableBrush({\r\n brushType: 'lineX',\r\n brushStyle: areaSelectStyle,\r\n removeOnClick: true\r\n })\r\n .updateCovers(getCoverInfoList(axisModel));\r\n };\r\n ParallelAxisView.prototype._onBrush = function (eventParam) {\r\n var coverInfoList = eventParam.areas;\r\n var axisModel = this.axisModel;\r\n var axis = axisModel.axis;\r\n var intervals = map(coverInfoList, function (coverInfo) {\r\n return [\r\n axis.coordToData(coverInfo.range[0], true),\r\n axis.coordToData(coverInfo.range[1], true)\r\n ];\r\n });\r\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\r\n this.api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n parallelAxisId: axisModel.id,\r\n intervals: intervals\r\n });\r\n }\r\n };\r\n ParallelAxisView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n ParallelAxisView.type = 'parallelAxis';\r\n return ParallelAxisView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ParallelAxisView);\r\n function fromAxisAreaSelect(axisModel, ecModel, payload) {\r\n return payload\r\n && payload.type === 'axisAreaSelect'\r\n && ecModel.findComponents({ mainType: 'parallelAxis', query: payload })[0] === axisModel;\r\n }\r\n function getCoverInfoList(axisModel) {\r\n var axis = axisModel.axis;\r\n return map(axisModel.activeIntervals, function (interval) {\r\n return {\r\n brushType: 'lineX',\r\n panelId: 'pl',\r\n range: [\r\n axis.dataToCoord(interval[0], true),\r\n axis.dataToCoord(interval[1], true)\r\n ]\r\n };\r\n });\r\n }\r\n function getCoordSysModel(axisModel, ecModel) {\r\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\r\n }\n\n var CLICK_THRESHOLD = 5;\r\n var ParallelView = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n return _this;\r\n }\r\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\r\n this._model = parallelModel;\r\n this._api = api;\r\n if (!this._handlers) {\r\n this._handlers = {};\r\n each(handlers, function (handler, eventName) {\r\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\r\n }, this);\r\n }\r\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\r\n };\r\n ParallelView.prototype.dispose = function (ecModel, api) {\r\n each(this._handlers, function (handler, eventName) {\r\n api.getZr().off(eventName, handler);\r\n });\r\n this._handlers = null;\r\n };\r\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\r\n this._dispatchExpand(opt);\r\n };\r\n ParallelView.prototype._dispatchExpand = function (opt) {\r\n opt && this._api.dispatchAction(extend({ type: 'parallelAxisExpand' }, opt));\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ParallelView);\r\n var handlers = {\r\n mousedown: function (e) {\r\n if (checkTrigger(this, 'click')) {\r\n this._mouseDownPoint = [e.offsetX, e.offsetY];\r\n }\r\n },\r\n mouseup: function (e) {\r\n var mouseDownPoint = this._mouseDownPoint;\r\n if (checkTrigger(this, 'click') && mouseDownPoint) {\r\n var point = [e.offsetX, e.offsetY];\r\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2)\r\n + Math.pow(mouseDownPoint[1] - point[1], 2);\r\n if (dist > CLICK_THRESHOLD) {\r\n return;\r\n }\r\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n result.behavior !== 'none' && this._dispatchExpand({\r\n axisExpandWindow: result.axisExpandWindow\r\n });\r\n }\r\n this._mouseDownPoint = null;\r\n },\r\n mousemove: function (e) {\r\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\r\n return;\r\n }\r\n var model = this._model;\r\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n var behavior = result.behavior;\r\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\r\n this._throttledDispatchExpand(behavior === 'none'\r\n ? null\r\n : {\r\n axisExpandWindow: result.axisExpandWindow,\r\n animation: behavior === 'jump' ? null : {\r\n duration: 0\r\n }\r\n });\r\n }\r\n };\r\n function checkTrigger(view, triggerOn) {\r\n var model = view._model;\r\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\r\n }\r\n registerPreprocessor(parallelPreprocessor);\n\n var ParallelSeriesModel = (function (_super) {\r\n __extends(ParallelSeriesModel, _super);\r\n function ParallelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\r\n });\r\n };\r\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\r\n var coordSys = this.coordinateSystem;\r\n var data = this.getData();\r\n var indices = [];\r\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\r\n if (activeState === theActiveState) {\r\n indices.push(data.getRawIndex(dataIndex));\r\n }\r\n });\r\n return indices;\r\n };\r\n ParallelSeriesModel.type = 'series.parallel';\r\n ParallelSeriesModel.dependencies = ['parallel'];\r\n ParallelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'parallel',\r\n parallelIndex: 0,\r\n label: {\r\n show: false\r\n },\r\n inactiveOpacity: 0.05,\r\n activeOpacity: 1,\r\n lineStyle: {\r\n width: 1,\r\n opacity: 0.45,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n label: {\r\n show: false\r\n }\r\n },\r\n progressive: 500,\r\n smooth: false,\r\n animationEasing: 'linear'\r\n };\r\n return ParallelSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ParallelSeriesModel);\r\n function makeDefaultEncode(seriesModel) {\r\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n if (!parallelModel) {\r\n return;\r\n }\r\n var encodeDefine = {};\r\n each(parallelModel.dimensions, function (axisDim) {\r\n var dataDimIndex = convertDimNameToNumber(axisDim);\r\n encodeDefine[axisDim] = dataDimIndex;\r\n });\r\n return encodeDefine;\r\n }\r\n function convertDimNameToNumber(dimName) {\r\n return +dimName.replace('dim', '');\r\n }\n\n var DEFAULT_SMOOTH = 0.3;\r\n var ParallelView$1 = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n _this._dataGroup = new Group();\r\n _this._initialized = false;\r\n return _this;\r\n }\r\n ParallelView.prototype.init = function () {\r\n this.group.add(this._dataGroup);\r\n };\r\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var dataGroup = this._dataGroup;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n data.diff(oldData)\r\n .add(add)\r\n .update(update)\r\n .remove(remove)\r\n .execute();\r\n function add(newDataIndex) {\r\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function update(newDataIndex, oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\r\n data.setItemGraphicEl(newDataIndex, line);\r\n updateProps(line, { shape: { points: points } }, seriesModel, newDataIndex);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function remove(oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n dataGroup.remove(line);\r\n }\r\n if (!this._initialized) {\r\n this._initialized = true;\r\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\r\n setTimeout(function () {\r\n dataGroup.removeClipPath();\r\n });\r\n });\r\n dataGroup.setClipPath(clipPath);\r\n }\r\n this._data = data;\r\n };\r\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._initialized = true;\r\n this._data = null;\r\n this._dataGroup.removeAll();\r\n };\r\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\r\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\r\n line.incremental = true;\r\n updateElCommon(line, data, dataIndex, seriesScope);\r\n }\r\n };\r\n ParallelView.prototype.remove = function () {\r\n this._dataGroup && this._dataGroup.removeAll();\r\n this._data = null;\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n }(ChartView));\r\n function createGridClipShape(coordSys, seriesModel, cb) {\r\n var parallelModel = coordSys.model;\r\n var rect = coordSys.getRect();\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n });\r\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\r\n rectEl.setShape(dim, 0);\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n function createLinePoints(data, dataIndex, dimensions, coordSys) {\r\n var points = [];\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimName = dimensions[i];\r\n var value = data.get(data.mapDimension(dimName), dataIndex);\r\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\r\n points.push(coordSys.dataToPoint(value, dimName));\r\n }\r\n }\r\n return points;\r\n }\r\n function addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\r\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\r\n var line = new Polyline({\r\n shape: { points: points },\r\n z2: 10\r\n });\r\n dataGroup.add(line);\r\n data.setItemGraphicEl(dataIndex, line);\r\n return line;\r\n }\r\n function makeSeriesScope$2(seriesModel) {\r\n var smooth = seriesModel.get('smooth', true);\r\n smooth === true && (smooth = DEFAULT_SMOOTH);\r\n smooth = numericToNumber(smooth);\r\n eqNaN(smooth) && (smooth = 0);\r\n return { smooth: smooth };\r\n }\r\n function updateElCommon(el, data, dataIndex, seriesScope) {\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.fill = null;\r\n el.setShape('smooth', seriesScope.smooth);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n function isEmptyValue(val, axisType) {\r\n return axisType === 'category'\r\n ? val == null\r\n : (val == null || isNaN(val));\r\n }\r\n ChartView.registerClass(ParallelView$1);\n\n var opacityAccessPath$1 = ['lineStyle', 'opacity'];\r\n var parallelVisual = {\r\n seriesType: 'parallel',\r\n reset: function (seriesModel, ecModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var opacityMap = {\r\n normal: seriesModel.get(['lineStyle', 'opacity']),\r\n active: seriesModel.get('activeOpacity'),\r\n inactive: seriesModel.get('inactiveOpacity')\r\n };\r\n return {\r\n progress: function (params, data) {\r\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\r\n var opacity = opacityMap[activeState];\r\n if (activeState === 'normal' && data.hasItemOption) {\r\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true);\r\n itemOpacity != null && (opacity = itemOpacity);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n existsStyle.opacity = opacity;\r\n }, params.start, params.end);\r\n }\r\n };\r\n }\r\n };\n\n registerVisual(PRIORITY.VISUAL.BRUSH, parallelVisual);\n\n var SankeySeriesModel = (function (_super) {\r\n __extends(SankeySeriesModel, _super);\r\n function SankeySeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeySeriesModel.type;\r\n return _this;\r\n }\r\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var links = option.edges || option.links;\r\n var nodes = option.data || option.nodes;\r\n var levels = option.levels;\r\n this.levelModels = [];\r\n var levelModels = this.levelModels;\r\n for (var i = 0; i < levels.length; i++) {\r\n if (levels[i].depth != null && levels[i].depth >= 0) {\r\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('levels[i].depth is mandatory and should be natural number');\r\n }\r\n }\r\n }\r\n if (nodes && links) {\r\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var layout = seriesModel.getData().getItemLayout(idx);\r\n if (layout) {\r\n var nodeDepth = layout.depth;\r\n var levelModel = seriesModel.levelModels[nodeDepth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n edgeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\r\n var layout = edge.node1.getLayout();\r\n if (layout) {\r\n var depth = layout.depth;\r\n var levelModel = seriesModel.levelModels[depth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\r\n var dataItem = this.option.data[dataIndex];\r\n dataItem.localX = localPosition[0];\r\n dataItem.localY = localPosition[1];\r\n };\r\n SankeySeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n SankeySeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n function noValue(val) {\r\n return isNaN(val) || val == null;\r\n }\r\n if (dataType === 'edge') {\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var rawDataOpt = params.data;\r\n var edgeValue = params.value;\r\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\r\n return createTooltipMarkup('nameValue', {\r\n name: edgeName,\r\n value: edgeValue,\r\n noValue: noValue(edgeValue)\r\n });\r\n }\r\n else {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var value = node.getLayout().value;\r\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\r\n return createTooltipMarkup('nameValue', {\r\n name: name_1,\r\n value: value,\r\n noValue: noValue(value)\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n if (option.focusNodeAdjacency === true) {\r\n option.focusNodeAdjacency = 'allEdges';\r\n }\r\n };\r\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n if (params.value == null && dataType === 'node') {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var nodeValue = node.getLayout().value;\r\n params.value = nodeValue;\r\n }\r\n return params;\r\n };\r\n SankeySeriesModel.type = 'series.sankey';\r\n SankeySeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '5%',\r\n top: '5%',\r\n right: '20%',\r\n bottom: '5%',\r\n orient: 'horizontal',\r\n nodeWidth: 20,\r\n nodeGap: 8,\r\n draggable: true,\r\n focusNodeAdjacency: false,\r\n layoutIterations: 32,\r\n label: {\r\n show: true,\r\n position: 'right',\r\n fontSize: 12\r\n },\r\n levels: [],\r\n nodeAlign: 'justify',\r\n lineStyle: {\r\n color: '#314656',\r\n opacity: 0.2,\r\n curveness: 0.5\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 1000\r\n };\r\n return SankeySeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(SankeySeriesModel);\n\n var SankeyPathShape = (function () {\r\n function SankeyPathShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.cpx2 = 0;\r\n this.cpy2 = 0;\r\n this.extent = 0;\r\n }\r\n return SankeyPathShape;\r\n }());\r\n var SankeyPath = (function (_super) {\r\n __extends(SankeyPath, _super);\r\n function SankeyPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n SankeyPath.prototype.getDefaultShape = function () {\r\n return new SankeyPathShape();\r\n };\r\n SankeyPath.prototype.buildPath = function (ctx, shape) {\r\n var extent = shape.extent;\r\n ctx.moveTo(shape.x1, shape.y1);\r\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\r\n if (shape.orient === 'vertical') {\r\n ctx.lineTo(shape.x2 + extent, shape.y2);\r\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\r\n }\r\n else {\r\n ctx.lineTo(shape.x2, shape.y2 + extent);\r\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\r\n }\r\n ctx.closePath();\r\n };\r\n SankeyPath.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n SankeyPath.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n return SankeyPath;\r\n }(Path));\r\n var SankeyView = (function (_super) {\r\n __extends(SankeyView, _super);\r\n function SankeyView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeyView.type;\r\n _this._focusAdjacencyDisabled = false;\r\n return _this;\r\n }\r\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\r\n var sankeyView = this;\r\n var graph = seriesModel.getGraph();\r\n var group = this.group;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var nodeData = seriesModel.getData();\r\n var edgeData = seriesModel.getData('edge');\r\n var orient = seriesModel.get('orient');\r\n this._model = seriesModel;\r\n group.removeAll();\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n graph.eachEdge(function (edge) {\r\n var curve = new SankeyPath();\r\n var ecData = getECData(curve);\r\n ecData.dataIndex = edge.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataType = 'edge';\r\n var edgeModel = edge.getModel();\r\n var lineStyleModel = edgeModel.getModel('lineStyle');\r\n var curvature = lineStyleModel.get('curveness');\r\n var n1Layout = edge.node1.getLayout();\r\n var node1Model = edge.node1.getModel();\r\n var dragX1 = node1Model.get('localX');\r\n var dragY1 = node1Model.get('localY');\r\n var n2Layout = edge.node2.getLayout();\r\n var node2Model = edge.node2.getModel();\r\n var dragX2 = node2Model.get('localX');\r\n var dragY2 = node2Model.get('localY');\r\n var edgeLayout = edge.getLayout();\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n curve.shape.extent = Math.max(1, edgeLayout.dy);\r\n curve.shape.orient = orient;\r\n if (orient === 'vertical') {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\r\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\r\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\r\n cpx1 = x1;\r\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\r\n cpx2 = x2;\r\n cpy2 = y1 * curvature + y2 * (1 - curvature);\r\n }\r\n else {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\r\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\r\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\r\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\r\n cpy1 = y1;\r\n cpx2 = x1 * curvature + x2 * (1 - curvature);\r\n cpy2 = y2;\r\n }\r\n curve.setShape({\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n });\r\n curve.useStyle(lineStyleModel.getItemStyle());\r\n switch (curve.style.fill) {\r\n case 'source':\r\n curve.style.fill = edge.node1.getVisual('color');\r\n curve.style.decal = edge.node1.getVisual('style').decal;\r\n break;\r\n case 'target':\r\n curve.style.fill = edge.node2.getVisual('color');\r\n curve.style.decal = edge.node2.getVisual('style').decal;\r\n break;\r\n case 'gradient':\r\n var sourceColor = edge.node1.getVisual('color');\r\n var targetColor = edge.node2.getVisual('color');\r\n if (typeof sourceColor === 'string' && typeof targetColor === 'string') {\r\n curve.style.fill = new LinearGradient(0, 0, 1, 0, [{\r\n color: sourceColor,\r\n offset: 0\r\n }, {\r\n color: targetColor,\r\n offset: 1\r\n }]);\r\n }\r\n }\r\n var emphasisModel = edgeModel.getModel('emphasis');\r\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { return model.getItemStyle(); });\r\n group.add(curve);\r\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n getECData(curve).dataType = 'edge';\r\n });\r\n graph.eachNode(function (node) {\r\n var layout = node.getLayout();\r\n var itemModel = node.getModel();\r\n var dragX = itemModel.get('localX');\r\n var dragY = itemModel.get('localY');\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var rect = new Rect({\r\n shape: {\r\n x: dragX != null ? dragX * width : layout.x,\r\n y: dragY != null ? dragY * height : layout.y,\r\n width: layout.dx,\r\n height: layout.dy\r\n },\r\n style: itemModel.getModel('itemStyle').getItemStyle()\r\n });\r\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: node.dataIndex,\r\n defaultText: node.id\r\n });\r\n rect.disableLabelAnimation = true;\r\n rect.setStyle('fill', node.getVisual('color'));\r\n rect.setStyle('decal', node.getVisual('style').decal);\r\n setStatesStylesFromModel(rect, itemModel);\r\n group.add(rect);\r\n nodeData.setItemGraphicEl(node.dataIndex, rect);\r\n getECData(rect).dataType = 'node';\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n });\r\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\r\n var itemModel = nodeData.getItemModel(dataIndex);\r\n if (itemModel.get('draggable')) {\r\n el.drift = function (dx, dy) {\r\n sankeyView._focusAdjacencyDisabled = true;\r\n this.shape.x += dx;\r\n this.shape.y += dy;\r\n this.dirty();\r\n api.dispatchAction({\r\n type: 'dragNode',\r\n seriesId: seriesModel.id,\r\n dataIndex: nodeData.getRawIndex(dataIndex),\r\n localX: this.shape.x / width,\r\n localY: this.shape.y / height\r\n });\r\n };\r\n el.ondragend = function () {\r\n sankeyView._focusAdjacencyDisabled = false;\r\n };\r\n el.draggable = true;\r\n el.cursor = 'move';\r\n }\r\n });\r\n if (!this._data && seriesModel.isAnimationEnabled()) {\r\n group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () {\r\n group.removeClipPath();\r\n }));\r\n }\r\n this._data = seriesModel.getData();\r\n };\r\n SankeyView.prototype.dispose = function () {\r\n };\r\n SankeyView.type = 'sankey';\r\n return SankeyView;\r\n }(ChartView));\r\n function createGridClipShape$1(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n ChartView.registerClass(SankeyView);\n\n registerAction({\r\n type: 'dragNode',\r\n event: 'dragnode',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'sankey',\r\n query: payload\r\n }, function (seriesModel) {\r\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\r\n });\r\n });\n\n function sankeyLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var nodeWidth = seriesModel.get('nodeWidth');\r\n var nodeGap = seriesModel.get('nodeGap');\r\n var layoutInfo = getViewRect$4(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n var edges = graph.edges;\r\n computeNodeValues(nodes);\r\n var filteredNodes = filter(nodes, function (node) {\r\n return node.getLayout().value === 0;\r\n });\r\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\r\n var orient = seriesModel.get('orient');\r\n var nodeAlign = seriesModel.get('nodeAlign');\r\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\r\n });\r\n }\r\n function getViewRect$4(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\r\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\r\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\r\n computeEdgeDepths(nodes, orient);\r\n }\r\n function computeNodeValues(nodes) {\r\n each(nodes, function (node) {\r\n var value1 = sum(node.outEdges, getEdgeValue);\r\n var value2 = sum(node.inEdges, getEdgeValue);\r\n var nodeRawValue = node.getValue() || 0;\r\n var value = Math.max(value1, value2, nodeRawValue);\r\n node.setLayout({ value: value }, true);\r\n });\r\n }\r\n function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\r\n var remainEdges = [];\r\n var indegreeArr = [];\r\n var zeroIndegrees = [];\r\n var nextTargetNode = [];\r\n var x = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n remainEdges[i] = 1;\r\n }\r\n for (var i = 0; i < nodes.length; i++) {\r\n indegreeArr[i] = nodes[i].inEdges.length;\r\n if (indegreeArr[i] === 0) {\r\n zeroIndegrees.push(nodes[i]);\r\n }\r\n }\r\n var maxNodeDepth = -1;\r\n while (zeroIndegrees.length) {\r\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\r\n var node = zeroIndegrees[idx];\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n var isItemDepth = item.depth != null && item.depth >= 0;\r\n if (isItemDepth && item.depth > maxNodeDepth) {\r\n maxNodeDepth = item.depth;\r\n }\r\n node.setLayout({ depth: isItemDepth ? item.depth : x }, true);\r\n orient === 'vertical'\r\n ? node.setLayout({ dy: nodeWidth }, true)\r\n : node.setLayout({ dx: nodeWidth }, true);\r\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\r\n var edge = node.outEdges[edgeIdx];\r\n var indexEdge = edges.indexOf(edge);\r\n remainEdges[indexEdge] = 0;\r\n var targetNode = edge.node2;\r\n var nodeIndex = nodes.indexOf(targetNode);\r\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\r\n nextTargetNode.push(targetNode);\r\n }\r\n }\r\n }\r\n ++x;\r\n zeroIndegrees = nextTargetNode;\r\n nextTargetNode = [];\r\n }\r\n for (var i = 0; i < remainEdges.length; i++) {\r\n if (remainEdges[i] === 1) {\r\n throw new Error('Sankey is a DAG, the original data has cycle!');\r\n }\r\n }\r\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\r\n if (nodeAlign && nodeAlign !== 'left') {\r\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\r\n }\r\n var kx = orient === 'vertical'\r\n ? (height - nodeWidth) / maxDepth\r\n : (width - nodeWidth) / maxDepth;\r\n scaleNodeBreadths(nodes, kx, orient);\r\n }\r\n function isNodeDepth(node) {\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n return item.depth != null && item.depth >= 0;\r\n }\r\n function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\r\n if (nodeAlign === 'right') {\r\n var nextSourceNode = [];\r\n var remainNodes = nodes;\r\n var nodeHeight = 0;\r\n while (remainNodes.length) {\r\n for (var i = 0; i < remainNodes.length; i++) {\r\n var node = remainNodes[i];\r\n node.setLayout({ skNodeHeight: nodeHeight }, true);\r\n for (var j = 0; j < node.inEdges.length; j++) {\r\n var edge = node.inEdges[j];\r\n if (nextSourceNode.indexOf(edge.node1) < 0) {\r\n nextSourceNode.push(edge.node1);\r\n }\r\n }\r\n }\r\n remainNodes = nextSourceNode;\r\n nextSourceNode = [];\r\n ++nodeHeight;\r\n }\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node)) {\r\n node.setLayout({ depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) }, true);\r\n }\r\n });\r\n }\r\n else if (nodeAlign === 'justify') {\r\n moveSinksRight(nodes, maxDepth);\r\n }\r\n }\r\n function moveSinksRight(nodes, maxDepth) {\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node) && !node.outEdges.length) {\r\n node.setLayout({ depth: maxDepth }, true);\r\n }\r\n });\r\n }\r\n function scaleNodeBreadths(nodes, kx, orient) {\r\n each(nodes, function (node) {\r\n var nodeDepth = node.getLayout().depth * kx;\r\n orient === 'vertical'\r\n ? node.setLayout({ y: nodeDepth }, true)\r\n : node.setLayout({ x: nodeDepth }, true);\r\n });\r\n }\r\n function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\r\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\r\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n for (var alpha = 1; iterations > 0; iterations--) {\r\n alpha *= 0.99;\r\n relaxRightToLeft(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n relaxLeftToRight(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n }\r\n }\r\n function prepareNodesByBreadth(nodes, orient) {\r\n var nodesByBreadth = [];\r\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\r\n var groupResult = groupData(nodes, function (node) {\r\n return node.getLayout()[keyAttr];\r\n });\r\n groupResult.keys.sort(function (a, b) {\r\n return a - b;\r\n });\r\n each(groupResult.keys, function (key) {\r\n nodesByBreadth.push(groupResult.buckets.get(key));\r\n });\r\n return nodesByBreadth;\r\n }\r\n function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\r\n var minKy = Infinity;\r\n each(nodesByBreadth, function (nodes) {\r\n var n = nodes.length;\r\n var sum = 0;\r\n each(nodes, function (node) {\r\n sum += node.getLayout().value;\r\n });\r\n var ky = orient === 'vertical'\r\n ? (width - (n - 1) * nodeGap) / sum\r\n : (height - (n - 1) * nodeGap) / sum;\r\n if (ky < minKy) {\r\n minKy = ky;\r\n }\r\n });\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node, i) {\r\n var nodeDy = node.getLayout().value * minKy;\r\n if (orient === 'vertical') {\r\n node.setLayout({ x: i }, true);\r\n node.setLayout({ dx: nodeDy }, true);\r\n }\r\n else {\r\n node.setLayout({ y: i }, true);\r\n node.setLayout({ dy: nodeDy }, true);\r\n }\r\n });\r\n });\r\n each(edges, function (edge) {\r\n var edgeDy = +edge.getValue() * minKy;\r\n edge.setLayout({ dy: edgeDy }, true);\r\n });\r\n }\r\n function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodesByBreadth, function (nodes) {\r\n nodes.sort(function (a, b) {\r\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\r\n });\r\n var nodeX;\r\n var node;\r\n var dy;\r\n var y0 = 0;\r\n var n = nodes.length;\r\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\r\n for (var i = 0; i < n; i++) {\r\n node = nodes[i];\r\n dy = y0 - node.getLayout()[keyAttr];\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] + dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\r\n }\r\n var viewWidth = orient === 'vertical' ? width : height;\r\n dy = y0 - nodeGap - viewWidth;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n y0 = nodeX;\r\n for (var i = n - 2; i >= 0; --i) {\r\n node = nodes[i];\r\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr];\r\n }\r\n }\r\n });\r\n }\r\n function relaxRightToLeft(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth.slice().reverse(), function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.outEdges.length) {\r\n var y = sum(node.outEdges, weightedTarget, orient)\r\n / sum(node.outEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.outEdges.length;\r\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n function weightedTarget(edge, orient) {\r\n return center$1(edge.node2, orient) * edge.getValue();\r\n }\r\n function centerTarget(edge, orient) {\r\n return center$1(edge.node2, orient);\r\n }\r\n function weightedSource(edge, orient) {\r\n return center$1(edge.node1, orient) * edge.getValue();\r\n }\r\n function centerSource(edge, orient) {\r\n return center$1(edge.node1, orient);\r\n }\r\n function center$1(node, orient) {\r\n return orient === 'vertical'\r\n ? node.getLayout().x + node.getLayout().dx / 2\r\n : node.getLayout().y + node.getLayout().dy / 2;\r\n }\r\n function getEdgeValue(edge) {\r\n return edge.getValue();\r\n }\r\n function sum(array, cb, orient) {\r\n var sum = 0;\r\n var len = array.length;\r\n var i = -1;\r\n while (++i < len) {\r\n var value = +cb(array[i], orient);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n return sum;\r\n }\r\n function relaxLeftToRight(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.inEdges.length) {\r\n var y = sum(node.inEdges, weightedSource, orient)\r\n / sum(node.inEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.inEdges.length;\r\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n function computeEdgeDepths(nodes, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodes, function (node) {\r\n node.outEdges.sort(function (a, b) {\r\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\r\n });\r\n node.inEdges.sort(function (a, b) {\r\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\r\n });\r\n });\r\n each(nodes, function (node) {\r\n var sy = 0;\r\n var ty = 0;\r\n each(node.outEdges, function (edge) {\r\n edge.setLayout({ sy: sy }, true);\r\n sy += edge.getLayout().dy;\r\n });\r\n each(node.inEdges, function (edge) {\r\n edge.setLayout({ ty: ty }, true);\r\n ty += edge.getLayout().dy;\r\n });\r\n });\r\n }\n\n function sankeyVisual(ecModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n if (nodes.length) {\r\n var minValue_1 = Infinity;\r\n var maxValue_1 = -Infinity;\r\n each(nodes, function (node) {\r\n var nodeValue = node.getLayout().value;\r\n if (nodeValue < minValue_1) {\r\n minValue_1 = nodeValue;\r\n }\r\n if (nodeValue > maxValue_1) {\r\n maxValue_1 = nodeValue;\r\n }\r\n });\r\n each(nodes, function (node) {\r\n var mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue_1, maxValue_1],\r\n visual: seriesModel.get('color')\r\n });\r\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n var customColor = node.getModel().get(['itemStyle', 'color']);\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', { fill: customColor });\r\n }\r\n else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', { fill: mapValueToColor });\r\n }\r\n });\r\n }\r\n });\r\n }\n\n registerLayout(sankeyLayout);\r\n registerVisual(sankeyVisual);\n\n var WhiskerBoxCommonMixin = (function () {\r\n function WhiskerBoxCommonMixin() {\r\n }\r\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\r\n var ordinalMeta;\r\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\r\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\r\n var xAxisType = xAxisModel.get('type');\r\n var yAxisType = yAxisModel.get('type');\r\n var addOrdinal;\r\n if (xAxisType === 'category') {\r\n option.layout = 'horizontal';\r\n ordinalMeta = xAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else if (yAxisType === 'category') {\r\n option.layout = 'vertical';\r\n ordinalMeta = yAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else {\r\n option.layout = option.layout || 'horizontal';\r\n }\r\n var coordDims = ['x', 'y'];\r\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\r\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\r\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\r\n var axisModels = [xAxisModel, yAxisModel];\r\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\r\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\r\n var data = option.data;\r\n if (data && addOrdinal) {\r\n var newOptionData_1 = [];\r\n each(data, function (item, index) {\r\n var newItem;\r\n if (isArray(item)) {\r\n newItem = item.slice();\r\n item.unshift(index);\r\n }\r\n else if (isArray(item.value)) {\r\n newItem = item.value.slice();\r\n item.value.unshift(index);\r\n }\r\n else {\r\n newItem = item;\r\n }\r\n newOptionData_1.push(newItem);\r\n });\r\n option.data = newOptionData_1;\r\n }\r\n var defaultValueDimensions = this.defaultValueDimensions;\r\n var coordDimensions = [{\r\n name: baseAxisDim,\r\n type: getDimensionTypeByAxis(baseAxisType),\r\n ordinalMeta: ordinalMeta,\r\n otherDims: {\r\n tooltip: false,\r\n itemName: 0\r\n },\r\n dimsDef: ['base']\r\n }, {\r\n name: otherAxisDim,\r\n type: getDimensionTypeByAxis(otherAxisType),\r\n dimsDef: defaultValueDimensions.slice()\r\n }];\r\n return createListSimply(this, {\r\n coordDimensions: coordDimensions,\r\n dimensionsCount: defaultValueDimensions.length + 1,\r\n encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\r\n });\r\n };\r\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\r\n var dim = this._baseAxisDim;\r\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\r\n };\r\n return WhiskerBoxCommonMixin;\r\n }());\n\n var BoxplotSeriesModel = (function (_super) {\r\n __extends(BoxplotSeriesModel, _super);\r\n function BoxplotSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'min', defaultTooltip: true },\r\n { name: 'Q1', defaultTooltip: true },\r\n { name: 'median', defaultTooltip: true },\r\n { name: 'Q3', defaultTooltip: true },\r\n { name: 'max', defaultTooltip: true }\r\n ];\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n BoxplotSeriesModel.type = 'series.boxplot';\r\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n BoxplotSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n boxWidth: [7, 50],\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2,\r\n shadowBlur: 5,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n },\r\n animationDuration: 800\r\n };\r\n return BoxplotSeriesModel;\r\n }(SeriesModel));\r\n mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\r\n SeriesModel.registerClass(BoxplotSeriesModel);\n\n var BoxplotView = (function (_super) {\r\n __extends(BoxplotView, _super);\r\n function BoxplotView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotView.type;\r\n return _this;\r\n }\r\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var group = this.group;\r\n var oldData = this._data;\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (!symbolEl) {\r\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\r\n }\r\n else {\r\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n BoxplotView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var data = this._data;\r\n this._data = null;\r\n data && data.eachItemGraphicEl(function (el) {\r\n el && group.remove(el);\r\n });\r\n };\r\n BoxplotView.type = 'boxplot';\r\n return BoxplotView;\r\n }(ChartView));\r\n var BoxPathShape = (function () {\r\n function BoxPathShape() {\r\n }\r\n return BoxPathShape;\r\n }());\r\n var BoxPath = (function (_super) {\r\n __extends(BoxPath, _super);\r\n function BoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'boxplotBoxPath';\r\n return _this;\r\n }\r\n BoxPath.prototype.getDefaultShape = function () {\r\n return new BoxPathShape();\r\n };\r\n BoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n var i = 0;\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n for (; i < 4; i++) {\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n ctx.closePath();\r\n for (; i < ends.length; i++) {\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n };\r\n return BoxPath;\r\n }(Path));\r\n function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\r\n var ends = itemLayout.ends;\r\n var el = new BoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, constDim, itemLayout)\r\n : ends\r\n }\r\n });\r\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\r\n return el;\r\n }\r\n function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\r\n var seriesModel = data.hostModel;\r\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\r\n updateMethod(el, { shape: { points: itemLayout.ends } }, seriesModel, dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.z2 = 100;\r\n var itemModel = data.getItemModel(dataIndex);\r\n setStatesStylesFromModel(el, itemModel);\r\n enableHoverEmphasis(el, itemModel.get(['emphasis', 'focus']), itemModel.get(['emphasis', 'blurScope']));\r\n }\r\n function transInit(points, dim, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[dim] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n }\r\n ChartView.registerClass(BoxplotView);\n\n function boxplotVisual(ecModel, api) {\r\n ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n });\r\n }\n\n var each$7 = each;\r\n function boxplotLayout(ecModel) {\r\n var groupResult = groupSeriesByAxis(ecModel);\r\n each$7(groupResult, function (groupItem) {\r\n var seriesModels = groupItem.seriesModels;\r\n if (!seriesModels.length) {\r\n return;\r\n }\r\n calculateBase(groupItem);\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\r\n });\r\n });\r\n }\r\n function groupSeriesByAxis(ecModel) {\r\n var result = [];\r\n var axisList = [];\r\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var idx = indexOf(axisList, baseAxis);\r\n if (idx < 0) {\r\n idx = axisList.length;\r\n axisList[idx] = baseAxis;\r\n result[idx] = {\r\n axis: baseAxis,\r\n seriesModels: []\r\n };\r\n }\r\n result[idx].seriesModels.push(seriesModel);\r\n });\r\n return result;\r\n }\r\n function calculateBase(groupItem) {\r\n var extent;\r\n var baseAxis = groupItem.axis;\r\n var seriesModels = groupItem.seriesModels;\r\n var seriesCount = seriesModels.length;\r\n var boxWidthList = groupItem.boxWidthList = [];\r\n var boxOffsetList = groupItem.boxOffsetList = [];\r\n var boundList = [];\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else {\r\n var maxDataCount_1 = 0;\r\n each$7(seriesModels, function (seriesModel) {\r\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\r\n });\r\n extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / maxDataCount_1;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var boxWidthBound = seriesModel.get('boxWidth');\r\n if (!isArray(boxWidthBound)) {\r\n boxWidthBound = [boxWidthBound, boxWidthBound];\r\n }\r\n boundList.push([\r\n parsePercent$2(boxWidthBound[0], bandWidth) || 0,\r\n parsePercent$2(boxWidthBound[1], bandWidth) || 0\r\n ]);\r\n });\r\n var availableWidth = bandWidth * 0.8 - 2;\r\n var boxGap = availableWidth / seriesCount * 0.3;\r\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\r\n var base = boxWidth / 2 - availableWidth / 2;\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n boxOffsetList.push(base);\r\n base += boxGap + boxWidth;\r\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\r\n });\r\n }\r\n function layoutSingleSeries(seriesModel, offset, boxWidth) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var halfWidth = boxWidth / 2;\r\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\r\n var vDimIdx = 1 - cDimIdx;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n if (cDim == null || vDims.length < 5) {\r\n return;\r\n }\r\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\r\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\r\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\r\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\r\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\r\n var ends = [];\r\n addBodyEnd(ends, end2, false);\r\n addBodyEnd(ends, end4, true);\r\n ends.push(end1, end2, end5, end4);\r\n layEndLine(ends, end1);\r\n layEndLine(ends, end5);\r\n layEndLine(ends, median);\r\n data.setItemLayout(dataIndex, {\r\n initBaseline: median[vDimIdx],\r\n ends: ends\r\n });\r\n }\r\n function getPoint(axisDimVal, dim, dataIndex) {\r\n var val = data.get(dim, dataIndex);\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n var point;\r\n if (isNaN(axisDimVal) || isNaN(val)) {\r\n point = [NaN, NaN];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(p);\r\n point[cDimIdx] += offset;\r\n }\r\n return point;\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] += halfWidth;\r\n point2[cDimIdx] -= halfWidth;\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function layEndLine(ends, endCenter) {\r\n var from = endCenter.slice();\r\n var to = endCenter.slice();\r\n from[cDimIdx] -= halfWidth;\r\n to[cDimIdx] += halfWidth;\r\n ends.push(from, to);\r\n }\r\n }\n\n function prepareBoxplotData(rawData, opt) {\r\n opt = opt || {};\r\n var boxData = [];\r\n var outliers = [];\r\n var boundIQR = opt.boundIQR;\r\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\r\n for (var i = 0; i < rawData.length; i++) {\r\n var ascList = asc(rawData[i].slice());\r\n var Q1 = quantile(ascList, 0.25);\r\n var Q2 = quantile(ascList, 0.5);\r\n var Q3 = quantile(ascList, 0.75);\r\n var min = ascList[0];\r\n var max = ascList[ascList.length - 1];\r\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\r\n var low = useExtreme\r\n ? min\r\n : Math.max(min, Q1 - bound);\r\n var high = useExtreme\r\n ? max\r\n : Math.min(max, Q3 + bound);\r\n var itemNameFormatter = opt.itemNameFormatter;\r\n var itemName = isFunction(itemNameFormatter)\r\n ? itemNameFormatter({ value: i })\r\n : isString(itemNameFormatter)\r\n ? itemNameFormatter.replace('{value}', i + '')\r\n : i + '';\r\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\r\n for (var j = 0; j < ascList.length; j++) {\r\n var dataItem = ascList[j];\r\n if (dataItem < low || dataItem > high) {\r\n var outlier = [itemName, dataItem];\r\n outliers.push(outlier);\r\n }\r\n }\r\n }\r\n return {\r\n boxData: boxData,\r\n outliers: outliers\r\n };\r\n }\n\n var boxplotTransform = {\r\n type: 'echarts:boxplot',\r\n transform: function transform(params) {\r\n var upstream = params.upstream;\r\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\r\n }\r\n throwError(errMsg);\r\n }\r\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\r\n return [{\r\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\r\n data: result.boxData\r\n }, {\r\n data: result.outliers\r\n }];\r\n }\r\n };\n\n registerVisual(boxplotVisual);\r\n registerLayout(boxplotLayout);\r\n registerTransform(boxplotTransform);\n\n var CandlestickSeriesModel = (function (_super) {\r\n __extends(CandlestickSeriesModel, _super);\r\n function CandlestickSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'open', defaultTooltip: true },\r\n { name: 'close', defaultTooltip: true },\r\n { name: 'lowest', defaultTooltip: true },\r\n { name: 'highest', defaultTooltip: true }\r\n ];\r\n return _this;\r\n }\r\n CandlestickSeriesModel.prototype.getShadowDim = function () {\r\n return 'open';\r\n };\r\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n return itemLayout && selectors.rect(itemLayout.brushRect);\r\n };\r\n CandlestickSeriesModel.type = 'series.candlestick';\r\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n CandlestickSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n clip: true,\r\n itemStyle: {\r\n color: '#c23531',\r\n color0: '#314656',\r\n borderWidth: 1,\r\n borderColor: '#c23531',\r\n borderColor0: '#314656'\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2\r\n }\r\n },\r\n barMaxWidth: null,\r\n barMinWidth: null,\r\n barWidth: null,\r\n large: true,\r\n largeThreshold: 600,\r\n progressive: 3e3,\r\n progressiveThreshold: 1e4,\r\n progressiveChunkMode: 'mod',\r\n animationEasing: 'linear',\r\n animationDuration: 300\r\n };\r\n return CandlestickSeriesModel;\r\n }(SeriesModel));\r\n mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\r\n SeriesModel.registerClass(CandlestickSeriesModel);\n\n var SKIP_PROPS = ['color', 'borderColor'];\r\n var CandlestickView = (function (_super) {\r\n __extends(CandlestickView, _super);\r\n function CandlestickView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickView.type;\r\n return _this;\r\n }\r\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeClipPath();\r\n this._updateDrawMode(seriesModel);\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel)\r\n : this._renderNormal(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n this._isLargeDraw\r\n ? this._incrementalRenderLarge(params, seriesModel)\r\n : this._incrementalRenderNormal(params, seriesModel);\r\n };\r\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n CandlestickView.prototype._renderNormal = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var needsClip = seriesModel.get('clip', true);\r\n var coord = seriesModel.coordinateSystem;\r\n var clipArea = coord.getArea && coord.getArea();\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n return;\r\n }\r\n var el = createNormalBox$1(itemLayout, newIdx, true);\r\n initProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx);\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(el);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n if (!el) {\r\n el = createNormalBox$1(itemLayout);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: {\r\n points: itemLayout.ends\r\n }\r\n }, seriesModel, newIdx);\r\n }\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n CandlestickView.prototype._renderLarge = function (seriesModel) {\r\n this._clear();\r\n createLarge$1(seriesModel, this.group);\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\r\n var data = seriesModel.getData();\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n var el = createNormalBox$1(itemLayout);\r\n setBoxCommon(el, data, dataIndex, isSimpleBox);\r\n el.incremental = true;\r\n this.group.add(el);\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n createLarge$1(seriesModel, this.group, true);\r\n };\r\n CandlestickView.prototype.remove = function (ecModel) {\r\n this._clear();\r\n };\r\n CandlestickView.prototype._clear = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CandlestickView.type = 'candlestick';\r\n return CandlestickView;\r\n }(ChartView));\r\n ChartView.registerClass(CandlestickView);\r\n var NormalBoxPathShape = (function () {\r\n function NormalBoxPathShape() {\r\n }\r\n return NormalBoxPathShape;\r\n }());\r\n var NormalBoxPath = (function (_super) {\r\n __extends(NormalBoxPath, _super);\r\n function NormalBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'normalCandlestickBox';\r\n return _this;\r\n }\r\n NormalBoxPath.prototype.getDefaultShape = function () {\r\n return new NormalBoxPathShape();\r\n };\r\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n if (this.__simpleBox) {\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[6][0], ends[6][1]);\r\n }\r\n else {\r\n ctx.moveTo(ends[0][0], ends[0][1]);\r\n ctx.lineTo(ends[1][0], ends[1][1]);\r\n ctx.lineTo(ends[2][0], ends[2][1]);\r\n ctx.lineTo(ends[3][0], ends[3][1]);\r\n ctx.closePath();\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[5][0], ends[5][1]);\r\n ctx.moveTo(ends[6][0], ends[6][1]);\r\n ctx.lineTo(ends[7][0], ends[7][1]);\r\n }\r\n };\r\n return NormalBoxPath;\r\n }(Path));\r\n function createNormalBox$1(itemLayout, dataIndex, isInit) {\r\n var ends = itemLayout.ends;\r\n return new NormalBoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit$1(ends, itemLayout)\r\n : ends\r\n },\r\n z2: 100\r\n });\r\n }\r\n function isNormalBoxClipped(clipArea, itemLayout) {\r\n var clipped = true;\r\n for (var i = 0; i < itemLayout.ends.length; i++) {\r\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\r\n clipped = false;\r\n break;\r\n }\r\n }\r\n return clipped;\r\n }\r\n function setBoxCommon(el, data, dataIndex, isSimpleBox) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.__simpleBox = isSimpleBox;\r\n setStatesStylesFromModel(el, itemModel);\r\n }\r\n function transInit$1(points, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[1] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n }\r\n var LargeBoxPathShape = (function () {\r\n function LargeBoxPathShape() {\r\n }\r\n return LargeBoxPathShape;\r\n }());\r\n var LargeBoxPath = (function (_super) {\r\n __extends(LargeBoxPath, _super);\r\n function LargeBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeCandlestickBox';\r\n return _this;\r\n }\r\n LargeBoxPath.prototype.getDefaultShape = function () {\r\n return new LargeBoxPathShape();\r\n };\r\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n for (var i = 0; i < points.length;) {\r\n if (this.__sign === points[i++]) {\r\n var x = points[i++];\r\n ctx.moveTo(x, points[i++]);\r\n ctx.lineTo(x, points[i++]);\r\n }\r\n else {\r\n i += 3;\r\n }\r\n }\r\n };\r\n return LargeBoxPath;\r\n }(Path));\r\n function createLarge$1(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var largePoints = data.getLayout('largePoints');\r\n var elP = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: 1\r\n });\r\n group.add(elP);\r\n var elN = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: -1\r\n });\r\n group.add(elN);\r\n setLargeStyle$1(1, elP, seriesModel);\r\n setLargeStyle$1(-1, elN, seriesModel);\r\n if (incremental) {\r\n elP.incremental = true;\r\n elN.incremental = true;\r\n }\r\n }\r\n function setLargeStyle$1(sign, el, seriesModel, data) {\r\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0'])\r\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\r\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n }\n\n function candlestickPreprocessor(option) {\r\n if (!option || !isArray(option.series)) {\r\n return;\r\n }\r\n each(option.series, function (seriesItem) {\r\n if (isObject(seriesItem) && seriesItem.type === 'k') {\r\n seriesItem.type = 'candlestick';\r\n }\r\n });\r\n }\n\n var positiveBorderColorQuery = ['itemStyle', 'borderColor'];\r\n var negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\r\n var positiveColorQuery = ['itemStyle', 'color'];\r\n var negativeColorQuery = ['itemStyle', 'color0'];\r\n var candlestickVisual = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n function getColor(sign, model) {\r\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\r\n }\r\n function getBorderColor(sign, model) {\r\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\r\n }\r\n var data = seriesModel.getData();\r\n data.setVisual('legendSymbol', 'roundRect');\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var isLargeRender = seriesModel.pipelineContext.large;\r\n return !isLargeRender && {\r\n progress: function (params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var sign = data.getItemLayout(dataIndex).sign;\r\n var style = itemModel.getItemStyle();\r\n style.fill = getColor(sign, itemModel);\r\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n extend(existsStyle, style);\r\n }\r\n }\r\n };\r\n }\r\n };\n\n var LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n var candlestickLayout = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var candleWidth = calculateCandleWidth(seriesModel, data);\r\n var cDimIdx = 0;\r\n var vDimIdx = 1;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n var openDim = vDims[0];\r\n var closeDim = vDims[1];\r\n var lowestDim = vDims[2];\r\n var highestDim = vDims[3];\r\n data.setLayout({\r\n candleWidth: candleWidth,\r\n isSimpleBox: candleWidth <= 1.3\r\n });\r\n if (cDim == null || vDims.length < 4) {\r\n return;\r\n }\r\n return {\r\n progress: seriesModel.pipelineContext.large\r\n ? largeProgress : normalProgress\r\n };\r\n function normalProgress(params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n var ocLow = Math.min(openVal, closeVal);\r\n var ocHigh = Math.max(openVal, closeVal);\r\n var ocLowPoint = getPoint(ocLow, axisDimVal);\r\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\r\n var lowestPoint = getPoint(lowestVal, axisDimVal);\r\n var highestPoint = getPoint(highestVal, axisDimVal);\r\n var ends = [];\r\n addBodyEnd(ends, ocHighPoint, 0);\r\n addBodyEnd(ends, ocLowPoint, 1);\r\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\r\n data.setItemLayout(dataIndex, {\r\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\r\n initBaseline: openVal > closeVal\r\n ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\r\n ends: ends,\r\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\r\n });\r\n }\r\n function getPoint(val, axisDimVal) {\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n return (isNaN(axisDimVal) || isNaN(val))\r\n ? [NaN, NaN]\r\n : coordSys.dataToPoint(p);\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false);\r\n point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true);\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\r\n var pmin = getPoint(lowestVal, axisDimVal);\r\n var pmax = getPoint(highestVal, axisDimVal);\r\n pmin[cDimIdx] -= candleWidth / 2;\r\n pmax[cDimIdx] -= candleWidth / 2;\r\n return {\r\n x: pmin[0],\r\n y: pmin[1],\r\n width: candleWidth ,\r\n height: pmax[1] - pmin[1] \r\n };\r\n }\r\n function subPixelOptimizePoint(point) {\r\n point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1);\r\n return point;\r\n }\r\n }\r\n function largeProgress(params, data) {\r\n var points = new LargeArr$1(params.count * 4);\r\n var offset = 0;\r\n var point;\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\r\n points[offset++] = NaN;\r\n offset += 3;\r\n continue;\r\n }\r\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\r\n tmpIn[cDimIdx] = axisDimVal;\r\n tmpIn[vDimIdx] = lowestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[0] : NaN;\r\n points[offset++] = point ? point[1] : NaN;\r\n tmpIn[vDimIdx] = highestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[1] : NaN;\r\n }\r\n data.setLayout('largePoints', points);\r\n }\r\n }\r\n };\r\n function getSign(data, dataIndex, openVal, closeVal, closeDim) {\r\n var sign;\r\n if (openVal > closeVal) {\r\n sign = -1;\r\n }\r\n else if (openVal < closeVal) {\r\n sign = 1;\r\n }\r\n else {\r\n sign = dataIndex > 0\r\n ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1)\r\n : 1;\r\n }\r\n return sign;\r\n }\r\n function calculateCandleWidth(seriesModel, data) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var extent;\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / data.count());\r\n var barMaxWidth = parsePercent$2(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\r\n var barMinWidth = parsePercent$2(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\r\n var barWidth = seriesModel.get('barWidth');\r\n return barWidth != null\r\n ? parsePercent$2(barWidth, bandWidth)\r\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\r\n }\n\n registerPreprocessor(candlestickPreprocessor);\r\n registerVisual(candlestickVisual);\r\n registerLayout(candlestickLayout);\n\n var EffectScatterSeriesModel = (function (_super) {\r\n __extends(EffectScatterSeriesModel, _super);\r\n function EffectScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n EffectScatterSeriesModel.type = 'series.effectScatter';\r\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\r\n EffectScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n effectType: 'ripple',\r\n progressive: 0,\r\n showEffectOn: 'render',\r\n rippleEffect: {\r\n period: 4,\r\n scale: 2.5,\r\n brushType: 'fill'\r\n },\r\n symbolSize: 10\r\n };\r\n return EffectScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(EffectScatterSeriesModel);\n\n var EFFECT_RIPPLE_NUMBER = 3;\r\n function normalizeSymbolSize$1(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n }\r\n function updateRipplePath(rippleGroup, effectCfg) {\r\n var color = effectCfg.rippleEffectColor || effectCfg.color;\r\n rippleGroup.eachChild(function (ripplePath) {\r\n ripplePath.attr({\r\n z: effectCfg.z,\r\n zlevel: effectCfg.zlevel,\r\n style: {\r\n stroke: effectCfg.brushType === 'stroke' ? color : null,\r\n fill: effectCfg.brushType === 'fill' ? color : null\r\n }\r\n });\r\n });\r\n }\r\n var EffectSymbol = (function (_super) {\r\n __extends(EffectSymbol, _super);\r\n function EffectSymbol(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var symbol = new Symbol(data, idx);\r\n var rippleGroup = new Group();\r\n _this.add(symbol);\r\n _this.add(rippleGroup);\r\n _this.updateData(data, idx);\r\n return _this;\r\n }\r\n EffectSymbol.prototype.stopEffectAnimation = function () {\r\n this.childAt(1).removeAll();\r\n };\r\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\r\n var symbolType = effectCfg.symbolType;\r\n var color = effectCfg.color;\r\n var rippleGroup = this.childAt(1);\r\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\r\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n ripplePath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 99,\r\n silent: true,\r\n scaleX: 0.5,\r\n scaleY: 0.5\r\n });\r\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset;\r\n ripplePath.animate('', true)\r\n .when(effectCfg.period, {\r\n scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2]\r\n })\r\n .delay(delay)\r\n .start();\r\n ripplePath.animateStyle(true)\r\n .when(effectCfg.period, {\r\n opacity: 0\r\n })\r\n .delay(delay)\r\n .start();\r\n rippleGroup.add(ripplePath);\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\r\n var oldEffectCfg = this._effectCfg;\r\n var rippleGroup = this.childAt(1);\r\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\r\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\r\n var propName = DIFFICULT_PROPS[i];\r\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\r\n this.stopEffectAnimation();\r\n this.startEffectAnimation(effectCfg);\r\n return;\r\n }\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n EffectSymbol.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n EffectSymbol.prototype.updateData = function (data, idx) {\r\n var _this = this;\r\n var seriesModel = data.hostModel;\r\n this.childAt(0).updateData(data, idx);\r\n var rippleGroup = this.childAt(1);\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = data.getItemVisual(idx, 'symbol');\r\n var symbolSize = normalizeSymbolSize$1(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var color = symbolStyle && symbolStyle.fill;\r\n rippleGroup.setScale(symbolSize);\r\n rippleGroup.traverse(function (ripplePath) {\r\n ripplePath.setStyle('fill', color);\r\n });\r\n var symbolOffset = itemModel.getShallow('symbolOffset');\r\n if (symbolOffset) {\r\n rippleGroup.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n rippleGroup.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var effectCfg = {};\r\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\r\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\r\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\r\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\r\n effectCfg.effectOffset = idx / data.count();\r\n effectCfg.z = seriesModel.getShallow('z') || 0;\r\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\r\n effectCfg.symbolType = symbolType;\r\n effectCfg.color = color;\r\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\r\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\r\n if (effectCfg.showEffectOn === 'render') {\r\n this._effectCfg\r\n ? this.updateEffectAnimation(effectCfg)\r\n : this.startEffectAnimation(effectCfg);\r\n this._effectCfg = effectCfg;\r\n }\r\n else {\r\n this._effectCfg = null;\r\n this.stopEffectAnimation();\r\n this.onHoverStateChange = function (toState) {\r\n if (toState === 'emphasis') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.startEffectAnimation(effectCfg);\r\n }\r\n }\r\n else if (toState === 'normal') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.stopEffectAnimation();\r\n }\r\n }\r\n };\r\n }\r\n this._effectCfg = effectCfg;\r\n enableHoverEmphasis(this);\r\n };\r\n EffectSymbol.prototype.fadeOut = function (cb) {\r\n this.off('mouseover').off('mouseout');\r\n cb && cb();\r\n };\r\n return EffectSymbol;\r\n }(Group));\r\n inherits(EffectSymbol, Group);\n\n var EffectScatterView = (function (_super) {\r\n __extends(EffectScatterView, _super);\r\n function EffectScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterView.type;\r\n return _this;\r\n }\r\n EffectScatterView.prototype.init = function () {\r\n this._symbolDraw = new SymbolDraw(EffectSymbol);\r\n };\r\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var effectSymbolDraw = this._symbolDraw;\r\n effectSymbolDraw.updateData(data);\r\n this.group.add(effectSymbolDraw.group);\r\n };\r\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._symbolDraw.updateLayout();\r\n };\r\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.getRoamTransform) {\r\n this.group.transform = clone$2(coordSys.getRoamTransform());\r\n this.group.decomposeTransform();\r\n }\r\n };\r\n EffectScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n };\r\n EffectScatterView.type = 'effectScatter';\r\n return EffectScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(EffectScatterView);\n\n registerLayout(pointsLayout('effectScatter'));\n\n var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\r\n var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\r\n function compatEc2(seriesOpt) {\r\n var data = seriesOpt.data;\r\n if (data && data[0] && data[0][0] && data[0][0].coord) {\r\n if (__DEV__) {\r\n console.warn('Lines data configuration has been changed to'\r\n + ' { coords:[[1,2],[2,3]] }');\r\n }\r\n seriesOpt.data = map(data, function (itemOpt) {\r\n var coords = [\r\n itemOpt[0].coord, itemOpt[1].coord\r\n ];\r\n var target = {\r\n coords: coords\r\n };\r\n if (itemOpt[0].name) {\r\n target.fromName = itemOpt[0].name;\r\n }\r\n if (itemOpt[1].name) {\r\n target.toName = itemOpt[1].name;\r\n }\r\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\r\n });\r\n }\r\n }\r\n var LinesSeriesModel = (function (_super) {\r\n __extends(LinesSeriesModel, _super);\r\n function LinesSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n LinesSeriesModel.prototype.init = function (option) {\r\n option.data = option.data || [];\r\n compatEc2(option);\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n _super.prototype.init.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.mergeOption = function (option) {\r\n compatEc2(option);\r\n if (option.data) {\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n }\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.appendData = function (params) {\r\n var result = this._processFlatCoordsArray(params.data);\r\n if (result.flatCoords) {\r\n if (!this._flatCoords) {\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n }\r\n else {\r\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\r\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\r\n }\r\n params.data = new Float32Array(result.count);\r\n }\r\n this.getRawData().appendData(params.data);\r\n };\r\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\r\n var itemModel = this.getData().getItemModel(idx);\r\n var coords = (itemModel.option instanceof Array)\r\n ? itemModel.option : itemModel.getShallow('coords');\r\n if (__DEV__) {\r\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\r\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\r\n }\r\n }\r\n return coords;\r\n };\r\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\r\n if (this._flatCoordsOffset) {\r\n return this._flatCoordsOffset[idx * 2 + 1];\r\n }\r\n else {\r\n return this._getCoordsFromItemModel(idx).length;\r\n }\r\n };\r\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\r\n if (this._flatCoordsOffset) {\r\n var offset = this._flatCoordsOffset[idx * 2];\r\n var len = this._flatCoordsOffset[idx * 2 + 1];\r\n for (var i = 0; i < len; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = this._flatCoords[offset + i * 2];\r\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\r\n }\r\n return len;\r\n }\r\n else {\r\n var coords = this._getCoordsFromItemModel(idx);\r\n for (var i = 0; i < coords.length; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = coords[i][0];\r\n out[i][1] = coords[i][1];\r\n }\r\n return coords.length;\r\n }\r\n };\r\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\r\n var startOffset = 0;\r\n if (this._flatCoords) {\r\n startOffset = this._flatCoords.length;\r\n }\r\n if (typeof data[0] === 'number') {\r\n var len = data.length;\r\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\r\n var coordsStorage = new Float64Arr(len);\r\n var coordsCursor = 0;\r\n var offsetCursor = 0;\r\n var dataCount = 0;\r\n for (var i = 0; i < len;) {\r\n dataCount++;\r\n var count = data[i++];\r\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\r\n coordsOffsetAndLenStorage[offsetCursor++] = count;\r\n for (var k = 0; k < count; k++) {\r\n var x = data[i++];\r\n var y = data[i++];\r\n coordsStorage[coordsCursor++] = x;\r\n coordsStorage[coordsCursor++] = y;\r\n if (i > len) {\r\n if (__DEV__) {\r\n throw new Error('Invalid data format.');\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\r\n flatCoords: coordsStorage,\r\n count: dataCount\r\n };\r\n }\r\n return {\r\n flatCoordsOffset: null,\r\n flatCoords: null,\r\n count: data.length\r\n };\r\n };\r\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n if (__DEV__) {\r\n var CoordSys = CoordinateSystemManager.get(option.coordinateSystem);\r\n if (!CoordSys) {\r\n throw new Error('Unkown coordinate system ' + option.coordinateSystem);\r\n }\r\n }\r\n var lineData = new List(['value'], this);\r\n lineData.hasItemOption = false;\r\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\r\n if (dataItem instanceof Array) {\r\n return NaN;\r\n }\r\n else {\r\n lineData.hasItemOption = true;\r\n var value = dataItem.value;\r\n if (value != null) {\r\n return value instanceof Array ? value[dimIndex] : value;\r\n }\r\n }\r\n });\r\n return lineData;\r\n };\r\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var itemModel = data.getItemModel(dataIndex);\r\n var name = itemModel.get('name');\r\n if (name) {\r\n return name;\r\n }\r\n var fromName = itemModel.get('fromName');\r\n var toName = itemModel.get('toName');\r\n var nameArr = [];\r\n fromName != null && nameArr.push(fromName);\r\n toName != null && nameArr.push(toName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > ')\r\n });\r\n };\r\n LinesSeriesModel.prototype.preventIncremental = function () {\r\n return !!this.get(['effect', 'show']);\r\n };\r\n LinesSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 1e4 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n LinesSeriesModel.type = 'series.lines';\r\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\r\n LinesSeriesModel.defaultOption = {\r\n coordinateSystem: 'geo',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n xAxisIndex: 0,\r\n yAxisIndex: 0,\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 10],\r\n geoIndex: 0,\r\n effect: {\r\n show: false,\r\n period: 4,\r\n constantSpeed: 0,\r\n symbol: 'circle',\r\n symbolSize: 3,\r\n loop: true,\r\n trailLength: 0.2\r\n },\r\n large: false,\r\n largeThreshold: 2000,\r\n polyline: false,\r\n clip: true,\r\n label: {\r\n show: false,\r\n position: 'end'\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n };\r\n return LinesSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LinesSeriesModel);\n\n var EffectLine = (function (_super) {\r\n __extends(EffectLine, _super);\r\n function EffectLine(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this.add(_this.createLine(lineData, idx, seriesScope));\r\n _this._updateEffectSymbol(lineData, idx);\r\n return _this;\r\n }\r\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Line$1(lineData, idx, seriesScope);\r\n };\r\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\r\n var itemModel = lineData.getItemModel(idx);\r\n var effectModel = itemModel.getModel('effect');\r\n var size = effectModel.get('symbolSize');\r\n var symbolType = effectModel.get('symbol');\r\n if (!isArray(size)) {\r\n size = [size, size];\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var color = effectModel.get('color') || (lineStyle && lineStyle.stroke);\r\n var symbol = this.childAt(1);\r\n if (this._symbolType !== symbolType) {\r\n this.remove(symbol);\r\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n this.add(symbol);\r\n }\r\n if (!symbol) {\r\n return;\r\n }\r\n symbol.setStyle('shadowColor', color);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n symbol.setColor(color);\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\r\n var symbol = this.childAt(1);\r\n if (!symbol) {\r\n return;\r\n }\r\n var self = this;\r\n var points = lineData.getItemLayout(idx);\r\n var period = effectModel.get('period') * 1000;\r\n var loop = effectModel.get('loop');\r\n var constantSpeed = effectModel.get('constantSpeed');\r\n var delayExpr = retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n });\r\n symbol.ignore = true;\r\n this._updateAnimationPoints(symbol, points);\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n if (period !== this._period || loop !== this._loop) {\r\n symbol.stopAnimation();\r\n if (period > 0) {\r\n var delayNum = void 0;\r\n if (typeof delayExpr === 'function') {\r\n delayNum = delayExpr(idx);\r\n }\r\n else {\r\n delayNum = delayExpr;\r\n }\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n symbol.__t = 0;\r\n var animator = symbol.animate('', loop)\r\n .when(period, {\r\n __t: 1\r\n })\r\n .delay(delayNum)\r\n .during(function () {\r\n self._updateSymbolPosition(symbol);\r\n });\r\n if (!loop) {\r\n animator.done(function () {\r\n self.remove(symbol);\r\n });\r\n }\r\n animator.start();\r\n }\r\n }\r\n this._period = period;\r\n this._loop = loop;\r\n };\r\n EffectLine.prototype._getLineLength = function (symbol) {\r\n return (dist(symbol.__p1, symbol.__cp1)\r\n + dist(symbol.__cp1, symbol.__p2));\r\n };\r\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [\r\n (points[0][0] + points[1][0]) / 2,\r\n (points[0][1] + points[1][1]) / 2\r\n ];\r\n };\r\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\r\n this.childAt(0).updateData(lineData, idx, seriesScope);\r\n this._updateEffectSymbol(lineData, idx);\r\n };\r\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\r\n var p1 = symbol.__p1;\r\n var p2 = symbol.__p2;\r\n var cp1 = symbol.__cp1;\r\n var t = symbol.__t;\r\n var pos = [symbol.x, symbol.y];\r\n var lastPos = pos.slice();\r\n var quadraticAt$1 = quadraticAt;\r\n var quadraticDerivativeAt$1 = quadraticDerivativeAt;\r\n pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t);\r\n var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t);\r\n var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t);\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = dist(lastPos, pos) * 1.05;\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n }\r\n else if (symbol.__lastT === 1) {\r\n symbol.scaleY = 2 * dist(p1, pos);\r\n }\r\n else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n };\r\n EffectLine.prototype.updateLayout = function (lineData, idx) {\r\n this.childAt(0).updateLayout(lineData, idx);\r\n var effectModel = lineData.getItemModel(idx).getModel('effect');\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n return EffectLine;\r\n }(Group));\n\n var Polyline$1 = (function (_super) {\r\n __extends(Polyline$1, _super);\r\n function Polyline$1(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createPolyline(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) {\r\n var points = lineData.getItemLayout(idx);\r\n var line = new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n });\r\n this.add(line);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childAt(0);\r\n var target = {\r\n shape: {\r\n points: lineData.getItemLayout(idx)\r\n }\r\n };\r\n updateProps(line, target, seriesModel, idx);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var line = this.childAt(0);\r\n var itemModel = lineData.getItemModel(idx);\r\n var hoverLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n hoverLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n }\r\n line.useStyle(lineData.getItemVisual(idx, 'style'));\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n var lineEmphasisState = line.ensureState('emphasis');\r\n lineEmphasisState.style = hoverLineStyle;\r\n enableHoverEmphasis(this);\r\n };\r\n Polyline$1.prototype.updateLayout = function (lineData, idx) {\r\n var polyline = this.childAt(0);\r\n polyline.setShape('points', lineData.getItemLayout(idx));\r\n };\r\n return Polyline$1;\r\n }(Group));\n\n var EffectPolyline = (function (_super) {\r\n __extends(EffectPolyline, _super);\r\n function EffectPolyline() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._lastFrame = 0;\r\n _this._lastFramePercent = 0;\r\n return _this;\r\n }\r\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Polyline$1(lineData, idx, seriesScope);\r\n };\r\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\r\n this._points = points;\r\n var accLenArr = [0];\r\n var len = 0;\r\n for (var i = 1; i < points.length; i++) {\r\n var p1 = points[i - 1];\r\n var p2 = points[i];\r\n len += dist(p1, p2);\r\n accLenArr.push(len);\r\n }\r\n if (len === 0) {\r\n this._length = 0;\r\n return;\r\n }\r\n for (var i = 0; i < accLenArr.length; i++) {\r\n accLenArr[i] /= len;\r\n }\r\n this._offsets = accLenArr;\r\n this._length = len;\r\n };\r\n EffectPolyline.prototype._getLineLength = function () {\r\n return this._length;\r\n };\r\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\r\n var t = symbol.__t;\r\n var points = this._points;\r\n var offsets = this._offsets;\r\n var len = points.length;\r\n if (!offsets) {\r\n return;\r\n }\r\n var lastFrame = this._lastFrame;\r\n var frame;\r\n if (t < this._lastFramePercent) {\r\n var start = Math.min(lastFrame + 1, len - 1);\r\n for (frame = start; frame >= 0; frame--) {\r\n if (offsets[frame] <= t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame, len - 2);\r\n }\r\n else {\r\n for (frame = lastFrame; frame < len; frame++) {\r\n if (offsets[frame] > t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame - 1, len - 2);\r\n }\r\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\r\n var p0 = points[frame];\r\n var p1 = points[frame + 1];\r\n symbol.x = p0[0] * (1 - p) + p * p1[0];\r\n symbol.y = p0[1] * (1 - p) + p * p1[1];\r\n var tx = p1[0] - p0[0];\r\n var ty = p1[1] - p0[1];\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n this._lastFrame = frame;\r\n this._lastFramePercent = t;\r\n symbol.ignore = false;\r\n };\r\n return EffectPolyline;\r\n }(EffectLine));\n\n var LargeLinesPathShape = (function () {\r\n function LargeLinesPathShape() {\r\n this.polyline = false;\r\n this.curveness = 0;\r\n this.segs = [];\r\n }\r\n return LargeLinesPathShape;\r\n }());\r\n var LargeLinesPath = (function (_super) {\r\n __extends(LargeLinesPath, _super);\r\n function LargeLinesPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeLinesPath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n LargeLinesPath.prototype.getDefaultShape = function () {\r\n return new LargeLinesPathShape();\r\n };\r\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n if (shape.polyline) {\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n ctx.moveTo(segs[i++], segs[i++]);\r\n for (var k = 1; k < count; k++) {\r\n ctx.lineTo(segs[i++], segs[i++]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n ctx.moveTo(x0, y0);\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n ctx.quadraticCurveTo(x2, y2, x1, y1);\r\n }\r\n else {\r\n ctx.lineTo(x1, y1);\r\n }\r\n }\r\n }\r\n };\r\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n var lineWidth = this.style.lineWidth;\r\n if (shape.polyline) {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n for (var k = 1; k < count; k++) {\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n else {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n else {\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeLinesPath;\r\n }(Path));\r\n var LargeLineDraw = (function () {\r\n function LargeLineDraw() {\r\n this.group = new Group();\r\n }\r\n LargeLineDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeLineDraw.prototype.updateData = function (data) {\r\n this.group.removeAll();\r\n var lineEl = new LargeLinesPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data);\r\n this.group.add(lineEl);\r\n this._incremental = null;\r\n };\r\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 5e5) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\r\n var lineEl = new LargeLinesPath();\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data, !!this._incremental);\r\n if (!this._incremental) {\r\n lineEl.rectHover = true;\r\n lineEl.cursor = 'default';\r\n lineEl.__startIndex = taskParams.start;\r\n this.group.add(lineEl);\r\n }\r\n else {\r\n this._incremental.addDisplayable(lineEl, true);\r\n }\r\n };\r\n LargeLineDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\r\n var hostModel = data.hostModel;\r\n lineEl.setShape({\r\n polyline: hostModel.get('polyline'),\r\n curveness: hostModel.get(['lineStyle', 'curveness'])\r\n });\r\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\r\n lineEl.style.strokeNoScale = true;\r\n var style = data.getVisual('style');\r\n if (style && style.stroke) {\r\n lineEl.setStyle('stroke', style.stroke);\r\n }\r\n lineEl.setStyle('fill', null);\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(lineEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n lineEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex > 0) {\r\n ecData_1.dataIndex = dataIndex + lineEl.__startIndex;\r\n }\r\n });\r\n }\r\n };\r\n LargeLineDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeLineDraw;\r\n }());\n\n var linesLayout = {\r\n seriesType: 'lines',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var isPolyline = seriesModel.get('polyline');\r\n var isLarge = seriesModel.pipelineContext.large;\r\n return {\r\n progress: function (params, lineData) {\r\n var lineCoords = [];\r\n if (isLarge) {\r\n var points = void 0;\r\n var segCount = params.end - params.start;\r\n if (isPolyline) {\r\n var totalCoordsCount = 0;\r\n for (var i = params.start; i < params.end; i++) {\r\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\r\n }\r\n points = new Float32Array(segCount + totalCoordsCount * 2);\r\n }\r\n else {\r\n points = new Float32Array(segCount * 4);\r\n }\r\n var offset = 0;\r\n var pt = [];\r\n for (var i = params.start; i < params.end; i++) {\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n if (isPolyline) {\r\n points[offset++] = len;\r\n }\r\n for (var k = 0; k < len; k++) {\r\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\r\n points[offset++] = pt[0];\r\n points[offset++] = pt[1];\r\n }\r\n }\r\n lineData.setLayout('linesPoints', points);\r\n }\r\n else {\r\n for (var i = params.start; i < params.end; i++) {\r\n var itemModel = lineData.getItemModel(i);\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n var pts = [];\r\n if (isPolyline) {\r\n for (var j = 0; j < len; j++) {\r\n pts.push(coordSys.dataToPoint(lineCoords[j]));\r\n }\r\n }\r\n else {\r\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\r\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\r\n var curveness = itemModel.get(['lineStyle', 'curveness']);\r\n if (+curveness) {\r\n pts[2] = [\r\n (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness,\r\n (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness\r\n ];\r\n }\r\n }\r\n lineData.setItemLayout(i, pts);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n };\n\n var LinesView = (function (_super) {\r\n __extends(LinesView, _super);\r\n function LinesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesView.type;\r\n return _this;\r\n }\r\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n var zlevel = seriesModel.get('zlevel');\r\n var trailLength = seriesModel.get(['effect', 'trailLength']);\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg) {\r\n zr.painter.getLayer(zlevel).clear(true);\r\n }\r\n if (this._lastZlevel != null && !isSvg) {\r\n zr.configLayer(this._lastZlevel, {\r\n motionBlur: false\r\n });\r\n }\r\n if (this._showEffect(seriesModel) && trailLength) {\r\n if (__DEV__) {\r\n var notInIndividual_1 = false;\r\n ecModel.eachSeries(function (otherSeriesModel) {\r\n if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {\r\n notInIndividual_1 = true;\r\n }\r\n });\r\n notInIndividual_1 && console.warn('Lines with trail effect should have an individual zlevel');\r\n }\r\n if (!isSvg) {\r\n zr.configLayer(zlevel, {\r\n motionBlur: true,\r\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\r\n });\r\n }\r\n }\r\n lineDraw.updateData(data);\r\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n this._lastZlevel = zlevel;\r\n this._finished = true;\r\n };\r\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n lineDraw.incrementalPrepareUpdate(data);\r\n this._clearLayer(api);\r\n this._finished = false;\r\n };\r\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = linesLayout.reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._lineDraw.updateLayout();\r\n this._clearLayer(api);\r\n }\r\n };\r\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\r\n var lineDraw = this._lineDraw;\r\n var hasEffect = this._showEffect(seriesModel);\r\n var isPolyline = !!seriesModel.get('polyline');\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (__DEV__) {\r\n if (hasEffect && isLargeDraw) {\r\n console.warn('Large lines not support effect');\r\n }\r\n }\r\n if (!lineDraw\r\n || hasEffect !== this._hasEffet\r\n || isPolyline !== this._isPolyline\r\n || isLargeDraw !== this._isLargeDraw) {\r\n if (lineDraw) {\r\n lineDraw.remove();\r\n }\r\n lineDraw = this._lineDraw = isLargeDraw\r\n ? new LargeLineDraw()\r\n : new LineDraw(isPolyline\r\n ? (hasEffect ? EffectPolyline : Polyline$1)\r\n : (hasEffect ? EffectLine : Line$1));\r\n this._hasEffet = hasEffect;\r\n this._isPolyline = isPolyline;\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(lineDraw.group);\r\n return lineDraw;\r\n };\r\n LinesView.prototype._showEffect = function (seriesModel) {\r\n return !!seriesModel.get(['effect', 'show']);\r\n };\r\n LinesView.prototype._clearLayer = function (api) {\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg && this._lastZlevel != null) {\r\n zr.painter.getLayer(this._lastZlevel).clear(true);\r\n }\r\n };\r\n LinesView.prototype.remove = function (ecModel, api) {\r\n this._lineDraw && this._lineDraw.remove();\r\n this._lineDraw = null;\r\n this._clearLayer(api);\r\n };\r\n LinesView.type = 'lines';\r\n return LinesView;\r\n }(ChartView));\r\n ChartView.registerClass(LinesView);\n\n function normalize$3(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n }\r\n var linesVisual = {\r\n seriesType: 'lines',\r\n reset: function (seriesModel) {\r\n var symbolType = normalize$3(seriesModel.get('symbol'));\r\n var symbolSize = normalize$3(seriesModel.get('symbolSize'));\r\n var data = seriesModel.getData();\r\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n data.setVisual('toSymbol', symbolType && symbolType[1]);\r\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = normalize$3(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true));\r\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\r\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\r\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\r\n }\r\n return {\r\n dataEach: data.hasItemOption ? dataEach : null\r\n };\r\n }\r\n };\n\n registerLayout(linesLayout);\r\n registerVisual(linesVisual);\n\n var HeatmapSeriesModel = (function (_super) {\r\n __extends(HeatmapSeriesModel, _super);\r\n function HeatmapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapSeriesModel.type;\r\n return _this;\r\n }\r\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n generateCoord: 'value'\r\n });\r\n };\r\n HeatmapSeriesModel.prototype.preventIncremental = function () {\r\n var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem'));\r\n if (coordSysCreator && coordSysCreator.dimensions) {\r\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\r\n }\r\n };\r\n HeatmapSeriesModel.type = 'series.heatmap';\r\n HeatmapSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n geoIndex: 0,\r\n blurSize: 30,\r\n pointSize: 20,\r\n maxOpacity: 1,\r\n minOpacity: 0,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return HeatmapSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(HeatmapSeriesModel);\n\n var GRADIENT_LEVELS = 256;\r\n var HeatmapLayer = (function () {\r\n function HeatmapLayer() {\r\n this.blurSize = 30;\r\n this.pointSize = 20;\r\n this.maxOpacity = 1;\r\n this.minOpacity = 0;\r\n this._gradientPixels = {\r\n inRange: null,\r\n outOfRange: null\r\n };\r\n var canvas = createCanvas();\r\n this.canvas = canvas;\r\n }\r\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\r\n var brush = this._getBrush();\r\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\r\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\r\n var r = this.pointSize + this.blurSize;\r\n var canvas = this.canvas;\r\n var ctx = canvas.getContext('2d');\r\n var len = data.length;\r\n canvas.width = width;\r\n canvas.height = height;\r\n for (var i = 0; i < len; ++i) {\r\n var p = data[i];\r\n var x = p[0];\r\n var y = p[1];\r\n var value = p[2];\r\n var alpha = normalize(value);\r\n ctx.globalAlpha = alpha;\r\n ctx.drawImage(brush, x - r, y - r);\r\n }\r\n if (!canvas.width || !canvas.height) {\r\n return canvas;\r\n }\r\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n var pixels = imageData.data;\r\n var offset = 0;\r\n var pixelLen = pixels.length;\r\n var minOpacity = this.minOpacity;\r\n var maxOpacity = this.maxOpacity;\r\n var diffOpacity = maxOpacity - minOpacity;\r\n while (offset < pixelLen) {\r\n var alpha = pixels[offset + 3] / 256;\r\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\r\n if (alpha > 0) {\r\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\r\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\r\n pixels[offset++] = gradient[gradientOffset];\r\n pixels[offset++] = gradient[gradientOffset + 1];\r\n pixels[offset++] = gradient[gradientOffset + 2];\r\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\r\n }\r\n else {\r\n offset += 4;\r\n }\r\n }\r\n ctx.putImageData(imageData, 0, 0);\r\n return canvas;\r\n };\r\n HeatmapLayer.prototype._getBrush = function () {\r\n var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas());\r\n var r = this.pointSize + this.blurSize;\r\n var d = r * 2;\r\n brushCanvas.width = d;\r\n brushCanvas.height = d;\r\n var ctx = brushCanvas.getContext('2d');\r\n ctx.clearRect(0, 0, d, d);\r\n ctx.shadowOffsetX = d;\r\n ctx.shadowBlur = this.blurSize;\r\n ctx.shadowColor = '#000';\r\n ctx.beginPath();\r\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n return brushCanvas;\r\n };\r\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\r\n var gradientPixels = this._gradientPixels;\r\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\r\n var color = [0, 0, 0, 0];\r\n var off = 0;\r\n for (var i = 0; i < 256; i++) {\r\n colorFunc[state](i / 255, true, color);\r\n pixelsSingleState[off++] = color[0];\r\n pixelsSingleState[off++] = color[1];\r\n pixelsSingleState[off++] = color[2];\r\n pixelsSingleState[off++] = color[3];\r\n }\r\n return pixelsSingleState;\r\n };\r\n return HeatmapLayer;\r\n }());\n\n function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n pieceList = map(pieceList, function (piece) {\r\n return {\r\n interval: [\r\n (piece.interval[0] - dataExtent[0]) / dataSpan,\r\n (piece.interval[1] - dataExtent[0]) / dataSpan\r\n ]\r\n };\r\n });\r\n var len = pieceList.length;\r\n var lastIndex = 0;\r\n return function (val) {\r\n var i;\r\n for (i = lastIndex; i < len; i++) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n if (i === len) {\r\n for (i = lastIndex - 1; i >= 0; i--) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return i >= 0 && i < len && selected[i];\r\n };\r\n }\r\n function getIsInContinuousRange(dataExtent, range) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n range = [\r\n (range[0] - dataExtent[0]) / dataSpan,\r\n (range[1] - dataExtent[0]) / dataSpan\r\n ];\r\n return function (val) {\r\n return val >= range[0] && val <= range[1];\r\n };\r\n }\r\n function isGeoCoordSys(coordSys) {\r\n var dimensions = coordSys.dimensions;\r\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\r\n }\r\n var HeatmapView = (function (_super) {\r\n __extends(HeatmapView, _super);\r\n function HeatmapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapView.type;\r\n return _this;\r\n }\r\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\r\n var visualMapOfThisSeries;\r\n ecModel.eachComponent('visualMap', function (visualMap) {\r\n visualMap.eachTargetSeries(function (targetSeries) {\r\n if (targetSeries === seriesModel) {\r\n visualMapOfThisSeries = visualMap;\r\n }\r\n });\r\n });\r\n if (__DEV__) {\r\n if (!visualMapOfThisSeries) {\r\n throw new Error('Heatmap must use with visualMap');\r\n }\r\n }\r\n this.group.removeAll();\r\n this._incrementalDisplayable = null;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\r\n }\r\n else if (isGeoCoordSys(coordSys)) {\r\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\r\n }\r\n };\r\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var width;\r\n var height;\r\n var xAxisExtent;\r\n var yAxisExtent;\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n if (__DEV__) {\r\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\r\n throw new Error('Heatmap on cartesian must have two category axes');\r\n }\r\n if (!(xAxis.onBand && yAxis.onBand)) {\r\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\r\n }\r\n }\r\n width = xAxis.getBandWidth();\r\n height = yAxis.getBandWidth();\r\n xAxisExtent = xAxis.scale.getExtent();\r\n yAxisExtent = yAxis.scale.getExtent();\r\n }\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\r\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var labelStatesModels = getLabelStatesModels(seriesModel);\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n var dataDims = isCoordinateSystemType(coordSys, 'cartesian2d')\r\n ? [\r\n data.mapDimension('x'),\r\n data.mapDimension('y'),\r\n data.mapDimension('value')\r\n ]\r\n : [\r\n data.mapDimension('time'),\r\n data.mapDimension('value')\r\n ];\r\n for (var idx = start; idx < end; idx++) {\r\n var rect = void 0;\r\n var style = data.getItemVisual(idx, 'style');\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var dataDimX = data.get(dataDims[0], idx);\r\n var dataDimY = data.get(dataDims[1], idx);\r\n if (isNaN(data.get(dataDims[2], idx))\r\n || dataDimX < xAxisExtent[0]\r\n || dataDimX > xAxisExtent[1]\r\n || dataDimY < yAxisExtent[0]\r\n || dataDimY > yAxisExtent[1]) {\r\n continue;\r\n }\r\n var point = coordSys.dataToPoint([\r\n dataDimX,\r\n dataDimY\r\n ]);\r\n rect = new Rect({\r\n shape: {\r\n x: Math.floor(Math.round(point[0]) - width / 2),\r\n y: Math.floor(Math.round(point[1]) - height / 2),\r\n width: Math.ceil(width),\r\n height: Math.ceil(height)\r\n },\r\n style: style\r\n });\r\n }\r\n else {\r\n if (isNaN(data.get(dataDims[1], idx))) {\r\n continue;\r\n }\r\n rect = new Rect({\r\n z2: 1,\r\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\r\n style: style\r\n });\r\n }\r\n var itemModel = data.getItemModel(idx);\r\n if (data.hasItemOption) {\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var defaultText = '-';\r\n if (rawValue && rawValue[2] != null) {\r\n defaultText = rawValue[2] + '';\r\n }\r\n setLabelStyle(rect, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: defaultText\r\n });\r\n rect.ensureState('emphasis').style = emphasisStyle;\r\n rect.ensureState('blur').style = blurStyle;\r\n rect.ensureState('select').style = selectStyle;\r\n enableHoverEmphasis(rect, focus, blurScope);\r\n rect.incremental = incremental;\r\n if (incremental) {\r\n rect.states.emphasis.hoverLayer = true;\r\n }\r\n group.add(rect);\r\n data.setItemGraphicEl(idx, rect);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\r\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\r\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\r\n var data = seriesModel.getData();\r\n var hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());\r\n hmLayer.blurSize = seriesModel.get('blurSize');\r\n hmLayer.pointSize = seriesModel.get('pointSize');\r\n hmLayer.minOpacity = seriesModel.get('minOpacity');\r\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\r\n var rect = geo.getViewRect().clone();\r\n var roamTransform = geo.getRoamTransform();\r\n rect.applyTransform(roamTransform);\r\n var x = Math.max(rect.x, 0);\r\n var y = Math.max(rect.y, 0);\r\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\r\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var dims = [\r\n data.mapDimension('lng'),\r\n data.mapDimension('lat'),\r\n data.mapDimension('value')\r\n ];\r\n var points = data.mapArray(dims, function (lng, lat, value) {\r\n var pt = geo.dataToPoint([lng, lat]);\r\n pt[0] -= x;\r\n pt[1] -= y;\r\n pt.push(value);\r\n return pt;\r\n });\r\n var dataExtent = visualMapModel.getExtent();\r\n var isInRange = visualMapModel.type === 'visualMap.continuous'\r\n ? getIsInContinuousRange(dataExtent, visualMapModel.option.range)\r\n : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\r\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\r\n inRange: inRangeVisuals.color.getColorMapper(),\r\n outOfRange: outOfRangeVisuals.color.getColorMapper()\r\n }, isInRange);\r\n var img = new ZRImage({\r\n style: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y,\r\n image: hmLayer.canvas\r\n },\r\n silent: true\r\n });\r\n this.group.add(img);\r\n };\r\n HeatmapView.type = 'heatmap';\r\n return HeatmapView;\r\n }(ChartView));\r\n ChartView.registerClass(HeatmapView);\n\n var PictorialBarSeriesModel = (function (_super) {\r\n __extends(PictorialBarSeriesModel, _super);\r\n function PictorialBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.defaultSymbol = 'roundRect';\r\n return _this;\r\n }\r\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\r\n option.stack = null;\r\n return _super.prototype.getInitialData.apply(this, arguments);\r\n };\r\n PictorialBarSeriesModel.type = 'series.pictorialBar';\r\n PictorialBarSeriesModel.dependencies = ['grid'];\r\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n symbol: 'circle',\r\n symbolSize: null,\r\n symbolRotate: null,\r\n symbolPosition: null,\r\n symbolOffset: null,\r\n symbolMargin: null,\r\n symbolRepeat: false,\r\n symbolRepeatDirection: 'end',\r\n symbolClip: false,\r\n symbolBoundingData: null,\r\n symbolPatternSize: 400,\r\n barGap: '-100%',\r\n progressive: 0,\r\n emphasis: {\r\n scale: false\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n });\r\n return PictorialBarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(PictorialBarSeriesModel);\n\n var BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth'];\r\n var LAYOUT_ATTRS = [\r\n { xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right'] },\r\n { xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom'] }\r\n ];\r\n var pathForLineWidth = new Circle();\r\n var PictorialBarView = (function (_super) {\r\n __extends(PictorialBarView, _super);\r\n function PictorialBarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarView.type;\r\n return _this;\r\n }\r\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var coordSysRect = cartesian.master.getRect();\r\n var opt = {\r\n ecSize: { width: api.getWidth(), height: api.getHeight() },\r\n seriesModel: seriesModel,\r\n coordSys: cartesian,\r\n coordSysExtent: [\r\n [coordSysRect.x, coordSysRect.x + coordSysRect.width],\r\n [coordSysRect.y, coordSysRect.y + coordSysRect.height]\r\n ],\r\n isHorizontal: isHorizontal,\r\n valueDim: LAYOUT_ATTRS[+isHorizontal],\r\n categoryDim: LAYOUT_ATTRS[1 - (+isHorizontal)]\r\n };\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var itemModel = getItemModel(data, dataIndex);\r\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\r\n var bar = createBar(data, opt, symbolMeta);\r\n data.setItemGraphicEl(dataIndex, bar);\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var bar = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(bar);\r\n return;\r\n }\r\n var itemModel = getItemModel(data, newIndex);\r\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\r\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\r\n group.remove(bar);\r\n data.setItemGraphicEl(newIndex, null);\r\n bar = null;\r\n }\r\n if (bar) {\r\n updateBar(bar, opt, symbolMeta);\r\n }\r\n else {\r\n bar = createBar(data, opt, symbolMeta, true);\r\n }\r\n data.setItemGraphicEl(newIndex, bar);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .remove(function (dataIndex) {\r\n var bar = oldData.getItemGraphicEl(dataIndex);\r\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\r\n })\r\n .execute();\r\n this._data = data;\r\n return this.group;\r\n };\r\n PictorialBarView.prototype.remove = function (ecModel, api) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (ecModel.get('animation')) {\r\n if (data) {\r\n data.eachItemGraphicEl(function (bar) {\r\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\r\n });\r\n }\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n PictorialBarView.type = 'pictorialBar';\r\n return PictorialBarView;\r\n }(ChartView));\r\n function getSymbolMeta(data, dataIndex, itemModel, opt) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var symbolRepeat = itemModel.get('symbolRepeat');\r\n var symbolClip = itemModel.get('symbolClip');\r\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\r\n var symbolRotate = itemModel.get('symbolRotate');\r\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\r\n var isAnimationEnabled = itemModel.isAnimationEnabled();\r\n var symbolMeta = {\r\n dataIndex: dataIndex,\r\n layout: layout,\r\n itemModel: itemModel,\r\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\r\n style: data.getItemVisual(dataIndex, 'style'),\r\n symbolClip: symbolClip,\r\n symbolRepeat: symbolRepeat,\r\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\r\n symbolPatternSize: symbolPatternSize,\r\n rotation: rotation,\r\n animationModel: isAnimationEnabled ? itemModel : null,\r\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\r\n z2: itemModel.getShallow('z', true) || 0\r\n };\r\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\r\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\r\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\r\n var symbolSize = symbolMeta.symbolSize;\r\n var symbolOffset = itemModel.get('symbolOffset');\r\n if (isArray(symbolOffset)) {\r\n symbolOffset = [\r\n parsePercent$2(symbolOffset[0], symbolSize[0]),\r\n parsePercent$2(symbolOffset[1], symbolSize[1])\r\n ];\r\n }\r\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\r\n return symbolMeta;\r\n }\r\n function prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var symbolBoundingData = itemModel.get('symbolBoundingData');\r\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\r\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\r\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\r\n var boundingLength;\r\n if (isArray(symbolBoundingData)) {\r\n var symbolBoundingExtent = [\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\r\n ];\r\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\r\n boundingLength = symbolBoundingExtent[pxSignIdx];\r\n }\r\n else if (symbolBoundingData != null) {\r\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\r\n }\r\n else if (symbolRepeat) {\r\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\r\n }\r\n else {\r\n boundingLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.boundingLength = boundingLength;\r\n if (symbolRepeat) {\r\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\r\n }\r\n function convertToCoordOnAxis(axis, value) {\r\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\r\n }\r\n function prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var categoryDim = opt.categoryDim;\r\n var categorySize = Math.abs(layout[categoryDim.wh]);\r\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\r\n var parsedSymbolSize;\r\n if (isArray(symbolSize)) {\r\n parsedSymbolSize = symbolSize.slice();\r\n }\r\n else {\r\n if (symbolSize == null) {\r\n parsedSymbolSize = ['100%', '100%'];\r\n }\r\n else {\r\n parsedSymbolSize = [symbolSize, symbolSize];\r\n }\r\n }\r\n parsedSymbolSize[categoryDim.index] = parsePercent$2(parsedSymbolSize[categoryDim.index], categorySize);\r\n parsedSymbolSize[valueDim.index] = parsePercent$2(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\r\n outputSymbolMeta.symbolSize = parsedSymbolSize;\r\n var symbolScale = outputSymbolMeta.symbolScale = [\r\n parsedSymbolSize[0] / symbolPatternSize,\r\n parsedSymbolSize[1] / symbolPatternSize\r\n ];\r\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\r\n }\r\n function prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\r\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0;\r\n if (valueLineWidth) {\r\n pathForLineWidth.attr({\r\n scaleX: symbolScale[0],\r\n scaleY: symbolScale[1],\r\n rotation: rotation\r\n });\r\n pathForLineWidth.updateTransform();\r\n valueLineWidth /= pathForLineWidth.getLineScale();\r\n valueLineWidth *= symbolScale[opt.valueDim.index];\r\n }\r\n outputSymbolMeta.valueLineWidth = valueLineWidth;\r\n }\r\n function prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\r\n var categoryDim = opt.categoryDim;\r\n var valueDim = opt.valueDim;\r\n var pxSign = outputSymbolMeta.pxSign;\r\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\r\n var pathLen = unitLength;\r\n if (symbolRepeat) {\r\n var absBoundingLength = Math.abs(boundingLength);\r\n var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + '';\r\n var hasEndGap = false;\r\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\r\n hasEndGap = true;\r\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\r\n }\r\n var symbolMarginNumeric = parsePercent$2(symbolMargin, symbolSize[valueDim.index]);\r\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\r\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n var repeatSpecified = isNumeric(symbolRepeat);\r\n var repeatTimes = repeatSpecified\r\n ? symbolRepeat\r\n : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\r\n var mDiff = absBoundingLength - repeatTimes * unitLength;\r\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\r\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\r\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\r\n repeatTimes = repeatCutLength\r\n ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin)\r\n : 0;\r\n }\r\n pathLen = repeatTimes * uLenWithMargin - endFix;\r\n outputSymbolMeta.repeatTimes = repeatTimes;\r\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\r\n }\r\n var sizeFix = pxSign * (pathLen / 2);\r\n var pathPosition = outputSymbolMeta.pathPosition = [];\r\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\r\n pathPosition[valueDim.index] = symbolPosition === 'start'\r\n ? sizeFix\r\n : symbolPosition === 'end'\r\n ? boundingLength - sizeFix\r\n : boundingLength / 2;\r\n if (symbolOffset) {\r\n pathPosition[0] += symbolOffset[0];\r\n pathPosition[1] += symbolOffset[1];\r\n }\r\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\r\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\r\n bundlePosition[valueDim.index] = layout[valueDim.xy];\r\n var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout);\r\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\r\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\r\n var clipShape = outputSymbolMeta.clipShape = {};\r\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\r\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\r\n clipShape[valueDim.xy] = 0;\r\n clipShape[valueDim.wh] = layout[valueDim.wh];\r\n }\r\n function createPath(symbolMeta) {\r\n var symbolPatternSize = symbolMeta.symbolPatternSize;\r\n var path = createSymbol(symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\r\n path.attr({\r\n culling: true\r\n });\r\n path.type !== 'image' && path.setStyle({\r\n strokeNoScale: true\r\n });\r\n return path;\r\n }\r\n function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var symbolSize = symbolMeta.symbolSize;\r\n var valueLineWidth = symbolMeta.valueLineWidth;\r\n var pathPosition = symbolMeta.pathPosition;\r\n var valueDim = opt.valueDim;\r\n var repeatTimes = symbolMeta.repeatTimes || 0;\r\n var index = 0;\r\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\r\n eachPath(bar, function (path) {\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n if (index < repeatTimes) {\r\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(path, null, { scaleX: 0, scaleY: 0 }, symbolMeta, isUpdate, function () {\r\n bundle.remove(path);\r\n });\r\n }\r\n index++;\r\n });\r\n for (; index < repeatTimes; index++) {\r\n var path = createPath(symbolMeta);\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n bundle.add(path);\r\n var target = makeTarget(index);\r\n updateAttr(path, {\r\n x: target.x,\r\n y: target.y,\r\n scaleX: 0,\r\n scaleY: 0\r\n }, {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n rotation: target.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n function makeTarget(index) {\r\n var position = pathPosition.slice();\r\n var pxSign = symbolMeta.pxSign;\r\n var i = index;\r\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\r\n i = repeatTimes - 1 - index;\r\n }\r\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n };\r\n }\r\n }\r\n function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var mainPath = bar.__pictorialMainPath;\r\n if (!mainPath) {\r\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\r\n bundle.add(mainPath);\r\n updateAttr(mainPath, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: 0,\r\n scaleY: 0,\r\n rotation: symbolMeta.rotation\r\n }, {\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1]\r\n }, symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(mainPath, null, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n }\r\n function createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\r\n var rectShape = extend({}, symbolMeta.barRectShape);\r\n var barRect = bar.__pictorialBarRect;\r\n if (!barRect) {\r\n barRect = bar.__pictorialBarRect = new Rect({\r\n z2: 2,\r\n shape: rectShape,\r\n silent: true,\r\n style: {\r\n stroke: 'transparent',\r\n fill: 'transparent',\r\n lineWidth: 0\r\n }\r\n });\r\n bar.add(barRect);\r\n }\r\n else {\r\n updateAttr(barRect, null, { shape: rectShape }, symbolMeta, isUpdate);\r\n }\r\n }\r\n function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\r\n if (symbolMeta.symbolClip) {\r\n var clipPath = bar.__pictorialClipPath;\r\n var clipShape = extend({}, symbolMeta.clipShape);\r\n var valueDim = opt.valueDim;\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n if (clipPath) {\r\n updateProps(clipPath, { shape: clipShape }, animationModel, dataIndex);\r\n }\r\n else {\r\n clipShape[valueDim.wh] = 0;\r\n clipPath = new Rect({ shape: clipShape });\r\n bar.__pictorialBundle.setClipPath(clipPath);\r\n bar.__pictorialClipPath = clipPath;\r\n var target = {};\r\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\r\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { shape: target }, animationModel, dataIndex);\r\n }\r\n }\r\n }\r\n function getItemModel(data, dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\r\n itemModel.isAnimationEnabled = isAnimationEnabled;\r\n return itemModel;\r\n }\r\n function getAnimationDelayParams(path) {\r\n return {\r\n index: path.__pictorialAnimationIndex,\r\n count: path.__pictorialRepeatTimes\r\n };\r\n }\r\n function isAnimationEnabled() {\r\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\r\n }\r\n function createBar(data, opt, symbolMeta, isUpdate) {\r\n var bar = new Group();\r\n var bundle = new Group();\r\n bar.add(bundle);\r\n bar.__pictorialBundle = bundle;\r\n bundle.x = symbolMeta.bundlePosition[0];\r\n bundle.y = symbolMeta.bundlePosition[1];\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\r\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\r\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n return bar;\r\n }\r\n function updateBar(bar, opt, symbolMeta) {\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n var bundle = bar.__pictorialBundle;\r\n updateProps(bundle, {\r\n x: symbolMeta.bundlePosition[0],\r\n y: symbolMeta.bundlePosition[1]\r\n }, animationModel, dataIndex);\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, true);\r\n createOrUpdateClip(bar, opt, symbolMeta, true);\r\n }\r\n function removeBar(data, dataIndex, animationModel, bar) {\r\n var labelRect = bar.__pictorialBarRect;\r\n labelRect && (labelRect.removeTextContent());\r\n var pathes = [];\r\n eachPath(bar, function (path) {\r\n pathes.push(path);\r\n });\r\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath);\r\n bar.__pictorialClipPath && (animationModel = null);\r\n each(pathes, function (path) {\r\n removeElement(path, { scaleX: 0, scaleY: 0 }, animationModel, dataIndex, function () {\r\n bar.parent && bar.parent.remove(bar);\r\n });\r\n });\r\n data.setItemGraphicEl(dataIndex, null);\r\n }\r\n function getShapeStr(data, symbolMeta) {\r\n return [\r\n data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none',\r\n !!symbolMeta.symbolRepeat,\r\n !!symbolMeta.symbolClip\r\n ].join(':');\r\n }\r\n function eachPath(bar, cb, context) {\r\n each(bar.__pictorialBundle.children(), function (el) {\r\n el !== bar.__pictorialBarRect && cb.call(context, el);\r\n });\r\n }\r\n function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\r\n immediateAttrs && el.attr(immediateAttrs);\r\n if (symbolMeta.symbolClip && !isUpdate) {\r\n animationAttrs && el.attr(animationAttrs);\r\n }\r\n else {\r\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\r\n }\r\n }\r\n function updateCommon$1(bar, opt, symbolMeta) {\r\n var dataIndex = symbolMeta.dataIndex;\r\n var itemModel = symbolMeta.itemModel;\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n var focus = emphasisModel.get('focus');\r\n var blurScope = emphasisModel.get('blurScope');\r\n var hoverScale = emphasisModel.get('scale');\r\n eachPath(bar, function (path) {\r\n if (path instanceof ZRImage) {\r\n var pathStyle = path.style;\r\n path.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolMeta.style));\r\n }\r\n else {\r\n path.useStyle(symbolMeta.style);\r\n }\r\n var emphasisState = path.ensureState('emphasis');\r\n emphasisState.style = emphasisStyle;\r\n if (hoverScale) {\r\n emphasisState.scaleX = path.scaleX * 1.1;\r\n emphasisState.scaleY = path.scaleY * 1.1;\r\n }\r\n path.ensureState('blur').style = blurStyle;\r\n path.ensureState('select').style = selectStyle;\r\n cursorStyle && (path.cursor = cursorStyle);\r\n path.z2 = symbolMeta.z2;\r\n });\r\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\r\n var barRect = bar.__pictorialBarRect;\r\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\r\n labelFetcher: opt.seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\r\n inheritColor: symbolMeta.style.fill,\r\n defaultOpacity: symbolMeta.style.opacity,\r\n defaultOutsidePosition: barPositionOutside\r\n });\r\n enableHoverEmphasis(bar, focus, blurScope);\r\n }\r\n function toIntTimes(times) {\r\n var roundedTimes = Math.round(times);\r\n return Math.abs(times - roundedTimes) < 1e-4\r\n ? roundedTimes\r\n : Math.ceil(times);\r\n }\r\n ChartView.registerClass(PictorialBarView);\n\n registerLayout(curry(layout, 'pictorialBar'));\n\n var SingleAxis = (function (_super) {\r\n __extends(SingleAxis, _super);\r\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n SingleAxis.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n SingleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.coordinateSystem.pointToData(point)[0];\r\n };\r\n return SingleAxis;\r\n }(Axis));\n\n var Single = (function () {\r\n function Single(axisModel, ecModel, api) {\r\n this.type = 'single';\r\n this.dimension = 'single';\r\n this.dimensions = ['single'];\r\n this.axisPointerEnabled = true;\r\n this.model = axisModel;\r\n this._init(axisModel, ecModel, api);\r\n }\r\n Single.prototype._init = function (axisModel, ecModel, api) {\r\n var dim = this.dimension;\r\n var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axis.orient = axisModel.get('orient');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = this;\r\n this._axis = axis;\r\n };\r\n Single.prototype.update = function (ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === this) {\r\n var data_1 = seriesModel.getData();\r\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\r\n this._axis.scale.unionExtentFromData(data_1, dim);\r\n }, this);\r\n niceScaleExtent(this._axis.scale, this._axis.model);\r\n }\r\n }, this);\r\n };\r\n Single.prototype.resize = function (axisModel, api) {\r\n this._rect = getLayoutRect({\r\n left: axisModel.get('left'),\r\n top: axisModel.get('top'),\r\n right: axisModel.get('right'),\r\n bottom: axisModel.get('bottom'),\r\n width: axisModel.get('width'),\r\n height: axisModel.get('height')\r\n }, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._adjustAxis();\r\n };\r\n Single.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Single.prototype._adjustAxis = function () {\r\n var rect = this._rect;\r\n var axis = this._axis;\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\r\n var idx = axis.reverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\r\n };\r\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var extentSum = axisExtent[0] + axisExtent[1];\r\n var isHorizontal = axis.isHorizontal();\r\n axis.toGlobalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n };\r\n Single.prototype.getAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getBaseAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getAxes = function () {\r\n return [this._axis];\r\n };\r\n Single.prototype.getTooltipAxes = function () {\r\n return {\r\n baseAxes: [this.getAxis()],\r\n otherAxes: []\r\n };\r\n };\r\n Single.prototype.containPoint = function (point) {\r\n var rect = this.getRect();\r\n var axis = this.getAxis();\r\n var orient = axis.orient;\r\n if (orient === 'horizontal') {\r\n return axis.contain(axis.toLocalCoord(point[0]))\r\n && (point[1] >= rect.y && point[1] <= (rect.y + rect.height));\r\n }\r\n else {\r\n return axis.contain(axis.toLocalCoord(point[1]))\r\n && (point[0] >= rect.y && point[0] <= (rect.y + rect.height));\r\n }\r\n };\r\n Single.prototype.pointToData = function (point) {\r\n var axis = this.getAxis();\r\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\r\n };\r\n Single.prototype.dataToPoint = function (val) {\r\n var axis = this.getAxis();\r\n var rect = this.getRect();\r\n var pt = [];\r\n var idx = axis.orient === 'horizontal' ? 0 : 1;\r\n if (val instanceof Array) {\r\n val = val[0];\r\n }\r\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\r\n pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2);\r\n return pt;\r\n };\r\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Single;\r\n }());\r\n function getCoordSys$2(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var singleModel = finder.singleAxisModel;\r\n return singleModel && singleModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n }\n\n function create$3(ecModel, api) {\r\n var singles = [];\r\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\r\n var single = new Single(axisModel, ecModel, api);\r\n single.name = 'single_' + idx;\r\n single.resize(axisModel, api);\r\n axisModel.coordinateSystem = single;\r\n singles.push(single);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\r\n }\r\n });\r\n return singles;\r\n }\r\n CoordinateSystemManager.register('single', {\r\n create: create$3,\r\n dimensions: Single.prototype.dimensions\r\n });\n\n function layout$2(axisModel, opt) {\r\n opt = opt || {};\r\n var single = axisModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var axisPosition = axis.position;\r\n var orient = axis.orient;\r\n var rect = single.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var positionMap = {\r\n horizontal: { top: rectBound[2], bottom: rectBound[3] },\r\n vertical: { left: rectBound[0], right: rectBound[1] }\r\n };\r\n layout.position = [\r\n orient === 'vertical'\r\n ? positionMap.vertical[axisPosition]\r\n : rectBound[0],\r\n orient === 'horizontal'\r\n ? positionMap.horizontal[axisPosition]\r\n : rectBound[3]\r\n ];\r\n var r = { horizontal: 0, vertical: 1 };\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n var directionMap = { top: -1, bottom: 1, right: 1, left: -1 };\r\n layout.labelDirection = layout.tickDirection =\r\n layout.nameDirection = directionMap[axisPosition];\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n layout.z2 = 1;\r\n return layout;\r\n }\n\n var axisBuilderAttrs$2 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs$1 = ['splitArea', 'splitLine'];\r\n var SingleAxisView = (function (_super) {\r\n __extends(SingleAxisView, _super);\r\n function SingleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisView.type;\r\n _this.axisPointerClass = 'SingleAxisPointer';\r\n return _this;\r\n }\r\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n var layout = layout$2(axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, layout);\r\n each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder);\r\n group.add(this._axisGroup);\r\n group.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs$1, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders$1[name](this, this.group, this._axisGroup, axisModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n SingleAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n SingleAxisView.type = 'singleAxis';\r\n return SingleAxisView;\r\n }(AxisView));\r\n var axisElementBuilders$1 = {\r\n splitLine: function (axisView, group, axisGroup, axisModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var gridRect = axisModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var splitLines = [];\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n for (var i = 0; i < ticksCoords.length; ++i) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n silent: true\r\n }));\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle(['color']);\r\n for (var i = 0; i < splitLines.length; ++i) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n splitArea: function (axisView, group, axisGroup, axisModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\r\n }\r\n };\r\n ComponentView.registerClass(SingleAxisView);\n\n var SingleAxisModel = (function (_super) {\r\n __extends(SingleAxisModel, _super);\r\n function SingleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisModel.type;\r\n return _this;\r\n }\r\n SingleAxisModel.prototype.getCoordSysModel = function () {\r\n return this;\r\n };\r\n SingleAxisModel.type = 'singleAxis';\r\n SingleAxisModel.layoutMode = 'box';\r\n SingleAxisModel.defaultOption = {\r\n left: '5%',\r\n top: '5%',\r\n right: '5%',\r\n bottom: '5%',\r\n type: 'value',\r\n position: 'bottom',\r\n orient: 'horizontal',\r\n axisLine: {\r\n show: true,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n tooltip: {\r\n show: true\r\n },\r\n axisTick: {\r\n show: true,\r\n length: 6,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n interval: 'auto'\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n type: 'dashed',\r\n opacity: 0.2\r\n }\r\n }\r\n };\r\n return SingleAxisModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(SingleAxisModel);\r\n mixin(SingleAxisModel, AxisModelCommonMixin.prototype);\r\n axisModelCreator('single', SingleAxisModel, SingleAxisModel.defaultOption);\n\n function findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n }\n\n var inner$b = makeInner();\r\n function axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n }\r\n function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n }\r\n function buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n }\r\n function showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n }\r\n function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n }\r\n function updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n }\r\n function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n }\r\n function dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$b(zr)[highDownKey] || {};\r\n var newHighlights = inner$b(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n }\r\n function findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n }\r\n function makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n }\r\n function illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n }\n\n var inner$c = makeInner();\r\n var each$8 = each;\r\n function register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$c(zr).records || (inner$c(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$c(zr).records[key] || (inner$c(zr).records[key] = {});\r\n record.handler = handler;\r\n }\r\n function initGlobalListeners(zr, api) {\r\n if (inner$c(zr).initialized) {\r\n return;\r\n }\r\n inner$c(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$8(inner$c(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n }\r\n function dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n }\r\n function onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n }\r\n function doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n }\r\n function makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n }\r\n function unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$c(zr).records || {})[key];\r\n if (record) {\r\n inner$c(zr).records[key] = null;\r\n }\r\n }\n\n var AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n }(ComponentView));\r\n ComponentView.registerClass(AxisPointerView);\n\n var inner$d = makeInner();\r\n var clone$3 = clone;\r\n var bind$1 = bind;\r\n var BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$d(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$d(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$d(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$d(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$d(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n }());\r\n function updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$d(el).lastProp, props)) {\r\n inner$d(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n }\r\n function propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n }\r\n function updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n }\r\n function getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n }\r\n function updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n }\n\n function buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n }\r\n function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n }\r\n function confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n }\r\n function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n }\r\n function getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n }\r\n function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n }\r\n function makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n }\r\n function makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n }\r\n function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: true\r\n };\r\n }\n\n var CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n }(BaseAxisPointer));\r\n function getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n }\r\n var pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n }\r\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\n var AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n }(ComponentModel));\n\n ComponentModel.registerClass(AxisPointerModel);\r\n registerPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n });\r\n registerAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n }, axisTrigger);\n\n var XY = ['x', 'y'];\r\n var WH = ['width', 'height'];\r\n var SingleAxisPointer = (function (_super) {\r\n __extends(SingleAxisPointer, _super);\r\n function SingleAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\r\n var pixelValue = coordSys.dataToPoint(value)[0];\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$2(axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$2(axisModel, { labelInside: false });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var position = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var dimIndex = getPointDimIndex(axis);\r\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: {\r\n verticalAlign: 'middle'\r\n }\r\n };\r\n };\r\n return SingleAxisPointer;\r\n }(BaseAxisPointer));\r\n var pointerShapeBuilder$1 = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = axis.getBandWidth();\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getPointDimIndex(axis) {\r\n return axis.isHorizontal() ? 0 : 1;\r\n }\r\n function getGlobalExtent(coordSys, dimIndex) {\r\n var rect = coordSys.getRect();\r\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\r\n }\r\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n\n extendComponentView({\r\n type: 'single'\r\n });\n\n var DATA_NAME_INDEX = 2;\r\n var ThemeRiverSeriesModel = (function (_super) {\r\n __extends(ThemeRiverSeriesModel, _super);\r\n function ThemeRiverSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n ThemeRiverSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\r\n var rawDataLength = data.length;\r\n var timeValueKeys = {};\r\n var groupResult = groupData(data, function (item) {\r\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\r\n timeValueKeys[item[0] + ''] = -1;\r\n }\r\n return item[2];\r\n });\r\n var layerData = [];\r\n groupResult.buckets.each(function (items, key) {\r\n layerData.push({\r\n name: key, dataList: items\r\n });\r\n });\r\n var layerNum = layerData.length;\r\n for (var k = 0; k < layerNum; ++k) {\r\n var name_1 = layerData[k].name;\r\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\r\n var timeValue = layerData[k].dataList[j][0] + '';\r\n timeValueKeys[timeValue] = k;\r\n }\r\n for (var timeValue in timeValueKeys) {\r\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\r\n timeValueKeys[timeValue] = k;\r\n data[rawDataLength] = [timeValue, 0, name_1];\r\n rawDataLength++;\r\n }\r\n }\r\n }\r\n return data;\r\n };\r\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n var axisType = singleAxisModel.get('type');\r\n var filterData = filter(option.data, function (dataItem) {\r\n return dataItem[2] !== undefined;\r\n });\r\n var data = this.fixData(filterData || []);\r\n var nameList = [];\r\n var nameMap = this.nameMap = createHashMap();\r\n var count = 0;\r\n for (var i = 0; i < data.length; ++i) {\r\n nameList.push(data[i][DATA_NAME_INDEX]);\r\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\r\n nameMap.set(data[i][DATA_NAME_INDEX], count);\r\n count++;\r\n }\r\n }\r\n var dimensionsInfo = createDimensions(data, {\r\n coordDimensions: ['single'],\r\n dimensionsDefine: [\r\n {\r\n name: 'time',\r\n type: getDimensionTypeByAxis(axisType)\r\n },\r\n {\r\n name: 'value',\r\n type: 'float'\r\n },\r\n {\r\n name: 'name',\r\n type: 'ordinal'\r\n }\r\n ],\r\n encodeDefine: {\r\n single: 0,\r\n value: 1,\r\n itemName: 2\r\n }\r\n });\r\n var list = new List(dimensionsInfo, this);\r\n list.initData(data);\r\n return list;\r\n };\r\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\r\n var data = this.getData();\r\n var lenCount = data.count();\r\n var indexArr = [];\r\n for (var i = 0; i < lenCount; ++i) {\r\n indexArr[i] = i;\r\n }\r\n var timeDim = data.mapDimension('single');\r\n var groupResult = groupData(indexArr, function (index) {\r\n return data.get('name', index);\r\n });\r\n var layerSeries = [];\r\n groupResult.buckets.each(function (items, key) {\r\n items.sort(function (index1, index2) {\r\n return data.get(timeDim, index1) - data.get(timeDim, index2);\r\n });\r\n layerSeries.push({\r\n name: key,\r\n indices: items\r\n });\r\n });\r\n return layerSeries;\r\n };\r\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\r\n if (!isArray(dim)) {\r\n dim = dim ? [dim] : [];\r\n }\r\n var data = this.getData();\r\n var layerSeries = this.getLayerSeries();\r\n var indices = [];\r\n var layerNum = layerSeries.length;\r\n var nestestValue;\r\n for (var i = 0; i < layerNum; ++i) {\r\n var minDist = Number.MAX_VALUE;\r\n var nearestIdx = -1;\r\n var pointNum = layerSeries[i].indices.length;\r\n for (var j = 0; j < pointNum; ++j) {\r\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\r\n var dist = Math.abs(theValue - value);\r\n if (dist <= minDist) {\r\n nestestValue = theValue;\r\n minDist = dist;\r\n nearestIdx = layerSeries[i].indices[j];\r\n }\r\n }\r\n indices.push(nearestIdx);\r\n }\r\n return { dataIndices: indices, nestestValue: nestestValue };\r\n };\r\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var name = data.getName(dataIndex);\r\n var value = data.get(data.mapDimension('value'), dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n ThemeRiverSeriesModel.type = 'series.themeRiver';\r\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\r\n ThemeRiverSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'singleAxis',\r\n boundaryGap: ['10%', '10%'],\r\n singleAxisIndex: 0,\r\n animationEasing: 'linear',\r\n label: {\r\n margin: 4,\r\n show: true,\r\n position: 'left',\r\n fontSize: 11\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return ThemeRiverSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ThemeRiverSeriesModel);\n\n var ThemeRiverView = (function (_super) {\r\n __extends(ThemeRiverView, _super);\r\n function ThemeRiverView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverView.type;\r\n _this._layers = [];\r\n return _this;\r\n }\r\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var self = this;\r\n var group = this.group;\r\n var layersSeries = seriesModel.getLayerSeries();\r\n var layoutInfo = data.getLayout('layoutInfo');\r\n var rect = layoutInfo.rect;\r\n var boundaryGap = layoutInfo.boundaryGap;\r\n group.x = 0;\r\n group.y = rect.y + boundaryGap[0];\r\n function keyGetter(item) {\r\n return item.name;\r\n }\r\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\r\n var newLayersGroups = [];\r\n dataDiffer\r\n .add(bind(process, this, 'add'))\r\n .update(bind(process, this, 'update'))\r\n .remove(bind(process, this, 'remove'))\r\n .execute();\r\n function process(status, idx, oldIdx) {\r\n var oldLayersGroups = self._layers;\r\n if (status === 'remove') {\r\n group.remove(oldLayersGroups[idx]);\r\n return;\r\n }\r\n var points0 = [];\r\n var points1 = [];\r\n var style;\r\n var indices = layersSeries[idx].indices;\r\n var j = 0;\r\n for (; j < indices.length; j++) {\r\n var layout = data.getItemLayout(indices[j]);\r\n var x = layout.x;\r\n var y0 = layout.y0;\r\n var y = layout.y;\r\n points0.push(x, y0);\r\n points1.push(x, y0 + y);\r\n style = data.getItemVisual(indices[j], 'style');\r\n }\r\n var polygon;\r\n var textLayout = data.getItemLayout(indices[0]);\r\n var labelModel = seriesModel.getModel('label');\r\n var margin = labelModel.get('margin');\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n if (status === 'add') {\r\n var layerGroup = newLayersGroups[idx] = new Group();\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1,\r\n smooth: 0.4,\r\n stackedOnSmooth: 0.4,\r\n smoothConstraint: false\r\n },\r\n z2: 0\r\n });\r\n layerGroup.add(polygon);\r\n group.add(layerGroup);\r\n if (seriesModel.isAnimationEnabled()) {\r\n polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () {\r\n polygon.removeClipPath();\r\n }));\r\n }\r\n }\r\n else {\r\n var layerGroup = oldLayersGroups[oldIdx];\r\n polygon = layerGroup.childAt(0);\r\n group.add(layerGroup);\r\n newLayersGroups[idx] = layerGroup;\r\n updateProps(polygon, {\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1\r\n }\r\n }, seriesModel);\r\n }\r\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\r\n labelDataIndex: indices[j - 1],\r\n defaultText: data.getName(indices[j - 1]),\r\n inheritColor: style.fill\r\n }, {\r\n normal: {\r\n verticalAlign: 'middle'\r\n }\r\n });\r\n polygon.setTextConfig({\r\n position: null,\r\n local: true\r\n });\r\n var labelEl = polygon.getTextContent();\r\n if (labelEl) {\r\n labelEl.x = textLayout.x - margin;\r\n labelEl.y = textLayout.y0 + textLayout.y / 2;\r\n }\r\n polygon.useStyle(style);\r\n data.setItemGraphicEl(idx, polygon);\r\n setStatesStylesFromModel(polygon, seriesModel);\r\n enableHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n this._layersSeries = layersSeries;\r\n this._layers = newLayersGroups;\r\n };\r\n ThemeRiverView.type = 'themeRiver';\r\n return ThemeRiverView;\r\n }(ChartView));\r\n function createGridClipShape$2(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n x: rect.x - 50,\r\n width: rect.width + 100,\r\n height: rect.height + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n ChartView.registerClass(ThemeRiverView);\n\n function themeRiverLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var single = seriesModel.coordinateSystem;\r\n var layoutInfo = {};\r\n var rect = single.getRect();\r\n layoutInfo.rect = rect;\r\n var boundaryGap = seriesModel.get('boundaryGap');\r\n var axis = single.getAxis();\r\n layoutInfo.boundaryGap = boundaryGap;\r\n if (axis.orient === 'horizontal') {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.height);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.height);\r\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, height);\r\n }\r\n else {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.width);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.width);\r\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, width);\r\n }\r\n data.setLayout('layoutInfo', layoutInfo);\r\n });\r\n }\r\n function doThemeRiverLayout(data, seriesModel, height) {\r\n if (!data.count()) {\r\n return;\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n var layerSeries = seriesModel.getLayerSeries();\r\n var timeDim = data.mapDimension('single');\r\n var valueDim = data.mapDimension('value');\r\n var layerPoints = map(layerSeries, function (singleLayer) {\r\n return map(singleLayer.indices, function (idx) {\r\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\r\n pt[1] = data.get(valueDim, idx);\r\n return pt;\r\n });\r\n });\r\n var base = computeBaseline(layerPoints);\r\n var baseLine = base.y0;\r\n var ky = height / base.max;\r\n var n = layerSeries.length;\r\n var m = layerSeries[0].indices.length;\r\n var baseY0;\r\n for (var j = 0; j < m; ++j) {\r\n baseY0 = baseLine[j] * ky;\r\n data.setItemLayout(layerSeries[0].indices[j], {\r\n layerIndex: 0,\r\n x: layerPoints[0][j][0],\r\n y0: baseY0,\r\n y: layerPoints[0][j][1] * ky\r\n });\r\n for (var i = 1; i < n; ++i) {\r\n baseY0 += layerPoints[i - 1][j][1] * ky;\r\n data.setItemLayout(layerSeries[i].indices[j], {\r\n layerIndex: i,\r\n x: layerPoints[i][j][0],\r\n y0: baseY0,\r\n y: layerPoints[i][j][1] * ky\r\n });\r\n }\r\n }\r\n }\r\n function computeBaseline(data) {\r\n var layerNum = data.length;\r\n var pointNum = data[0].length;\r\n var sums = [];\r\n var y0 = [];\r\n var max = 0;\r\n for (var i = 0; i < pointNum; ++i) {\r\n var temp = 0;\r\n for (var j = 0; j < layerNum; ++j) {\r\n temp += data[j][i][1];\r\n }\r\n if (temp > max) {\r\n max = temp;\r\n }\r\n sums.push(temp);\r\n }\r\n for (var k = 0; k < pointNum; ++k) {\r\n y0[k] = (max - sums[k]) / 2;\r\n }\r\n max = 0;\r\n for (var l = 0; l < pointNum; ++l) {\r\n var sum = sums[l] + y0[l];\r\n if (sum > max) {\r\n max = sum;\r\n }\r\n }\r\n return {\r\n y0: y0,\r\n max: max\r\n };\r\n }\n\n registerLayout(themeRiverLayout);\r\n registerProcessor(dataFilter('themeRiver'));\n\n var SunburstSeriesModel = (function (_super) {\r\n __extends(SunburstSeriesModel, _super);\r\n function SunburstSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstSeriesModel.type;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = { name: option.name, children: option.data };\r\n completeTreeValue$1(root);\r\n var levelModels = map(option.levels || [], function (levelDefine) {\r\n return new Model(levelDefine, this, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n levelModel && (model.parentModel = levelModel);\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n SunburstSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n SunburstSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n SunburstSeriesModel.type = 'series.sunburst';\r\n SunburstSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n stillShowZeroSum: true,\r\n nodeClick: 'rootToNode',\r\n renderLabelForZeroData: false,\r\n label: {\r\n rotate: 'radial',\r\n show: true,\r\n opacity: 1,\r\n align: 'center',\r\n position: 'inside',\r\n distance: 5,\r\n silent: true\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderColor: 'white',\r\n borderType: 'solid',\r\n shadowBlur: 0,\r\n shadowColor: 'rgba(0, 0, 0, 0.2)',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n emphasis: {\r\n focus: 'descendant'\r\n },\r\n blur: {\r\n itemStyle: {\r\n opacity: 0.2\r\n },\r\n label: {\r\n opacity: 0.1\r\n }\r\n },\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n data: [],\r\n levels: [],\r\n sort: 'desc'\r\n };\r\n return SunburstSeriesModel;\r\n }(SeriesModel));\r\n function completeTreeValue$1(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue$1(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n }\r\n SeriesModel.registerClass(SunburstSeriesModel);\n\n var DEFAULT_SECTOR_Z = 2;\r\n var DEFAULT_TEXT_Z = 4;\r\n var SunburstPiece = (function (_super) {\r\n __extends(SunburstPiece, _super);\r\n function SunburstPiece(node, seriesModel, ecModel, api) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = DEFAULT_SECTOR_Z;\r\n _this.textConfig = {\r\n inside: true\r\n };\r\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\r\n var text = new ZRText({\r\n z2: DEFAULT_TEXT_Z,\r\n silent: node.getModel().get(['label', 'silent'])\r\n });\r\n _this.setTextContent(text);\r\n _this.updateData(true, node, seriesModel, ecModel, api);\r\n return _this;\r\n }\r\n SunburstPiece.prototype.updateData = function (firstCreate, node, seriesModel, ecModel, api) {\r\n this.node = node;\r\n node.piece = this;\r\n seriesModel = seriesModel || this._seriesModel;\r\n ecModel = ecModel || this._ecModel;\r\n var sector = this;\r\n getECData(sector).dataIndex = node.dataIndex;\r\n var itemModel = node.getModel();\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = node.getLayout();\r\n var sectorShape = extend({}, layout);\r\n sectorShape.label = null;\r\n var normalStyle = node.getVisual('style');\r\n normalStyle.lineJoin = 'bevel';\r\n var decal = node.getVisual('decal');\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape);\r\n extend(sectorShape, cornerRadius);\r\n each(SPECIAL_STATES, function (stateName) {\r\n var state = sector.ensureState(stateName);\r\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\r\n state.style = itemStyleModel.getItemStyle();\r\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\r\n if (cornerRadius) {\r\n state.shape = cornerRadius;\r\n }\r\n });\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n sector.shape.r = layout.r0;\r\n updateProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, node.dataIndex);\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel);\r\n }\r\n sector.useStyle(normalStyle);\r\n this._updateLabel(seriesModel);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._seriesModel = seriesModel || this._seriesModel;\r\n this._ecModel = ecModel || this._ecModel;\r\n var focus = emphasisModel.get('focus');\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n enableHoverEmphasis(this, focusDataIndices || focus, emphasisModel.get('blurScope'));\r\n };\r\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\r\n var _this = this;\r\n var itemModel = this.node.getModel();\r\n var normalLabelModel = itemModel.getModel('label');\r\n var layout = this.node.getLayout();\r\n var angle = layout.endAngle - layout.startAngle;\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var dx = Math.cos(midAngle);\r\n var dy = Math.sin(midAngle);\r\n var sector = this;\r\n var label = sector.getTextContent();\r\n var dataIndex = this.node.dataIndex;\r\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\r\n var isNormalShown = normalLabelModel.get('show')\r\n && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\r\n label.ignore = !isNormalShown;\r\n each(DISPLAY_STATES, function (stateName) {\r\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label')\r\n : itemModel.getModel([stateName, 'label']);\r\n var isNormal = stateName === 'normal';\r\n var state = isNormal ? label : label.ensureState(stateName);\r\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\r\n if (isNormal) {\r\n text = text || _this.node.name;\r\n }\r\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\r\n if (text) {\r\n state.style.text = text;\r\n }\r\n var isShown = labelStateModel.get('show');\r\n if (isShown != null && !isNormal) {\r\n state.ignore = !isShown;\r\n }\r\n var labelPosition = getLabelAttr(labelStateModel, 'position');\r\n var sectorState = isNormal ? sector : sector.states[stateName];\r\n var labelColor = sectorState.style.fill;\r\n sectorState.textConfig = {\r\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\r\n inside: labelPosition !== 'outside'\r\n };\r\n var r;\r\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\r\n var textAlign = getLabelAttr(labelStateModel, 'align');\r\n if (labelPosition === 'outside') {\r\n r = layout.r + labelPadding;\r\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\r\n }\r\n else {\r\n if (!textAlign || textAlign === 'center') {\r\n r = (layout.r + layout.r0) / 2;\r\n textAlign = 'center';\r\n }\r\n else if (textAlign === 'left') {\r\n r = layout.r0 + labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (textAlign === 'right') {\r\n r = layout.r - labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'left';\r\n }\r\n }\r\n }\r\n state.style.align = textAlign;\r\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\r\n state.x = r * dx + layout.cx;\r\n state.y = r * dy + layout.cy;\r\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\r\n var rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = -midAngle;\r\n if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = Math.PI / 2 - midAngle;\r\n if (rotate > Math.PI / 2) {\r\n rotate -= Math.PI;\r\n }\r\n else if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (typeof rotateType === 'number') {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n state.rotation = rotate;\r\n });\r\n function getLabelAttr(model, name) {\r\n var stateAttr = model.get(name);\r\n if (stateAttr == null) {\r\n return normalLabelModel.get(name);\r\n }\r\n return stateAttr;\r\n }\r\n label.dirtyStyle();\r\n };\r\n return SunburstPiece;\r\n }(Sector));\n\n var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\r\n registerAction({ type: ROOT_TO_NODE_ACTION, update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n });\r\n var HIGHLIGHT_ACTION = 'sunburstHighlight';\r\n registerAction({ type: HIGHLIGHT_ACTION, update: 'none' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleHighlight);\r\n function handleHighlight(model) {\r\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\r\n if (targetInfo) {\r\n payload.dataIndex = targetInfo.node.dataIndex;\r\n }\r\n }\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlight', 'sunburstHighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'highlight'\r\n }));\r\n });\r\n var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\r\n registerAction({ type: UNHIGHLIGHT_ACTION, update: 'updateView' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'sunburstUnhighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'downplay'\r\n }));\r\n });\n\n var SunburstView = (function (_super) {\r\n __extends(SunburstView, _super);\r\n function SunburstView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstView.type;\r\n return _this;\r\n }\r\n SunburstView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var self = this;\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var data = seriesModel.getData();\r\n var virtualRoot = data.tree.root;\r\n var newRoot = seriesModel.getViewRoot();\r\n var group = this.group;\r\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\r\n var newChildren = [];\r\n newRoot.eachNode(function (node) {\r\n newChildren.push(node);\r\n });\r\n var oldChildren = this._oldChildren || [];\r\n dualTravel(newChildren, oldChildren);\r\n renderRollUp(virtualRoot, newRoot);\r\n this._initEvents();\r\n this._oldChildren = newChildren;\r\n function dualTravel(newChildren, oldChildren) {\r\n if (newChildren.length === 0 && oldChildren.length === 0) {\r\n return;\r\n }\r\n new DataDiffer(oldChildren, newChildren, getKey, getKey)\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIdx, oldIdx) {\r\n var newNode = newIdx == null ? null : newChildren[newIdx];\r\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\r\n doRenderNode(newNode, oldNode);\r\n }\r\n }\r\n function doRenderNode(newNode, oldNode) {\r\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\r\n newNode = null;\r\n }\r\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\r\n if (oldNode && oldNode.piece) {\r\n if (newNode) {\r\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\r\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\r\n }\r\n else {\r\n removeNode(oldNode);\r\n }\r\n }\r\n else if (newNode) {\r\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\r\n group.add(piece);\r\n data.setItemGraphicEl(newNode.dataIndex, piece);\r\n }\r\n }\r\n }\r\n function removeNode(node) {\r\n if (!node) {\r\n return;\r\n }\r\n if (node.piece) {\r\n group.remove(node.piece);\r\n node.piece = null;\r\n }\r\n }\r\n function renderRollUp(virtualRoot, viewRoot) {\r\n if (viewRoot.depth > 0) {\r\n if (self.virtualPiece) {\r\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\r\n }\r\n else {\r\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\r\n group.add(self.virtualPiece);\r\n }\r\n viewRoot.piece.off('click');\r\n self.virtualPiece.on('click', function (e) {\r\n self._rootToNode(viewRoot.parentNode);\r\n });\r\n }\r\n else if (self.virtualPiece) {\r\n group.remove(self.virtualPiece);\r\n self.virtualPiece = null;\r\n }\r\n }\r\n };\r\n SunburstView.prototype._initEvents = function () {\r\n var _this = this;\r\n this.group.off('click');\r\n this.group.on('click', function (e) {\r\n var targetFound = false;\r\n var viewRoot = _this.seriesModel.getViewRoot();\r\n viewRoot.eachNode(function (node) {\r\n if (!targetFound\r\n && node.piece && node.piece === e.target) {\r\n var nodeClick = node.getModel().get('nodeClick');\r\n if (nodeClick === 'rootToNode') {\r\n _this._rootToNode(node);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.getModel();\r\n var link = itemModel.get('link');\r\n if (link) {\r\n var linkTarget = itemModel.get('target', true)\r\n || '_blank';\r\n windowOpen(link, linkTarget);\r\n }\r\n }\r\n targetFound = true;\r\n }\r\n });\r\n });\r\n };\r\n SunburstView.prototype._rootToNode = function (node) {\r\n if (node !== this.seriesModel.getViewRoot()) {\r\n this.api.dispatchAction({\r\n type: ROOT_TO_NODE_ACTION,\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: node\r\n });\r\n }\r\n };\r\n SunburstView.prototype.containPoint = function (point, seriesModel) {\r\n var treeRoot = seriesModel.getData();\r\n var itemLayout = treeRoot.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n SunburstView.type = 'sunburst';\r\n return SunburstView;\r\n }(ChartView));\r\n ChartView.registerClass(SunburstView);\n\n var RADIAN$2 = Math.PI / 180;\r\n function sunburstLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width);\r\n var cy = parsePercent$2(center[1], height);\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$2;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$2;\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var treeRoot = seriesModel.getViewRoot();\r\n var rootDepth = treeRoot.depth;\r\n var sort = seriesModel.get('sort');\r\n if (sort != null) {\r\n initChildren$1(treeRoot, sort);\r\n }\r\n var validDataCount = 0;\r\n each(treeRoot.children, function (child) {\r\n !isNaN(child.getValue()) && validDataCount++;\r\n });\r\n var sum = treeRoot.getValue();\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var renderRollupNode = treeRoot.depth > 0;\r\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\r\n var rPerLevel = (r - r0) / (levels || 1);\r\n var clockwise = seriesModel.get('clockwise');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var dir = clockwise ? 1 : -1;\r\n var renderNode = function (node, startAngle) {\r\n if (!node) {\r\n return;\r\n }\r\n var endAngle = startAngle;\r\n if (node !== virtualRoot) {\r\n var value = node.getValue();\r\n var angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n }\r\n endAngle = startAngle + dir * angle;\r\n var depth = node.depth - rootDepth\r\n - (renderRollupNode ? -1 : 1);\r\n var rStart = r0 + rPerLevel * depth;\r\n var rEnd = r0 + rPerLevel * (depth + 1);\r\n var itemModel = node.getModel();\r\n if (itemModel.get('r0') != null) {\r\n rStart = parsePercent$2(itemModel.get('r0'), size / 2);\r\n }\r\n if (itemModel.get('r') != null) {\r\n rEnd = parsePercent$2(itemModel.get('r'), size / 2);\r\n }\r\n node.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n if (node.children && node.children.length) {\r\n var siblingAngle_1 = 0;\r\n each(node.children, function (node) {\r\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\r\n });\r\n }\r\n return endAngle - startAngle;\r\n };\r\n if (renderRollupNode) {\r\n var rStart = r0;\r\n var rEnd = r0 + rPerLevel;\r\n var angle = Math.PI * 2;\r\n virtualRoot.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: startAngle + angle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n renderNode(treeRoot, startAngle);\r\n });\r\n }\r\n function initChildren$1(node, sortOrder) {\r\n var children = node.children || [];\r\n node.children = sort$2(children, sortOrder);\r\n if (children.length) {\r\n each(node.children, function (child) {\r\n initChildren$1(child, sortOrder);\r\n });\r\n }\r\n }\r\n function sort$2(children, sortOrder) {\r\n if (typeof sortOrder === 'function') {\r\n var sortTargets = map(children, function (child, idx) {\r\n var value = child.getValue();\r\n return {\r\n params: {\r\n depth: child.depth,\r\n height: child.height,\r\n dataIndex: child.dataIndex,\r\n getValue: function () { return value; }\r\n },\r\n index: idx\r\n };\r\n });\r\n sortTargets.sort(function (a, b) {\r\n return sortOrder(a.params, b.params);\r\n });\r\n return map(sortTargets, function (target) {\r\n return children[target.index];\r\n });\r\n }\r\n else {\r\n var isAsc_1 = sortOrder === 'asc';\r\n return children.sort(function (a, b) {\r\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\r\n return diff === 0\r\n ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1)\r\n : diff;\r\n });\r\n }\r\n }\n\n function sunburstVisual(ecModel) {\r\n var paletteScope = {};\r\n function pickColor(node, seriesModel, treeHeight) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var color = seriesModel.getColorFromPalette((current.name || current.dataIndex + ''), paletteScope);\r\n if (node.depth > 1 && typeof color === 'string') {\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n return color;\r\n }\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n }\n\n registerLayout(curry(sunburstLayout, 'sunburst'));\r\n registerProcessor(curry(dataFilter, 'sunburst'));\r\n registerVisual(sunburstVisual);\n\n function dataToCoordSize(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['x', 'y'], function (dim, dimIdx) {\r\n var axis = this.getAxis(dim);\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }, this);\r\n }\r\n function cartesianPrepareCustom(coordSys) {\r\n var rect = coordSys.master.getRect();\r\n return {\r\n coordSys: {\r\n type: 'cartesian2d',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$1(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map([0, 1], function (dimIdx) {\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var p1 = [];\r\n var p2 = [];\r\n p1[dimIdx] = val - halfSize;\r\n p2[dimIdx] = val + halfSize;\r\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\r\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\r\n }, this);\r\n }\r\n function geoPrepareCustom(coordSys) {\r\n var rect = coordSys.getBoundingRect();\r\n return {\r\n coordSys: {\r\n type: 'geo',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n zoom: coordSys.getZoom()\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize$1, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$2(dataSize, dataItem) {\r\n var axis = this.getAxis();\r\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\r\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }\r\n function singlePrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n return {\r\n coordSys: {\r\n type: 'singleAxis',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (val) {\r\n return coordSys.dataToPoint(val);\r\n },\r\n size: bind(dataToCoordSize$2, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$3(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['Radius', 'Angle'], function (dim, dimIdx) {\r\n var getterName = 'get' + dim + 'Axis';\r\n var axis = this[getterName]();\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var result = axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n if (dim === 'Angle') {\r\n result = result * Math.PI / 180;\r\n }\r\n return result;\r\n }, this);\r\n }\r\n function polarPrepareCustom(coordSys) {\r\n var radiusAxis = coordSys.getRadiusAxis();\r\n var angleAxis = coordSys.getAngleAxis();\r\n var radius = radiusAxis.getExtent();\r\n radius[0] > radius[1] && radius.reverse();\r\n return {\r\n coordSys: {\r\n type: 'polar',\r\n cx: coordSys.cx,\r\n cy: coordSys.cy,\r\n r: radius[1],\r\n r0: radius[0]\r\n },\r\n api: {\r\n coord: function (data) {\r\n var radius = radiusAxis.dataToRadius(data[0]);\r\n var angle = angleAxis.dataToAngle(data[1]);\r\n var coord = coordSys.coordToPoint([radius, angle]);\r\n coord.push(radius, angle * Math.PI / 180);\r\n return coord;\r\n },\r\n size: bind(dataToCoordSize$3, coordSys)\r\n }\r\n };\r\n }\n\n function calendarPrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n var rangeInfo = coordSys.getRangeInfo();\r\n return {\r\n coordSys: {\r\n type: 'calendar',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n cellWidth: coordSys.getCellWidth(),\r\n cellHeight: coordSys.getCellHeight(),\r\n rangeInfo: {\r\n start: rangeInfo.start,\r\n end: rangeInfo.end,\r\n weeks: rangeInfo.weeks,\r\n dayCount: rangeInfo.allDay\r\n }\r\n },\r\n api: {\r\n coord: function (data, clamp) {\r\n return coordSys.dataToPoint(data, clamp);\r\n }\r\n }\r\n };\r\n }\n\n var deprecatedLogs = {};\r\n function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n }\r\n function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n }\r\n function convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n }\r\n function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\r\n var out = itemStl;\r\n out.textPosition = out.textPosition || txCfg.position || 'inside';\r\n txCfg.offset != null && (out.textOffset = txCfg.offset);\r\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\r\n txCfg.distance != null && (out.textDistance = txCfg.distance);\r\n var isInside = out.textPosition.indexOf('inside') >= 0;\r\n var hostFill = itemStl.fill || '#000';\r\n convertToEC4RichItem(out, txStl);\r\n var textFillNotSet = out.textFill == null;\r\n if (isInside) {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.insideFill || '#fff';\r\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\r\n !out.textStroke && (out.textStroke = hostFill);\r\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\r\n }\r\n }\r\n else {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.outsideFill || hostFill;\r\n }\r\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\r\n }\r\n out.text = txStl.text;\r\n out.rich = txStl.rich;\r\n each(txStl.rich, function (richItem) {\r\n convertToEC4RichItem(richItem, richItem);\r\n });\r\n return out;\r\n }\r\n function convertToEC4RichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\r\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\r\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\r\n hasOwn(richItem, 'font') && (out.font = richItem.font);\r\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\r\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\r\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\r\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\r\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\r\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\r\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\r\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\r\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\r\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\r\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\r\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\r\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\r\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\r\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\r\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\r\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\r\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\r\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\r\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\r\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\r\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\r\n }\r\n function warnDeprecated(deprecated, insteadApproach) {\r\n if (__DEV__) {\r\n var key = deprecated + '^_^' + insteadApproach;\r\n if (!deprecatedLogs[key]) {\r\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\r\n deprecatedLogs[key] = true;\r\n }\r\n }\r\n }\n\n var inner$e = makeInner();\r\n var TRANSFORM_PROPS = {\r\n x: 1,\r\n y: 1,\r\n scaleX: 1,\r\n scaleY: 1,\r\n originX: 1,\r\n originY: 1,\r\n rotation: 1\r\n };\r\n var transformPropNamesStr = keys(TRANSFORM_PROPS).join(', ');\r\n var STYLE_VISUAL_TYPE = {\r\n color: 'fill',\r\n borderColor: 'stroke'\r\n };\r\n var NON_STYLE_VISUAL_PROPS = {\r\n symbol: 1,\r\n symbolSize: 1,\r\n symbolKeepAspect: 1,\r\n legendSymbol: 1,\r\n visualMeta: 1,\r\n liftZ: 1,\r\n decal: 1\r\n };\r\n var EMPHASIS = 'emphasis';\r\n var NORMAL = 'normal';\r\n var BLUR = 'blur';\r\n var SELECT = 'select';\r\n var STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\r\n var PATH_ITEM_STYLE = {\r\n normal: ['itemStyle'],\r\n emphasis: [EMPHASIS, 'itemStyle'],\r\n blur: [BLUR, 'itemStyle'],\r\n select: [SELECT, 'itemStyle']\r\n };\r\n var PATH_LABEL = {\r\n normal: ['label'],\r\n emphasis: [EMPHASIS, 'label'],\r\n blur: [BLUR, 'label'],\r\n select: [SELECT, 'label']\r\n };\r\n var GROUP_DIFF_PREFIX = 'e\\0\\0';\r\n var attachedTxInfoTmp = {\r\n normal: {},\r\n emphasis: {},\r\n blur: {},\r\n select: {}\r\n };\r\n var LEGACY_TRANSFORM_PROPS = {\r\n position: ['x', 'y'],\r\n scale: ['scaleX', 'scaleY'],\r\n origin: ['originX', 'originY']\r\n };\r\n var tmpTransformable = new Transformable();\r\n var prepareCustoms = {\r\n cartesian2d: cartesianPrepareCustom,\r\n geo: geoPrepareCustom,\r\n singleAxis: singlePrepareCustom,\r\n polar: polarPrepareCustom,\r\n calendar: calendarPrepareCustom\r\n };\r\n var CustomSeriesModel = (function (_super) {\r\n __extends(CustomSeriesModel, _super);\r\n function CustomSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesModel.type;\r\n return _this;\r\n }\r\n CustomSeriesModel.prototype.optionUpdated = function () {\r\n this.currentZLevel = this.get('zlevel', true);\r\n this.currentZ = this.get('z', true);\r\n };\r\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this);\r\n };\r\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n el && (params.info = inner$e(el).info);\r\n return params;\r\n };\r\n CustomSeriesModel.type = 'series.custom';\r\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n CustomSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n clip: false\r\n };\r\n return CustomSeriesModel;\r\n }(SeriesModel));\r\n ComponentModel.registerClass(CustomSeriesModel);\r\n var CustomSeriesView = (function (_super) {\r\n __extends(CustomSeriesView, _super);\r\n function CustomSeriesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesView.type;\r\n return _this;\r\n }\r\n CustomSeriesView.prototype.render = function (customSeries, ecModel, api, payload) {\r\n var oldData = this._data;\r\n var data = customSeries.getData();\r\n var group = this.group;\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n var transOpt = customSeries.__transientTransitionOpt;\r\n if (transOpt && (transOpt.from == null || transOpt.to == null)) {\r\n oldData && oldData.each(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n });\r\n data.each(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n });\r\n }\r\n else {\r\n var morphPreparation_1 = new MorphPreparation(customSeries, transOpt);\r\n var diffMode = transOpt ? 'multiple' : 'oneToOne';\r\n (new DataDiffer(oldData ? oldData.getIndices() : [], data.getIndices(), createGetKey(oldData, diffMode, transOpt && transOpt.from), createGetKey(data, diffMode, transOpt && transOpt.to), null, diffMode))\r\n .add(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n })\r\n .remove(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n morphPreparation_1.reset('oneToOne');\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n if (morphPreparation_1.hasFrom()) {\r\n removeElementDirectly(oldEl, group);\r\n oldEl = null;\r\n }\r\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateManyToOne(function (newIdx, oldIndices) {\r\n morphPreparation_1.reset('manyToOne');\r\n for (var i = 0; i < oldIndices.length; i++) {\r\n var oldEl = oldData.getItemGraphicEl(oldIndices[i]);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n }\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateOneToMany(function (newIndices, oldIdx) {\r\n morphPreparation_1.reset('oneToMany');\r\n var newLen = newIndices.length;\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n for (var i = 0; i < newLen; i++) {\r\n createOrUpdateItem(api, null, newIndices[i], renderItem(newIndices[i], payload), customSeries, group, data, morphPreparation_1);\r\n }\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .execute();\r\n }\r\n var clipPath = customSeries.get('clip', true)\r\n ? createClipPath(customSeries.coordinateSystem, false, customSeries)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n this._data = data;\r\n };\r\n CustomSeriesView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CustomSeriesView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\r\n var data = customSeries.getData();\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n function setIncrementalAndHoverLayer(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = params.start; idx < params.end; idx++) {\r\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data, null);\r\n el.traverse(setIncrementalAndHoverLayer);\r\n }\r\n };\r\n CustomSeriesView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\r\n var elementName = query.element;\r\n if (elementName == null || targetEl.name === elementName) {\r\n return true;\r\n }\r\n while ((targetEl = (targetEl.__hostTarget || targetEl.parent)) && targetEl !== this.group) {\r\n if (targetEl.name === elementName) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n CustomSeriesView.type = 'custom';\r\n return CustomSeriesView;\r\n }(ChartView));\r\n ChartView.registerClass(CustomSeriesView);\r\n function createGetKey(data, diffMode, dimension) {\r\n if (!data) {\r\n return;\r\n }\r\n if (diffMode === 'oneToOne') {\r\n return function (rawIdx, dataIndex) {\r\n return data.getId(dataIndex);\r\n };\r\n }\r\n var diffByDimName = data.getDimension(dimension);\r\n var dimInfo = data.getDimensionInfo(diffByDimName);\r\n if (!dimInfo) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = dimension + \" is not a valid dimension.\";\r\n }\r\n throwError(errMsg);\r\n }\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n return function (rawIdx, dataIndex) {\r\n var key = data.get(diffByDimName, dataIndex);\r\n if (ordinalMeta) {\r\n key = ordinalMeta.categories[key];\r\n }\r\n return (key == null || eqNaN(key))\r\n ? rawIdx + ''\r\n : '_ec_' + key;\r\n };\r\n }\r\n function createEl(elOption) {\r\n var graphicType = elOption.type;\r\n var el;\r\n if (graphicType === 'path') {\r\n var shape = elOption.shape;\r\n var pathRect = (shape.width != null && shape.height != null)\r\n ? {\r\n x: shape.x || 0,\r\n y: shape.y || 0,\r\n width: shape.width,\r\n height: shape.height\r\n }\r\n : null;\r\n var pathData = getPathData(shape);\r\n el = makePath(pathData, null, pathRect, shape.layout || 'center');\r\n inner$e(el).customPathData = pathData;\r\n }\r\n else if (graphicType === 'image') {\r\n el = new ZRImage({});\r\n inner$e(el).customImagePath = elOption.style.image;\r\n }\r\n else if (graphicType === 'text') {\r\n el = new ZRText({});\r\n }\r\n else if (graphicType === 'group') {\r\n el = new Group();\r\n }\r\n else if (graphicType === 'compoundPath') {\r\n throw new Error('\"compoundPath\" is not supported yet.');\r\n }\r\n else {\r\n var Clz = getShapeClass(graphicType);\r\n if (!Clz) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\r\n }\r\n throwError(errMsg);\r\n }\r\n el = new Clz();\r\n }\r\n inner$e(el).customGraphicType = graphicType;\r\n el.name = elOption.name;\r\n el.z2EmphasisLift = 1;\r\n el.z2SelectLift = 1;\r\n return el;\r\n }\r\n function updateElNormal(api, el, isMorphTo, dataIndex, elOption, styleOpt, attachedTxInfo, seriesModel, isInit, isTextContent) {\r\n var transFromProps = {};\r\n var allPropsFinal = {};\r\n var elDisplayable = el.isGroup ? null : el;\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('shape', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('shape', elOption, allPropsFinal);\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('extra', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('extra', elOption, allPropsFinal);\r\n !isMorphTo && prepareTransformTransitionFrom(el, null, elOption, transFromProps, isInit);\r\n prepareTransformAllPropsFinal(elOption, allPropsFinal);\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\r\n if (txCfgOpt) {\r\n el.setTextConfig(txCfgOpt);\r\n }\r\n if (el.type === 'text' && styleOpt) {\r\n var textOptionStyle = styleOpt;\r\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\r\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\r\n }\r\n if (styleOpt) {\r\n var decalPattern = void 0;\r\n var decalObj = isPath$1(el) ? styleOpt.decal : null;\r\n if (api && decalObj) {\r\n decalObj.dirty = true;\r\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\r\n }\r\n styleOpt.__decalPattern = decalPattern;\r\n }\r\n !isMorphTo && prepareStyleTransitionFrom(el, null, elOption, styleOpt, transFromProps, isInit);\r\n if (elDisplayable) {\r\n hasOwn(elOption, 'invisible') && (elDisplayable.invisible = elOption.invisible);\r\n }\r\n if (!isMorphTo) {\r\n applyPropsFinal(el, allPropsFinal, styleOpt);\r\n applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit);\r\n }\r\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\r\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\r\n if (!isTextContent) {\r\n hasOwn(elOption, 'info') && (inner$e(el).info = elOption.info);\r\n }\r\n styleOpt ? el.dirty() : el.markRedraw();\r\n return isMorphTo ? allPropsFinal : null;\r\n }\r\n function applyPropsFinal(el, allPropsFinal, styleOpt) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n if (elDisplayable && styleOpt) {\r\n var decalPattern = styleOpt.__decalPattern;\r\n var originalDecalObj = void 0;\r\n if (decalPattern) {\r\n originalDecalObj = styleOpt.decal;\r\n styleOpt.decal = decalPattern;\r\n }\r\n elDisplayable.useStyle(styleOpt);\r\n if (decalPattern) {\r\n styleOpt.decal = originalDecalObj;\r\n }\r\n var animators = elDisplayable.animators;\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (animator.targetName === 'style') {\r\n animator.changeTarget(elDisplayable.style);\r\n }\r\n }\r\n }\r\n allPropsFinal && el.attr(allPropsFinal);\r\n }\r\n function applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit) {\r\n if (transFromProps) {\r\n var userDuring = elOption.during;\r\n inner$e(el).userDuring = userDuring;\r\n var cfgDuringCall = userDuring ? bind(duringCall, { el: el, userDuring: userDuring }) : null;\r\n var cfg = {\r\n dataIndex: dataIndex,\r\n isFrom: true,\r\n during: cfgDuringCall\r\n };\r\n isInit\r\n ? initProps(el, transFromProps, seriesModel, cfg)\r\n : updateProps(el, transFromProps, seriesModel, cfg);\r\n }\r\n }\r\n function prepareShapeOrExtraTransitionFrom(mainAttr, el, morphFromEl, elOption, transFromProps, isInit) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var elPropsInAttr = el[mainAttr];\r\n var transFromPropsInAttr;\r\n var enterFrom = attrOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromPropsInAttr[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit\r\n && elPropsInAttr\r\n && !(morphFromEl != null && mainAttr === 'shape')) {\r\n if (attrOpt.transition) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var transitionKeys = normalizeToArray(attrOpt.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer(key, attrOpt[key], elVal);\r\n }\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n else if (indexOf(elOption.transition, mainAttr) >= 0) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var elPropsInAttrKeys = keys(elPropsInAttr);\r\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\r\n var key = elPropsInAttrKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = attrOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToPropsInAttr = leaveToProps[mainAttr] || (leaveToProps[mainAttr] = {});\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToPropsInAttr[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var allPropsInAttr = allProps[mainAttr] = {};\r\n var keysInAttr = keys(attrOpt);\r\n for (var i = 0; i < keysInAttr.length; i++) {\r\n var key = keysInAttr[i];\r\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\r\n }\r\n }\r\n function prepareTransformTransitionFrom(el, morphFromEl, elOption, transFromProps, isInit) {\r\n var enterFrom = elOption.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.enterFrom');\r\n }\r\n transFromProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit) {\r\n if (morphFromEl) {\r\n var fromTransformable = calcOldElLocalTransformBasedOnNewElParent(morphFromEl, el);\r\n setTransformPropToTransitionFrom(transFromProps, 'x', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'rotation', fromTransformable);\r\n }\r\n else if (elOption.transition) {\r\n var transitionKeys = normalizeToArray(elOption.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n if (key === 'style' || key === 'shape' || key === 'extra') {\r\n continue;\r\n }\r\n var elVal = el[key];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.transition');\r\n checkNonStyleTansitionRefer(key, elOption[key], elVal);\r\n }\r\n transFromProps[key] = elVal;\r\n }\r\n }\r\n else {\r\n setTransformPropToTransitionFrom(transFromProps, 'x', el);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', el);\r\n }\r\n }\r\n var leaveTo = elOption.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.leaveTo');\r\n }\r\n leaveToProps[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function prepareTransformAllPropsFinal(elOption, allProps) {\r\n setLagecyTransformProp(elOption, allProps, 'position');\r\n setLagecyTransformProp(elOption, allProps, 'scale');\r\n setLagecyTransformProp(elOption, allProps, 'origin');\r\n setTransformProp(elOption, allProps, 'x');\r\n setTransformProp(elOption, allProps, 'y');\r\n setTransformProp(elOption, allProps, 'scaleX');\r\n setTransformProp(elOption, allProps, 'scaleY');\r\n setTransformProp(elOption, allProps, 'originX');\r\n setTransformProp(elOption, allProps, 'originY');\r\n setTransformProp(elOption, allProps, 'rotation');\r\n }\r\n function prepareStyleTransitionFrom(el, morphFromEl, elOption, styleOpt, transFromProps, isInit) {\r\n if (!styleOpt) {\r\n return;\r\n }\r\n var fromEl = morphFromEl || el;\r\n var fromElStyle = fromEl.style;\r\n var transFromStyleProps;\r\n var enterFrom = styleOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromStyleProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit && fromElStyle) {\r\n if (styleOpt.transition) {\r\n var transitionKeys = normalizeToArray(styleOpt.transition);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n else if (el.getAnimationStyleProps\r\n && indexOf(elOption.transition, 'style') >= 0) {\r\n var animationProps = el.getAnimationStyleProps();\r\n var animationStyleProps = animationProps ? animationProps.style : null;\r\n if (animationStyleProps) {\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n var styleKeys = keys(styleOpt);\r\n for (var i = 0; i < styleKeys.length; i++) {\r\n var key = styleKeys[i];\r\n if (animationStyleProps[key]) {\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = styleOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToKeys = keys(leaveTo);\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToStyleProps = leaveToProps.style || (leaveToProps.style = {});\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToStyleProps[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function calcOldElLocalTransformBasedOnNewElParent(oldEl, newEl) {\r\n if (!oldEl || oldEl === newEl || oldEl.parent === newEl.parent) {\r\n return oldEl;\r\n }\r\n var tmpM = tmpTransformable.transform\r\n || (tmpTransformable.transform = identity([]));\r\n var oldGlobalTransform = oldEl.getComputedTransform();\r\n oldGlobalTransform\r\n ? copy$1(tmpM, oldGlobalTransform)\r\n : identity(tmpM);\r\n var newParent = newEl.parent;\r\n if (newParent) {\r\n newParent.getComputedTransform();\r\n }\r\n tmpTransformable.originX = oldEl.originX;\r\n tmpTransformable.originY = oldEl.originY;\r\n tmpTransformable.parent = newParent;\r\n tmpTransformable.decomposeTransform();\r\n return tmpTransformable;\r\n }\r\n var checkNonStyleTansitionRefer;\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer = function (propName, optVal, elVal) {\r\n if (!isArrayLike(optVal)) {\r\n assert(optVal != null && isFinite(optVal), 'Prop `' + propName + '` must refer to a finite number or ArrayLike for transition.');\r\n }\r\n else {\r\n assert(optVal !== elVal, 'Prop `' + propName + '` must use different Array object each time for transition.');\r\n }\r\n };\r\n }\r\n function isNonStyleTransitionEnabled(optVal, elVal) {\r\n return !isArrayLike(optVal)\r\n ? (optVal != null && isFinite(optVal))\r\n : optVal !== elVal;\r\n }\r\n var checkTransformPropRefer;\r\n if (__DEV__) {\r\n checkTransformPropRefer = function (key, usedIn) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Prop `' + key + '` is not a permitted in `' + usedIn + '`. '\r\n + 'Only `' + keys(TRANSFORM_PROPS).join('`, `') + '` are permitted.');\r\n };\r\n }\r\n function getOrCreateLeaveToPropsFromEl(el) {\r\n var innerEl = inner$e(el);\r\n return innerEl.leaveToProps || (innerEl.leaveToProps = {});\r\n }\r\n var tmpDuringScope = {};\r\n var customDuringAPI = {\r\n setTransform: function (key, val) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\r\n }\r\n tmpDuringScope.el[key] = val;\r\n return this;\r\n },\r\n getTransform: function (key) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\r\n }\r\n return tmpDuringScope.el[key];\r\n },\r\n setShape: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape\r\n || (tmpDuringScope.el.shape = {});\r\n shape[key] = val;\r\n tmpDuringScope.isShapeDirty = true;\r\n return this;\r\n },\r\n getShape: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape;\r\n if (shape) {\r\n return shape[key];\r\n }\r\n },\r\n setStyle: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n if (__DEV__) {\r\n if (eqNaN(val)) {\r\n warn('style.' + key + ' must not be assigned with NaN.');\r\n }\r\n }\r\n style[key] = val;\r\n tmpDuringScope.isStyleDirty = true;\r\n }\r\n return this;\r\n },\r\n getStyle: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n return style[key];\r\n }\r\n },\r\n setExtra: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra\r\n || (tmpDuringScope.el.extra = {});\r\n extra[key] = val;\r\n return this;\r\n },\r\n getExtra: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra;\r\n if (extra) {\r\n return extra[key];\r\n }\r\n }\r\n };\r\n function assertNotReserved(key) {\r\n if (__DEV__) {\r\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\r\n throw new Error('key must not be \"' + key + '\"');\r\n }\r\n }\r\n }\r\n function duringCall() {\r\n var scope = this;\r\n var el = scope.el;\r\n if (!el) {\r\n return;\r\n }\r\n var newstUserDuring = inner$e(el).userDuring;\r\n var scopeUserDuring = scope.userDuring;\r\n if (newstUserDuring !== scopeUserDuring) {\r\n scope.el = scope.userDuring = null;\r\n return;\r\n }\r\n tmpDuringScope.el = el;\r\n tmpDuringScope.isShapeDirty = false;\r\n tmpDuringScope.isStyleDirty = false;\r\n scopeUserDuring(customDuringAPI);\r\n if (tmpDuringScope.isShapeDirty && el.dirtyShape) {\r\n el.dirtyShape();\r\n }\r\n if (tmpDuringScope.isStyleDirty && el.dirtyStyle) {\r\n el.dirtyStyle();\r\n }\r\n }\r\n function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo, isRoot, isTextContent) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\r\n if (elDisplayable) {\r\n var stateObj = elDisplayable.ensureState(state);\r\n if (styleOpt === false) {\r\n var existingEmphasisState = elDisplayable.getState(state);\r\n if (existingEmphasisState) {\r\n existingEmphasisState.style = null;\r\n }\r\n }\r\n else {\r\n stateObj.style = styleOpt || null;\r\n }\r\n if (txCfgOpt) {\r\n stateObj.textConfig = txCfgOpt;\r\n }\r\n setDefaultStateProxy(elDisplayable);\r\n }\r\n }\r\n function updateZ$1(el, elOption, seriesModel, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n var elDisplayable = el;\r\n var currentZ = seriesModel.currentZ;\r\n var currentZLevel = seriesModel.currentZLevel;\r\n elDisplayable.z = currentZ;\r\n elDisplayable.zlevel = currentZLevel;\r\n var optZ2 = elOption.z2;\r\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\r\n for (var i = 0; i < STATES.length; i++) {\r\n updateZForEachState(elDisplayable, elOption, STATES[i]);\r\n }\r\n }\r\n function updateZForEachState(elDisplayable, elOption, state) {\r\n var isNormal = state === NORMAL;\r\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\r\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\r\n var stateObj;\r\n if (optZ2 != null) {\r\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\r\n stateObj.z2 = optZ2 || 0;\r\n }\r\n }\r\n function setLagecyTransformProp(elOption, targetProps, legacyName, fromTransformable) {\r\n var legacyArr = elOption[legacyName];\r\n var xyName = LEGACY_TRANSFORM_PROPS[legacyName];\r\n if (legacyArr) {\r\n if (fromTransformable) {\r\n targetProps[xyName[0]] = fromTransformable[xyName[0]];\r\n targetProps[xyName[1]] = fromTransformable[xyName[1]];\r\n }\r\n else {\r\n targetProps[xyName[0]] = legacyArr[0];\r\n targetProps[xyName[1]] = legacyArr[1];\r\n }\r\n }\r\n }\r\n function setTransformProp(elOption, allProps, name, fromTransformable) {\r\n if (elOption[name] != null) {\r\n allProps[name] = fromTransformable ? fromTransformable[name] : elOption[name];\r\n }\r\n }\r\n function setTransformPropToTransitionFrom(transitionFrom, name, fromTransformable) {\r\n if (fromTransformable) {\r\n transitionFrom[name] = fromTransformable[name];\r\n }\r\n }\r\n function makeRenderItem(customSeries, data, ecModel, api) {\r\n var renderItem = customSeries.get('renderItem');\r\n var coordSys = customSeries.coordinateSystem;\r\n var prepareResult = {};\r\n if (coordSys) {\r\n if (__DEV__) {\r\n assert(renderItem, 'series.render is required.');\r\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\r\n }\r\n prepareResult = coordSys.prepareCustoms\r\n ? coordSys.prepareCustoms(coordSys)\r\n : prepareCustoms[coordSys.type](coordSys);\r\n }\r\n var userAPI = defaults({\r\n getWidth: api.getWidth,\r\n getHeight: api.getHeight,\r\n getZr: api.getZr,\r\n getDevicePixelRatio: api.getDevicePixelRatio,\r\n value: value,\r\n style: style,\r\n ordinalRawValue: ordinalRawValue,\r\n styleEmphasis: styleEmphasis,\r\n visual: visual,\r\n barLayout: barLayout,\r\n currentSeriesIndices: currentSeriesIndices,\r\n font: font\r\n }, prepareResult.api || {});\r\n var userParams = {\r\n context: {},\r\n seriesId: customSeries.id,\r\n seriesName: customSeries.name,\r\n seriesIndex: customSeries.seriesIndex,\r\n coordSys: prepareResult.coordSys,\r\n dataInsideLength: data.count(),\r\n encode: wrapEncodeDef(customSeries.getData())\r\n };\r\n var currDataIndexInside;\r\n var currItemModel;\r\n var currItemStyleModels = {};\r\n var currLabelModels = {};\r\n var seriesItemStyleModels = {};\r\n var seriesLabelModels = {};\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n seriesItemStyleModels[stateName] = customSeries\r\n .getModel(PATH_ITEM_STYLE[stateName]);\r\n seriesLabelModels[stateName] = customSeries\r\n .getModel(PATH_LABEL[stateName]);\r\n }\r\n function getItemModel(dataIndexInside) {\r\n return dataIndexInside === currDataIndexInside\r\n ? (currItemModel || (currItemModel = data.getItemModel(dataIndexInside)))\r\n : data.getItemModel(dataIndexInside);\r\n }\r\n function getItemStyleModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesItemStyleModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\r\n }\r\n function getLabelModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesLabelModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\r\n }\r\n return function (dataIndexInside, payload) {\r\n currDataIndexInside = dataIndexInside;\r\n currItemModel = null;\r\n currItemStyleModels = {};\r\n currLabelModels = {};\r\n return renderItem && renderItem(defaults({\r\n dataIndexInside: dataIndexInside,\r\n dataIndex: data.getRawIndex(dataIndexInside),\r\n actionType: payload ? payload.type : null\r\n }, userParams), userAPI);\r\n };\r\n function value(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n return data.get(data.getDimension(dim || 0), dataIndexInside);\r\n }\r\n function ordinalRawValue(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var dimInfo = data.getDimensionInfo(dim || 0);\r\n if (!dimInfo) {\r\n return;\r\n }\r\n var val = data.get(dimInfo.name, dataIndexInside);\r\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.categories[val]\r\n : val;\r\n }\r\n function style(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.style', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var style = data.getItemVisual(dataIndexInside, 'style');\r\n var visualColor = style && style.fill;\r\n var opacity = style && style.opacity;\r\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\r\n visualColor != null && (itemStyle.fill = visualColor);\r\n opacity != null && (itemStyle.opacity = opacity);\r\n var opt = { inheritColor: isString(visualColor) ? visualColor : '#000' };\r\n var labelModel = getLabelModel(dataIndexInside, NORMAL);\r\n var textStyle = createTextStyle(labelModel, null, opt, false, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, opt, false);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function styleEmphasis(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\r\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\r\n var textStyle = createTextStyle(labelModel, null, null, true, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, null, true);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function applyUserPropsAfter(itemStyle, extra) {\r\n for (var key in extra) {\r\n if (hasOwn(extra, key)) {\r\n itemStyle[key] = extra[key];\r\n }\r\n }\r\n }\r\n function preFetchFromExtra(extra, itemStyle) {\r\n if (extra) {\r\n extra.textFill && (itemStyle.textFill = extra.textFill);\r\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\r\n }\r\n }\r\n function visual(visualType, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\r\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\r\n return style_1\r\n ? style_1[STYLE_VISUAL_TYPE[visualType]]\r\n : null;\r\n }\r\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\r\n return data.getItemVisual(dataIndexInside, visualType);\r\n }\r\n }\r\n function barLayout(opt) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var baseAxis = coordSys.getBaseAxis();\r\n return getLayoutOnAxis(defaults({ axis: baseAxis }, opt));\r\n }\r\n }\r\n function currentSeriesIndices() {\r\n return ecModel.getCurrentSeriesIndices();\r\n }\r\n function font(opt) {\r\n return getFont(opt, ecModel);\r\n }\r\n }\r\n function wrapEncodeDef(data) {\r\n var encodeDef = {};\r\n each(data.dimensions, function (dimName, dataDimIndex) {\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isExtraCoord) {\r\n var coordDim = dimInfo.coordDim;\r\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\r\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\r\n }\r\n });\r\n return encodeDef;\r\n }\r\n function createOrUpdateItem(api, el, dataIndex, elOption, seriesModel, group, data, morphPreparation) {\r\n if (!elOption) {\r\n removeElementDirectly(el, group);\r\n return;\r\n }\r\n el = doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, true, morphPreparation);\r\n el && data.setItemGraphicEl(dataIndex, el);\r\n enableHoverEmphasis(el, elOption.focus, elOption.blurScope);\r\n return el;\r\n }\r\n function doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, isRoot, morphPreparation) {\r\n if (__DEV__) {\r\n assert(elOption, 'should not have an null/undefined element setting');\r\n }\r\n var toBeReplacedIdx = -1;\r\n if (el && (doesElNeedRecreate(el, elOption))) {\r\n toBeReplacedIdx = group.childrenRef().indexOf(el);\r\n el = null;\r\n }\r\n var elIsNewCreated = !el;\r\n if (!el) {\r\n el = createEl(elOption);\r\n }\r\n else {\r\n el.clearStates();\r\n }\r\n var canMorph = inner$e(el).canMorph = elOption.morph && isPath$1(el);\r\n var thisElIsMorphTo = canMorph && morphPreparation && morphPreparation.hasFrom();\r\n var isInit = elIsNewCreated && !thisElIsMorphTo;\r\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt =\r\n attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt =\r\n attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt =\r\n attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\r\n attachedTxInfoTmp.isLegacy = false;\r\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\r\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\r\n var pendingAllPropsFinal = updateElNormal(api, el, thisElIsMorphTo, dataIndex, elOption, elOption.style, attachedTxInfoTmp, seriesModel, isInit, false);\r\n if (thisElIsMorphTo) {\r\n morphPreparation.addTo(el, elOption, dataIndex, pendingAllPropsFinal);\r\n }\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var otherStateOpt = retrieveStateOption(elOption, stateName);\r\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\r\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\r\n }\r\n }\r\n updateZ$1(el, elOption, seriesModel);\r\n if (elOption.type === 'group') {\r\n mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation);\r\n }\r\n if (toBeReplacedIdx >= 0) {\r\n group.replaceAt(el, toBeReplacedIdx);\r\n }\r\n else {\r\n group.add(el);\r\n }\r\n return el;\r\n }\r\n function doesElNeedRecreate(el, elOption) {\r\n var elInner = inner$e(el);\r\n var elOptionType = elOption.type;\r\n var elOptionShape = elOption.shape;\r\n var elOptionStyle = elOption.style;\r\n return ((elOptionType != null\r\n && elOptionType !== elInner.customGraphicType)\r\n || (elOptionType === 'path'\r\n && hasOwnPathData(elOptionShape)\r\n && getPathData(elOptionShape) !== elInner.customPathData)\r\n || (elOptionType === 'image'\r\n && hasOwn(elOptionStyle, 'image')\r\n && elOptionStyle.image !== elInner.customImagePath));\r\n }\r\n function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\r\n var clipPathOpt = elOption.clipPath;\r\n if (clipPathOpt === false) {\r\n if (el && el.getClipPath()) {\r\n el.removeClipPath();\r\n }\r\n }\r\n else if (clipPathOpt) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {\r\n clipPath = null;\r\n }\r\n if (!clipPath) {\r\n clipPath = createEl(clipPathOpt);\r\n if (__DEV__) {\r\n assert(clipPath instanceof Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\r\n }\r\n el.setClipPath(clipPath);\r\n }\r\n updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);\r\n }\r\n }\r\n function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n processTxInfo(elOption, null, attachedTxInfo);\r\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\r\n var txConOptNormal = attachedTxInfo.normal.conOpt;\r\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\r\n var txConOptBlur = attachedTxInfo.blur.conOpt;\r\n var txConOptSelect = attachedTxInfo.select.conOpt;\r\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\r\n var textContent = el.getTextContent();\r\n if (txConOptNormal === false) {\r\n textContent && el.removeTextContent();\r\n }\r\n else {\r\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { type: 'text' };\r\n if (!textContent) {\r\n textContent = createEl(txConOptNormal);\r\n el.setTextContent(textContent);\r\n }\r\n else {\r\n textContent.clearStates();\r\n }\r\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\r\n updateElNormal(null, textContent, null, dataIndex, txConOptNormal, txConStlOptNormal, null, seriesModel, isInit, true);\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\r\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\r\n }\r\n }\r\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\r\n }\r\n }\r\n }\r\n function processTxInfo(elOption, state, attachedTxInfo) {\r\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\r\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\r\n var elType = elOption.type;\r\n var txCfg = stateOpt ? stateOpt.textConfig : null;\r\n var txConOptNormal = elOption.textContent;\r\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\r\n if (styleOpt && (attachedTxInfo.isLegacy\r\n || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\r\n attachedTxInfo.isLegacy = true;\r\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\r\n if (!txCfg && convertResult.textConfig) {\r\n txCfg = convertResult.textConfig;\r\n }\r\n if (!txConOpt && convertResult.textContent) {\r\n txConOpt = convertResult.textContent;\r\n }\r\n }\r\n if (!state && txConOpt) {\r\n var txConOptNormal_1 = txConOpt;\r\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\r\n if (__DEV__) {\r\n txConOptNormal_1.type !== 'text' && assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\r\n }\r\n }\r\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\r\n info.cfg = txCfg;\r\n info.conOpt = txConOpt;\r\n }\r\n function retrieveStateOption(elOption, state) {\r\n return !state ? elOption : elOption ? elOption[state] : null;\r\n }\r\n function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\r\n var style = stateOption && stateOption.style;\r\n if (style == null && state === EMPHASIS && stateOptionNormal) {\r\n style = stateOptionNormal.styleEmphasis;\r\n }\r\n return style;\r\n }\r\n function mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation) {\r\n var newChildren = elOption.children;\r\n var newLen = newChildren ? newChildren.length : 0;\r\n var mergeChildren = elOption.$mergeChildren;\r\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\r\n var notMerge = mergeChildren === false;\r\n if (!newLen && !byName && !notMerge) {\r\n return;\r\n }\r\n if (byName) {\r\n diffGroupChildren({\r\n api: api,\r\n oldChildren: el.children() || [],\r\n newChildren: newChildren || [],\r\n dataIndex: dataIndex,\r\n seriesModel: seriesModel,\r\n group: el,\r\n morphPreparation: morphPreparation\r\n });\r\n return;\r\n }\r\n notMerge && el.removeAll();\r\n var index = 0;\r\n for (; index < newLen; index++) {\r\n newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el, false, morphPreparation);\r\n }\r\n for (var i = el.childCount() - 1; i >= index; i--) {\r\n doRemoveEl(el.childAt(i), seriesModel, el);\r\n }\r\n }\r\n function diffGroupChildren(context) {\r\n (new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context))\r\n .add(processAddUpdate)\r\n .update(processAddUpdate)\r\n .remove(processRemove)\r\n .execute();\r\n }\r\n function getKey(item, idx) {\r\n var name = item && item.name;\r\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\r\n }\r\n function processAddUpdate(newIndex, oldIndex) {\r\n var context = this.context;\r\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\r\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\r\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group, false, context.morphPreparation);\r\n }\r\n function processRemove(oldIndex) {\r\n var context = this.context;\r\n var child = context.oldChildren[oldIndex];\r\n doRemoveEl(child, context.seriesModel, context.group);\r\n }\r\n function doRemoveEl(el, seriesModel, group) {\r\n if (el) {\r\n var leaveToProps = inner$e(el).leaveToProps;\r\n leaveToProps\r\n ? updateProps(el, leaveToProps, seriesModel, {\r\n cb: function () {\r\n group.remove(el);\r\n }\r\n })\r\n : group.remove(el);\r\n }\r\n }\r\n function getPathData(shape) {\r\n return shape && (shape.pathData || shape.d);\r\n }\r\n function hasOwnPathData(shape) {\r\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\r\n }\r\n function isPath$1(el) {\r\n return el && el instanceof Path;\r\n }\r\n function removeElementDirectly(el, group) {\r\n el && group.remove(el);\r\n }\r\n var MorphPreparation = (function () {\r\n function MorphPreparation(seriesModel, transOpt) {\r\n this._fromList = [];\r\n this._toList = [];\r\n this._toElOptionList = [];\r\n this._allPropsFinalList = [];\r\n this._toDataIndices = [];\r\n this._morphConfigList = [];\r\n this._seriesModel = seriesModel;\r\n this._transOpt = transOpt;\r\n }\r\n MorphPreparation.prototype.hasFrom = function () {\r\n return !!this._fromList.length;\r\n };\r\n MorphPreparation.prototype.findAndAddFrom = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n if (inner$e(el).canMorph) {\r\n this._fromList.push(el);\r\n }\r\n if (el.isGroup) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n this.findAndAddFrom(children[i]);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype.addTo = function (path, elOption, dataIndex, allPropsFinal) {\r\n if (path) {\r\n this._toList.push(path);\r\n this._toElOptionList.push(elOption);\r\n this._toDataIndices.push(dataIndex);\r\n this._allPropsFinalList.push(allPropsFinal);\r\n }\r\n };\r\n MorphPreparation.prototype.applyMorphing = function () {\r\n var type = this._type;\r\n var fromList = this._fromList;\r\n var toList = this._toList;\r\n var toListLen = toList.length;\r\n var fromListLen = fromList.length;\r\n if (!fromListLen || !toListLen) {\r\n return;\r\n }\r\n if (type === 'oneToOne') {\r\n for (var toIdx = 0; toIdx < toListLen; toIdx++) {\r\n this._oneToOneForSingleTo(toIdx, toIdx);\r\n }\r\n }\r\n else if (type === 'manyToOne') {\r\n var fromSingleSegLen = Math.max(1, Math.floor(fromListLen / toListLen));\r\n for (var toIdx = 0, fromIdxStart = 0; toIdx < toListLen; toIdx++, fromIdxStart += fromSingleSegLen) {\r\n var fromCount = toIdx + 1 >= toListLen\r\n ? fromListLen - fromIdxStart\r\n : fromSingleSegLen;\r\n this._manyToOneForSingleTo(toIdx, fromIdxStart >= fromListLen ? null : fromIdxStart, fromCount);\r\n }\r\n }\r\n else if (type === 'oneToMany') {\r\n var toSingleSegLen = Math.max(1, Math.floor(toListLen / fromListLen));\r\n for (var toIdxStart = 0, fromIdx = 0; toIdxStart < toListLen; toIdxStart += toSingleSegLen, fromIdx++) {\r\n var toCount = toIdxStart + toSingleSegLen >= toListLen\r\n ? toListLen - toIdxStart\r\n : toSingleSegLen;\r\n this._oneToManyForSingleFrom(toIdxStart, toCount, fromIdx >= fromListLen ? null : fromIdx);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype._oneToOneForSingleTo = function (toIdx, fromIdx) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var toDataIndex = this._toDataIndices[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n var from = this._fromList[fromIdx];\r\n var elAnimationConfig = this._getOrCreateMorphConfig(toDataIndex);\r\n var morphDuration = elAnimationConfig.duration;\r\n if (from && isCombiningPath(from)) {\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphDuration) {\r\n var combineResult = combine([from], to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n }\r\n else {\r\n var morphFrom = (morphDuration\r\n && from\r\n && (from !== to || isInAnyMorphing(from))) ? from : null;\r\n var transFromProps = {};\r\n prepareShapeOrExtraTransitionFrom('shape', to, morphFrom, toElOption, transFromProps, false);\r\n prepareShapeOrExtraTransitionFrom('extra', to, morphFrom, toElOption, transFromProps, false);\r\n prepareTransformTransitionFrom(to, morphFrom, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(to, morphFrom, toElOption, toElOption.style, transFromProps, false);\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphFrom) {\r\n morphPath(morphFrom, to, elAnimationConfig);\r\n }\r\n applyTransitionFrom(to, toDataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._manyToOneForSingleTo = function (toIdx, fromIdxStart, fromCount) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdx]);\r\n if (elAnimationConfig.duration && fromIdxStart != null) {\r\n var combineFromList = [];\r\n for (var fromIdx = fromIdxStart; fromIdx < fromCount; fromIdx++) {\r\n combineFromList.push(this._fromList[fromIdx]);\r\n }\r\n var combineResult = combine(combineFromList, to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n };\r\n MorphPreparation.prototype._oneToManyForSingleFrom = function (toIdxStart, toCount, fromIdx) {\r\n var from = fromIdx == null ? null : this._fromList[fromIdx];\r\n var toList = this._toList;\r\n var separateToList = [];\r\n for (var toIdx = toIdxStart; toIdx < toCount; toIdx++) {\r\n var to = toList[toIdx];\r\n applyPropsFinal(to, this._allPropsFinalList[toIdx], this._toElOptionList[toIdx].style);\r\n separateToList.push(to);\r\n }\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdxStart]);\r\n if (elAnimationConfig.duration && from) {\r\n var separateResult = separate(from, separateToList, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(separateResult, toIdxStart, toCount);\r\n }\r\n };\r\n MorphPreparation.prototype._processResultIndividuals = function (combineSeparateResult, toIdxStart, toCount) {\r\n var isSeparate = toCount != null;\r\n for (var i = 0; i < combineSeparateResult.count; i++) {\r\n var fromIndividual = combineSeparateResult.fromIndividuals[i];\r\n var toIndividual = combineSeparateResult.toIndividuals[i];\r\n var toIdx = toIdxStart + (isSeparate ? i : 0);\r\n var toElOption = this._toElOptionList[toIdx];\r\n var dataIndex = this._toDataIndices[toIdx];\r\n var transFromProps = {};\r\n prepareTransformTransitionFrom(toIndividual, fromIndividual, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(toIndividual, fromIndividual, toElOption, toElOption.style, transFromProps, false);\r\n applyTransitionFrom(toIndividual, dataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._getOrCreateMorphConfig = function (dataIndex) {\r\n var morphConfigList = this._morphConfigList;\r\n var config = morphConfigList[dataIndex];\r\n if (config) {\r\n return config;\r\n }\r\n var duration;\r\n var easing;\r\n var delay;\r\n var seriesModel = this._seriesModel;\r\n var transOpt = this._transOpt;\r\n if (seriesModel.isAnimationEnabled()) {\r\n var animationPayload = void 0;\r\n if (seriesModel && seriesModel.ecModel) {\r\n var updatePayload = seriesModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n easing = animationPayload.easing || 'cubicOut';\r\n delay = animationPayload.delay || 0;\r\n }\r\n else {\r\n easing = seriesModel.get('animationEasingUpdate');\r\n var delayOption = seriesModel.get('animationDelayUpdate');\r\n delay = isFunction(delayOption) ? delayOption(dataIndex) : delayOption;\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n duration = isFunction(durationOption) ? durationOption(dataIndex) : durationOption;\r\n }\r\n }\r\n config = {\r\n duration: duration || 0,\r\n delay: delay,\r\n easing: easing,\r\n dividingMethod: transOpt ? transOpt.dividingMethod : null\r\n };\r\n morphConfigList[dataIndex] = config;\r\n return config;\r\n };\r\n MorphPreparation.prototype.reset = function (type) {\r\n this._type = type;\r\n this._fromList.length =\r\n this._toList.length =\r\n this._toElOptionList.length =\r\n this._allPropsFinalList.length =\r\n this._toDataIndices.length = 0;\r\n };\r\n return MorphPreparation;\r\n }());\r\n function copyPropsWhenDivided(srcPath, tarPath, willClone) {\r\n tarPath.style = willClone\r\n ? clone(srcPath.style)\r\n : srcPath.style;\r\n tarPath.zlevel = srcPath.zlevel;\r\n tarPath.z = srcPath.z;\r\n tarPath.z2 = srcPath.z2;\r\n }\n\n function getSeriesStackId$1(seriesModel) {\r\n return seriesModel.get('stack')\r\n || '__ec_stack_' + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey$1(polar, axis) {\r\n return axis.dim + polar.model.componentIndex;\r\n }\r\n function barLayoutPolar(seriesType, ecModel, api) {\r\n var lastStackCoords = {};\r\n var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\r\n return !ecModel.isSeriesFiltered(seriesModel)\r\n && seriesModel.coordinateSystem\r\n && seriesModel.coordinateSystem.type === 'polar';\r\n }));\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (seriesModel.coordinateSystem.type !== 'polar') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = polar.getOtherAxis(baseAxis);\r\n var cx = seriesModel.coordinateSystem.cx;\r\n var cy = seriesModel.coordinateSystem.cy;\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var clampLayout = baseAxis.dim !== 'radius'\r\n || !seriesModel.get('roundCap', true);\r\n var valueAxisStart = valueAxis.dataToCoord(0);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var r0 = void 0;\r\n var r = void 0;\r\n var startAngle = void 0;\r\n var endAngle = void 0;\r\n if (valueAxis.dim === 'radius') {\r\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\r\n var angle = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(radiusSpan) < barMinHeight) {\r\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n r0 = baseCoord;\r\n r = baseCoord + radiusSpan;\r\n startAngle = angle - columnOffset;\r\n endAngle = startAngle - columnWidth;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\r\n }\r\n else {\r\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\r\n var radius = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(angleSpan) < barMinAngle) {\r\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\r\n }\r\n r0 = radius + columnOffset;\r\n r = r0 + columnWidth;\r\n startAngle = baseCoord;\r\n endAngle = baseCoord + angleSpan;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\r\n }\r\n data.setItemLayout(idx, {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: -startAngle * Math.PI / 180,\r\n endAngle: -endAngle * Math.PI / 180\r\n });\r\n }\r\n });\r\n }\r\n function calRadialBar(barSeries) {\r\n var columnsMap = {};\r\n each(barSeries, function (seriesModel, idx) {\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: '20%',\r\n gap: '30%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n if (barWidth && !stacks[stackId].width) {\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n stacks[stackId].width = barWidth;\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGap = parsePercent$2(columnsOnAxis.categoryGap, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column, stack) {\r\n var maxWidth = column.maxWidth;\r\n if (maxWidth && maxWidth < autoWidth) {\r\n maxWidth = Math.min(maxWidth, remainedWidth);\r\n if (column.width) {\r\n maxWidth = Math.min(maxWidth, column.width);\r\n }\r\n remainedWidth -= maxWidth;\r\n column.width = maxWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\n\n var PolarModel = (function (_super) {\r\n __extends(PolarModel, _super);\r\n function PolarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PolarModel.type;\r\n return _this;\r\n }\r\n PolarModel.prototype.findAxisModel = function (axisType) {\r\n var foundAxisModel;\r\n var ecModel = this.ecModel;\r\n ecModel.eachComponent(axisType, function (axisModel) {\r\n if (axisModel.getCoordSysModel() === this) {\r\n foundAxisModel = axisModel;\r\n }\r\n }, this);\r\n return foundAxisModel;\r\n };\r\n PolarModel.type = 'polar';\r\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\r\n PolarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '80%'\r\n };\r\n return PolarModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(PolarModel);\n\n var PolarAxisModel = (function (_super) {\r\n __extends(PolarAxisModel, _super);\r\n function PolarAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n };\r\n PolarAxisModel.type = 'polarAxis';\r\n return PolarAxisModel;\r\n }(ComponentModel));\r\n mixin(PolarAxisModel, AxisModelCommonMixin);\r\n var AngleAxisModel = (function (_super) {\r\n __extends(AngleAxisModel, _super);\r\n function AngleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisModel.type;\r\n return _this;\r\n }\r\n AngleAxisModel.type = 'angleAxis';\r\n return AngleAxisModel;\r\n }(PolarAxisModel));\r\n var RadiusAxisModel = (function (_super) {\r\n __extends(RadiusAxisModel, _super);\r\n function RadiusAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisModel.type;\r\n return _this;\r\n }\r\n RadiusAxisModel.type = 'radiusAxis';\r\n return RadiusAxisModel;\r\n }(PolarAxisModel));\r\n var angleAxisExtraOption = {\r\n startAngle: 90,\r\n clockwise: true,\r\n splitNumber: 12,\r\n axisLabel: {\r\n rotate: 0\r\n }\r\n };\r\n var radiusAxisExtraOption = {\r\n splitNumber: 5\r\n };\r\n axisModelCreator('angle', AngleAxisModel, angleAxisExtraOption);\r\n axisModelCreator('radius', RadiusAxisModel, radiusAxisExtraOption);\n\n var RadiusAxis = (function (_super) {\r\n __extends(RadiusAxis, _super);\r\n function RadiusAxis(scale, radiusExtent) {\r\n return _super.call(this, 'radius', scale, radiusExtent) || this;\r\n }\r\n RadiusAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n return RadiusAxis;\r\n }(Axis));\r\n RadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\r\n RadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\n\n var inner$f = makeInner();\r\n var AngleAxis = (function (_super) {\r\n __extends(AngleAxis, _super);\r\n function AngleAxis(scale, angleExtent) {\r\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\r\n }\r\n AngleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n AngleAxis.prototype.calculateCategoryInterval = function () {\r\n var axis = this;\r\n var labelModel = axis.getLabelModel();\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitH = Math.abs(unitSpan);\r\n var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\r\n var maxH = Math.max(rect.height, 7);\r\n var dh = maxH / unitH;\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(dh));\r\n var cache = inner$f(axis.model);\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n }\r\n return interval;\r\n };\r\n return AngleAxis;\r\n }(Axis));\r\n AngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\r\n AngleAxis.prototype.angleToData = Axis.prototype.coordToData;\n\n var Polar = (function () {\r\n function Polar(name) {\r\n this.dimensions = ['radius', 'angle'];\r\n this.type = 'polar';\r\n this.cx = 0;\r\n this.cy = 0;\r\n this._radiusAxis = new RadiusAxis();\r\n this._angleAxis = new AngleAxis();\r\n this.axisPointerEnabled = true;\r\n this.name = name || '';\r\n this._radiusAxis.polar = this._angleAxis.polar = this;\r\n }\r\n Polar.prototype.containPoint = function (point) {\r\n var coord = this.pointToCoord(point);\r\n return this._radiusAxis.contain(coord[0])\r\n && this._angleAxis.contain(coord[1]);\r\n };\r\n Polar.prototype.containData = function (data) {\r\n return this._radiusAxis.containData(data[0])\r\n && this._angleAxis.containData(data[1]);\r\n };\r\n Polar.prototype.getAxis = function (dim) {\r\n var key = ('_' + dim + 'Axis');\r\n return this[key];\r\n };\r\n Polar.prototype.getAxes = function () {\r\n return [this._radiusAxis, this._angleAxis];\r\n };\r\n Polar.prototype.getAxesByScale = function (scaleType) {\r\n var axes = [];\r\n var angleAxis = this._angleAxis;\r\n var radiusAxis = this._radiusAxis;\r\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\r\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\r\n return axes;\r\n };\r\n Polar.prototype.getAngleAxis = function () {\r\n return this._angleAxis;\r\n };\r\n Polar.prototype.getRadiusAxis = function () {\r\n return this._radiusAxis;\r\n };\r\n Polar.prototype.getOtherAxis = function (axis) {\r\n var angleAxis = this._angleAxis;\r\n return axis === angleAxis ? this._radiusAxis : angleAxis;\r\n };\r\n Polar.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAngleAxis();\r\n };\r\n Polar.prototype.getTooltipAxes = function (dim) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? this.getAxis(dim) : this.getBaseAxis();\r\n return {\r\n baseAxes: [baseAxis],\r\n otherAxes: [this.getOtherAxis(baseAxis)]\r\n };\r\n };\r\n Polar.prototype.dataToPoint = function (data, clamp) {\r\n return this.coordToPoint([\r\n this._radiusAxis.dataToRadius(data[0], clamp),\r\n this._angleAxis.dataToAngle(data[1], clamp)\r\n ]);\r\n };\r\n Polar.prototype.pointToData = function (point, clamp) {\r\n var coord = this.pointToCoord(point);\r\n return [\r\n this._radiusAxis.radiusToData(coord[0], clamp),\r\n this._angleAxis.angleToData(coord[1], clamp)\r\n ];\r\n };\r\n Polar.prototype.pointToCoord = function (point) {\r\n var dx = point[0] - this.cx;\r\n var dy = point[1] - this.cy;\r\n var angleAxis = this.getAngleAxis();\r\n var extent = angleAxis.getExtent();\r\n var minAngle = Math.min(extent[0], extent[1]);\r\n var maxAngle = Math.max(extent[0], extent[1]);\r\n angleAxis.inverse\r\n ? (minAngle = maxAngle - 360)\r\n : (maxAngle = minAngle + 360);\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx) / Math.PI * 180;\r\n var dir = radian < minAngle ? 1 : -1;\r\n while (radian < minAngle || radian > maxAngle) {\r\n radian += dir * 360;\r\n }\r\n return [radius, radian];\r\n };\r\n Polar.prototype.coordToPoint = function (coord) {\r\n var radius = coord[0];\r\n var radian = coord[1] / 180 * Math.PI;\r\n var x = Math.cos(radian) * radius + this.cx;\r\n var y = -Math.sin(radian) * radius + this.cy;\r\n return [x, y];\r\n };\r\n Polar.prototype.getArea = function () {\r\n var angleAxis = this.getAngleAxis();\r\n var radiusAxis = this.getRadiusAxis();\r\n var radiusExtent = radiusAxis.getExtent().slice();\r\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\r\n var angleExtent = angleAxis.getExtent();\r\n var RADIAN = Math.PI / 180;\r\n return {\r\n cx: this.cx,\r\n cy: this.cy,\r\n r0: radiusExtent[0],\r\n r: radiusExtent[1],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse,\r\n contain: function (x, y) {\r\n var dx = x - this.cx;\r\n var dy = y - this.cy;\r\n var d2 = dx * dx + dy * dy;\r\n var r = this.r;\r\n var r0 = this.r0;\r\n return d2 <= r * r && d2 >= r0 * r0;\r\n }\r\n };\r\n };\r\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Polar;\r\n }());\r\n function getCoordSys$3(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var polarModel = finder.polarModel;\r\n return polarModel && polarModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n }\n\n function resizePolar(polar, polarModel, api) {\r\n var center = polarModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n polar.cx = parsePercent$2(center[0], width);\r\n polar.cy = parsePercent$2(center[1], height);\r\n var radiusAxis = polar.getRadiusAxis();\r\n var size = Math.min(width, height) / 2;\r\n var radius = polarModel.get('radius');\r\n if (radius == null) {\r\n radius = [0, '100%'];\r\n }\r\n else if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n var parsedRadius = [\r\n parsePercent$2(radius[0], size),\r\n parsePercent$2(radius[1], size)\r\n ];\r\n radiusAxis.inverse\r\n ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0])\r\n : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\r\n }\r\n function updatePolarScale(ecModel, api) {\r\n var polar = this;\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxis = polar.getRadiusAxis();\r\n angleAxis.scale.setExtent(Infinity, -Infinity);\r\n radiusAxis.scale.setExtent(Infinity, -Infinity);\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === polar) {\r\n var data_1 = seriesModel.getData();\r\n each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\r\n radiusAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\r\n angleAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n }\r\n });\r\n niceScaleExtent(angleAxis.scale, angleAxis.model);\r\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\r\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\r\n var extent = angleAxis.getExtent();\r\n var diff = 360 / angleAxis.scale.count();\r\n angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);\r\n angleAxis.setExtent(extent[0], extent[1]);\r\n }\r\n }\r\n function isAngleAxisModel(axisModel) {\r\n return axisModel.mainType === 'angleAxis';\r\n }\r\n function setAxis(axis, axisModel) {\r\n axis.type = axisModel.get('type');\r\n axis.scale = createScaleByModel(axisModel);\r\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\r\n axis.inverse = axisModel.get('inverse');\r\n if (isAngleAxisModel(axisModel)) {\r\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\r\n var startAngle = axisModel.get('startAngle');\r\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\r\n }\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n }\r\n var polarCreator = {\r\n dimensions: Polar.prototype.dimensions,\r\n create: function (ecModel, api) {\r\n var polarList = [];\r\n ecModel.eachComponent('polar', function (polarModel, idx) {\r\n var polar = new Polar(idx + '');\r\n polar.update = updatePolarScale;\r\n var radiusAxis = polar.getRadiusAxis();\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n setAxis(radiusAxis, radiusAxisModel);\r\n setAxis(angleAxis, angleAxisModel);\r\n resizePolar(polar, polarModel, api);\r\n polarList.push(polar);\r\n polarModel.coordinateSystem = polar;\r\n polar.model = polarModel;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'polar') {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!polarModel) {\r\n throw new Error('Polar \"' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\r\n }\r\n }\r\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\r\n }\r\n });\r\n return polarList;\r\n }\r\n };\r\n CoordinateSystemManager.register('polar', polarCreator);\n\n var elementList$1 = [\r\n 'axisLine',\r\n 'axisLabel',\r\n 'axisTick',\r\n 'minorTick',\r\n 'splitLine',\r\n 'minorSplitLine',\r\n 'splitArea'\r\n ];\r\n function getAxisLineShape(polar, rExtent, angle) {\r\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\r\n var start = polar.coordToPoint([rExtent[0], angle]);\r\n var end = polar.coordToPoint([rExtent[1], angle]);\r\n return {\r\n x1: start[0],\r\n y1: start[1],\r\n x2: end[0],\r\n y2: end[1]\r\n };\r\n }\r\n function getRadiusIdx(polar) {\r\n var radiusAxis = polar.getRadiusAxis();\r\n return radiusAxis.inverse ? 0 : 1;\r\n }\r\n function fixAngleOverlap(list) {\r\n var firstItem = list[0];\r\n var lastItem = list[list.length - 1];\r\n if (firstItem\r\n && lastItem\r\n && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\r\n list.pop();\r\n }\r\n }\r\n var AngleAxisView = (function (_super) {\r\n __extends(AngleAxisView, _super);\r\n function AngleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!angleAxisModel.get('show')) {\r\n return;\r\n }\r\n var angleAxis = angleAxisModel.axis;\r\n var polar = angleAxis.polar;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var ticksAngles = angleAxis.getTicksCoords();\r\n var minorTickAngles = angleAxis.getMinorTicksCoords();\r\n var labels = map(angleAxis.getViewLabels(), function (labelItem) {\r\n labelItem = clone(labelItem);\r\n labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);\r\n return labelItem;\r\n });\r\n fixAngleOverlap(labels);\r\n fixAngleOverlap(ticksAngles);\r\n each(elementList$1, function (name) {\r\n if (angleAxisModel.get([name, 'show'])\r\n && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\r\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\r\n }\r\n }, this);\r\n };\r\n AngleAxisView.type = 'angleAxis';\r\n return AngleAxisView;\r\n }(AxisView));\r\n var angelAxisElementsBuilders = {\r\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\r\n var rId = getRadiusIdx(polar);\r\n var r0Id = rId ? 0 : 1;\r\n var shape;\r\n if (radiusExtent[r0Id] === 0) {\r\n shape = new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n else {\r\n shape = new Ring({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n r0: radiusExtent[r0Id]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n shape.style.fill = null;\r\n group.add(shape);\r\n },\r\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = map(ticksAngles, function (tickAngleItem) {\r\n return new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\r\n });\r\n });\r\n group.add(mergePath$1(lines, {\r\n style: defaults(tickModel.getModel('lineStyle').getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n })\r\n }));\r\n },\r\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var minorTickModel = angleAxisModel.getModel('minorTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }))\r\n }));\r\n },\r\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\r\n var rawCategoryData = angleAxisModel.getCategories(true);\r\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\r\n var labelMargin = commonLabelModel.get('margin');\r\n var triggerEvent = angleAxisModel.get('triggerEvent');\r\n each(labels, function (labelItem, idx) {\r\n var labelModel = commonLabelModel;\r\n var tickValue = labelItem.tickValue;\r\n var r = radiusExtent[getRadiusIdx(polar)];\r\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3\r\n ? 'center' : (p[0] > cx ? 'left' : 'right');\r\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3\r\n ? 'middle' : (p[1] > cy ? 'top' : 'bottom');\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\r\n }\r\n }\r\n var textEl = new ZRText({\r\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\r\n style: createTextStyle(labelModel, {\r\n x: p[0],\r\n y: p[1],\r\n fill: labelModel.getTextColor()\r\n || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\r\n text: labelItem.formattedLabel,\r\n align: labelTextAlign,\r\n verticalAlign: labelTextVerticalAlign\r\n })\r\n });\r\n group.add(textEl);\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = labelItem.rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n }, this);\r\n },\r\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var splitLineModel = angleAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksAngles.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: lineStyleModel.getLineStyle(),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n },\r\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!ticksAngles.length) {\r\n return;\r\n }\r\n var splitAreaModel = angleAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var RADIAN = Math.PI / 180;\r\n var prevAngle = -ticksAngles[0].coord * RADIAN;\r\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\r\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\r\n var clockwise = angleAxisModel.get('clockwise');\r\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\r\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: r0,\r\n r: r1,\r\n startAngle: prevAngle,\r\n endAngle: -coord * RADIAN,\r\n clockwise: clockwise\r\n },\r\n silent: true\r\n }));\r\n prevAngle = -coord * RADIAN;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n };\r\n ComponentView.registerClass(AngleAxisView);\n\n var axisBuilderAttrs$3 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs$2 = [\r\n 'splitLine', 'splitArea', 'minorSplitLine'\r\n ];\r\n var RadiusAxisView = (function (_super) {\r\n __extends(RadiusAxisView, _super);\r\n function RadiusAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!radiusAxisModel.get('show')) {\r\n return;\r\n }\r\n var oldAxisGroup = this._axisGroup;\r\n var newAxisGroup = this._axisGroup = new Group();\r\n this.group.add(newAxisGroup);\r\n var radiusAxis = radiusAxisModel.axis;\r\n var polar = radiusAxis.polar;\r\n var angleAxis = polar.getAngleAxis();\r\n var ticksCoords = radiusAxis.getTicksCoords();\r\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\r\n var axisAngle = angleAxis.getExtent()[0];\r\n var radiusExtent = radiusAxis.getExtent();\r\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\r\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\r\n each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder);\r\n newAxisGroup.add(axisBuilder.getGroup());\r\n groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\r\n each(selfBuilderAttrs$2, function (name) {\r\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\r\n axisElementBuilders$2[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\r\n }\r\n }, this);\r\n };\r\n RadiusAxisView.type = 'radiusAxis';\r\n return RadiusAxisView;\r\n }(AxisView));\r\n var axisElementBuilders$2 = {\r\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n var splitLineModel = radiusAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: ticksCoords[i].coord\r\n }\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length],\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n lines.push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: minorTicksCoords[i][k].coord\r\n }\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults({\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n },\r\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var prevRadius = ticksCoords[0].coord;\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: prevRadius,\r\n r: ticksCoords[i].coord,\r\n startAngle: 0,\r\n endAngle: Math.PI * 2\r\n },\r\n silent: true\r\n }));\r\n prevRadius = ticksCoords[i].coord;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n };\r\n function layoutAxis(polar, radiusAxisModel, axisAngle) {\r\n return {\r\n position: [polar.cx, polar.cy],\r\n rotation: axisAngle / 180 * Math.PI,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1,\r\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\r\n z2: 1\r\n };\r\n }\r\n AxisView.registerClass(RadiusAxisView);\n\n var PolarAxisPointer = (function (_super) {\r\n __extends(PolarAxisPointer, _super);\r\n function PolarAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n if (axis.dim === 'angle') {\r\n this.animationThreshold = Math.PI / 18;\r\n }\r\n var polar = axis.polar;\r\n var otherAxis = polar.getOtherAxis(axis);\r\n var otherExtent = otherAxis.getExtent();\r\n var coordValue = axis.dataToCoord(value);\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, polar, coordValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var labelMargin = axisPointerModel.get(['label', 'margin']);\r\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\r\n };\r\n return PolarAxisPointer;\r\n }(BaseAxisPointer));\r\n function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\r\n var axis = axisModel.axis;\r\n var coord = axis.dataToCoord(value);\r\n var axisAngle = polar.getAngleAxis().getExtent()[0];\r\n axisAngle = axisAngle / 180 * Math.PI;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var position;\r\n var align;\r\n var verticalAlign;\r\n if (axis.dim === 'radius') {\r\n var transform = create$1();\r\n rotate(transform, transform, axisAngle);\r\n translate(transform, transform, [polar.cx, polar.cy]);\r\n position = applyTransform$1([coord, -labelMargin], transform);\r\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\r\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\r\n align = labelLayout.textAlign;\r\n verticalAlign = labelLayout.textVerticalAlign;\r\n }\r\n else {\r\n var r = radiusExtent[1];\r\n position = polar.coordToPoint([r + labelMargin, coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n align = Math.abs(position[0] - cx) / r < 0.3\r\n ? 'center' : (position[0] > cx ? 'left' : 'right');\r\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3\r\n ? 'middle' : (position[1] > cy ? 'top' : 'bottom');\r\n }\r\n return {\r\n position: position,\r\n align: align,\r\n verticalAlign: verticalAlign\r\n };\r\n }\r\n var pointerShapeBuilder$2 = {\r\n line: function (axis, polar, coordValue, otherExtent) {\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Line',\r\n shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\r\n }\r\n : {\r\n type: 'Circle',\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: coordValue\r\n }\r\n };\r\n },\r\n shadow: function (axis, polar, coordValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var radian = Math.PI / 180;\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\r\n }\r\n : {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\r\n };\r\n }\r\n };\r\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n\n registerLayout(curry(barLayoutPolar, 'bar'));\r\n extendComponentView({\r\n type: 'polar'\r\n });\n\n var GeoView = (function (_super) {\r\n __extends(GeoView, _super);\r\n function GeoView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoView.type;\r\n return _this;\r\n }\r\n GeoView.prototype.init = function (ecModel, api) {\r\n var mapDraw = new MapDraw(api);\r\n this._mapDraw = mapDraw;\r\n this.group.add(mapDraw.group);\r\n this._api = api;\r\n };\r\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\r\n var mapDraw = this._mapDraw;\r\n if (geoModel.get('show')) {\r\n mapDraw.draw(geoModel, ecModel, api, this, payload);\r\n }\r\n else {\r\n this._mapDraw.group.removeAll();\r\n }\r\n mapDraw.group.on('click', this._handleRegionClick, this);\r\n mapDraw.group.silent = geoModel.get('silent');\r\n this._model = geoModel;\r\n this.updateSelectStatus(geoModel, ecModel, api);\r\n };\r\n GeoView.prototype._handleRegionClick = function (e) {\r\n var current = e.target;\r\n var eventData;\r\n while ((eventData = getECData(current).eventData) == null) {\r\n current = current.__hostTarget || current.parent;\r\n }\r\n if (eventData) {\r\n this._api.dispatchAction({\r\n type: 'geoToggleSelect',\r\n geoId: this._model.id,\r\n name: eventData.name\r\n });\r\n }\r\n };\r\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\r\n var _this = this;\r\n this._mapDraw.group.traverse(function (node) {\r\n var eventData = getECData(node).eventData;\r\n if (eventData) {\r\n _this._model.isSelected(eventData.name)\r\n ? api.enterSelect(node) : api.leaveSelect(node);\r\n return true;\r\n }\r\n });\r\n };\r\n GeoView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n };\r\n GeoView.type = 'geo';\r\n return GeoView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GeoView);\n\n var GeoModel = (function (_super) {\r\n __extends(GeoModel, _super);\r\n function GeoModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoModel.type;\r\n return _this;\r\n }\r\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n defaultEmphasis(option, 'label', ['show']);\r\n };\r\n GeoModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n var self = this;\r\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap);\r\n var selectedMap = {};\r\n this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) {\r\n var regionName = regionOpt.name;\r\n if (regionName) {\r\n optionModelMap.set(regionName, new Model(regionOpt, self));\r\n if (regionOpt.selected) {\r\n selectedMap[regionName] = true;\r\n }\r\n }\r\n return optionModelMap;\r\n }, createHashMap());\r\n if (!option.selectedMap) {\r\n option.selectedMap = selectedMap;\r\n }\r\n };\r\n GeoModel.prototype.getRegionModel = function (name) {\r\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\r\n };\r\n GeoModel.prototype.getFormattedLabel = function (name, status) {\r\n var regionModel = this.getRegionModel(name);\r\n var formatter = status === 'normal'\r\n ? regionModel.get(['label', 'formatter'])\r\n : regionModel.get(['emphasis', 'label', 'formatter']);\r\n var params = {\r\n name: name\r\n };\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n return formatter.replace('{a}', name != null ? name : '');\r\n }\r\n };\r\n GeoModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GeoModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GeoModel.prototype.select = function (name) {\r\n var option = this.option;\r\n var selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n if (selectedMode !== 'multiple') {\r\n option.selectedMap = null;\r\n }\r\n var selectedMap = option.selectedMap || (option.selectedMap = {});\r\n selectedMap[name] = true;\r\n };\r\n GeoModel.prototype.unSelect = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n if (selectedMap) {\r\n selectedMap[name] = false;\r\n }\r\n };\r\n GeoModel.prototype.toggleSelected = function (name) {\r\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\r\n };\r\n GeoModel.prototype.isSelected = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n return !!(selectedMap && selectedMap[name]);\r\n };\r\n GeoModel.prototype._initSelectedMapFromData = function () {\r\n };\r\n GeoModel.type = 'geo';\r\n GeoModel.layoutMode = 'box';\r\n GeoModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n show: true,\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: null,\r\n silent: false,\r\n map: '',\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n color: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n regions: []\r\n };\r\n return GeoModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GeoModel);\n\n function makeAction(method, actionInfo) {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n var selected = {};\r\n ecModel.eachComponent({ mainType: 'geo', query: payload }, function (geoModel) {\r\n geoModel[method](payload.name);\r\n var geo = geoModel.coordinateSystem;\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n });\r\n });\r\n return {\r\n selected: selected,\r\n name: payload.name\r\n };\r\n });\r\n }\r\n makeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n });\r\n makeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n });\r\n makeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n });\n\n var PROXIMATE_ONE_DAY = 86400000;\r\n var Calendar = (function () {\r\n function Calendar(calendarModel, ecModel, api) {\r\n this.type = 'calendar';\r\n this.dimensions = Calendar.dimensions;\r\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\r\n this._model = calendarModel;\r\n }\r\n Calendar.getDimensionsInfo = function () {\r\n return [{\r\n name: 'time', type: 'time'\r\n }, 'value'];\r\n };\r\n Calendar.prototype.getRangeInfo = function () {\r\n return this._rangeInfo;\r\n };\r\n Calendar.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Calendar.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Calendar.prototype.getCellWidth = function () {\r\n return this._sw;\r\n };\r\n Calendar.prototype.getCellHeight = function () {\r\n return this._sh;\r\n };\r\n Calendar.prototype.getOrient = function () {\r\n return this._orient;\r\n };\r\n Calendar.prototype.getFirstDayOfWeek = function () {\r\n return this._firstDayOfWeek;\r\n };\r\n Calendar.prototype.getDateInfo = function (date) {\r\n date = parseDate(date);\r\n var y = date.getFullYear();\r\n var m = date.getMonth() + 1;\r\n var mStr = m < 10 ? '0' + m : '' + m;\r\n var d = date.getDate();\r\n var dStr = d < 10 ? '0' + d : '' + d;\r\n var day = date.getDay();\r\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\r\n return {\r\n y: y + '',\r\n m: mStr,\r\n d: dStr,\r\n day: day,\r\n time: date.getTime(),\r\n formatedDate: y + '-' + mStr + '-' + dStr,\r\n date: date\r\n };\r\n };\r\n Calendar.prototype.getNextNDay = function (date, n) {\r\n n = n || 0;\r\n if (n === 0) {\r\n return this.getDateInfo(date);\r\n }\r\n date = new Date(this.getDateInfo(date).time);\r\n date.setDate(date.getDate() + n);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.prototype.update = function (ecModel, api) {\r\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\r\n this._orient = this._model.get('orient');\r\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\r\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\r\n var weeks = this._rangeInfo.weeks || 1;\r\n var whNames = ['width', 'height'];\r\n var cellSize = this._model.getCellSize().slice();\r\n var layoutParams = this._model.getBoxLayoutParams();\r\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\r\n each([0, 1], function (idx) {\r\n if (cellSizeSpecified(cellSize, idx)) {\r\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\r\n }\r\n });\r\n var whGlobal = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);\r\n each([0, 1], function (idx) {\r\n if (!cellSizeSpecified(cellSize, idx)) {\r\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\r\n }\r\n });\r\n function cellSizeSpecified(cellSize, idx) {\r\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\r\n }\r\n this._sw = cellSize[0];\r\n this._sh = cellSize[1];\r\n };\r\n Calendar.prototype.dataToPoint = function (data, clamp) {\r\n isArray(data) && (data = data[0]);\r\n clamp == null && (clamp = true);\r\n var dayInfo = this.getDateInfo(data);\r\n var range = this._rangeInfo;\r\n var date = dayInfo.formatedDate;\r\n if (clamp && !(dayInfo.time >= range.start.time\r\n && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\r\n return [NaN, NaN];\r\n }\r\n var week = dayInfo.day;\r\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\r\n if (this._orient === 'vertical') {\r\n return [\r\n this._rect.x + week * this._sw + this._sw / 2,\r\n this._rect.y + nthWeek * this._sh + this._sh / 2\r\n ];\r\n }\r\n return [\r\n this._rect.x + nthWeek * this._sw + this._sw / 2,\r\n this._rect.y + week * this._sh + this._sh / 2\r\n ];\r\n };\r\n Calendar.prototype.pointToData = function (point) {\r\n var date = this.pointToDate(point);\r\n return date && date.time;\r\n };\r\n Calendar.prototype.dataToRect = function (data, clamp) {\r\n var point = this.dataToPoint(data, clamp);\r\n return {\r\n contentShape: {\r\n x: point[0] - (this._sw - this._lineWidth) / 2,\r\n y: point[1] - (this._sh - this._lineWidth) / 2,\r\n width: this._sw - this._lineWidth,\r\n height: this._sh - this._lineWidth\r\n },\r\n center: point,\r\n tl: [\r\n point[0] - this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n tr: [\r\n point[0] + this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n br: [\r\n point[0] + this._sw / 2,\r\n point[1] + this._sh / 2\r\n ],\r\n bl: [\r\n point[0] - this._sw / 2,\r\n point[1] + this._sh / 2\r\n ]\r\n };\r\n };\r\n Calendar.prototype.pointToDate = function (point) {\r\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\r\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\r\n var range = this._rangeInfo.range;\r\n if (this._orient === 'vertical') {\r\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\r\n }\r\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\r\n };\r\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n Calendar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Calendar.prototype._initRangeOption = function () {\r\n var range = this._model.get('range');\r\n var normalizedRange;\r\n if (isArray(range) && range.length === 1) {\r\n range = range[0];\r\n }\r\n if (!isArray(range)) {\r\n var rangeStr = range.toString();\r\n if (/^\\d{4}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n var start = this.getDateInfo(rangeStr);\r\n var firstDay = start.date;\r\n firstDay.setMonth(firstDay.getMonth() + 1);\r\n var end = this.getNextNDay(firstDay, -1);\r\n normalizedRange = [start.formatedDate, end.formatedDate];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr, rangeStr];\r\n }\r\n }\r\n else {\r\n normalizedRange = range;\r\n }\r\n if (!normalizedRange) {\r\n if (__DEV__) {\r\n logError('Invalid date range.');\r\n }\r\n return range;\r\n }\r\n var tmp = this._getRangeInfo(normalizedRange);\r\n if (tmp.start.time > tmp.end.time) {\r\n normalizedRange.reverse();\r\n }\r\n return normalizedRange;\r\n };\r\n Calendar.prototype._getRangeInfo = function (range) {\r\n var parsedRange = [\r\n this.getDateInfo(range[0]),\r\n this.getDateInfo(range[1])\r\n ];\r\n var reversed;\r\n if (parsedRange[0].time > parsedRange[1].time) {\r\n reversed = true;\r\n parsedRange.reverse();\r\n }\r\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY)\r\n - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\r\n var date = new Date(parsedRange[0].time);\r\n var startDateNum = date.getDate();\r\n var endDateNum = parsedRange[1].date.getDate();\r\n date.setDate(startDateNum + allDay - 1);\r\n var dateNum = date.getDate();\r\n if (dateNum !== endDateNum) {\r\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\r\n while ((dateNum = date.getDate()) !== endDateNum\r\n && (date.getTime() - parsedRange[1].time) * sign > 0) {\r\n allDay -= sign;\r\n date.setDate(dateNum - sign);\r\n }\r\n }\r\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\r\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\r\n reversed && parsedRange.reverse();\r\n return {\r\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\r\n start: parsedRange[0],\r\n end: parsedRange[1],\r\n allDay: allDay,\r\n weeks: weeks,\r\n nthWeek: nthWeek,\r\n fweek: parsedRange[0].day,\r\n lweek: parsedRange[1].day\r\n };\r\n };\r\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\r\n var rangeInfo = this._getRangeInfo(range);\r\n if (nthWeek > rangeInfo.weeks\r\n || (nthWeek === 0 && day < rangeInfo.fweek)\r\n || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)) {\r\n return null;\r\n }\r\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\r\n var date = new Date(rangeInfo.start.time);\r\n date.setDate(+rangeInfo.start.d + nthDay);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.create = function (ecModel, api) {\r\n var calendarList = [];\r\n ecModel.eachComponent('calendar', function (calendarModel) {\r\n var calendar = new Calendar(calendarModel, ecModel, api);\r\n calendarList.push(calendar);\r\n calendarModel.coordinateSystem = calendar;\r\n });\r\n ecModel.eachSeries(function (calendarSeries) {\r\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\r\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\r\n }\r\n });\r\n return calendarList;\r\n };\r\n Calendar.dimensions = ['time', 'value'];\r\n return Calendar;\r\n }());\r\n function getCoordSys$4(finder) {\r\n var calendarModel = finder.calendarModel;\r\n var seriesModel = finder.seriesModel;\r\n var coordSys = calendarModel\r\n ? calendarModel.coordinateSystem\r\n : seriesModel\r\n ? seriesModel.coordinateSystem\r\n : null;\r\n return coordSys;\r\n }\r\n CoordinateSystemManager.register('calendar', Calendar);\n\n var CalendarModel = (function (_super) {\r\n __extends(CalendarModel, _super);\r\n function CalendarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarModel.type;\r\n return _this;\r\n }\r\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\r\n };\r\n CalendarModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(this.option, option);\r\n };\r\n CalendarModel.prototype.getCellSize = function () {\r\n return this.option.cellSize;\r\n };\r\n CalendarModel.type = 'calendar';\r\n CalendarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n left: 80,\r\n top: 60,\r\n cellSize: 20,\r\n orient: 'horizontal',\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: '#000',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n },\r\n dayLabel: {\r\n show: true,\r\n firstDay: 0,\r\n position: 'start',\r\n margin: '50%',\r\n nameMap: 'en',\r\n color: '#000'\r\n },\r\n monthLabel: {\r\n show: true,\r\n position: 'start',\r\n margin: 5,\r\n align: 'center',\r\n nameMap: 'en',\r\n formatter: null,\r\n color: '#000'\r\n },\r\n yearLabel: {\r\n show: true,\r\n position: null,\r\n margin: 30,\r\n formatter: null,\r\n color: '#ccc',\r\n fontFamily: 'sans-serif',\r\n fontWeight: 'bolder',\r\n fontSize: 20\r\n }\r\n };\r\n return CalendarModel;\r\n }(ComponentModel));\r\n function mergeAndNormalizeLayoutParams(target, raw) {\r\n var cellSize = target.cellSize;\r\n var cellSizeArr;\r\n if (!isArray(cellSize)) {\r\n cellSizeArr = target.cellSize = [cellSize, cellSize];\r\n }\r\n else {\r\n cellSizeArr = cellSize;\r\n }\r\n if (cellSizeArr.length === 1) {\r\n cellSizeArr[1] = cellSizeArr[0];\r\n }\r\n var ignoreSize = map([0, 1], function (hvIdx) {\r\n if (sizeCalculable(raw, hvIdx)) {\r\n cellSizeArr[hvIdx] = 'auto';\r\n }\r\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\r\n });\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(CalendarModel);\n\n var MONTH_TEXT = {\r\n EN: [\r\n 'Jan', 'Feb', 'Mar',\r\n 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep',\r\n 'Oct', 'Nov', 'Dec'\r\n ],\r\n CN: [\r\n '一月', '二月', '三月',\r\n '四月', '五月', '六月',\r\n '七月', '八月', '九月',\r\n '十月', '十一月', '十二月'\r\n ]\r\n };\r\n var WEEK_TEXT = {\r\n EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n CN: ['日', '一', '二', '三', '四', '五', '六']\r\n };\r\n var CalendarView = (function (_super) {\r\n __extends(CalendarView, _super);\r\n function CalendarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarView.type;\r\n return _this;\r\n }\r\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n var coordSys = calendarModel.coordinateSystem;\r\n var rangeData = coordSys.getRangeInfo();\r\n var orient = coordSys.getOrient();\r\n this._renderDayRect(calendarModel, rangeData, group);\r\n this._renderLines(calendarModel, rangeData, orient, group);\r\n this._renderYearText(calendarModel, rangeData, orient, group);\r\n this._renderMonthText(calendarModel, orient, group);\r\n this._renderWeekText(calendarModel, rangeData, orient, group);\r\n };\r\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\r\n var sw = coordSys.getCellWidth();\r\n var sh = coordSys.getCellHeight();\r\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\r\n var point = coordSys.dataToRect([i], false).tl;\r\n var rect = new Rect({\r\n shape: {\r\n x: point[0],\r\n y: point[1],\r\n width: sw,\r\n height: sh\r\n },\r\n cursor: 'default',\r\n style: itemRectStyleModel\r\n });\r\n group.add(rect);\r\n }\r\n };\r\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\r\n var self = this;\r\n var coordSys = calendarModel.coordinateSystem;\r\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\r\n var show = calendarModel.get(['splitLine', 'show']);\r\n var lineWidth = lineStyleModel.lineWidth;\r\n this._tlpoints = [];\r\n this._blpoints = [];\r\n this._firstDayOfMonth = [];\r\n this._firstDayPoints = [];\r\n var firstDay = rangeData.start;\r\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\r\n addPoints(firstDay.formatedDate);\r\n if (i === 0) {\r\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\r\n }\r\n var date = firstDay.date;\r\n date.setMonth(date.getMonth() + 1);\r\n firstDay = coordSys.getDateInfo(date);\r\n }\r\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\r\n function addPoints(date) {\r\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\r\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\r\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\r\n self._tlpoints.push(points[0]);\r\n self._blpoints.push(points[points.length - 1]);\r\n show && self._drawSplitline(points, lineStyleModel, group);\r\n }\r\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\r\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\r\n };\r\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\r\n var rs = [points[0].slice(), points[points.length - 1].slice()];\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\r\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\r\n return rs;\r\n };\r\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\r\n var poyline = new Polyline({\r\n z2: 20,\r\n shape: {\r\n points: points\r\n },\r\n style: lineStyle\r\n });\r\n group.add(poyline);\r\n };\r\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var parsedDate = coordSys.getDateInfo(date);\r\n var points = [];\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\r\n var point = coordSys.dataToRect([tmpD.time], false);\r\n points[2 * tmpD.day] = point.tl;\r\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\r\n }\r\n return points;\r\n };\r\n CalendarView.prototype._formatterLabel = function (formatter, params) {\r\n if (typeof formatter === 'string' && formatter) {\r\n return formatTplSimple(formatter, params);\r\n }\r\n if (typeof formatter === 'function') {\r\n return formatter(params);\r\n }\r\n return params.nameMap;\r\n };\r\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\r\n var x = point[0];\r\n var y = point[1];\r\n var aligns = ['center', 'bottom'];\r\n if (position === 'bottom') {\r\n y += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else if (position === 'left') {\r\n x -= margin;\r\n }\r\n else if (position === 'right') {\r\n x += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else {\r\n y -= margin;\r\n }\r\n var rotate = 0;\r\n if (position === 'left' || position === 'right') {\r\n rotate = Math.PI / 2;\r\n }\r\n return {\r\n rotation: rotate,\r\n x: x,\r\n y: y,\r\n style: {\r\n align: aligns[0],\r\n verticalAlign: aligns[1]\r\n }\r\n };\r\n };\r\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\r\n var yearLabel = calendarModel.getModel('yearLabel');\r\n if (!yearLabel.get('show')) {\r\n return;\r\n }\r\n var margin = yearLabel.get('margin');\r\n var pos = yearLabel.get('position');\r\n if (!pos) {\r\n pos = orient !== 'horizontal' ? 'top' : 'left';\r\n }\r\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\r\n var xc = (points[0][0] + points[1][0]) / 2;\r\n var yc = (points[0][1] + points[1][1]) / 2;\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n var posPoints = {\r\n top: [xc, points[idx][1]],\r\n bottom: [xc, points[1 - idx][1]],\r\n left: [points[1 - idx][0], yc],\r\n right: [points[idx][0], yc]\r\n };\r\n var name = rangeData.start.y;\r\n if (+rangeData.end.y > +rangeData.start.y) {\r\n name = name + '-' + rangeData.end.y;\r\n }\r\n var formatter = yearLabel.get('formatter');\r\n var params = {\r\n start: rangeData.start.y,\r\n end: rangeData.end.y,\r\n nameMap: name\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var yearText = new ZRText({\r\n z2: 30,\r\n style: createTextStyle(yearLabel, {\r\n text: content\r\n })\r\n });\r\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\r\n group.add(yearText);\r\n };\r\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\r\n var align = 'left';\r\n var vAlign = 'top';\r\n var x = point[0];\r\n var y = point[1];\r\n if (orient === 'horizontal') {\r\n y = y + margin;\r\n if (isCenter) {\r\n align = 'center';\r\n }\r\n if (position === 'start') {\r\n vAlign = 'bottom';\r\n }\r\n }\r\n else {\r\n x = x + margin;\r\n if (isCenter) {\r\n vAlign = 'middle';\r\n }\r\n if (position === 'start') {\r\n align = 'right';\r\n }\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderMonthText = function (calendarModel, orient, group) {\r\n var monthLabel = calendarModel.getModel('monthLabel');\r\n if (!monthLabel.get('show')) {\r\n return;\r\n }\r\n var nameMap = monthLabel.get('nameMap');\r\n var margin = monthLabel.get('margin');\r\n var pos = monthLabel.get('position');\r\n var align = monthLabel.get('align');\r\n var termPoints = [this._tlpoints, this._blpoints];\r\n if (isString(nameMap)) {\r\n nameMap = MONTH_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var idx = pos === 'start' ? 0 : 1;\r\n var axis = orient === 'horizontal' ? 0 : 1;\r\n margin = pos === 'start' ? -margin : margin;\r\n var isCenter = (align === 'center');\r\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\r\n var tmp = termPoints[idx][i].slice();\r\n var firstDay = this._firstDayOfMonth[i];\r\n if (isCenter) {\r\n var firstDayPoints = this._firstDayPoints[i];\r\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\r\n }\r\n var formatter = monthLabel.get('formatter');\r\n var name_1 = nameMap[+firstDay.m - 1];\r\n var params = {\r\n yyyy: firstDay.y,\r\n yy: (firstDay.y + '').slice(2),\r\n MM: firstDay.m,\r\n M: +firstDay.m,\r\n nameMap: name_1\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var monthText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(monthLabel, { text: content }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\r\n });\r\n group.add(monthText);\r\n }\r\n };\r\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\r\n var align = 'center';\r\n var vAlign = 'middle';\r\n var x = point[0];\r\n var y = point[1];\r\n var isStart = position === 'start';\r\n if (orient === 'horizontal') {\r\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\r\n align = isStart ? 'right' : 'left';\r\n }\r\n else {\r\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\r\n vAlign = isStart ? 'bottom' : 'top';\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderWeekText = function (calendarModel, rangeData, orient, group) {\r\n var dayLabel = calendarModel.getModel('dayLabel');\r\n if (!dayLabel.get('show')) {\r\n return;\r\n }\r\n var coordSys = calendarModel.coordinateSystem;\r\n var pos = dayLabel.get('position');\r\n var nameMap = dayLabel.get('nameMap');\r\n var margin = dayLabel.get('margin');\r\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\r\n if (isString(nameMap)) {\r\n nameMap = WEEK_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var start = coordSys.getNextNDay(rangeData.end.time, (7 - rangeData.lweek)).time;\r\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\r\n margin = parsePercent$2(margin, cellSize[orient === 'horizontal' ? 0 : 1]);\r\n if (pos === 'start') {\r\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\r\n margin = -margin;\r\n }\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(start, i);\r\n var point = coordSys.dataToRect([tmpD.time], false).center;\r\n var day = i;\r\n day = Math.abs((i + firstDayOfWeek) % 7);\r\n var weekText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(dayLabel, { text: nameMap[day] }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\r\n });\r\n group.add(weekText);\r\n }\r\n };\r\n CalendarView.type = 'calendar';\r\n return CalendarView;\r\n }(ComponentView));\r\n ComponentView.registerClass(CalendarView);\n\n var inner$g = makeInner();\r\n var _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n };\r\n registerPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n });\r\n var GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GraphicComponentModel);\r\n var GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$g(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$g(el);\r\n var parentElInner = inner$g(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$g(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GraphicComponentView);\r\n function createEl$1(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$g(el).__ecGraphicId = id;\r\n }\r\n function removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$g(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n }\r\n function getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n }\r\n function isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n }\r\n function setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n }\r\n function mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n }\r\n function setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n }\r\n function setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n }\n\n var ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n }());\r\n var features = {};\r\n function registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n }\r\n function getFeature(name) {\r\n return features[name];\r\n }\n\n var ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ToolboxModel);\n\n function layout$3(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n }\r\n function makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n }\n\n var ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$3(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ToolboxView);\r\n function isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n }\n\n var SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n }(ToolboxFeature));\r\n SaveAsImage.prototype.unusable = !env.canvasSupported;\r\n registerFeature('saveAsImage', SaveAsImage);\n\n var INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\n var radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n ];\r\n var MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n }(ToolboxFeature));\r\n var seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n };\r\n registerAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n });\r\n registerFeature('magicType', MagicType);\n\n var BLOCK_SPLITER = new Array(60).join('-');\r\n var ITEM_SPLITER = '\\t';\r\n function groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n }\r\n function assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n }\r\n function trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n }\r\n function isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n }\r\n var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\n function parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n }\r\n function parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n }\r\n function parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n }\r\n var DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n }(ToolboxFeature));\r\n function tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n }\r\n registerFeature('dataView', DataView);\r\n registerAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n });\n\n var COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\n var INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n ];\r\n var BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n }());\r\n function formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n }\r\n function parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n }\r\n var targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n };\r\n var targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n ];\r\n var panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n };\r\n var coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n };\r\n function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n var diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n };\r\n function axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n }\r\n function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n }\r\n function getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n }\n\n var each$9 = each;\r\n var inner$h = makeInner();\r\n function push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$9(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n }\r\n function pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$9(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n }\r\n function clear$1(ecModel) {\r\n inner$h(ecModel).snapshots = null;\r\n }\r\n function count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n }\r\n function getStoreSnapshots(ecModel) {\r\n var store = inner$h(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n }\n\n ComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n });\n\n var DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n ];\r\n var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\n function isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n }\r\n function getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n }\r\n function findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n }\r\n function collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n }\n\n var DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n }());\r\n var DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n }(ComponentModel));\r\n function retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n }\n\n var DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DataZoomView);\n\n var SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SelectDataZoomModel);\n\n var SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n }(DataZoomView));\r\n ComponentView.registerClass(SelectDataZoomView);\n\n var each$a = each;\r\n var asc$1 = asc;\r\n var AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$a(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$a(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$a(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$a(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$a(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n }());\r\n function calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$a(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n });\n\n registerAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n });\n\n var each$b = each;\r\n var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\n var DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers$1[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$b(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n }(ToolboxFeature));\r\n var handlers$1 = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n };\r\n function makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n }\r\n function updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n }\r\n function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n }\r\n registerFeature('dataZoom', DataZoomFeature);\r\n registerInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$b(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$b(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n });\n\n var RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n }(ToolboxFeature));\r\n registerFeature('restore', RestoreOption);\r\n registerAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n });\n\n var TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TooltipModel);\n\n function shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n }\n\n var vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\n var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\n function mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n }\r\n function assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n }\r\n function assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n }\r\n function assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n }\r\n function assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n }\r\n function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\r\n var TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n }());\n\n var TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n }());\r\n function mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n }\r\n function calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n }\r\n function makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\n\n var bind$2 = bind;\r\n var each$c = each;\r\n var parsePercent$3 = parsePercent$2;\r\n var proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n });\r\n var TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$c(dataByCoordSys, function (itemCoordSys) {\r\n each$c(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$c(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$c(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$c(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n }(ComponentView));\r\n function buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n }\r\n function makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n }\r\n function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n }\r\n function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n }\r\n function calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n }\r\n function isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n }\r\n ComponentView.registerClass(TooltipView);\n\n registerAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n }, function () { });\r\n registerAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n }, function () { });\n\n var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\r\n function brushPreprocessor(option, isNew) {\r\n var brushComponents = normalizeToArray(option ? option.brush : []);\r\n if (!brushComponents.length) {\r\n return;\r\n }\r\n var brushComponentSpecifiedBtns = [];\r\n each(brushComponents, function (brushOpt) {\r\n var tbs = brushOpt.hasOwnProperty('toolbox')\r\n ? brushOpt.toolbox : [];\r\n if (tbs instanceof Array) {\r\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\r\n }\r\n });\r\n var toolbox = option && option.toolbox;\r\n if (isArray(toolbox)) {\r\n toolbox = toolbox[0];\r\n }\r\n if (!toolbox) {\r\n toolbox = { feature: {} };\r\n option.toolbox = [toolbox];\r\n }\r\n var toolboxFeature = (toolbox.feature || (toolbox.feature = {}));\r\n var toolboxBrush = (toolboxFeature.brush || (toolboxFeature.brush = {}));\r\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\r\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\r\n removeDuplicate(brushTypes);\r\n if (isNew && !brushTypes.length) {\r\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\r\n }\r\n }\r\n function removeDuplicate(arr) {\r\n var map = {};\r\n each(arr, function (val) {\r\n map[val] = 1;\r\n });\r\n arr.length = 0;\r\n each(map, function (flag, val) {\r\n arr.push(val);\r\n });\r\n }\n\n var each$d = each;\r\n function hasKeys(obj) {\r\n if (obj) {\r\n for (var name_1 in obj) {\r\n if (obj.hasOwnProperty(name_1)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n function createVisualMappings(option, stateList, supplementVisualOption) {\r\n var visualMappings = {};\r\n each$d(stateList, function (state) {\r\n var mappings = visualMappings[state] = createMappings();\r\n each$d(option[state], function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var mappingOption = {\r\n type: visualType,\r\n visual: visualData\r\n };\r\n supplementVisualOption && supplementVisualOption(mappingOption, state);\r\n mappings[visualType] = new VisualMapping(mappingOption);\r\n if (visualType === 'opacity') {\r\n mappingOption = clone(mappingOption);\r\n mappingOption.type = 'colorAlpha';\r\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\r\n }\r\n });\r\n });\r\n return visualMappings;\r\n function createMappings() {\r\n var Creater = function () { };\r\n Creater.prototype.__hidden = Creater.prototype;\r\n var obj = new Creater();\r\n return obj;\r\n }\r\n }\r\n function replaceVisualOption(thisOption, newOption, keys) {\r\n var has;\r\n each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n has = true;\r\n }\r\n });\r\n has && each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n thisOption[key] = clone(newOption[key]);\r\n }\r\n else {\r\n delete thisOption[key];\r\n }\r\n });\r\n }\r\n function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n var dataIndex;\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n if (dimension == null) {\r\n data.each(eachItem);\r\n }\r\n else {\r\n data.each([dimension], eachItem);\r\n }\r\n function eachItem(valueOrIndex, index) {\r\n dataIndex = dimension == null\r\n ? valueOrIndex\r\n : index;\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n return;\r\n }\r\n var valueState = getValueState.call(scope, valueOrIndex);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n return {\r\n progress: function progress(params, data) {\r\n var dimName;\r\n if (dim != null) {\r\n dimName = data.getDimension(dim);\r\n }\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n continue;\r\n }\r\n var value = dim != null\r\n ? data.get(dimName, dataIndex)\r\n : dataIndex;\r\n var valueState = getValueState(value);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n };\r\n }\n\n function makeBrushCommonSelectorForSeries(area) {\r\n var brushType = area.brushType;\r\n var selectors = {\r\n point: function (itemLayout) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect: function (itemLayout) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n }\r\n var selector = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout\r\n && area.boundingRect.contain(itemLayout[0], itemLayout[1])\r\n && contain$2(area.range, itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n var points = area.range;\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n var x = itemLayout.x;\r\n var y = itemLayout.y;\r\n var width = itemLayout.width;\r\n var height = itemLayout.height;\r\n var p = points[0];\r\n if (contain$2(points, x, y)\r\n || contain$2(points, x + width, y)\r\n || contain$2(points, x, y + height)\r\n || contain$2(points, x + width, y + height)\r\n || BoundingRect.create(itemLayout).contain(p[0], p[1])\r\n || linePolygonIntersect(x, y, x + width, y, points)\r\n || linePolygonIntersect(x, y, x, y + height, points)\r\n || linePolygonIntersect(x + width, y, x + width, y + height, points)\r\n || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\r\n return true;\r\n }\r\n }\r\n }\r\n };\r\n function getLineSelectors(xyIndex) {\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var layoutRange = [\r\n itemLayout[xy[xyIndex]],\r\n itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]\r\n ];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range)\r\n || inLineRange(layoutRange[1], range)\r\n || inLineRange(range[0], layoutRange)\r\n || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n }\r\n function inLineRange(p, range) {\r\n return range[0] <= p && p <= range[1];\r\n }\n\n var STATE_LIST = ['inBrush', 'outOfBrush'];\r\n var DISPATCH_METHOD = '__ecBrushSelect';\r\n var DISPATCH_FLAG = '__ecInBrushSelectEvent';\r\n var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH;\r\n function layoutCovers(ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\r\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\r\n });\r\n }\r\n registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) {\r\n var brushSelected = [];\r\n var throttleType;\r\n var throttleDelay;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { brushType: false });\r\n });\r\n layoutCovers(ecModel);\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel, brushIndex) {\r\n var thisBrushSelected = {\r\n brushId: brushModel.id,\r\n brushIndex: brushIndex,\r\n brushName: brushModel.name,\r\n areas: clone(brushModel.areas),\r\n selected: []\r\n };\r\n brushSelected.push(thisBrushSelected);\r\n var brushOption = brushModel.option;\r\n var brushLink = brushOption.brushLink;\r\n var linkedSeriesMap = [];\r\n var selectedDataIndexForLink = [];\r\n var rangeInfoBySeries = [];\r\n var hasBrushExists = false;\r\n if (!brushIndex) {\r\n throttleType = brushOption.throttleType;\r\n throttleDelay = brushOption.throttleDelay;\r\n }\r\n var areas = map(brushModel.areas, function (area) {\r\n var builder = boundingRectBuilders[area.brushType];\r\n var selectableArea = defaults({ boundingRect: builder ? builder(area) : void 0 }, area);\r\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\r\n return selectableArea;\r\n });\r\n var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\r\n mappingOption.mappingMethod = 'fixed';\r\n });\r\n isArray(brushLink) && each(brushLink, function (seriesIndex) {\r\n linkedSeriesMap[seriesIndex] = 1;\r\n });\r\n function linkOthers(seriesIndex) {\r\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\r\n }\r\n function brushed(rangeInfoList) {\r\n return !!rangeInfoList.length;\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\r\n seriesModel.subType === 'parallel'\r\n ? stepAParallel(seriesModel, seriesIndex)\r\n : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\r\n });\r\n function stepAParallel(seriesModel, seriesIndex) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\r\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\r\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\r\n });\r\n }\r\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\r\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\r\n return;\r\n }\r\n each(areas, function (area) {\r\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\r\n rangeInfoList.push(area);\r\n }\r\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\r\n });\r\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\r\n var data_1 = seriesModel.getData();\r\n data_1.each(function (dataIndex) {\r\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\r\n selectedDataIndexForLink[dataIndex] = 1;\r\n }\r\n });\r\n }\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var seriesBrushSelected = {\r\n seriesId: seriesModel.id,\r\n seriesIndex: seriesIndex,\r\n seriesName: seriesModel.name,\r\n dataIndex: []\r\n };\r\n thisBrushSelected.selected.push(seriesBrushSelected);\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\r\n var data = seriesModel.getData();\r\n var getValueState = linkOthers(seriesIndex)\r\n ? function (dataIndex) {\r\n return selectedDataIndexForLink[dataIndex]\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n }\r\n : function (dataIndex) {\r\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex)\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n };\r\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList))\r\n && applyVisual(STATE_LIST, visualMappings, data, getValueState);\r\n });\r\n });\r\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\r\n });\r\n function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\r\n if (!payload) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n if (zr[DISPATCH_FLAG]) {\r\n return;\r\n }\r\n if (!zr[DISPATCH_METHOD]) {\r\n zr[DISPATCH_METHOD] = doDispatch;\r\n }\r\n var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\r\n fn(api, brushSelected);\r\n }\r\n function doDispatch(api, brushSelected) {\r\n if (!api.isDisposed()) {\r\n var zr = api.getZr();\r\n zr[DISPATCH_FLAG] = true;\r\n api.dispatchAction({\r\n type: 'brushSelect',\r\n batch: brushSelected\r\n });\r\n zr[DISPATCH_FLAG] = false;\r\n }\r\n }\r\n function checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\r\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\r\n var area = rangeInfoList[i];\r\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\r\n return true;\r\n }\r\n }\r\n }\r\n function brushModelNotControll(brushModel, seriesIndex) {\r\n var seriesIndices = brushModel.option.seriesIndex;\r\n return seriesIndices != null\r\n && seriesIndices !== 'all'\r\n && (isArray(seriesIndices)\r\n ? indexOf(seriesIndices, seriesIndex) < 0\r\n : seriesIndex !== seriesIndices);\r\n }\r\n var boundingRectBuilders = {\r\n rect: function (area) {\r\n return getBoundingRectFromMinMax(area.range);\r\n },\r\n polygon: function (area) {\r\n var minMax;\r\n var range = area.range;\r\n for (var i = 0, len = range.length; i < len; i++) {\r\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var rg = range[i];\r\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\r\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\r\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\r\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\r\n }\r\n return minMax && getBoundingRectFromMinMax(minMax);\r\n }\r\n };\r\n function getBoundingRectFromMinMax(minMax) {\r\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\r\n }\n\n var DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\r\n var BrushModel = (function (_super) {\r\n __extends(BrushModel, _super);\r\n function BrushModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushModel.type;\r\n _this.areas = [];\r\n _this.brushOption = {};\r\n return _this;\r\n }\r\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\r\n var inBrush = thisOption.inBrush = thisOption.inBrush || {};\r\n thisOption.outOfBrush = thisOption.outOfBrush || { color: DEFAULT_OUT_OF_BRUSH_COLOR };\r\n if (!inBrush.hasOwnProperty('liftZ')) {\r\n inBrush.liftZ = 5;\r\n }\r\n };\r\n BrushModel.prototype.setAreas = function (areas) {\r\n if (__DEV__) {\r\n assert(isArray(areas));\r\n each(areas, function (area) {\r\n assert(area.brushType, 'Illegal areas');\r\n });\r\n }\r\n if (!areas) {\r\n return;\r\n }\r\n this.areas = map(areas, function (area) {\r\n return generateBrushOption(this.option, area);\r\n }, this);\r\n };\r\n BrushModel.prototype.setBrushOption = function (brushOption) {\r\n this.brushOption = generateBrushOption(this.option, brushOption);\r\n this.brushType = this.brushOption.brushType;\r\n };\r\n BrushModel.type = 'brush';\r\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\r\n BrushModel.defaultOption = {\r\n seriesIndex: 'all',\r\n brushType: 'rect',\r\n brushMode: 'single',\r\n transformable: true,\r\n brushStyle: {\r\n borderWidth: 1,\r\n color: 'rgba(210,219,238,0.3)',\r\n borderColor: '#D2DBEE'\r\n },\r\n throttleType: 'fixRate',\r\n throttleDelay: 0,\r\n removeOnClick: true,\r\n z: 10000\r\n };\r\n return BrushModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(BrushModel);\r\n function generateBrushOption(option, brushOption) {\r\n return merge({\r\n brushType: option.brushType,\r\n brushMode: option.brushMode,\r\n transformable: option.transformable,\r\n brushStyle: new Model(option.brushStyle).getItemStyle(),\r\n removeOnClick: option.removeOnClick,\r\n z: option.z\r\n }, brushOption, true);\r\n }\n\n var BrushView = (function (_super) {\r\n __extends(BrushView, _super);\r\n function BrushView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushView.type;\r\n return _this;\r\n }\r\n BrushView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n this.model;\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this))\r\n .mount();\r\n };\r\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\r\n this.model = brushModel;\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\r\n layoutCovers(ecModel);\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\r\n this.updateTransform(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\r\n (!payload || payload.$from !== brushModel.id) && this._brushController\r\n .setPanels(brushModel.brushTargetManager.makePanelOpts(api))\r\n .enableBrush(brushModel.brushOption)\r\n .updateCovers(brushModel.areas.slice());\r\n };\r\n BrushView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n BrushView.prototype._onBrush = function (eventParam) {\r\n var modelId = this.model.id;\r\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\r\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\r\n type: 'brush',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n eventParam.isEnd && this.api.dispatchAction({\r\n type: 'brushEnd',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n };\r\n BrushView.type = 'brush';\r\n return BrushView;\r\n }(ComponentView));\r\n ComponentView.registerClass(BrushView);\n\n registerAction({ type: 'brush', event: 'brush', update: 'updateVisual' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush', query: payload }, function (brushModel) {\r\n brushModel.setAreas(payload.areas);\r\n });\r\n });\r\n registerAction({ type: 'brushSelect', event: 'brushSelected', update: 'none' }, function () { });\r\n registerAction({ type: 'brushEnd', event: 'brushEnd', update: 'none' }, function () { });\n\n var ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\r\n var BrushFeature = (function (_super) {\r\n __extends(BrushFeature, _super);\r\n function BrushFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\r\n var brushType;\r\n var brushMode;\r\n var isBrushed;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n brushType = brushModel.brushType;\r\n brushMode = brushModel.brushOption.brushMode || 'single';\r\n isBrushed = isBrushed || !!brushModel.areas.length;\r\n });\r\n this._brushType = brushType;\r\n this._brushMode = brushMode;\r\n each(featureModel.get('type', true), function (type) {\r\n featureModel.setIconStatus(type, (type === 'keep'\r\n ? brushMode === 'multiple'\r\n : type === 'clear'\r\n ? isBrushed\r\n : type === brushType) ? 'emphasis' : 'normal');\r\n });\r\n };\r\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\r\n this.render(featureModel, ecModel, api);\r\n };\r\n BrushFeature.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon', true);\r\n var icons = {};\r\n each(model.get('type', true), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\r\n var brushType = this._brushType;\r\n var brushMode = this._brushMode;\r\n if (type === 'clear') {\r\n api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n intervals: []\r\n });\r\n api.dispatchAction({\r\n type: 'brush',\r\n command: 'clear',\r\n areas: []\r\n });\r\n }\r\n else {\r\n api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'brush',\r\n brushOption: {\r\n brushType: type === 'keep'\r\n ? brushType\r\n : (brushType === type ? false : type),\r\n brushMode: type === 'keep'\r\n ? (brushMode === 'multiple' ? 'single' : 'multiple')\r\n : brushMode\r\n }\r\n });\r\n }\r\n };\r\n BrushFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: ICON_TYPES.slice(),\r\n icon: {\r\n rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\r\n polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\r\n lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\r\n lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\r\n keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\r\n clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'brush', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return BrushFeature;\r\n }(ToolboxFeature));\r\n registerFeature('brush', BrushFeature);\n\n registerPreprocessor(brushPreprocessor);\n\n var TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TitleModel);\r\n var TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n }(ComponentView));\r\n ComponentView.registerClass(TitleView);\n\n function timelinePreprocessor(option) {\r\n var timelineOpt = option && option.timeline;\r\n if (!isArray(timelineOpt)) {\r\n timelineOpt = timelineOpt ? [timelineOpt] : [];\r\n }\r\n each(timelineOpt, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n compatibleEC2(opt);\r\n });\r\n }\r\n function compatibleEC2(opt) {\r\n var type = opt.type;\r\n var ec2Types = { 'number': 'value', 'time': 'time' };\r\n if (ec2Types[type]) {\r\n opt.axisType = ec2Types[type];\r\n delete opt.type;\r\n }\r\n transferItem(opt);\r\n if (has(opt, 'controlPosition')) {\r\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\r\n if (!has(controlStyle, 'position')) {\r\n controlStyle.position = opt.controlPosition;\r\n }\r\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\r\n controlStyle.show = false;\r\n delete controlStyle.position;\r\n }\r\n delete opt.controlPosition;\r\n }\r\n each(opt.data || [], function (dataItem) {\r\n if (isObject(dataItem) && !isArray(dataItem)) {\r\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\r\n dataItem.value = dataItem.name;\r\n }\r\n transferItem(dataItem);\r\n }\r\n });\r\n }\r\n function transferItem(opt) {\r\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\r\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\r\n var label = opt.label || (opt.label || {});\r\n var labelNormal = label.normal || (label.normal = {});\r\n var excludeLabelAttr = { normal: 1, emphasis: 1 };\r\n each(label, function (value, name) {\r\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\r\n labelNormal[name] = value;\r\n }\r\n });\r\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\r\n label.emphasis = itemStyleEmphasis.label;\r\n delete itemStyleEmphasis.label;\r\n }\r\n }\r\n function has(obj, attr) {\r\n return obj.hasOwnProperty(attr);\r\n }\n\n ComponentModel.registerSubTypeDefaulter('timeline', function () {\r\n return 'slider';\r\n });\n\n registerAction({ type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.currentIndex != null) {\r\n timelineModel.setCurrentIndex(payload.currentIndex);\r\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {\r\n timelineModel.setPlayState(false);\r\n }\r\n }\r\n ecModel.resetOption('timeline', { replaceMerge: timelineModel.get('replaceMerge', true) });\r\n return defaults({\r\n currentIndex: timelineModel.option.currentIndex\r\n }, payload);\r\n });\r\n registerAction({ type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.playState != null) {\r\n timelineModel.setPlayState(payload.playState);\r\n }\r\n });\n\n var TimelineModel = (function (_super) {\r\n __extends(TimelineModel, _super);\r\n function TimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineModel.type;\r\n _this.layoutMode = 'box';\r\n return _this;\r\n }\r\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n var count = this._data.count();\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n }\r\n else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n this.option.currentIndex = currentIndex;\r\n };\r\n TimelineModel.prototype.getCurrentIndex = function () {\r\n return this.option.currentIndex;\r\n };\r\n TimelineModel.prototype.isIndexMax = function () {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n };\r\n TimelineModel.prototype.setPlayState = function (state) {\r\n this.option.autoPlay = !!state;\r\n };\r\n TimelineModel.prototype.getPlayState = function () {\r\n return !!this.option.autoPlay;\r\n };\r\n TimelineModel.prototype._initData = function () {\r\n var thisOption = this.option;\r\n var dataArr = thisOption.data || [];\r\n var axisType = thisOption.axisType;\r\n var names = this._names = [];\r\n var processedDataArr;\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n var value = convertOptionIdName(getDataItemValue(item), '');\r\n var newItem;\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n newItem.value = index;\r\n }\r\n else {\r\n newItem = index;\r\n }\r\n processedDataArr.push(newItem);\r\n names.push(value);\r\n });\r\n }\r\n else {\r\n processedDataArr = dataArr;\r\n }\r\n var dimType = ({\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n })[axisType] || 'number';\r\n var data = this._data = new List([{\r\n name: 'value', type: dimType\r\n }], this);\r\n data.initData(processedDataArr, names);\r\n };\r\n TimelineModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n TimelineModel.prototype.getCategories = function () {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n };\r\n TimelineModel.type = 'timeline';\r\n TimelineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n axisType: 'time',\r\n realtime: true,\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n controlPosition: 'left',\r\n autoPlay: false,\r\n rewind: false,\r\n loop: true,\r\n playInterval: 2000,\r\n currentIndex: 0,\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n data: []\r\n };\r\n return TimelineModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TimelineModel);\n\n var SliderTimelineModel = (function (_super) {\r\n __extends(SliderTimelineModel, _super);\r\n function SliderTimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineModel.type;\r\n return _this;\r\n }\r\n SliderTimelineModel.type = 'timeline.slider';\r\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n orient: 'horizontal',\r\n inverse: false,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n symbol: 'circle',\r\n symbolSize: 12,\r\n lineStyle: {\r\n show: true,\r\n width: 2,\r\n color: '#DAE1F5'\r\n },\r\n label: {\r\n position: 'auto',\r\n show: true,\r\n interval: 'auto',\r\n rotate: 0,\r\n color: '#A4B1D7'\r\n },\r\n itemStyle: {\r\n color: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n checkpointStyle: {\r\n symbol: 'circle',\r\n symbolSize: 15,\r\n color: '#316bf3',\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0, 0, 0, 0.3)',\r\n animation: true,\r\n animationDuration: 300,\r\n animationEasing: 'quinticInOut'\r\n },\r\n controlStyle: {\r\n show: true,\r\n showPlayBtn: true,\r\n showPrevBtn: true,\r\n showNextBtn: true,\r\n itemSize: 24,\r\n itemGap: 12,\r\n position: 'left',\r\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\r\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\r\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\r\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\r\n prevBtnSize: 18,\r\n nextBtnSize: 18,\r\n color: '#A4B1D7',\r\n borderColor: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: '#6f778d'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n controlStyle: {\r\n color: '#316BF3',\r\n borderColor: '#316BF3',\r\n borderWidth: 2\r\n }\r\n },\r\n progress: {\r\n lineStyle: {\r\n color: '#316BF3'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n label: {\r\n color: '#6f778d'\r\n }\r\n },\r\n data: []\r\n });\r\n return SliderTimelineModel;\r\n }(TimelineModel));\r\n mixin(SliderTimelineModel, DataFormatMixin.prototype);\r\n ComponentModel.registerClass(SliderTimelineModel);\n\n var TimelineView = (function (_super) {\r\n __extends(TimelineView, _super);\r\n function TimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineView.type;\r\n return _this;\r\n }\r\n TimelineView.type = 'timeline';\r\n return TimelineView;\r\n }(ComponentView));\n\n var TimelineAxis = (function (_super) {\r\n __extends(TimelineAxis, _super);\r\n function TimelineAxis(dim, scale, coordExtent, axisType) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n return _this;\r\n }\r\n TimelineAxis.prototype.getLabelModel = function () {\r\n return this.model.getModel('label');\r\n };\r\n TimelineAxis.prototype.isHorizontal = function () {\r\n return this.model.get('orient') === 'horizontal';\r\n };\r\n return TimelineAxis;\r\n }(Axis));\n\n var PI$9 = Math.PI;\r\n var labelDataIndexStore = makeInner();\r\n var SliderTimelineView = (function (_super) {\r\n __extends(SliderTimelineView, _super);\r\n function SliderTimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineView.type;\r\n return _this;\r\n }\r\n SliderTimelineView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n };\r\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\r\n this.model = timelineModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n this.group.removeAll();\r\n if (timelineModel.get('show', true)) {\r\n var layoutInfo_1 = this._layout(timelineModel, api);\r\n var mainGroup_1 = this._createGroup('_mainGroup');\r\n var labelGroup = this._createGroup('_labelGroup');\r\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\r\n timelineModel.formatTooltip = function (dataIndex) {\r\n var name = axis_1.scale.getLabel({ value: dataIndex });\r\n return createTooltipMarkup('nameValue', { noName: true, value: name });\r\n };\r\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\r\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\r\n }, this);\r\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\r\n this._position(layoutInfo_1, timelineModel);\r\n }\r\n this._doPlayStop();\r\n this._updateTicksStatus();\r\n };\r\n SliderTimelineView.prototype.remove = function () {\r\n this._clearTimer();\r\n this.group.removeAll();\r\n };\r\n SliderTimelineView.prototype.dispose = function () {\r\n this._clearTimer();\r\n };\r\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\r\n var labelPosOpt = timelineModel.get(['label', 'position']);\r\n var orient = timelineModel.get('orient');\r\n var viewRect = getViewRect$5(timelineModel, api);\r\n var parsedLabelPos;\r\n if (labelPosOpt == null || labelPosOpt === 'auto') {\r\n parsedLabelPos = orient === 'horizontal'\r\n ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')\r\n : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');\r\n }\r\n else if (isString(labelPosOpt)) {\r\n parsedLabelPos = {\r\n horizontal: { top: '-', bottom: '+' },\r\n vertical: { left: '-', right: '+' }\r\n }[orient][labelPosOpt];\r\n }\r\n else {\r\n parsedLabelPos = labelPosOpt;\r\n }\r\n var labelAlignMap = {\r\n horizontal: 'center',\r\n vertical: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'left' : 'right'\r\n };\r\n var labelBaselineMap = {\r\n horizontal: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'top' : 'bottom',\r\n vertical: 'middle'\r\n };\r\n var rotationMap = {\r\n horizontal: 0,\r\n vertical: PI$9 / 2\r\n };\r\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\r\n var controlModel = timelineModel.getModel('controlStyle');\r\n var showControl = controlModel.get('show', true);\r\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\r\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\r\n var sizePlusGap = controlSize + controlGap;\r\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\r\n labelRotation = labelRotation * PI$9 / 180;\r\n var playPosition;\r\n var prevBtnPosition;\r\n var nextBtnPosition;\r\n var controlPosition = controlModel.get('position', true);\r\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\r\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\r\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\r\n var xLeft = 0;\r\n var xRight = mainLength;\r\n if (controlPosition === 'left' || controlPosition === 'bottom') {\r\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n else {\r\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n var axisExtent = [xLeft, xRight];\r\n if (timelineModel.get('inverse')) {\r\n axisExtent.reverse();\r\n }\r\n return {\r\n viewRect: viewRect,\r\n mainLength: mainLength,\r\n orient: orient,\r\n rotation: rotationMap[orient],\r\n labelRotation: labelRotation,\r\n labelPosOpt: parsedLabelPos,\r\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\r\n labelBaseline: timelineModel.get(['label', 'verticalAlign'])\r\n || timelineModel.get(['label', 'baseline'])\r\n || labelBaselineMap[orient],\r\n playPosition: playPosition,\r\n prevBtnPosition: prevBtnPosition,\r\n nextBtnPosition: nextBtnPosition,\r\n axisExtent: axisExtent,\r\n controlSize: controlSize,\r\n controlGap: controlGap\r\n };\r\n };\r\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\r\n var mainGroup = this._mainGroup;\r\n var labelGroup = this._labelGroup;\r\n var viewRect = layoutInfo.viewRect;\r\n if (layoutInfo.orient === 'vertical') {\r\n var m = create$1();\r\n var rotateOriginX = viewRect.x;\r\n var rotateOriginY = viewRect.y + viewRect.height;\r\n translate(m, m, [-rotateOriginX, -rotateOriginY]);\r\n rotate(m, m, -PI$9 / 2);\r\n translate(m, m, [rotateOriginX, rotateOriginY]);\r\n viewRect = viewRect.clone();\r\n viewRect.applyTransform(m);\r\n }\r\n var viewBound = getBound(viewRect);\r\n var mainBound = getBound(mainGroup.getBoundingRect());\r\n var labelBound = getBound(labelGroup.getBoundingRect());\r\n var mainPosition = [mainGroup.x, mainGroup.y];\r\n var labelsPosition = [labelGroup.x, labelGroup.y];\r\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\r\n var labelPosOpt = layoutInfo.labelPosOpt;\r\n if (labelPosOpt == null || isString(labelPosOpt)) {\r\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\r\n }\r\n else {\r\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\r\n }\r\n mainGroup.setPosition(mainPosition);\r\n labelGroup.setPosition(labelsPosition);\r\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\r\n setOrigin(mainGroup);\r\n setOrigin(labelGroup);\r\n function setOrigin(targetGroup) {\r\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\r\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\r\n }\r\n function getBound(rect) {\r\n return [\r\n [rect.x, rect.x + rect.width],\r\n [rect.y, rect.y + rect.height]\r\n ];\r\n }\r\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\r\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\r\n }\r\n };\r\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\r\n var data = timelineModel.getData();\r\n var axisType = timelineModel.get('axisType');\r\n var scale = createScaleByModel$1(timelineModel, axisType);\r\n scale.getTicks = function () {\r\n return data.mapArray(['value'], function (value) {\r\n return { value: value };\r\n });\r\n };\r\n var dataExtent = data.getDataExtent('value');\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n scale.niceTicks();\r\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\r\n axis.model = timelineModel;\r\n return axis;\r\n };\r\n SliderTimelineView.prototype._createGroup = function (key) {\r\n var newGroup = this[key] = new Group();\r\n this.group.add(newGroup);\r\n return newGroup;\r\n };\r\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\r\n var axisExtent = axis.getExtent();\r\n if (!timelineModel.get(['lineStyle', 'show'])) {\r\n return;\r\n }\r\n var line = new Line({\r\n shape: {\r\n x1: axisExtent[0], y1: 0,\r\n x2: axisExtent[1], y2: 0\r\n },\r\n style: extend({ lineCap: 'round' }, timelineModel.getModel('lineStyle').getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(line);\r\n var progressLine = this._progressLine = new Line({\r\n shape: {\r\n x1: axisExtent[0],\r\n x2: this._currentPointer\r\n ? this._currentPointer.x : axisExtent[0],\r\n y1: 0, y2: 0\r\n },\r\n style: defaults({ lineCap: 'round', lineWidth: line.style.lineWidth }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(progressLine);\r\n };\r\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var data = timelineModel.getData();\r\n var ticks = axis.scale.getTicks();\r\n this._tickSymbols = [];\r\n each(ticks, function (tick) {\r\n var tickCoord = axis.dataToCoord(tick.value);\r\n var itemModel = data.getItemModel(tick.value);\r\n var itemStyleModel = itemModel.getModel('itemStyle');\r\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\r\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\r\n var symbolOpt = {\r\n x: tickCoord,\r\n y: 0,\r\n onclick: bind(_this._changeTimeline, _this, tick.value)\r\n };\r\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\r\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\r\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\r\n enableHoverEmphasis(el);\r\n var ecData = getECData(el);\r\n if (itemModel.get('tooltip')) {\r\n ecData.dataIndex = tick.value;\r\n ecData.dataModel = timelineModel;\r\n }\r\n else {\r\n ecData.dataIndex = ecData.dataModel = null;\r\n }\r\n _this._tickSymbols.push(el);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var labelModel = axis.getLabelModel();\r\n if (!labelModel.get('show')) {\r\n return;\r\n }\r\n var data = timelineModel.getData();\r\n var labels = axis.getViewLabels();\r\n this._tickLabels = [];\r\n each(labels, function (labelItem) {\r\n var dataIndex = labelItem.tickValue;\r\n var itemModel = data.getItemModel(dataIndex);\r\n var normalLabelModel = itemModel.getModel('label');\r\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\r\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\r\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: 0,\r\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\r\n onclick: bind(_this._changeTimeline, _this, dataIndex),\r\n silent: false,\r\n style: createTextStyle(normalLabelModel, {\r\n text: labelItem.formattedLabel,\r\n align: layoutInfo.labelAlign,\r\n verticalAlign: layoutInfo.labelBaseline\r\n })\r\n });\r\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\r\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\r\n group.add(textEl);\r\n enableHoverEmphasis(textEl);\r\n labelDataIndexStore(textEl).dataIndex = dataIndex;\r\n _this._tickLabels.push(textEl);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\r\n var controlSize = layoutInfo.controlSize;\r\n var rotation = layoutInfo.rotation;\r\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\r\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\r\n var playState = timelineModel.getPlayState();\r\n var inverse = timelineModel.get('inverse', true);\r\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\r\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\r\n makeBtn(layoutInfo.playPosition, (playState ? 'stop' : 'play'), bind(this._handlePlayClick, this, !playState), true);\r\n function makeBtn(position, iconName, onclick, willRotate) {\r\n if (!position) {\r\n return;\r\n }\r\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\r\n var rect = [0, -iconSize / 2, iconSize, iconSize];\r\n var opt = {\r\n position: position,\r\n origin: [controlSize / 2, 0],\r\n rotation: willRotate ? -rotation : 0,\r\n rectHover: true,\r\n style: itemStyle,\r\n onclick: onclick\r\n };\r\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, opt);\r\n btn.ensureState('emphasis').style = hoverStyle;\r\n group.add(btn);\r\n enableHoverEmphasis(btn);\r\n }\r\n };\r\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\r\n var data = timelineModel.getData();\r\n var currentIndex = timelineModel.getCurrentIndex();\r\n var pointerModel = data.getItemModel(currentIndex)\r\n .getModel('checkpointStyle');\r\n var me = this;\r\n var callback = {\r\n onCreate: function (pointer) {\r\n pointer.draggable = true;\r\n pointer.drift = bind(me._handlePointerDrag, me);\r\n pointer.ondragend = bind(me._handlePointerDragend, me);\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\r\n },\r\n onUpdate: function (pointer) {\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\r\n }\r\n };\r\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\r\n };\r\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\r\n this._clearTimer();\r\n this.api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: nextState,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\r\n this._clearTimer();\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\r\n };\r\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\r\n };\r\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\r\n var toCoord = this._toAxisCoord(mousePos)[0];\r\n var axis = this._axis;\r\n var axisExtent = asc(axis.getExtent().slice());\r\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\r\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\r\n this._currentPointer.x = toCoord;\r\n this._currentPointer.markRedraw();\r\n this._progressLine.shape.x2 = toCoord;\r\n this._progressLine.dirty();\r\n var targetDataIndex = this._findNearestTick(toCoord);\r\n var timelineModel = this.model;\r\n if (trigger || (targetDataIndex !== timelineModel.getCurrentIndex()\r\n && timelineModel.get('realtime'))) {\r\n this._changeTimeline(targetDataIndex);\r\n }\r\n };\r\n SliderTimelineView.prototype._doPlayStop = function () {\r\n var _this = this;\r\n this._clearTimer();\r\n if (this.model.getPlayState()) {\r\n this._timer = setTimeout(function () {\r\n var timelineModel = _this.model;\r\n _this._changeTimeline(timelineModel.getCurrentIndex()\r\n + (timelineModel.get('rewind', true) ? -1 : 1));\r\n }, this.model.get('playInterval'));\r\n }\r\n };\r\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\r\n var trans = this._mainGroup.getLocalTransform();\r\n return applyTransform$1(vertex, trans, true);\r\n };\r\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\r\n var data = this.model.getData();\r\n var dist = Infinity;\r\n var targetDataIndex;\r\n var axis = this._axis;\r\n data.each(['value'], function (value, dataIndex) {\r\n var coord = axis.dataToCoord(value);\r\n var d = Math.abs(coord - axisCoord);\r\n if (d < dist) {\r\n dist = d;\r\n targetDataIndex = dataIndex;\r\n }\r\n });\r\n return targetDataIndex;\r\n };\r\n SliderTimelineView.prototype._clearTimer = function () {\r\n if (this._timer) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n };\r\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\r\n var currentIndex = this.model.getCurrentIndex();\r\n if (nextIndex === '+') {\r\n nextIndex = currentIndex + 1;\r\n }\r\n else if (nextIndex === '-') {\r\n nextIndex = currentIndex - 1;\r\n }\r\n this.api.dispatchAction({\r\n type: 'timelineChange',\r\n currentIndex: nextIndex,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._updateTicksStatus = function () {\r\n var currentIndex = this.model.getCurrentIndex();\r\n var tickSymbols = this._tickSymbols;\r\n var tickLabels = this._tickLabels;\r\n if (tickSymbols) {\r\n for (var i = 0; i < tickSymbols.length; i++) {\r\n tickSymbols && tickSymbols[i]\r\n && tickSymbols[i].toggleState('progress', i < currentIndex);\r\n }\r\n }\r\n if (tickLabels) {\r\n for (var i = 0; i < tickLabels.length; i++) {\r\n tickLabels && tickLabels[i]\r\n && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\r\n }\r\n }\r\n };\r\n SliderTimelineView.type = 'timeline.slider';\r\n return SliderTimelineView;\r\n }(TimelineView));\r\n function createScaleByModel$1(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new IntervalScale();\r\n }\r\n }\r\n }\r\n function getViewRect$5(model, api) {\r\n return getLayoutRect(model.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, model.get('padding'));\r\n }\r\n function makeControlIcon(timelineModel, objPath, rect, opts) {\r\n var style = opts.style;\r\n var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\r\n if (style) {\r\n icon.setStyle(style);\r\n }\r\n return icon;\r\n }\r\n function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\r\n var color = itemStyleModel.get('color');\r\n if (!symbol) {\r\n var symbolType = hostModel.get('symbol');\r\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n symbol.setStyle('strokeNoScale', true);\r\n group.add(symbol);\r\n callback && callback.onCreate(symbol);\r\n }\r\n else {\r\n symbol.setColor(color);\r\n group.add(symbol);\r\n callback && callback.onUpdate(symbol);\r\n }\r\n var itemStyle = itemStyleModel.getItemStyle(['color']);\r\n symbol.setStyle(itemStyle);\r\n opt = merge({\r\n rectHover: true,\r\n z2: 100\r\n }, opt, true);\r\n var symbolSize = hostModel.get('symbolSize');\r\n symbolSize = symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n opt.scaleX = symbolSize[0] / 2;\r\n opt.scaleY = symbolSize[1] / 2;\r\n var symbolOffset = hostModel.get('symbolOffset');\r\n if (symbolOffset) {\r\n opt.x = opt.x || 0;\r\n opt.y = opt.y || 0;\r\n opt.x += parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n opt.y += parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = hostModel.get('symbolRotate');\r\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n symbol.attr(opt);\r\n symbol.updateTransform();\r\n return symbol;\r\n }\r\n function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\r\n if (pointer.dragging) {\r\n return;\r\n }\r\n var pointerModel = timelineModel.getModel('checkpointStyle');\r\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\r\n if (noAnimation || !pointerModel.get('animation', true)) {\r\n pointer.attr({\r\n x: toCoord,\r\n y: 0\r\n });\r\n progressLine && progressLine.attr({\r\n shape: { x2: toCoord }\r\n });\r\n }\r\n else {\r\n var animationCfg = {\r\n duration: pointerModel.get('animationDuration', true),\r\n easing: pointerModel.get('animationEasing', true)\r\n };\r\n pointer.stopAnimation(null, true);\r\n pointer.animateTo({\r\n x: toCoord,\r\n y: 0\r\n }, animationCfg);\r\n progressLine && progressLine.animateTo({\r\n shape: { x2: toCoord }\r\n }, animationCfg);\r\n }\r\n }\r\n ComponentView.registerClass(SliderTimelineView);\n\n registerPreprocessor(timelinePreprocessor);\n\n function fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n }\r\n var inner$i = makeInner();\r\n var MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$i(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$i(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$i(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$i(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n }(ComponentModel));\r\n mixin(MarkerModel, DataFormatMixin.prototype);\n\n var MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkPointModel);\n\n function hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n }\r\n function hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n }\r\n function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n }\r\n var markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n };\r\n function dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n }\r\n function getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n }\r\n function dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n }\r\n function dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n }\r\n function dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n }\r\n function numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n }\n\n var inner$j = makeInner();\r\n var MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$j(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$j(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$j(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n }(ComponentView));\n\n function updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n }\r\n var MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n }(MarkerView));\r\n function createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n }\r\n ComponentView.registerClass(MarkPointView);\n\n registerPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n });\n\n var MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkLineModel);\n\n var inner$k = makeInner();\r\n var markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n };\r\n function isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n }\r\n function markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n }\r\n function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n }\r\n var MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$k(mlModel).from;\r\n var toData_1 = inner$k(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$k(mlModel).from = fromData;\r\n inner$k(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n }(MarkerView));\r\n function createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n }\r\n ComponentView.registerClass(MarkLineView);\n\n registerPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n });\n\n var MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkAreaModel);\n\n var inner$l = makeInner();\r\n var markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n };\r\n function isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n }\r\n function markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n }\r\n function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n }\r\n var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\n var MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$l(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$l(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n }(MarkerView));\r\n function createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n }\r\n ComponentView.registerClass(MarkAreaView);\n\n registerPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n });\n\n var getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n };\r\n var LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(LegendModel);\n\n function legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n }\r\n registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\n registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\n registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\n registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\n registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\n var curry$1 = curry;\r\n var each$e = each;\r\n var Group$2 = Group;\r\n var LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$2());\r\n this.group.add(this._selectorGroup = new Group$2());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$e(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$2();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$e(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$2();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n }(ComponentView));\r\n function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n }\r\n function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n }\r\n function isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n }\r\n function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n ComponentView.registerClass(LegendView);\n\n function legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\n ComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n });\n\n var ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n }(LegendModel));\r\n function mergeAndNormalizeLayoutParams$1(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(ScrollableLegendModel);\n\n var Group$3 = Group;\r\n var WH$1 = ['width', 'height'];\r\n var XY$1 = ['x', 'y'];\r\n var ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$3());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$3());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var hw = WH$1[1 - orientIdx];\r\n var yx = XY$1[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n }(LegendView));\r\n ComponentView.registerClass(ScrollableLegendView);\n\n registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n });\n\n var SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SliderZoomModel);\n\n var Rect$2 = Rect;\r\n var DEFAULT_LOCATION_EDGE_GAP = 7;\r\n var DEFAULT_FRAME_BORDER_WIDTH = 1;\r\n var DEFAULT_FILLER_SIZE = 30;\r\n var DEFAULT_MOVE_HANDLE_SIZE = 7;\r\n var HORIZONTAL = 'horizontal';\r\n var VERTICAL = 'vertical';\r\n var LABEL_GAP = 5;\r\n var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\n var REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n };\r\n var SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$2({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$2({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$2({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$2({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$2({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n }(DataZoomView));\r\n function getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n }\r\n function getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(SliderZoomView);\n\n var InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(InsideZoomModel);\n\n var inner$m = makeInner();\r\n registerProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$m(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n });\r\n function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$m(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n }\r\n function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$m(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n }\r\n function createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction$1, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n }\r\n function dispatchAction$1(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n }\r\n function containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n }\r\n function mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n }\n\n var InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n }(DataZoomView));\r\n var getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n };\r\n function makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n }\r\n var getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n };\r\n ComponentView.registerClass(InsideZoomView);\n\n var each$f = each;\r\n function visualMapPreprocessor(option) {\r\n var visualMap = option && option.visualMap;\r\n if (!isArray(visualMap)) {\r\n visualMap = visualMap ? [visualMap] : [];\r\n }\r\n each$f(visualMap, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) {\r\n opt.pieces = opt.splitList;\r\n delete opt.splitList;\r\n }\r\n var pieces = opt.pieces;\r\n if (pieces && isArray(pieces)) {\r\n each$f(pieces, function (piece) {\r\n if (isObject(piece)) {\r\n if (has$1(piece, 'start') && !has$1(piece, 'min')) {\r\n piece.min = piece.start;\r\n }\r\n if (has$1(piece, 'end') && !has$1(piece, 'max')) {\r\n piece.max = piece.end;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n function has$1(obj, name) {\r\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\r\n }\n\n ComponentModel.registerSubTypeDefaulter('visualMap', function (option) {\r\n return (!option.categories\r\n && (!(option.pieces\r\n ? option.pieces.length > 0\r\n : option.splitNumber > 0)\r\n || option.calculable))\r\n ? 'continuous' : 'piecewise';\r\n });\n\n var VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT;\r\n registerVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var resetDefines = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!visualMapModel.isTargetSeries(seriesModel)\r\n || (pipelineContext && pipelineContext.large)) {\r\n return;\r\n }\r\n resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\r\n });\r\n return resetDefines;\r\n }\r\n });\r\n registerVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var visualMetaList = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n if (visualMapModel.isTargetSeries(seriesModel)) {\r\n var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {\r\n stops: [],\r\n outerColors: []\r\n };\r\n var concreteDim = visualMapModel.getDataDimension(data);\r\n var dimInfo = data.getDimensionInfo(concreteDim);\r\n if (dimInfo != null) {\r\n visualMeta.dimension = dimInfo.index;\r\n visualMetaList.push(visualMeta);\r\n }\r\n }\r\n });\r\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\r\n }\r\n });\r\n function getColorVisual(seriesModel, visualMapModel, value, valueState) {\r\n var mappings = visualMapModel.targetVisuals[valueState];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n var resultVisual = {\r\n color: getVisualFromData(seriesModel.getData(), 'color')\r\n };\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n var mapping = mappings[(type === 'opacity' ? '__alphaForOpacity' : type)];\r\n mapping && mapping.applyVisual(value, getVisual, setVisual);\r\n }\r\n return resultVisual.color;\r\n function getVisual(key) {\r\n return resultVisual[key];\r\n }\r\n function setVisual(key, value) {\r\n resultVisual[key] = value;\r\n }\r\n }\n\n var visualDefault = {\r\n get: function (visualType, key, isCategory) {\r\n var value = clone((defaultOption$2[visualType] || {})[key]);\r\n return isCategory\r\n ? (isArray(value) ? value[value.length - 1] : value)\r\n : value;\r\n }\r\n };\r\n var defaultOption$2 = {\r\n color: {\r\n active: ['#006edd', '#e0ffff'],\r\n inactive: ['rgba(0,0,0,0)']\r\n },\r\n colorHue: {\r\n active: [0, 360],\r\n inactive: [0, 0]\r\n },\r\n colorSaturation: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n colorLightness: {\r\n active: [0.9, 0.5],\r\n inactive: [0, 0]\r\n },\r\n colorAlpha: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n opacity: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n symbol: {\r\n active: ['circle', 'roundRect', 'diamond'],\r\n inactive: ['none']\r\n },\r\n symbolSize: {\r\n active: [10, 50],\r\n inactive: [0, 0]\r\n }\r\n };\n\n var mapVisual$1 = VisualMapping.mapVisual;\r\n var eachVisual = VisualMapping.eachVisual;\r\n var isArray$1 = isArray;\r\n var each$g = each;\r\n var asc$2 = asc;\r\n var linearMap$1 = linearMap;\r\n var VisualMapModel = (function (_super) {\r\n __extends(VisualMapModel, _super);\r\n function VisualMapModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapModel.type;\r\n _this.stateList = ['inRange', 'outOfRange'];\r\n _this.replacableOptionKeys = [\r\n 'inRange', 'outOfRange', 'target', 'controller', 'color'\r\n ];\r\n _this.layoutMode = {\r\n type: 'box', ignoreSize: true\r\n };\r\n _this.dataBound = [-Infinity, Infinity];\r\n _this.targetVisuals = {};\r\n _this.controllerVisuals = {};\r\n return _this;\r\n }\r\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n if (!env.canvasSupported) {\r\n thisOption.realtime = false;\r\n }\r\n !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\r\n this.textStyleModel = this.getModel('textStyle');\r\n this.resetItemSize();\r\n this.completeVisualOption();\r\n };\r\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\r\n var stateList = this.stateList;\r\n supplementVisualOption = bind(supplementVisualOption, this);\r\n this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);\r\n this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);\r\n };\r\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\r\n var optionSeriesIndex = this.option.seriesIndex;\r\n var seriesIndices = [];\r\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\r\n this.ecModel.eachSeries(function (seriesModel, index) {\r\n seriesIndices.push(index);\r\n });\r\n }\r\n else {\r\n seriesIndices = normalizeToArray(optionSeriesIndex);\r\n }\r\n return seriesIndices;\r\n };\r\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\r\n each(this.getTargetSeriesIndices(), function (seriesIndex) {\r\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\r\n if (seriesModel) {\r\n callback.call(context, seriesModel);\r\n }\r\n }, this);\r\n };\r\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\r\n var is = false;\r\n this.eachTargetSeries(function (model) {\r\n model === seriesModel && (is = true);\r\n });\r\n return is;\r\n };\r\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\r\n var option = this.option;\r\n var precision = option.precision;\r\n var dataBound = this.dataBound;\r\n var formatter = option.formatter;\r\n var isMinMax;\r\n edgeSymbols = edgeSymbols || ['<', '>'];\r\n if (isArray(value)) {\r\n value = value.slice();\r\n isMinMax = true;\r\n }\r\n var textValue = isCategory\r\n ? value\r\n : (isMinMax\r\n ? [toFixed(value[0]), toFixed(value[1])]\r\n : toFixed(value));\r\n if (isString(formatter)) {\r\n return formatter\r\n .replace('{value}', isMinMax ? textValue[0] : textValue)\r\n .replace('{value2}', isMinMax ? textValue[1] : textValue);\r\n }\r\n else if (isFunction(formatter)) {\r\n return isMinMax\r\n ? formatter(value[0], value[1])\r\n : formatter(value);\r\n }\r\n if (isMinMax) {\r\n if (value[0] === dataBound[0]) {\r\n return edgeSymbols[0] + ' ' + textValue[1];\r\n }\r\n else if (value[1] === dataBound[1]) {\r\n return edgeSymbols[1] + ' ' + textValue[0];\r\n }\r\n else {\r\n return textValue[0] + ' - ' + textValue[1];\r\n }\r\n }\r\n else {\r\n return textValue;\r\n }\r\n function toFixed(val) {\r\n return val === dataBound[0]\r\n ? 'min'\r\n : val === dataBound[1]\r\n ? 'max'\r\n : (+val).toFixed(Math.min(precision, 20));\r\n }\r\n };\r\n VisualMapModel.prototype.resetExtent = function () {\r\n var thisOption = this.option;\r\n var extent = asc$2([thisOption.min, thisOption.max]);\r\n this._dataExtent = extent;\r\n };\r\n VisualMapModel.prototype.getDataDimension = function (list) {\r\n var optDim = this.option.dimension;\r\n var listDimensions = list.dimensions;\r\n if (optDim == null && !listDimensions.length) {\r\n return;\r\n }\r\n if (optDim != null) {\r\n return list.getDimension(optDim);\r\n }\r\n var dimNames = list.dimensions;\r\n for (var i = dimNames.length - 1; i >= 0; i--) {\r\n var dimName = dimNames[i];\r\n var dimInfo = list.getDimensionInfo(dimName);\r\n if (!dimInfo.isCalculationCoord) {\r\n return dimName;\r\n }\r\n }\r\n };\r\n VisualMapModel.prototype.getExtent = function () {\r\n return this._dataExtent.slice();\r\n };\r\n VisualMapModel.prototype.completeVisualOption = function () {\r\n var ecModel = this.ecModel;\r\n var thisOption = this.option;\r\n var base = {\r\n inRange: thisOption.inRange,\r\n outOfRange: thisOption.outOfRange\r\n };\r\n var target = thisOption.target || (thisOption.target = {});\r\n var controller = thisOption.controller || (thisOption.controller = {});\r\n merge(target, base);\r\n merge(controller, base);\r\n var isCategory = this.isCategory();\r\n completeSingle.call(this, target);\r\n completeSingle.call(this, controller);\r\n completeInactive.call(this, target, 'inRange', 'outOfRange');\r\n completeController.call(this, controller);\r\n function completeSingle(base) {\r\n if (isArray$1(thisOption.color)\r\n && !base.inRange) {\r\n base.inRange = { color: thisOption.color.slice().reverse() };\r\n }\r\n base.inRange = base.inRange || { color: ecModel.get('gradientColor') };\r\n }\r\n function completeInactive(base, stateExist, stateAbsent) {\r\n var optExist = base[stateExist];\r\n var optAbsent = base[stateAbsent];\r\n if (optExist && !optAbsent) {\r\n optAbsent = base[stateAbsent] = {};\r\n each$g(optExist, function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\r\n if (defa != null) {\r\n optAbsent[visualType] = defa;\r\n if (visualType === 'color'\r\n && !optAbsent.hasOwnProperty('opacity')\r\n && !optAbsent.hasOwnProperty('colorAlpha')) {\r\n optAbsent.opacity = [0, 0];\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function completeController(controller) {\r\n var symbolExists = (controller.inRange || {}).symbol\r\n || (controller.outOfRange || {}).symbol;\r\n var symbolSizeExists = (controller.inRange || {}).symbolSize\r\n || (controller.outOfRange || {}).symbolSize;\r\n var inactiveColor = this.get('inactiveColor');\r\n each$g(this.stateList, function (state) {\r\n var itemSize = this.itemSize;\r\n var visuals = controller[state];\r\n if (!visuals) {\r\n visuals = controller[state] = {\r\n color: isCategory ? inactiveColor : [inactiveColor]\r\n };\r\n }\r\n if (visuals.symbol == null) {\r\n visuals.symbol = symbolExists\r\n && clone(symbolExists)\r\n || (isCategory ? 'roundRect' : ['roundRect']);\r\n }\r\n if (visuals.symbolSize == null) {\r\n visuals.symbolSize = symbolSizeExists\r\n && clone(symbolSizeExists)\r\n || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\r\n }\r\n visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) {\r\n return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol;\r\n });\r\n var symbolSize = visuals.symbolSize;\r\n if (symbolSize != null) {\r\n var max_1 = -Infinity;\r\n eachVisual(symbolSize, function (value) {\r\n value > max_1 && (max_1 = value);\r\n });\r\n visuals.symbolSize = mapVisual$1(symbolSize, function (value) {\r\n return linearMap$1(value, [0, max_1], [0, itemSize[0]], true);\r\n });\r\n }\r\n }, this);\r\n }\r\n };\r\n VisualMapModel.prototype.resetItemSize = function () {\r\n this.itemSize = [\r\n parseFloat(this.get('itemWidth')),\r\n parseFloat(this.get('itemHeight'))\r\n ];\r\n };\r\n VisualMapModel.prototype.isCategory = function () {\r\n return !!this.option.categories;\r\n };\r\n VisualMapModel.prototype.setSelected = function (selected) { };\r\n VisualMapModel.prototype.getSelected = function () {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getValueState = function (value) {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\r\n return null;\r\n };\r\n VisualMapModel.type = 'visualMap';\r\n VisualMapModel.dependencies = ['series'];\r\n VisualMapModel.defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 4,\r\n seriesIndex: 'all',\r\n min: 0,\r\n max: 200,\r\n left: 0,\r\n right: null,\r\n top: null,\r\n bottom: 0,\r\n itemWidth: null,\r\n itemHeight: null,\r\n inverse: false,\r\n orient: 'vertical',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n contentColor: '#5793f3',\r\n inactiveColor: '#aaa',\r\n borderWidth: 0,\r\n padding: 5,\r\n textGap: 10,\r\n precision: 0,\r\n textStyle: {\r\n color: '#333'\r\n }\r\n };\r\n return VisualMapModel;\r\n }(ComponentModel));\n\n var DEFAULT_BAR_BOUND = [20, 140];\r\n var ContinuousModel = (function (_super) {\r\n __extends(ContinuousModel, _super);\r\n function ContinuousModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousModel.type;\r\n return _this;\r\n }\r\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n this.resetVisual(function (mappingOption) {\r\n mappingOption.mappingMethod = 'linear';\r\n mappingOption.dataExtent = this.getExtent();\r\n });\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.resetItemSize = function () {\r\n _super.prototype.resetItemSize.apply(this, arguments);\r\n var itemSize = this.itemSize;\r\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\r\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\r\n };\r\n ContinuousModel.prototype._resetRange = function () {\r\n var dataExtent = this.getExtent();\r\n var range = this.option.range;\r\n if (!range || range.auto) {\r\n dataExtent.auto = 1;\r\n this.option.range = dataExtent;\r\n }\r\n else if (isArray(range)) {\r\n if (range[0] > range[1]) {\r\n range.reverse();\r\n }\r\n range[0] = Math.max(range[0], dataExtent[0]);\r\n range[1] = Math.min(range[1], dataExtent[1]);\r\n }\r\n };\r\n ContinuousModel.prototype.completeVisualOption = function () {\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n each(this.stateList, function (state) {\r\n var symbolSize = this.option.controller[state].symbolSize;\r\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\r\n symbolSize[0] = symbolSize[1] / 3;\r\n }\r\n }, this);\r\n };\r\n ContinuousModel.prototype.setSelected = function (selected) {\r\n this.option.range = selected.slice();\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.getSelected = function () {\r\n var dataExtent = this.getExtent();\r\n var dataInterval = asc((this.get('range') || []).slice());\r\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\r\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\r\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\r\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\r\n return dataInterval;\r\n };\r\n ContinuousModel.prototype.getValueState = function (value) {\r\n var range = this.option.range;\r\n var dataExtent = this.getExtent();\r\n return ((range[0] <= dataExtent[0] || range[0] <= value)\r\n && (range[1] >= dataExtent[1] || value <= range[1])) ? 'inRange' : 'outOfRange';\r\n };\r\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\r\n var result = [];\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndices\r\n });\r\n }, this);\r\n return result;\r\n };\r\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\r\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\r\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\r\n var stops = [];\r\n function setStop(value, valueState) {\r\n stops.push({\r\n value: value,\r\n color: getColorVisual(value, valueState)\r\n });\r\n }\r\n var iIdx = 0;\r\n var oIdx = 0;\r\n var iLen = iVals.length;\r\n var oLen = oVals.length;\r\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\r\n if (oVals[oIdx] < iVals[iIdx]) {\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\r\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\r\n setStop(iVals[iIdx], 'inRange');\r\n }\r\n for (var first = 1; oIdx < oLen; oIdx++) {\r\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\r\n if (first) {\r\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\r\n first = 0;\r\n }\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n var stopsLen = stops.length;\r\n return {\r\n stops: stops,\r\n outerColors: [\r\n stopsLen ? stops[0].color : 'transparent',\r\n stopsLen ? stops[stopsLen - 1].color : 'transparent'\r\n ]\r\n };\r\n };\r\n ContinuousModel.type = 'visualMap.continuous';\r\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n align: 'auto',\r\n calculable: false,\r\n hoverLink: true,\r\n realtime: true,\r\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\r\n handleSize: '120%',\r\n handleStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n indicatorIcon: 'circle',\r\n indicatorSize: '50%',\r\n indicatorStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n });\r\n return ContinuousModel;\r\n }(VisualMapModel));\r\n function getColorStopValues(visualMapModel, valueState, dataExtent) {\r\n if (dataExtent[0] === dataExtent[1]) {\r\n return dataExtent.slice();\r\n }\r\n var count = 200;\r\n var step = (dataExtent[1] - dataExtent[0]) / count;\r\n var value = dataExtent[0];\r\n var stopValues = [];\r\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\r\n stopValues.push(value);\r\n value += step;\r\n }\r\n stopValues.push(dataExtent[1]);\r\n return stopValues;\r\n }\r\n ComponentModel.registerClass(ContinuousModel);\n\n var VisualMapView = (function (_super) {\r\n __extends(VisualMapView, _super);\r\n function VisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapView.type;\r\n _this.autoPositionValues = { left: 1, right: 1, top: 1, bottom: 1 };\r\n return _this;\r\n }\r\n VisualMapView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload) {\r\n this.visualMapModel = visualMapModel;\r\n if (visualMapModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n this.doRender(visualMapModel, ecModel, api, payload);\r\n };\r\n VisualMapView.prototype.renderBackground = function (group) {\r\n var visualMapModel = this.visualMapModel;\r\n var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0);\r\n var rect = group.getBoundingRect();\r\n group.add(new Rect({\r\n z2: -1,\r\n silent: true,\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[3] + padding[1],\r\n height: rect.height + padding[0] + padding[2]\r\n },\r\n style: {\r\n fill: visualMapModel.get('backgroundColor'),\r\n stroke: visualMapModel.get('borderColor'),\r\n lineWidth: visualMapModel.get('borderWidth')\r\n }\r\n }));\r\n };\r\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\r\n opts = opts || {};\r\n var forceState = opts.forceState;\r\n var visualMapModel = this.visualMapModel;\r\n var visualObj = {};\r\n if (visualCluster === 'symbol') {\r\n visualObj.symbol = visualMapModel.get('itemSymbol');\r\n }\r\n if (visualCluster === 'color') {\r\n var defaultColor = visualMapModel.get('contentColor');\r\n visualObj.color = defaultColor;\r\n }\r\n function getter(key) {\r\n return visualObj[key];\r\n }\r\n function setter(key, value) {\r\n visualObj[key] = value;\r\n }\r\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n each(visualTypes, function (type) {\r\n var visualMapping = mappings[type];\r\n if (opts.convertOpacityToAlpha && type === 'opacity') {\r\n type = 'colorAlpha';\r\n visualMapping = mappings.__alphaForOpacity;\r\n }\r\n if (VisualMapping.dependsOn(type, visualCluster)) {\r\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\r\n }\r\n });\r\n return visualObj[visualCluster];\r\n };\r\n VisualMapView.prototype.positionGroup = function (group) {\r\n var model = this.visualMapModel;\r\n var api = this.api;\r\n positionElement(group, model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() });\r\n };\r\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { };\r\n VisualMapView.type = 'visualMap';\r\n return VisualMapView;\r\n }(ComponentView));\r\n ComponentView.registerClass(VisualMapView);\n\n var paramsSet = [\r\n ['left', 'right', 'width'],\r\n ['top', 'bottom', 'height']\r\n ];\r\n function getItemAlign(visualMapModel, api, itemSize) {\r\n var modelOption = visualMapModel.option;\r\n var itemAlign = modelOption.align;\r\n if (itemAlign != null && itemAlign !== 'auto') {\r\n return itemAlign;\r\n }\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\r\n var reals = paramsSet[realIndex];\r\n var fakeValue = [0, null, 10];\r\n var layoutInput = {};\r\n for (var i = 0; i < 3; i++) {\r\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\r\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\r\n }\r\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\r\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\r\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5\r\n < ecSize[rParam[1]] * 0.5 ? 0 : 1];\r\n }\r\n function makeHighDownBatch(batch, visualMapModel) {\r\n each(batch || [], function (batchItem) {\r\n if (batchItem.dataIndex != null) {\r\n batchItem.dataIndexInside = batchItem.dataIndex;\r\n batchItem.dataIndex = null;\r\n }\r\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\r\n });\r\n return batch;\r\n }\n\n var linearMap$2 = linearMap;\r\n var each$h = each;\r\n var mathMin$a = Math.min;\r\n var mathMax$a = Math.max;\r\n var HOVER_LINK_SIZE = 12;\r\n var HOVER_LINK_OUT = 6;\r\n var ContinuousView = (function (_super) {\r\n __extends(ContinuousView, _super);\r\n function ContinuousView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousView.type;\r\n _this._shapes = {};\r\n _this._dataInterval = [];\r\n _this._handleEnds = [];\r\n _this._hoverLinkDataIndices = [];\r\n return _this;\r\n }\r\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\r\n this._api = api;\r\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n };\r\n ContinuousView.prototype._buildView = function () {\r\n this.group.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var thisGroup = this.group;\r\n this._orient = visualMapModel.get('orient');\r\n this._useHandle = visualMapModel.get('calculable');\r\n this._resetInterval();\r\n this._renderBar(thisGroup);\r\n var dataRangeText = visualMapModel.get('text');\r\n this._renderEndsText(thisGroup, dataRangeText, 0);\r\n this._renderEndsText(thisGroup, dataRangeText, 1);\r\n this._updateView(true);\r\n this.renderBackground(thisGroup);\r\n this._updateView();\r\n this._enableHoverLinkToSeries();\r\n this._enableHoverLinkFromSeries();\r\n this.positionGroup(thisGroup);\r\n };\r\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\r\n if (!dataRangeText) {\r\n return;\r\n }\r\n var text = dataRangeText[1 - endsIndex];\r\n text = text != null ? text + '' : '';\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var itemSize = visualMapModel.itemSize;\r\n var barGroup = this._shapes.mainGroup;\r\n var position = this._applyTransform([\r\n itemSize[0] / 2,\r\n endsIndex === 0 ? -textGap : itemSize[1] + textGap\r\n ], barGroup);\r\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\r\n var orient = this._orient;\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n this.group.add(new ZRText({\r\n style: {\r\n x: position[0],\r\n y: position[1],\r\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\r\n align: orient === 'horizontal' ? align : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n };\r\n ContinuousView.prototype._renderBar = function (targetGroup) {\r\n var visualMapModel = this.visualMapModel;\r\n var shapes = this._shapes;\r\n var itemSize = visualMapModel.itemSize;\r\n var orient = this._orient;\r\n var useHandle = this._useHandle;\r\n var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);\r\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\r\n var gradientBarGroup = new Group();\r\n mainGroup.add(gradientBarGroup);\r\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\r\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true)));\r\n gradientBarGroup.setClipPath(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: itemSize[0],\r\n height: itemSize[1],\r\n r: 3\r\n }\r\n }));\r\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\r\n var textSize = mathMax$a(textRect.width, textRect.height);\r\n if (useHandle) {\r\n shapes.handleThumbs = [];\r\n shapes.handleLabels = [];\r\n shapes.handleLabelPoints = [];\r\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\r\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\r\n }\r\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\r\n targetGroup.add(mainGroup);\r\n };\r\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\r\n var onDrift = bind(this._dragHandle, this, handleIndex, false);\r\n var onDragEnd = bind(this._dragHandle, this, handleIndex, true);\r\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\r\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\r\n var cursor = getCursor$1(this._orient);\r\n handleThumb.attr({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n ondragend: onDragEnd,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n }\r\n });\r\n handleThumb.x = itemSize[0] / 2;\r\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\r\n handleThumb.setStyle({\r\n strokeNoScale: true,\r\n strokeFirst: true\r\n });\r\n handleThumb.style.lineWidth *= 2;\r\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n setAsHighDownDispatcher(handleThumb, true);\r\n mainGroup.add(handleThumb);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var handleLabel = new ZRText({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n handleLabel.ensureState('blur').style = {\r\n opacity: 0.1\r\n };\r\n handleLabel.stateTransition = { duration: 200 };\r\n this.group.add(handleLabel);\r\n var handleLabelPoint = [handleSize, 0];\r\n var shapes = this._shapes;\r\n shapes.handleThumbs[handleIndex] = handleThumb;\r\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\r\n shapes.handleLabels[handleIndex] = handleLabel;\r\n };\r\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\r\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\r\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\r\n indicator.attr({\r\n cursor: 'move',\r\n invisible: true,\r\n silent: true,\r\n x: itemSize[0] / 2\r\n });\r\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\r\n if (indicator instanceof ZRImage) {\r\n var pathStyle = indicator.style;\r\n indicator.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, indicatorStyle));\r\n }\r\n else {\r\n indicator.useStyle(indicatorStyle);\r\n }\r\n mainGroup.add(indicator);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var indicatorLabel = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n this.group.add(indicatorLabel);\r\n var indicatorLabelPoint = [\r\n (orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2,\r\n 0\r\n ];\r\n var shapes = this._shapes;\r\n shapes.indicator = indicator;\r\n shapes.indicatorLabel = indicatorLabel;\r\n shapes.indicatorLabelPoint = indicatorLabelPoint;\r\n this._firstShowIndicator = true;\r\n };\r\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, dx, dy) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n this._dragging = !isEnd;\r\n if (!isEnd) {\r\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\r\n this._updateInterval(handleIndex, vertex[1]);\r\n this._hideIndicator();\r\n this._updateView();\r\n }\r\n if (isEnd === !this.visualMapModel.get('realtime')) {\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: this._dataInterval.slice()\r\n });\r\n }\r\n if (isEnd) {\r\n !this._hovering && this._clearHoverLinkToSeries();\r\n }\r\n else if (useHoverLinkOnHandle(this.visualMapModel)) {\r\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\r\n }\r\n };\r\n ContinuousView.prototype._resetInterval = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\r\n var dataExtent = visualMapModel.getExtent();\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n this._handleEnds = [\r\n linearMap$2(dataInterval[0], dataExtent, sizeExtent, true),\r\n linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\r\n delta = delta || 0;\r\n var visualMapModel = this.visualMapModel;\r\n var handleEnds = this._handleEnds;\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, 0);\r\n var dataExtent = visualMapModel.getExtent();\r\n this._dataInterval = [\r\n linearMap$2(handleEnds[0], sizeExtent, dataExtent, true),\r\n linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateView = function (forSketch) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var shapes = this._shapes;\r\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\r\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\r\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\r\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\r\n shapes.inRange\r\n .setStyle({\r\n fill: visualInRange.barColor\r\n })\r\n .setShape('points', visualInRange.barPoints);\r\n shapes.outOfRange\r\n .setStyle({\r\n fill: visualOutOfRange.barColor\r\n })\r\n .setShape('points', visualOutOfRange.barPoints);\r\n this._updateHandle(inRangeHandleEnds, visualInRange);\r\n };\r\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\r\n var opts = {\r\n forceState: forceState,\r\n convertOpacityToAlpha: true\r\n };\r\n var colorStops = this._makeColorGradient(dataInterval, opts);\r\n var symbolSizes = [\r\n this.getControllerVisual(dataInterval[0], 'symbolSize', opts),\r\n this.getControllerVisual(dataInterval[1], 'symbolSize', opts)\r\n ];\r\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\r\n return {\r\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\r\n barPoints: barPoints,\r\n handlesColor: [\r\n colorStops[0].color,\r\n colorStops[colorStops.length - 1].color\r\n ]\r\n };\r\n };\r\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\r\n var sampleNumber = 100;\r\n var colorStops = [];\r\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\r\n offset: 0\r\n });\r\n for (var i = 1; i < sampleNumber; i++) {\r\n var currValue = dataInterval[0] + step * i;\r\n if (currValue > dataInterval[1]) {\r\n break;\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(currValue, 'color', opts),\r\n offset: i / sampleNumber\r\n });\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\r\n offset: 1\r\n });\r\n return colorStops;\r\n };\r\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\r\n var itemSize = this.visualMapModel.itemSize;\r\n return [\r\n [itemSize[0] - symbolSizes[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[1]],\r\n [itemSize[0] - symbolSizes[1], handleEnds[1]]\r\n ];\r\n };\r\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\r\n var orient = this._orient;\r\n var inverse = this.visualMapModel.get('inverse');\r\n return new Group((orient === 'horizontal' && !inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? 1 : -1, rotation: Math.PI / 2 }\r\n : (orient === 'horizontal' && inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? -1 : 1, rotation: -Math.PI / 2 }\r\n : (orient === 'vertical' && !inverse)\r\n ? { scaleX: itemAlign === 'left' ? 1 : -1, scaleY: -1 }\r\n : { scaleX: itemAlign === 'left' ? 1 : -1 });\r\n };\r\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n var shapes = this._shapes;\r\n var visualMapModel = this.visualMapModel;\r\n var handleThumbs = shapes.handleThumbs;\r\n var handleLabels = shapes.handleLabels;\r\n var itemSize = visualMapModel.itemSize;\r\n var dataExtent = visualMapModel.getExtent();\r\n each$h([0, 1], function (handleIndex) {\r\n var handleThumb = handleThumbs[handleIndex];\r\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\r\n handleThumb.y = handleEnds[handleIndex];\r\n var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\r\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\r\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\r\n handleThumb.x = itemSize[0] - symbolSize / 2;\r\n var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\r\n verticalAlign: 'middle',\r\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\r\n });\r\n }, this);\r\n };\r\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var itemSize = visualMapModel.itemSize;\r\n var sizeExtent = [0, itemSize[1]];\r\n var shapes = this._shapes;\r\n var indicator = shapes.indicator;\r\n if (!indicator) {\r\n return;\r\n }\r\n indicator.attr('invisible', false);\r\n var opts = { convertOpacityToAlpha: true };\r\n var color = this.getControllerVisual(cursorValue, 'color', opts);\r\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\r\n var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true);\r\n var x = itemSize[0] - symbolSize / 2;\r\n var oldIndicatorPos = { x: indicator.x, y: indicator.y };\r\n indicator.y = y;\r\n indicator.x = x;\r\n var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group));\r\n var indicatorLabel = shapes.indicatorLabel;\r\n indicatorLabel.attr('invisible', false);\r\n var align = this._applyTransform('left', shapes.mainGroup);\r\n var orient = this._orient;\r\n var isHorizontal = orient === 'horizontal';\r\n indicatorLabel.setStyle({\r\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\r\n verticalAlign: isHorizontal ? align : 'middle',\r\n align: isHorizontal ? 'center' : align\r\n });\r\n var indicatorNewProps = {\r\n x: x,\r\n y: y,\r\n style: {\r\n fill: color\r\n }\r\n };\r\n var labelNewProps = {\r\n style: {\r\n x: textPoint[0],\r\n y: textPoint[1]\r\n }\r\n };\r\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\r\n var animationCfg = {\r\n duration: 100,\r\n easing: 'cubicInOut',\r\n additive: true\r\n };\r\n indicator.x = oldIndicatorPos.x;\r\n indicator.y = oldIndicatorPos.y;\r\n indicator.animateTo(indicatorNewProps, animationCfg);\r\n indicatorLabel.animateTo(labelNewProps, animationCfg);\r\n }\r\n else {\r\n indicator.attr(indicatorNewProps);\r\n indicatorLabel.attr(labelNewProps);\r\n }\r\n this._firstShowIndicator = false;\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.enterBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\r\n var self = this;\r\n this._shapes.mainGroup\r\n .on('mousemove', function (e) {\r\n self._hovering = true;\r\n if (!self._dragging) {\r\n var itemSize = self.visualMapModel.itemSize;\r\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\r\n pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]);\r\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\r\n }\r\n })\r\n .on('mouseout', function () {\r\n self._hovering = false;\r\n !self._dragging && self._clearHoverLinkToSeries();\r\n });\r\n };\r\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\r\n var zr = this.api.getZr();\r\n if (this.visualMapModel.option.hoverLink) {\r\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\r\n zr.on('mouseout', this._hideIndicator, this);\r\n }\r\n else {\r\n this._clearHoverLinkFromSeries();\r\n }\r\n };\r\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\r\n var visualMapModel = this.visualMapModel;\r\n var itemSize = visualMapModel.itemSize;\r\n if (!visualMapModel.option.hoverLink) {\r\n return;\r\n }\r\n var sizeExtent = [0, itemSize[1]];\r\n var dataExtent = visualMapModel.getExtent();\r\n cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]);\r\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\r\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\r\n var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true);\r\n var valueRange = [\r\n linearMap$2(hoverRange[0], sizeExtent, dataExtent, true),\r\n linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)\r\n ];\r\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\r\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\r\n if (hoverOnBar) {\r\n if (valueRange[0] === -Infinity) {\r\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\r\n }\r\n else if (valueRange[1] === Infinity) {\r\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\r\n }\r\n else {\r\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\r\n }\r\n }\r\n var oldBatch = this._hoverLinkDataIndices;\r\n var newBatch = [];\r\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\r\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\r\n }\r\n var resultBatches = compressBatches(oldBatch, newBatch);\r\n this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel));\r\n this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel));\r\n };\r\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\r\n var el = e.target;\r\n var visualMapModel = this.visualMapModel;\r\n if (!el || getECData(el).dataIndex == null) {\r\n return;\r\n }\r\n var ecData = getECData(el);\r\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n if (!visualMapModel.isTargetSeries(dataModel)) {\r\n return;\r\n }\r\n var data = dataModel.getData(ecData.dataType);\r\n var value = data.get(visualMapModel.getDataDimension(data), ecData.dataIndex);\r\n if (!isNaN(value)) {\r\n this._showIndicator(value, value);\r\n }\r\n };\r\n ContinuousView.prototype._hideIndicator = function () {\r\n var shapes = this._shapes;\r\n shapes.indicator && shapes.indicator.attr('invisible', true);\r\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.leaveBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\r\n this._hideIndicator();\r\n var indices = this._hoverLinkDataIndices;\r\n this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel));\r\n indices.length = 0;\r\n };\r\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\r\n this._hideIndicator();\r\n var zr = this.api.getZr();\r\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\r\n zr.off('mouseout', this._hideIndicator);\r\n };\r\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\r\n var transform = getTransform(element, global ? null : this.group);\r\n return isArray(vertex)\r\n ? applyTransform$1(vertex, transform, inverse)\r\n : transformDirection(vertex, transform, inverse);\r\n };\r\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\r\n batch && batch.length && this.api.dispatchAction({\r\n type: type,\r\n batch: batch\r\n });\r\n };\r\n ContinuousView.prototype.dispose = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.prototype.remove = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.type = 'visualMap.continuous';\r\n return ContinuousView;\r\n }(VisualMapView));\r\n function createPolygon(points, cursor, onDrift, onDragEnd) {\r\n return new Polygon({\r\n shape: { points: points },\r\n draggable: !!onDrift,\r\n cursor: cursor,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd\r\n });\r\n }\r\n function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\r\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\r\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\r\n if (hoverLinkDataSize) {\r\n halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\r\n }\r\n return halfHoverLinkSize;\r\n }\r\n function useHoverLinkOnHandle(visualMapModel) {\r\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\r\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\r\n }\r\n function getCursor$1(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(ContinuousView);\n\n var actionInfo$2 = {\r\n type: 'selectDataRange',\r\n event: 'dataRangeSelected',\r\n update: 'update'\r\n };\r\n registerAction(actionInfo$2, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'visualMap', query: payload }, function (model) {\r\n model.setSelected(payload.selected);\r\n });\r\n });\n\n registerPreprocessor(visualMapPreprocessor);\n\n var PiecewiseModel = (function (_super) {\r\n __extends(PiecewiseModel, _super);\r\n function PiecewiseModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseModel.type;\r\n _this._pieceList = [];\r\n return _this;\r\n }\r\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n var mode = this._mode = this._determineMode();\r\n this._pieceList = [];\r\n resetMethods[this._mode].call(this, this._pieceList);\r\n this._resetSelected(newOption, isInit);\r\n var categories = this.option.categories;\r\n this.resetVisual(function (mappingOption, state) {\r\n if (mode === 'categories') {\r\n mappingOption.mappingMethod = 'category';\r\n mappingOption.categories = clone(categories);\r\n }\r\n else {\r\n mappingOption.dataExtent = this.getExtent();\r\n mappingOption.mappingMethod = 'piecewise';\r\n mappingOption.pieceList = map(this._pieceList, function (piece) {\r\n piece = clone(piece);\r\n if (state !== 'inRange') {\r\n piece.visual = null;\r\n }\r\n return piece;\r\n });\r\n }\r\n });\r\n };\r\n PiecewiseModel.prototype.completeVisualOption = function () {\r\n var option = this.option;\r\n var visualTypesInPieces = {};\r\n var visualTypes = VisualMapping.listVisualTypes();\r\n var isCategory = this.isCategory();\r\n each(option.pieces, function (piece) {\r\n each(visualTypes, function (visualType) {\r\n if (piece.hasOwnProperty(visualType)) {\r\n visualTypesInPieces[visualType] = 1;\r\n }\r\n });\r\n });\r\n each(visualTypesInPieces, function (v, visualType) {\r\n var exists = false;\r\n each(this.stateList, function (state) {\r\n exists = exists || has(option, state, visualType)\r\n || has(option.target, state, visualType);\r\n }, this);\r\n !exists && each(this.stateList, function (state) {\r\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\r\n });\r\n }, this);\r\n function has(obj, state, visualType) {\r\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\r\n }\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n };\r\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var pieceList = this._pieceList;\r\n var selected = (isInit ? thisOption : newOption).selected || {};\r\n thisOption.selected = selected;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (!selected.hasOwnProperty(key)) {\r\n selected[key] = true;\r\n }\r\n }, this);\r\n if (thisOption.selectedMode === 'single') {\r\n var hasSel_1 = false;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (selected[key]) {\r\n hasSel_1\r\n ? (selected[key] = false)\r\n : (hasSel_1 = true);\r\n }\r\n }, this);\r\n }\r\n };\r\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\r\n return this._mode === 'categories'\r\n ? piece.value + '' : piece.index + '';\r\n };\r\n PiecewiseModel.prototype.getPieceList = function () {\r\n return this._pieceList;\r\n };\r\n PiecewiseModel.prototype._determineMode = function () {\r\n var option = this.option;\r\n return option.pieces && option.pieces.length > 0\r\n ? 'pieces'\r\n : this.option.categories\r\n ? 'categories'\r\n : 'splitNumber';\r\n };\r\n PiecewiseModel.prototype.setSelected = function (selected) {\r\n this.option.selected = clone(selected);\r\n };\r\n PiecewiseModel.prototype.getValueState = function (value) {\r\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\r\n return index != null\r\n ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]\r\n ? 'inRange' : 'outOfRange')\r\n : 'outOfRange';\r\n };\r\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\r\n var result = [];\r\n var pieceList = this._pieceList;\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\r\n pIdx === pieceIndex && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({ seriesId: seriesModel.id, dataIndex: dataIndices });\r\n }, this);\r\n return result;\r\n };\r\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\r\n var representValue;\r\n if (this.isCategory()) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n if (piece.value != null) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n var pieceInterval = piece.interval || [];\r\n representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)\r\n ? 0\r\n : (pieceInterval[0] + pieceInterval[1]) / 2;\r\n }\r\n }\r\n return representValue;\r\n };\r\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\r\n if (this.isCategory()) {\r\n return;\r\n }\r\n var stops = [];\r\n var outerColors = ['', ''];\r\n var visualMapModel = this;\r\n function setStop(interval, valueState) {\r\n var representValue = visualMapModel.getRepresentValue({\r\n interval: interval\r\n });\r\n if (!valueState) {\r\n valueState = visualMapModel.getValueState(representValue);\r\n }\r\n var color = getColorVisual(representValue, valueState);\r\n if (interval[0] === -Infinity) {\r\n outerColors[0] = color;\r\n }\r\n else if (interval[1] === Infinity) {\r\n outerColors[1] = color;\r\n }\r\n else {\r\n stops.push({ value: interval[0], color: color }, { value: interval[1], color: color });\r\n }\r\n }\r\n var pieceList = this._pieceList.slice();\r\n if (!pieceList.length) {\r\n pieceList.push({ interval: [-Infinity, Infinity] });\r\n }\r\n else {\r\n var edge = pieceList[0].interval[0];\r\n edge !== -Infinity && pieceList.unshift({ interval: [-Infinity, edge] });\r\n edge = pieceList[pieceList.length - 1].interval[1];\r\n edge !== Infinity && pieceList.push({ interval: [edge, Infinity] });\r\n }\r\n var curr = -Infinity;\r\n each(pieceList, function (piece) {\r\n var interval = piece.interval;\r\n if (interval) {\r\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\r\n setStop(interval.slice());\r\n curr = interval[1];\r\n }\r\n }, this);\r\n return { stops: stops, outerColors: outerColors };\r\n };\r\n PiecewiseModel.type = 'visualMap.piecewise';\r\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n selected: null,\r\n minOpen: false,\r\n maxOpen: false,\r\n align: 'auto',\r\n itemWidth: 20,\r\n itemHeight: 14,\r\n itemSymbol: 'roundRect',\r\n pieces: null,\r\n categories: null,\r\n splitNumber: 5,\r\n selectedMode: 'multiple',\r\n itemGap: 10,\r\n hoverLink: true\r\n });\r\n return PiecewiseModel;\r\n }(VisualMapModel));\r\n var resetMethods = {\r\n splitNumber: function (outPieceList) {\r\n var thisOption = this.option;\r\n var precision = Math.min(thisOption.precision, 20);\r\n var dataExtent = this.getExtent();\r\n var splitNumber = thisOption.splitNumber;\r\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\r\n thisOption.splitNumber = splitNumber;\r\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\r\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\r\n precision++;\r\n }\r\n thisOption.precision = precision;\r\n splitStep = +splitStep.toFixed(precision);\r\n if (thisOption.minOpen) {\r\n outPieceList.push({\r\n interval: [-Infinity, dataExtent[0]],\r\n close: [0, 0]\r\n });\r\n }\r\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\r\n var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);\r\n outPieceList.push({\r\n interval: [curr, max],\r\n close: [1, 1]\r\n });\r\n }\r\n if (thisOption.maxOpen) {\r\n outPieceList.push({\r\n interval: [dataExtent[1], Infinity],\r\n close: [0, 0]\r\n });\r\n }\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece, index) {\r\n piece.index = index;\r\n piece.text = this.formatValueText(piece.interval);\r\n }, this);\r\n },\r\n categories: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.categories, function (cate) {\r\n outPieceList.push({\r\n text: this.formatValueText(cate, true),\r\n value: cate\r\n });\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n },\r\n pieces: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.pieces, function (pieceListItem, index) {\r\n if (!isObject(pieceListItem)) {\r\n pieceListItem = { value: pieceListItem };\r\n }\r\n var item = { text: '', index: index };\r\n if (pieceListItem.label != null) {\r\n item.text = pieceListItem.label;\r\n }\r\n if (pieceListItem.hasOwnProperty('value')) {\r\n var value = item.value = pieceListItem.value;\r\n item.interval = [value, value];\r\n item.close = [1, 1];\r\n }\r\n else {\r\n var interval = item.interval = [];\r\n var close_1 = item.close = [0, 0];\r\n var closeList = [1, 0, 1];\r\n var infinityList = [-Infinity, Infinity];\r\n var useMinMax = [];\r\n for (var lg = 0; lg < 2; lg++) {\r\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\r\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\r\n interval[lg] = pieceListItem[names[i]];\r\n close_1[lg] = closeList[i];\r\n useMinMax[lg] = i === 2;\r\n }\r\n interval[lg] == null && (interval[lg] = infinityList[lg]);\r\n }\r\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\r\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\r\n if (__DEV__) {\r\n if (interval[0] > interval[1]) {\r\n console.warn('Piece ' + index + 'is illegal: ' + interval\r\n + ' lower bound should not greater then uppper bound.');\r\n }\r\n }\r\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\r\n item.value = interval[0];\r\n }\r\n }\r\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\r\n outPieceList.push(item);\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece) {\r\n var close = piece.close;\r\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\r\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\r\n }, this);\r\n }\r\n };\r\n function normalizeReverse(thisOption, pieceList) {\r\n var inverse = thisOption.inverse;\r\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\r\n pieceList.reverse();\r\n }\r\n }\r\n ComponentModel.registerClass(PiecewiseModel);\n\n var PiecewiseVisualMapView = (function (_super) {\r\n __extends(PiecewiseVisualMapView, _super);\r\n function PiecewiseVisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseVisualMapView.type;\r\n return _this;\r\n }\r\n PiecewiseVisualMapView.prototype.doRender = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var textStyleModel = visualMapModel.textStyleModel;\r\n var textFont = textStyleModel.getFont();\r\n var textFill = textStyleModel.getTextColor();\r\n var itemAlign = this._getItemAlign();\r\n var itemSize = visualMapModel.itemSize;\r\n var viewData = this._getViewData();\r\n var endsText = viewData.endsText;\r\n var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText);\r\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\r\n each(viewData.viewPieceList, function (item) {\r\n var piece = item.piece;\r\n var itemGroup = new Group();\r\n itemGroup.onclick = bind(this._onItemClick, this, piece);\r\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\r\n var representValue = visualMapModel.getRepresentValue(piece);\r\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\r\n if (showLabel) {\r\n var visualState = this.visualMapModel.getValueState(representValue);\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\r\n y: itemSize[1] / 2,\r\n text: piece.text,\r\n verticalAlign: 'middle',\r\n align: itemAlign,\r\n font: textFont,\r\n fill: textFill,\r\n opacity: visualState === 'outOfRange' ? 0.5 : 1\r\n }\r\n }));\r\n }\r\n thisGroup.add(itemGroup);\r\n }, this);\r\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\r\n box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\r\n this.renderBackground(thisGroup);\r\n this.positionGroup(thisGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\r\n var _this = this;\r\n itemGroup\r\n .on('mouseover', function () { return onHoverLink('highlight'); })\r\n .on('mouseout', function () { return onHoverLink('downplay'); });\r\n var onHoverLink = function (method) {\r\n var visualMapModel = _this.visualMapModel;\r\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\r\n type: method,\r\n batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\r\n });\r\n };\r\n };\r\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var modelOption = visualMapModel.option;\r\n if (modelOption.orient === 'vertical') {\r\n return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\r\n }\r\n else {\r\n var align = modelOption.align;\r\n if (!align || align === 'auto') {\r\n align = 'left';\r\n }\r\n return align;\r\n }\r\n };\r\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\r\n if (!text) {\r\n return;\r\n }\r\n var itemGroup = new Group();\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2,\r\n y: itemSize[1] / 2,\r\n verticalAlign: 'middle',\r\n align: showLabel ? itemAlign : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n group.add(itemGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._getViewData = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) {\r\n return { piece: piece, indexInModelPieceList: index };\r\n });\r\n var endsText = visualMapModel.get('text');\r\n var orient = visualMapModel.get('orient');\r\n var inverse = visualMapModel.get('inverse');\r\n if (orient === 'horizontal' ? inverse : !inverse) {\r\n viewPieceList.reverse();\r\n }\r\n else if (endsText) {\r\n endsText = endsText.slice().reverse();\r\n }\r\n return { viewPieceList: viewPieceList, endsText: endsText };\r\n };\r\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\r\n group.add(createSymbol(this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, 'color')));\r\n };\r\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\r\n var visualMapModel = this.visualMapModel;\r\n var option = visualMapModel.option;\r\n var selected = clone(option.selected);\r\n var newKey = visualMapModel.getSelectedMapKey(piece);\r\n if (option.selectedMode === 'single') {\r\n selected[newKey] = true;\r\n each(selected, function (o, key) {\r\n selected[key] = key === newKey;\r\n });\r\n }\r\n else {\r\n selected[newKey] = !selected[newKey];\r\n }\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: selected\r\n });\r\n };\r\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\r\n return PiecewiseVisualMapView;\r\n }(VisualMapView));\r\n ComponentView.registerClass(PiecewiseVisualMapView);\n\n registerPreprocessor(visualMapPreprocessor);\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$n = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$n(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$n(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n function createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n }\n\n var NONE = 'none';\r\n var mathRound = Math.round;\r\n var mathSin$4 = Math.sin;\r\n var mathCos$4 = Math.cos;\r\n var PI$a = Math.PI;\r\n var PI2$a = Math.PI * 2;\r\n var degree = 180 / PI$a;\r\n var EPSILON$4 = 1e-4;\r\n function round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n }\r\n function round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n }\r\n function isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n }\r\n function pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n }\r\n function pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n }\r\n function setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n }\r\n function attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n }\r\n function attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n }\r\n function attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n }\r\n function bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n }\r\n var SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$a)\r\n || (clockwise ? dTheta >= PI2$a : -dTheta >= PI2$a);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$a : (dTheta % PI2$a + PI2$a);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$a) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$a - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$a + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n }());\r\n var svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n };\r\n function adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n }\r\n var svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n };\n\n function diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n }\r\n function extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n }\r\n function pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n }\r\n function buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n }\r\n function clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n }\r\n function arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n }\n\n var MARK_UNUSED = '0';\r\n var MARK_USED = '1';\r\n var Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n }());\n\n function isLinearGradient(value) {\r\n return value.type === 'linear';\r\n }\r\n function isRadialGradient(value) {\r\n return value.type === 'radial';\r\n }\r\n var GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (value\r\n && (value.type === 'linear'\r\n || value.type === 'radial')) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n }(Definable));\n\n function isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n }\r\n var patternDomMap = new WeakMap();\r\n var PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n }(Definable));\n\n function generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n }\r\n function hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n }\r\n var ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n }(Definable));\n\n var ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n }(Definable));\r\n function hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n }\r\n function getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n }\n\n function parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n }\r\n function getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n }\r\n function checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n }\r\n function insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n }\r\n function removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n }\r\n function getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n }\r\n var SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n }());\r\n function createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n }\n\n registerPainter('svg', SVGPainter);\n\n exports.Axis = Axis;\n exports.List = List;\n exports.Model = Model;\n exports.PRIORITY = PRIORITY;\n exports.color = color;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose$1;\n exports.env = env;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.format = format$1;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.graphic = graphic$1;\n exports.helper = helper;\n exports.init = init$1;\n exports.innerDrawElementOnCanvas = brushSingle;\n exports.matrix = matrix;\n exports.number = number;\n exports.parseGeoJSON = parseGeoJSON;\n exports.parseGeoJson = parseGeoJson;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.throttle = throttle;\n exports.time = time;\n exports.util = ecUtil;\n exports.vector = vector;\n exports.version = version$1;\n exports.zrender = zrender;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file +{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","mergeAll","targetAndSources","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","find","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","concatArray","newArray","offset","createObject","proto","properties","StyleCtor","hasOwn","own","noop","zrUtil","freeze","x","y","copy","out","v","clone$1","add","v1","v2","scaleAndAdd","sub","Math","sqrt","lenSquare","lengthSquare","mul","div","dot","scale","normalize","distance","dist","distanceSquare","distSquare","negate","lerp","applyTransform","m","min","max","vector","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut$1","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy$1","mul$1","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","clone$2","matrix","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","rgba2hsla","R","G","B","vMin","vMax","L","H","S","deltaR","deltaG","deltaB","lift","color","level","colorArr","stringify","toHex","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fastMapToColor","lerp$1","fullOutput","mapToColor","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","random","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromPoints","bottom","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DILIMITER_REG","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","nodeParsers","SVGParser","_defs","_root","_isDefine","_isText","xml","viewBox","getAttribute","parseAttributes","_parseNode","viewBoxRect","viewBoxTransform","viewBoxArr","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","defineParsers","def","_parseText","_textX","_textY","inheritStyle","textStyle","fontSize","fontFamily","fontStyle","fontWeight","internalField","circle","line","pointsStr","pointsArr","parsePoints","polygon","polyline","img","gradient","_parseGradientColorStops","offsetStr","stopColor","__inheritedStyle","pointsString","attributesMap","defs","onlyInlineStyle","zrStyle","parseTransformAttribute","parseStyleAttribute","svgAttrName","attrValue","getPaint","urlRegex","urlMatch","url","transformRegex","transformOps_1","valueArr","styleRegex","styleList","styleRegResult","exec","parseSVG","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CMD$3","PI2$6","PROP_XY","PROP_WH","tmpArr","aroundEqual","pathToBezierCurves","bezierArray","currentSubpath","createNewSubpath","addLine","addArc","tan","c1","s1","c2","s2","x4","y4","hx","hy","nextAngle","alignSubpath","subpath1","subpath2","shorterPath","shorterLen","shorterBezierCount","eachCurveSubDivCount","newSubpath","remained","tmpSegX","tmpSegY","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastX","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","centroid","signedArea","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","score","newArr","findBestMorphingRotation","fromArr","toArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","tmpArr_1","sa","ca","newX1","newY1","i_1","to","morphPath","fromPath","toPath","animationOpts","fromPathProxy","toPathProxy","isIndividualMorphingPath","__oldBuildPath","fromBezierCurves","toBezierCurves","morphingData","becomeIndividualMorphingPath","oldDone","oldAborted","oldDuring","__morphT","restoreIndividualMorphingPath","morphingPathBuildPath","__morphingData","newCp","item","morphT","updateIndividualMorphingPath","morphingPath","isCombiningPath","__combiningSubList","isInAnyMorphing","combine","fromPathList","copyPropsIfDivided","fromIndividuals","separateCount","fromCombiningSubList","dividingMethod","toPathSplittedList","divideShape","doneCount","abortedCalled","morphAnimationOpts","restoreCombiningPath","becomeCombiningPath","toIndividuals","count","combiningSubList","updateCombiningPathSubList","combiningPath","__oldAddSelfToZr","__oldRemoveSelfFromZr","combiningAddSelfToZr","combiningRemoveSelfFromZr","combiningChildrenRef","combiningPathSubListAddRemoveWithZr","method","separate","toPathList","toPathListLen","copyProps","duplicateShape","splitShape","resultPaths","toPathShape","splitPropIdx","propWH","propXY","subWH","xyCurr","subShape","splitted","endAngleNormalized","normalizeRadian$1","angleCurr","ctor","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","getType","clearAnimation","pathToImage","eventHandler","disposeAll","getInstance","registerPainter","zrender","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","asc","getPrecision","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","MAX_SAFE_INTEGER","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","quantile","ascArr","reformIntervals","littleThan","curr","currClose","close_1","close","lg","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","numberUtil","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","color$1","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","mathMax$4","mathMin$4","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","boundingRect","aspect","mergePath$1","pathRect","subPixelOptimizeLine$1","param","subPixelOptimizeRect$1","subPixelOptimize$1","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","getTransform","ancestor","mat","applyTransform$1","invert$1","transformDirection","direction","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","q","graphic","Text","IncrementalDisplayable","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","formatTime","utc","capitalFirst","convertToColorString","defaultColor","windowOpen","link","blank","open","opener","href","formatUtil","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","seriesIndices","airaOption","enabled","mergeTheme","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","set$1","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","order","incomparable","isDesc","_resultLT","_incomparable","lvalTypeof","rvalTypeof","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","TOOLTIP_NAME_TEXT_STYLE_CSS","TOOLTIP_TEXT_STYLE_RICH","TOOLTIP_VALUE_TEXT_STYLE_CSS","TOOLTIP_VALUE_TEXT_STYLE_RICH","TOOLTIP_LINE_HEIGHT_CSS","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","getBuilder","fragment","builderMap","section","planLayout","subBlockLen","blocks","thisBlockHasInnerGap","noHeader","thisGapLevelBetweenSubBlocks","subBlock","subGapLevel","__gapLevelBetweenSubBlocks","build","topMarginForOuterGap","gaps","getGap","subMarkupText","buildSubBlocks","html","displayableHeader","header","wrapInlineNameRichText","richText","wrapBlockHTML","nameValue","noName","noValue","noMarker","markerType","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","valueTypeOption","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","buildTooltipMarkup","builder","gapLevelBetweenSubBlocks","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","styles","paddingLeft","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","inlineValue","inlineValueType","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","rate","throttleType","originFn","lastThrottleType","lastRate","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","setItemVisualFromData","PI2$7","CMD$4","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpArr$1","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","version$1","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances$1","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","finderOpt","fromResult","toResult","toSeries","dimension","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","dispose$1","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","getExtent","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","OrdinalMeta","_needCollect","needCollect","_deduplication","deduplication","createByAxisModel","dedplication","getOrdinal","category","_getOrCreateMap","roundNumber","intervalScaleNiceTicks","splitNumber","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","minorTick","dataNum","expandSize","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","getLayoutOnAxis","baseAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cartesian","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","axisExtent","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","getOtherAxis","barMinHeight","valueDim","baseDim","stacked","isValueAxisH","isHorizontal","valueAxisStart","getValueAxisStart","baseValue","baseCoord","dataToPoint","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","toGlobalCoord","dataToCoord","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","tickValue","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","getNeedCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","getCategories","boundaryGap","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","AxisModelCommonMixin","getCoordSysModel","createList","dataStack$1","createScale","mixinAxisModelCommonMethods","helper","EPSILON$3","isAroundEqual$1","contain$2","Region","geometries","cp","exterior","loopGeo","interiors","transformTo","newRegion","decode","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","geometry","coordinates","decodePolygon","encodeOffsets","coordinate","prevX","prevY","parseGeoJSON","nameProperty","featureObj","region","inner$4","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labels","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","containData","fixExtentWithBands","coordToData","pointToData","getTicksCoords","getTickModel","ticksCoords","tickVal","alignWithLabel","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","getViewLabels","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","parseGeoJson","number","format$1","ecUtil","GRAPHIC_KEYS","graphic$1","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","RegExp","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","getValue","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","dimLoose","sampleLog","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_1","errMsg_2","comparator","item0","item1","orderDef","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","valueStart","getValueStart","baseAxisDim","valueAxisDim","baseDataOffset","stackResultDim","dataDimsForPoint","getStackedOnPoint","dataCoordInfo","stackedData","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$5","mathMax$5","isPointNull","drawSegment","segLen","allLen","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","primary","logBase","axisDefault","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","CartesianAxisModel","extraOption","categorySortInfo","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","axisPointerEnabled","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","getAxes","saveTooltipAxisInfo","getTooltipAxes","triggerAxis","cross","tooltipAxes","baseAxes","otherAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$5","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","Grid","_coordsMap","_coordsList","_axesMap","_axesList","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$6","mathMin$6","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$8","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_incremental","_setCommon","endIndex","byteOffset","_clearIncremental","isIncremental","extrudeShadow","ecData_1","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","IndicatorAxis","radiusExtent","Radar","radarModel","_indicatorAxes","getIndicatorModels","indicatorModel","indicatorAxis","getIndicatorAxes","indicatorIndex","coordToPoint","minRadianDiff","closestAxis","closestAxisIdx","viewSize","indicatorAxes","radarSeries","increaseInterval","fixedMin","fixedMax","nicedSplitNumber","pixel","radarList","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","indicator","axisBuilderAttrs$1","RadarView","_buildAxes","_buildSplitLineAndArea","axisBuilders","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","getColorIndex","areaOrLine","areaOrLineColorList","ticksRadius","realSplitNumber_1","axesTicksPoints","prevPoints","RadarSeriesModel","nameToDisplay","getTooltipPosition","radarIndex","normalizeSymbolSize","RadarView$1","createSymbol$1","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","radarLayout","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","polarIndex","geoCoord","points$1","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","geoCoordMap","fixGeoCoords","points$2","fixDiaoyuIsland","inner$6","geoJSONLoader","load","mapRecord","parsed","regionName","specialArea","getBoundingRect$1","regionRect","inner$7","geoSVGLoader","originRoot","buildGraphic","makeGraphic","hostKey","rootMap","originRootHostKey","removeGraphic","loaders","geoSourceManager","regionsMap","nameCoordMap","mapRecords","singleSource","results","mapNotExistsError","MapSeries","needsDrawMap","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","getMapType","getHostGeoModel","geoIndex","getRegionModel","seriesNames","otherIndex","originalData","setZoom","setCenter","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","areaColor","ATTR","take","resourceKey","userKey","getStore","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newX","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","getFixedItemStyle","MapDraw","_controller","_controllerHost","_regionsGroup","mapOrGeoModel","fromView","isGeo","mapSeries","_updateBackground","regionsGroup","transformInfo","getTransformInfo","isFirstDraw","targetScaleX","targetScaleY","roamTransform","isVisualEncodedByVisualMap","regionGroup","compoundPath","regionModel","itemStyleModel","emphasisItemStyleModel","blurItemStyleModel","selectItemStyleModel","rawScaleX","rawScaleY","rawX","rawY","transformPoint","interior","points_1","showLabel","isDataNaN","centerPt","regionModel_1","groupRegions","__regions","_updateController","_updateMapSelectHandler","_mapName","getZoom","makeActionBase","_mouseDownFlag","getViewRectAfterRoam","mapDraw","MapView","mapModel","_mapDraw","_renderSymbols","originalDataIndex","fullData","mainSeries","fullIndex_1","updateCenterAndZoom","previousZoom","getCenter","fixX","fixY","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_viewRect","rawTransform","_updateTransform","centerCoord","_center","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","defaultCenter","roamTransformable","rawTransformable","_rawTransform","noRoam","getCoordSys","Geo","invertLongitute","_nameCoordMap","_regionsMap","_invertLongitute","containCoord","getRegionByCoord","addGeoCoord","getGeoCoord","getCoordSys$1","geoModel","resizeGeo","leftTop","rightBottom","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","inner$8","linkList","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","depth","viewChildren","isExpand","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","getAncestorsIndices","currNode","getDescendantIndices","childNode","getLevelModel","levelModels","isAncestorOf","isDescendantOf","Tree","_nodes","getNodeByDataIndex","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","addChild","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","getOrient","realRoot","edgeShape","edgeForkPosition","roam","nodeScaleRatio","curveness","init$2","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","getViewRect$1","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","symbolNeedsDraw$1","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","groupZoom","roamZoom","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","__radialOldRawX","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","rootLayout","isLeft","labelRotateRadian","focusDataIndices","drawEdge","__edge","parentEl","curvature","getEdgeShape","childLayout","removeAnimationOpt","sourceEdge","layoutOpt","radialCoor1","radialCoor2","radialCoor3","radialCoor4","eachAfter","eachBefore","treeLayout","commonLayout","separation$1","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","resetViewRoot","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","getViewRoot","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","normalStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","itemWidth","availableSize","itemNode","makeItemPoints","onclick","packEventData","itemHeight","selfType","AnimationWrap","_elExistsMap","_finishedCallback","checkTerminate","createWrap","Group$1","Rect$1","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z_BASE","Z_BG","Z_CONTENT","getStateItemStyle","getItemStyleNormal","inner$9","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","_doAnimation","renderFinally","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","els","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","renderContent","useUpperLabel","processInvisible","visualBorderColor","selectStyle","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","iconChar","isShow","addDrillDownIcon","textEmphasisState","lasts","prepareAnimationWhenHasOld","calculateZ","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","zInLevel","zb","noop$1","actionTypes","i$1","handleRootToNode","originViewRoot","each$4","isObject$4","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","inner$a","treemapVisual","travelTree","designatedVisual","viewRootAncestors","nodeLayout","nodeItemStyleModel","visuals","buildVisuals","thisNodeColor","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","mathMax$7","mathMin$7","each$5","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","treemapLayout","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","worst","orderBy","overLeafDepth","sort$1","statistic","filterByThreshold","orderedChildren","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","getNodeByIndex","addEdge","n1","n2","edgesMap","GraphEdge","outEdges","inEdges","getEdgeByIndex","getEdge","eachEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","degree","inDegree","outDegree","getAdjacentDataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getGraphicEl","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","GraphSeriesModel","getCategoriesData","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryIdx","categoryModel","oldGetModel","newGetModel","newPathArr","getGraph","getEdgeData","sourceName","nodeMarkup","categoriesData","circular","rotateLabel","initLayout","repulsion","gravity","friction","edgeLength","layoutAnimation","edgeSymbol","edgeSymbolSize","edgeLabel","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","lineData","symbolSizeArr","__specifiedRotation","createLine","setLinePoints","Line$1","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","specifiedRotation","tangent","distanceX","distanceY","halfPercent","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","makeSeriesScope$1","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","getNodeGlobalScale","v3","v2DistSquare","mathAbs$2","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide$1","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","forceLayout","_startForceLayoutIteration","warmUp","_layouting","setFixed","setUnfixed","circularRotateLabel","categoryFilter","graphSeries","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryStyle","visualList","normalize$2","graphEdgeVisual","simpleLayout","simpleLayoutEdge","graphSimpleLayout","PI$7","_symbolRadiansHalf","circularLayout","basedOn","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","graphCircularLayout","scaleAndAdd$1","inNodes","pp","initialFriction","beforeStepCallback","afterStepCallback","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","nodeDataExtent_1","edgeDataExtent_1","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getViewRect$2","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","GaugeSeriesModel","icon","PointerShape","PointerPath","parsePosition","formatLabel","PI2$9","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","FunnelSeriesModel","minSize","funnelAlign","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","getViewRect$3","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelIndex","parallelOption","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","extentMinSpan","realExtent","currDistSign","each$6","mathMin$8","mathMax$8","mathFloor$2","mathCeil$1","round$2","PI$8","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","layoutExtent","axisCount","axisExpandWidth","restrict$1","axisExpandCount","axisExpandable","axisExpandWindow","winSize","axisExpandCenter","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","eachActiveState","dataDimensions","axisModels","hasActiveSet","hasAxisBrushed","activeState","getActiveState","axisLayout","getAxisLayout","getSlidedAxisExpandWindow","behavior","pointCoord","triggerArea","useJump","winSize2","create$2","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","defaultOption$1","areaSelectStyle","realtime","ParallelModel","_initDimensions","setAxisExpand","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","actionInfo$1","parallelAxisModel","BRUSH_PANEL_GLOBAL","mathMin$9","mathMax$9","mathPow$2","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_handlers","_uid","pointerHandlers","enableBrush","brushOption","_mounted","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panels","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","trigger$1","areas","isEnd","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","getTransform$1","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","_creatingPanel","thisBrushOption","eventParams","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","parallelAxisId","CLICK_THRESHOLD","ParallelView","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","triggerOn","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","theActiveState","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","DEFAULT_SMOOTH","ParallelView$1","_dataGroup","dataGroup","makeSeriesScope$2","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","opacityAccessPath$1","parallelVisual","opacityMap","active","inactive","itemOpacity","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","localX","localY","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","sourceColor","targetColor","dragX","dragY","createGridClipShape$1","sankeyLayout","getViewRect$4","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","center$1","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","WhiskerBoxCommonMixin","xAxisType","yAxisType","addOrdinal","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotVisual","each$7","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","availableWidth","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","low","high","itemNameFormatter","outlier","boxplotTransform","CandlestickSeriesModel","getShadowDim","brushRect","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","createNormalBox$1","setBoxCommon","createLarge$1","NormalBoxPathShape","NormalBoxPath","__simpleBox","transInit$1","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","setLargeStyle$1","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","LargeArr$1","candlestickLayout","candleWidth","calculateCandleWidth","openDim","closeDim","lowestDim","highestDim","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","getSign","makeBrushRect","pmin","pmax","EffectScatterSeriesModel","effectType","showEffectOn","rippleEffect","period","EFFECT_RIPPLE_NUMBER","normalizeSymbolSize$1","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","EffectScatterView","effectSymbolDraw","_updateGroupTransform","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","getLineCoordsCount","getLineCoords","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","CoordSys","effect","constantSpeed","trailLength","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","delayExpr","_updateAnimationPoints","_getLineLength","_period","delayNum","__t","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt$1","__lastT","Polyline$1","_createPolyline","hoverLineStyle","lineEmphasisState","EffectPolyline","accLenArr","_length","_offsets","offsets","LargeLinesPathShape","LargeLinesPath","LargeLineDraw","lineEl","linesLayout","isPolyline","isLarge","lineCoords","totalCoordsCount","LinesView","_updateLineDraw","_lastZlevel","_showEffect","notInIndividual_1","otherSeriesModel","hasEffect","_hasEffet","_isPolyline","normalize$3","linesVisual","HeatmapSeriesModel","blurSize","pointSize","maxOpacity","minOpacity","GRADIENT_LEVELS","HeatmapLayer","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_incrementalDisplayable","_renderOnCartesianAndCalendar","_renderOnGeo","dataDimX","dataDimY","dataToRect","contentShape","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","PictorialBarSeriesModel","symbolPosition","symbolMargin","symbolRepeat","symbolRepeatDirection","symbolClip","symbolBoundingData","symbolPatternSize","BAR_BORDER_WIDTH_QUERY$1","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","updateCommon$1","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","categorySize","parsedSymbolSize","unitLength","pathLen","absBoundingLength","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","updateAttr","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","pathes","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","SingleAxis","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","getCoordSys$2","singleModel","create$3","singles","layout$2","positionMap","directionMap","axisBuilderAttrs$2","selfBuilderAttrs$1","SingleAxisView","axisElementBuilders$1","SingleAxisModel","findPointFromSeries","isStacked","inner$b","axisTrigger","currTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","payloadInfo","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","getAxisTooltipData","nestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","seriesDataIndices","outputAxesInfo","valItem","tooltipOption","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","inner$c","each$8","initGlobalListeners","initialized","useHandler","doEnter","onLeave","dis","makeDispatchAction","dispatchTooltipFinally","pendings","showLen","showTip","hideLen","hideTip","actuallyPayload","unregister","AxisPointerView","inner$d","clone$3","bind$1","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","elOption","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","createPointerEl","createLabelEl","doUpdateProps","updateProps$1","updatePointerEl","updateLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","cursorPoint","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","bgColor","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","textLayout","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","XY","WH","SingleAxisPointer","getPointDimIndex","pointerShapeBuilder$1","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","getLayerSeries","lenCount","indexArr","timeDim","layerSeries","index1","index2","nearestIdx","pointNum","theValue","singleAxisIndex","ThemeRiverView","layersSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","layerGroup","createGridClipShape$2","themeRiverLayout","doThemeRiverLayout","layerPoints","singleLayer","computeBaseline","baseLine","baseY0","layerIndex","sums","temp","SunburstSeriesModel","completeTreeValue$1","renderLabelForZeroData","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_ecModel","labelMinAngle","isNormalShown","labelStateModel","isShown","getLabelAttr","sectorState","labelColor","labelPadding","rotateType","stateAttr","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","handleHighlight","UNHIGHLIGHT_ACTION","SunburstView","newRoot","newChildren","oldChildren","_oldChildren","renderRollUp","newNode","virtualPiece","targetFound","RADIAN$2","sunburstLayout","rootDepth","initChildren$1","renderRollupNode","rPerLevel","rStart","rEnd","siblingAngle_1","sortOrder","sort$2","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","dataToCoordSize$1","geoPrepareCustom","dataToCoordSize$2","singlePrepareCustom","dataToCoordSize$3","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","deprecatedLogs","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","srcStyle","textContentStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","warnDeprecated","deprecated","insteadApproach","inner$e","TRANSFORM_PROPS","transformPropNamesStr","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","GROUP_DIFF_PREFIX","attachedTxInfoTmp","LEGACY_TRANSFORM_PROPS","tmpTransformable","prepareCustoms","CustomSeriesModel","currentZLevel","currentZ","CustomSeriesView","customSeries","renderItem","makeRenderItem","doRemoveEl","createOrUpdateItem","morphPreparation_1","MorphPreparation","createGetKey","findAndAddFrom","hasFrom","removeElementDirectly","applyMorphing","oldIndices","newLen","setIncrementalAndHoverLayer","elementName","diffByDimName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","isMorphTo","styleOpt","attachedTxInfo","isTextContent","transFromProps","allPropsFinal","elDisplayable","prepareShapeOrExtraTransitionFrom","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareTransformAllPropsFinal","txCfgOpt","textOptionStyle","decalPattern","decalObj","isPath$1","__decalPattern","prepareStyleTransitionFrom","applyPropsFinal","applyTransitionFrom","originalDecalObj","userDuring","cfgDuringCall","duringCall","mainAttr","morphFromEl","attrOpt","elPropsInAttr","transFromPropsInAttr","enterFrom","enterFromKeys","transitionKeys","elVal","checkNonStyleTansitionRefer","elPropsInAttrKeys","isNonStyleTransitionEnabled","leaveTo","leaveToProps","getOrCreateLeaveToPropsFromEl","leaveToPropsInAttr","leaveToKeys","allProps","allPropsInAttr","keysInAttr","checkTransformPropRefer","fromTransformable","calcOldElLocalTransformBasedOnNewElParent","setTransformPropToTransitionFrom","setLagecyTransformProp","setTransformProp","fromEl","fromElStyle","transFromStyleProps","animationStyleProps","styleKeys","leaveToStyleProps","newEl","tmpM","oldGlobalTransform","newParent","optVal","usedIn","innerEl","tmpDuringScope","customDuringAPI","assertNotReserved","isShapeDirty","getShape","isStyleDirty","setExtra","getExtra","newstUserDuring","scopeUserDuring","updateElOnState","elStateOpt","isRoot","existingEmphasisState","updateZ$1","optZ2","updateZForEachState","retrieveStateOption","targetProps","legacyName","legacyArr","xyName","transitionFrom","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currDataIndexInside","currItemModel","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","morphPreparation","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","elIsNewCreated","canMorph","morph","thisElIsMorphTo","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","pendingAllPropsFinal","addTo","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","processAddUpdate","processRemove","childOption","_fromList","_toList","_toElOptionList","_allPropsFinalList","_toDataIndices","_morphConfigList","_transOpt","_type","fromList","toList","toListLen","fromListLen","toIdx","_oneToOneForSingleTo","fromSingleSegLen","fromIdxStart","fromCount","_manyToOneForSingleTo","toSingleSegLen","toIdxStart","fromIdx","toCount","_oneToManyForSingleFrom","toElOption","toDataIndex","elAnimationConfig","_getOrCreateMorphConfig","morphDuration","combineResult","copyPropsWhenDivided","_processResultIndividuals","morphFrom","combineFromList","separateToList","separateResult","combineSeparateResult","isSeparate","fromIndividual","toIndividual","morphConfigList","delayOption","srcPath","tarPath","willClone","getSeriesStackId$1","getAxisKey$1","barLayoutPolar","calRadialBar","clampLayout","radiusSpan","angleSpan","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","angleAxisExtraOption","radiusAxisExtraOption","RadiusAxis","radiusToData","inner$f","AngleAxis","angleToData","Polar","_radiusAxis","_angleAxis","maxAngle","getCoordSys$3","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","elementList$1","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","axisBuilderAttrs$3","selfBuilderAttrs$2","RadiusAxisView","newAxisGroup","axisAngle","layoutAxis","axisElementBuilders$2","prevRadius","PolarAxisPointer","coordValue","pointerShapeBuilder$2","getLabelPosition","GeoView","_handleRegionClick","updateSelectStatus","geoId","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","makeAction","PROXIMATE_ONE_DAY","Calendar","calendarModel","_rangeInfo","_sw","_sh","_orient","getFirstDayOfWeek","_firstDayOfWeek","getDateInfo","mStr","dStr","getDay","formatedDate","getNextNDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","cellSize","getCellSize","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tl","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","getCoordSys$4","normalizedRange","rangeStr","firstDay","setMonth","parsedRange","reversed","startDateNum","endDateNum","dateNum","fweek","lweek","nthDay","calendarList","calendarSeries","CalendarModel","mergeAndNormalizeLayoutParams","raw","cellSizeArr","MONTH_TEXT","EN","CN","WEEK_TEXT","CalendarView","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","weekText","inner$g","_nonShapeGraphicElements","graphicOption","elements","GraphicComponentModel","existList","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","newElOption","setKeyInfoToNewElOption","mergeNewElOptionToExist","setLayoutInfoToExist","$action","optionList","parentOption","useElOptionsToUpdate","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","elExisting","parentId","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","createEl$1","removeEl","textContentExisting","__ecGraphicWidthOption","__ecGraphicHeightOption","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","__ecGraphicWidth","__ecGraphicHeight","containerInfo","bounding","__ecGraphicId","existElParent","isSetLoc","isSet","existElOption","newElParentOption","newElOptCopy","newType","existItem","existingGroupOpt","newGroupOpt","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","layout$3","viewportSize","makeBackground","ToolboxView","toolboxModel","featureOpts","_features","featureNames","_featureNames","processFeature","featureModel","newTitle","isUserFeatureName","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","iconsMap","titlesMap","tooltipModel","__title","hoverStyle","defaultTextPosition","titleText","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","SaveAsImage","MouseEvent","$a","download","evt","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","bstr","atob","u8arr","Uint8Array","blob","Blob","tab","write","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","trim$1","isTSVFormat","firstLine","itemSplitRegex","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","COORD_CONVERTS","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","parseFinder$1","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","getSize","sizeOrigin","each$9","inner$h","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","dataZoomModel","percentRange","getPercentRange","clear$1","snapshots","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","axisRecords","effectedModels","effectedModelMap","addToEffected","foundNewLink","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_doInit","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","DataZoomView","SelectDataZoomModel","SelectDataZoomView","each$a","asc$1","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","_dataExtent","percentExtent","percentWindow","valueWindow","hasPropModeValue","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","eachAxisModel","proxyList","valueRange","each$b","DATA_ZOOM_ID_BASE","DataZoomFeature","brushController","updateZoomBtnStatus","updateBackBtnStatus","handlers$1","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","$fromToolbox","RestoreOption","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","confineOption","vendors","gCssText","mirrorPos","assembleArrow","arrowPosition","arrowPos","positionStyle","transformStyle","vendorPrefix","styleCss","assembleTransition","onlyFade","transitionCurve","transitionText","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","appendToBody","zrPainter","zrViewportRoot","body","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","currentStyle","_moveIfResized","className","nearPointColor","_longHideTimeout","styleCoord","offsetHeight","pointerEvents","setContent","setEnterable","ratioX","ratioY","visibility","getOuterSize","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","TooltipRichContent","makeStyleCoord$1","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","bind$2","each$c","parsePercent$3","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","_alwaysShowContent","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","makeDispatchAction$1","_ticket","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","modelCascade","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","each$d","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","PRIORITY_BRUSH","layoutCovers","brushModel","brushSelected","throttleDelay","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushView","$from","ICON_TYPES","BrushFeature","isBrushed","_brushMode","command","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","controlPosition","itemStyleEmphasis","labelNormal","excludeLabelAttr","currentIndex","setCurrentIndex","isIndexMax","setPlayState","playState","TimelineModel","_initData","autoPlay","getPlayState","dataArr","_names","processedDataArr","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","PI$9","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","labelPosOpt","getViewRect$5","parsedLabelPos","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","playPosition","prevBtnPosition","nextBtnPosition","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","createScaleByModel$1","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","makeBtn","_handlePlayClick","willRotate","iconSize","btn","makeControlIcon","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","fillLabel","inner$i","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","getAxisInfo$1","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","dataFilter$1","sum_1","count_1","inner$j","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createList$1","coordDimsInfos","dataOpt","MarkLineModel","inner$k","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInifinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList$2","fromData","toData","updateDataVisualAndLayout","fromSymbolRotate","fromSymbolSize","toSymbolRotate","toSymbolSize","optData","dimValueGetter$1","MarkAreaModel","inner$l","markAreaTransform","maModel","ltCoord","rbCoord","isInifinity$1","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","createList$3","xValue","yValue","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","allSelect","inverseSelect","inactiveColor","inactiveBorderColor","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","legendSelectActionHandler","isToggleSelect","legendModel","isItemSelected","curry$1","each$e","Group$2","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendSymbolType","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","createSelectorButton","selectorItem","emphasisLabelModel","legendModelItemStyle","itemIcon","legendGlobalTooltipModel","setSymbolStyle","legendSymbolCenter","hitRect","legendIndex","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","isUseHoverLayer","legendFilter","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","mergeAndNormalizeLayoutParams$1","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","Group$3","WH$1","XY$1","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","zoomLock","brushSelect","Rect$2","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","otherDataExtent","otherOffset","otherShadowExtent","thisShadowExtent","areaPoints","thisCoord","stride","lastIsEmpty","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","lastRange","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","InsideZoomModel","disabled","inner$m","apiInner","coordSysRecordMap","coordSysRecord","dataZoomInfoMap","dzReferCoordSysWrap","dzCoordSysInfo","createCoordSysRecord","dzReferCoordSysInfo","getRange","firstDzInfo","firstDzKey","disposeCoordSysRecord","controllerParams","mergeControllerParams","containsPoint","setViewInfoToCoordSysRecord","dzInfo","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","dispatchAction$1","typePriority","dataZoomInfo","oneType","InsideZoomView","pan","getRangeHandlers","scrollMove","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","each$f","visualMapPreprocessor","has$1","pieces","splitList","calculable","VISUAL_PRIORITY","isTargetSeries","getDataDimension","getVisualMeta","getColorVisual","concreteDim","resultVisual","visualDefault","defaultOption$2","mapVisual$1","isArray$1","each$g","asc$2","linearMap$1","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getTargetSeriesIndices","optionSeriesIndex","is","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","optDim","listDimensions","completeSingle","completeInactive","completeController","stateExist","stateAbsent","optExist","optAbsent","defa","symbolExists","symbolSizeExists","max_1","setSelected","getSelected","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","linearMap$2","each$h","mathMin$a","mathMax$a","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","getCursor$1","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","currValue","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","hoverLinkDataSize","hoverLinkOnHandle","actionInfo$2","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","itemSymbol","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","DEFAULT_OPTION","inner$n","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1","createElementNS","NONE","mathRound","mathSin$4","mathCos$4","PI$a","PI2$a","EPSILON$4","round3","round4","isAroundZero$1","pathHasFill","pathHasStroke","svgEl","attrXLink","setAttributeNS","attrXML","bindStyle","strokeWidth","strokeScale_1","SVGPathRebuilder","_d","_str","firstCmd","dThetaPositive","isCircle","unifiedTheta","_invalid","generateStr","getStr","svgPath","__svgEl","pathVersion","elExt","svgPathBuilder","__svgPathBuilder","__svgPathVersion","svgImage","HTMLImageElement","__imageSrc","TEXT_ALIGN_TO_ANCHOR","adjustTextY$1","svgText","textSvgEl","textSvgElStyle","equals","editLength","maxEditLength","bestPath","newPos","oldPos","extractCommon","added","execEditLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","clonePath","pushComponent","buildValues","commonCount","componentPos","componentLen","arrayDiff","MARK_UNUSED","MARK_USED","Definable","zrId","tagNames","markLabel","domName","nextId","_domName","_zrId","_svgRoot","_tagNames","_markLabel","getDefs","isForceCreating","getElementsByTagName","defs_1","doUpdate","addDom","removeDom","getDoms","doms","tagName","tags","markAllUnused","markDomUsed","markDomUnused","isDomUnused","removeUnused","getSvgProxy","getSvgElement","isLinearGradient","isRadialGradient","isGradient","GradientManager","addWithoutUpdate","that_1","__dom","markUsed","updateDom","stop_1","hex","isPattern","patternDomMap","PatternManager","patternDom","SVGElement","prevImage","imageSrc","HTMLCanvasElement","createdImage","generateClipPathsKey","hasClipPath","ClippathManager","_refGroups","_keyDuplicateCount","_getClipPathGroup","prevDisplayable","keyDuplicateCount","clipPathKey","clipGroup","clipPathEl","svgProxy","newRefGroupsMap","ShadowManager","_shadowDomMap","_shadowDomPool","_getFromPool","shadowDom","domChild","shadowKey","getShadowKey","_shadowDom","globalScale","stdDx","stdDy","stdDeviation","shadowDomsPool","parseInt10$1","checkParentAvailable","insertAfter","prevSibling","prepend","removeFromMyParent","SVGPainter","createMethodNotSupport","svgDom","bgRoot","_gradientManager","_patternManager","_clipPathManager","_shadowManager","viewport","_svgDom","_backgroundRoot","_viewport","_visibleList","_backgroundNode","bgNode","tag","gradientManager","patternManager","clipPathManager","shadowManager","visibleList","listLen","newVisibleList","prevSvgElement","topPrevSvgElement","currentClipGroup","isAdd","_getDefs","viewportStyle","viewportNode","encodeURIComponent","outerHTML","innerDrawElementOnCanvas","util"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,CAACD,MAAM,CAACO,OAAP,GAAiB,EAAlB,CADjC,CADA;AAGH,CAJA,EAIC,IAJD,EAIQ,UAAUL,OAAV,EAAmB;AAAE;AAE1B;;;;;;;;;;;;;AAcA;;AAEA,MAAIM,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,IAAAA,aAAa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AAA,OAAO,CAACs7J,iBAAR,GAA4BA,iBAA5B;AACAt7J,EAAAA,OAAO,CAACm7J,aAAR,GAAwBA,aAAxB;AACAn7J,EAAAA,OAAO,CAACg9J,iBAAR,GAA4BA,iBAA5B;AACAh9J,EAAAA,OAAO,CAACm8J,cAAR,GAAyBA,cAAzB;AACAn8J,EAAAA,OAAO,CAAC88J,gBAAR,GAA2BA,gBAA3B;AACA98J,EAAAA,OAAO,CAAC0+H,QAAR,GAAmBA,QAAnB;AACA1+H,EAAAA,OAAO,CAACiwB,IAAR,GAAeA,IAAf;AACAjwB,EAAAA,OAAO,CAAC+oV,IAAR,GAAe/7J,MAAf;AACAhtL,EAAAA,OAAO,CAACsO,MAAR,GAAiBA,MAAjB;AACAtO,EAAAA,OAAO,CAAC8D,OAAR,GAAkBgpJ,SAAlB;AACA9sJ,EAAAA,OAAO,CAAC6yE,OAAR,GAAkBA,OAAlB;AAEApyE,EAAAA,MAAM,CAAC8jC,cAAP,CAAsBvkC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEyH,IAAAA,KAAK,EAAE;AAAT,GAA7C;AAEH,CAh0oEA,CAAD","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(console, args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function mergeAll(targetAndSources, overwrite) {\r\n var result = targetAndSources[0];\r\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\r\n result = merge(result, targetAndSources[i], overwrite);\r\n }\r\n return result;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function find(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n return arr[i];\r\n }\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function concatArray(a, b) {\r\n var newArray = new a.constructor(a.length + b.length);\r\n for (var i = 0; i < a.length; i++) {\r\n newArray[i] = a[i];\r\n }\r\n var offset = a.length;\r\n for (var i = 0; i < b.length; i++) {\r\n newArray[i + offset] = b[i];\r\n }\r\n return newArray;\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n var zrUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $override: $override,\n guid: guid,\n logError: logError,\n clone: clone,\n merge: merge,\n mergeAll: mergeAll,\n extend: extend,\n defaults: defaults,\n createCanvas: createCanvas,\n indexOf: indexOf,\n inherits: inherits,\n mixin: mixin,\n isArrayLike: isArrayLike,\n each: each,\n map: map,\n reduce: reduce,\n filter: filter,\n find: find,\n keys: keys,\n bind: bind,\n curry: curry,\n isArray: isArray,\n isFunction: isFunction,\n isString: isString,\n isStringSafe: isStringSafe,\n isNumber: isNumber,\n isObject: isObject,\n isBuiltInObject: isBuiltInObject,\n isTypedArray: isTypedArray,\n isDom: isDom,\n isGradientObject: isGradientObject,\n isPatternObject: isPatternObject,\n isRegExp: isRegExp,\n eqNaN: eqNaN,\n retrieve: retrieve,\n retrieve2: retrieve2,\n retrieve3: retrieve3,\n slice: slice,\n normalizeCssArray: normalizeCssArray,\n assert: assert,\n trim: trim,\n setAsPrimitive: setAsPrimitive,\n isPrimitive: isPrimitive,\n HashMap: HashMap,\n createHashMap: createHashMap,\n concatArray: concatArray,\n createObject: createObject,\n hasOwn: hasOwn,\n noop: noop\n });\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function copy(out, v) {\r\n out[0] = v[0];\r\n out[1] = v[1];\r\n return out;\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function set(out, a, b) {\r\n out[0] = a;\r\n out[1] = b;\r\n return out;\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function scaleAndAdd(out, v1, v2, a) {\r\n out[0] = v1[0] + v2[0] * a;\r\n out[1] = v1[1] + v2[1] * a;\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n var length = len;\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n var lengthSquare = lenSquare;\r\n function mul(out, v1, v2) {\r\n out[0] = v1[0] * v2[0];\r\n out[1] = v1[1] * v2[1];\r\n return out;\r\n }\r\n function div(out, v1, v2) {\r\n out[0] = v1[0] / v2[0];\r\n out[1] = v1[1] / v2[1];\r\n return out;\r\n }\r\n function dot(v1, v2) {\r\n return v1[0] * v2[0] + v1[1] * v2[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function negate(out, v) {\r\n out[0] = -v[0];\r\n out[1] = -v[1];\r\n return out;\r\n }\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var vector = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create,\n copy: copy,\n clone: clone$1,\n set: set,\n add: add,\n scaleAndAdd: scaleAndAdd,\n sub: sub,\n len: len,\n length: length,\n lenSquare: lenSquare,\n lengthSquare: lengthSquare,\n mul: mul,\n div: div,\n dot: dot,\n scale: scale,\n normalize: normalize,\n distance: distance,\n dist: dist,\n distanceSquare: distanceSquare,\n distSquare: distSquare,\n negate: negate,\n lerp: lerp,\n applyTransform: applyTransform,\n min: min,\n max: max\n });\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n var _calcOut = [];\r\n function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\r\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\r\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\r\n }\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut$1 = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {\r\n out.zrX = _calcOut$1[0];\r\n out.zrY = _calcOut$1[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\r\n function isMiddleOrRightButtonOnMouseUpDown(e) {\r\n return e.which === 2 || e.which === 3;\r\n }\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy$1(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul$1(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n function clone$2(a) {\r\n var b = create$1();\r\n copy$1(b, a);\r\n return b;\r\n }\n\n var matrix = /*#__PURE__*/Object.freeze({\n __proto__: null,\n create: create$1,\n identity: identity,\n copy: copy$1,\n mul: mul$1,\n translate: translate,\n rotate: rotate,\n scale: scale$1,\n invert: invert,\n clone: clone$2\n });\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul$1(m, parent.transform, m);\r\n }\r\n else {\r\n copy$1(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul$1(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul$1(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssAngle(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 360 ? 360 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function lerpNumber(a, b, p) {\r\n return a + (b - a) * p;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function rgba2hsla(rgba) {\r\n if (!rgba) {\r\n return;\r\n }\r\n var R = rgba[0] / 255;\r\n var G = rgba[1] / 255;\r\n var B = rgba[2] / 255;\r\n var vMin = Math.min(R, G, B);\r\n var vMax = Math.max(R, G, B);\r\n var delta = vMax - vMin;\r\n var L = (vMax + vMin) / 2;\r\n var H;\r\n var S;\r\n if (delta === 0) {\r\n H = 0;\r\n S = 0;\r\n }\r\n else {\r\n if (L < 0.5) {\r\n S = delta / (vMax + vMin);\r\n }\r\n else {\r\n S = delta / (2 - vMax - vMin);\r\n }\r\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\r\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\r\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\r\n if (R === vMax) {\r\n H = deltaB - deltaG;\r\n }\r\n else if (G === vMax) {\r\n H = (1 / 3) + deltaR - deltaB;\r\n }\r\n else if (B === vMax) {\r\n H = (2 / 3) + deltaG - deltaR;\r\n }\r\n if (H < 0) {\r\n H += 1;\r\n }\r\n if (H > 1) {\r\n H -= 1;\r\n }\r\n }\r\n var hsla = [H * 360, S, L];\r\n if (rgba[3] != null) {\r\n hsla.push(rgba[3]);\r\n }\r\n return hsla;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function toHex(color) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\r\n }\r\n }\r\n function fastLerp(normalizedValue, colors, out) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n out = out || [];\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = colors[leftIndex];\r\n var rightColor = colors[rightIndex];\r\n var dv = value - leftIndex;\r\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\r\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\r\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\r\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\r\n return out;\r\n }\r\n var fastMapToColor = fastLerp;\r\n function lerp$1(normalizedValue, colors, fullOutput) {\r\n if (!(colors && colors.length)\r\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\r\n return;\r\n }\r\n var value = normalizedValue * (colors.length - 1);\r\n var leftIndex = Math.floor(value);\r\n var rightIndex = Math.ceil(value);\r\n var leftColor = parse(colors[leftIndex]);\r\n var rightColor = parse(colors[rightIndex]);\r\n var dv = value - leftIndex;\r\n var color = stringify([\r\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\r\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\r\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\r\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\r\n ], 'rgba');\r\n return fullOutput\r\n ? {\r\n color: color,\r\n leftIndex: leftIndex,\r\n rightIndex: rightIndex,\r\n value: value\r\n }\r\n : color;\r\n }\r\n var mapToColor = lerp$1;\r\n function modifyHSL(color, h, s, l) {\r\n var colorArr = parse(color);\r\n if (color) {\r\n colorArr = rgba2hsla(colorArr);\r\n h != null && (colorArr[0] = clampCssAngle(h));\r\n s != null && (colorArr[1] = parseCssFloat(s));\r\n l != null && (colorArr[2] = parseCssFloat(l));\r\n return stringify(hsla2rgba(colorArr), 'rgba');\r\n }\r\n }\r\n function modifyAlpha(color, alpha) {\r\n var colorArr = parse(color);\r\n if (colorArr && alpha != null) {\r\n colorArr[3] = clampCssFloat(alpha);\r\n return stringify(colorArr, 'rgba');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\r\n function random() {\r\n var r = Math.round(Math.random() * 255);\r\n var g = Math.round(Math.random() * 255);\r\n var b = Math.round(Math.random() * 255);\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n }\n\n var color = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parse: parse,\n lift: lift,\n toHex: toHex,\n fastLerp: fastLerp,\n fastMapToColor: fastMapToColor,\n lerp: lerp$1,\n mapToColor: mapToColor,\n modifyHSL: modifyHSL,\n modifyAlpha: modifyAlpha,\n stringify: stringify,\n lum: lum,\n random: random\n });\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop && additiveTo) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromPoints(points, min, max) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var p = points[0];\r\n var left = p[0];\r\n var right = p[0];\r\n var top = p[1];\r\n var bottom = p[1];\r\n for (var i = 1; i < points.length; i++) {\r\n p = points[i];\r\n left = mathMin$1(left, p[0]);\r\n right = mathMax$1(right, p[0]);\r\n top = mathMin$1(top, p[1]);\r\n bottom = mathMax$1(bottom, p[1]);\r\n }\r\n min[0] = left;\r\n min[1] = top;\r\n max[0] = right;\r\n max[1] = bottom;\r\n }\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\r\n function extendFromString(str, defaultOpts) {\r\n var innerOpts = createPathOptions(str, defaultOpts);\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.applyTransform = innerOpts.applyTransform;\r\n _this.buildPath = innerOpts.buildPath;\r\n return _this;\r\n }\r\n return Sub;\r\n }(SVGPath));\r\n return Sub;\r\n }\r\n function mergePath(pathEls, opts) {\r\n var pathList = [];\r\n var len = pathEls.length;\r\n for (var i = 0; i < len; i++) {\r\n var pathEl = pathEls[i];\r\n if (!pathEl.path) {\r\n pathEl.createPathProxy();\r\n }\r\n if (pathEl.shapeChanged()) {\r\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\r\n }\r\n pathList.push(pathEl.path);\r\n }\r\n var pathBundle = new Path(opts);\r\n pathBundle.createPathProxy();\r\n pathBundle.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.appendPath(pathList);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n };\r\n return pathBundle;\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n var DILIMITER_REG = /[\\s,]+/;\r\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\r\n var nodeParsers;\r\n var SVGParser = (function () {\r\n function SVGParser() {\r\n this._defs = {};\r\n this._root = null;\r\n this._isDefine = false;\r\n this._isText = false;\r\n }\r\n SVGParser.prototype.parse = function (xml, opt) {\r\n opt = opt || {};\r\n var svg = parseXML(xml);\r\n if (!svg) {\r\n throw new Error('Illegal svg');\r\n }\r\n var root = new Group();\r\n this._root = root;\r\n var viewBox = svg.getAttribute('viewBox') || '';\r\n var width = parseFloat((svg.getAttribute('width') || opt.width));\r\n var height = parseFloat((svg.getAttribute('height') || opt.height));\r\n isNaN(width) && (width = null);\r\n isNaN(height) && (height = null);\r\n parseAttributes(svg, root, null, true);\r\n var child = svg.firstChild;\r\n while (child) {\r\n this._parseNode(child, root);\r\n child = child.nextSibling;\r\n }\r\n var viewBoxRect;\r\n var viewBoxTransform;\r\n if (viewBox) {\r\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG);\r\n if (viewBoxArr.length >= 4) {\r\n viewBoxRect = {\r\n x: parseFloat((viewBoxArr[0] || 0)),\r\n y: parseFloat((viewBoxArr[1] || 0)),\r\n width: parseFloat(viewBoxArr[2]),\r\n height: parseFloat(viewBoxArr[3])\r\n };\r\n }\r\n }\r\n if (viewBoxRect && width != null && height != null) {\r\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\r\n if (!opt.ignoreViewBox) {\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n }\r\n if (!opt.ignoreRootClip && width != null && height != null) {\r\n root.setClipPath(new Rect({\r\n shape: { x: 0, y: 0, width: width, height: height }\r\n }));\r\n }\r\n return {\r\n root: root,\r\n width: width,\r\n height: height,\r\n viewBoxRect: viewBoxRect,\r\n viewBoxTransform: viewBoxTransform\r\n };\r\n };\r\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\r\n var nodeName = xmlNode.nodeName.toLowerCase();\r\n if (nodeName === 'defs') {\r\n this._isDefine = true;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = true;\r\n }\r\n var el;\r\n if (this._isDefine) {\r\n var parser = defineParsers[nodeName];\r\n if (parser) {\r\n var def = parser.call(this, xmlNode);\r\n var id = xmlNode.getAttribute('id');\r\n if (id) {\r\n this._defs[id] = def;\r\n }\r\n }\r\n }\r\n else {\r\n var parser = nodeParsers[nodeName];\r\n if (parser) {\r\n el = parser.call(this, xmlNode, parentGroup);\r\n parentGroup.add(el);\r\n }\r\n }\r\n if (el) {\r\n var child = xmlNode.firstChild;\r\n while (child) {\r\n if (child.nodeType === 1) {\r\n this._parseNode(child, el);\r\n }\r\n if (child.nodeType === 3 && this._isText) {\r\n this._parseText(child, el);\r\n }\r\n child = child.nextSibling;\r\n }\r\n }\r\n if (nodeName === 'defs') {\r\n this._isDefine = false;\r\n }\r\n else if (nodeName === 'text') {\r\n this._isText = false;\r\n }\r\n };\r\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\r\n if (xmlNode.nodeType === 1) {\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n this._textX += parseFloat(dx);\r\n this._textY += parseFloat(dy);\r\n }\r\n var text = new TSpan({\r\n style: {\r\n text: xmlNode.textContent\r\n },\r\n x: this._textX || 0,\r\n y: this._textY || 0\r\n });\r\n inheritStyle(parentGroup, text);\r\n parseAttributes(xmlNode, text, this._defs);\r\n var textStyle = text.style;\r\n var fontSize = textStyle.fontSize;\r\n if (fontSize && fontSize < 9) {\r\n textStyle.fontSize = 9;\r\n text.scaleX *= fontSize / 9;\r\n text.scaleY *= fontSize / 9;\r\n }\r\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\r\n textStyle.fontStyle,\r\n textStyle.fontWeight,\r\n (textStyle.fontSize || 12) + 'px',\r\n textStyle.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n textStyle.font = font;\r\n var rect = text.getBoundingRect();\r\n this._textX += rect.width;\r\n parentGroup.add(text);\r\n return text;\r\n };\r\n SVGParser.internalField = (function () {\r\n nodeParsers = {\r\n 'g': function (xmlNode, parentGroup) {\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'rect': function (xmlNode, parentGroup) {\r\n var rect = new Rect();\r\n inheritStyle(parentGroup, rect);\r\n parseAttributes(xmlNode, rect, this._defs);\r\n rect.setShape({\r\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\r\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\r\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\r\n height: parseFloat(xmlNode.getAttribute('height') || '0')\r\n });\r\n return rect;\r\n },\r\n 'circle': function (xmlNode, parentGroup) {\r\n var circle = new Circle();\r\n inheritStyle(parentGroup, circle);\r\n parseAttributes(xmlNode, circle, this._defs);\r\n circle.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n r: parseFloat(xmlNode.getAttribute('r') || '0')\r\n });\r\n return circle;\r\n },\r\n 'line': function (xmlNode, parentGroup) {\r\n var line = new Line();\r\n inheritStyle(parentGroup, line);\r\n parseAttributes(xmlNode, line, this._defs);\r\n line.setShape({\r\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\r\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\r\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\r\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\r\n });\r\n return line;\r\n },\r\n 'ellipse': function (xmlNode, parentGroup) {\r\n var ellipse = new Ellipse();\r\n inheritStyle(parentGroup, ellipse);\r\n parseAttributes(xmlNode, ellipse, this._defs);\r\n ellipse.setShape({\r\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\r\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\r\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\r\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\r\n });\r\n return ellipse;\r\n },\r\n 'polygon': function (xmlNode, parentGroup) {\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polygon = new Polygon({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n inheritStyle(parentGroup, polygon);\r\n parseAttributes(xmlNode, polygon, this._defs);\r\n return polygon;\r\n },\r\n 'polyline': function (xmlNode, parentGroup) {\r\n var path = new Path();\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n var pointsStr = xmlNode.getAttribute('points');\r\n var pointsArr;\r\n if (pointsStr) {\r\n pointsArr = parsePoints(pointsStr);\r\n }\r\n var polyline = new Polyline({\r\n shape: {\r\n points: pointsArr || []\r\n }\r\n });\r\n return polyline;\r\n },\r\n 'image': function (xmlNode, parentGroup) {\r\n var img = new ZRImage();\r\n inheritStyle(parentGroup, img);\r\n parseAttributes(xmlNode, img, this._defs);\r\n img.setStyle({\r\n image: xmlNode.getAttribute('xlink:href'),\r\n x: +xmlNode.getAttribute('x'),\r\n y: +xmlNode.getAttribute('y'),\r\n width: +xmlNode.getAttribute('width'),\r\n height: +xmlNode.getAttribute('height')\r\n });\r\n return img;\r\n },\r\n 'text': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x') || '0';\r\n var y = xmlNode.getAttribute('y') || '0';\r\n var dx = xmlNode.getAttribute('dx') || '0';\r\n var dy = xmlNode.getAttribute('dy') || '0';\r\n this._textX = parseFloat(x) + parseFloat(dx);\r\n this._textY = parseFloat(y) + parseFloat(dy);\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n return g;\r\n },\r\n 'tspan': function (xmlNode, parentGroup) {\r\n var x = xmlNode.getAttribute('x');\r\n var y = xmlNode.getAttribute('y');\r\n if (x != null) {\r\n this._textX = parseFloat(x);\r\n }\r\n if (y != null) {\r\n this._textY = parseFloat(y);\r\n }\r\n var dx = xmlNode.getAttribute('dx') || 0;\r\n var dy = xmlNode.getAttribute('dy') || 0;\r\n var g = new Group();\r\n inheritStyle(parentGroup, g);\r\n parseAttributes(xmlNode, g, this._defs);\r\n this._textX += dx;\r\n this._textY += dy;\r\n return g;\r\n },\r\n 'path': function (xmlNode, parentGroup) {\r\n var d = xmlNode.getAttribute('d') || '';\r\n var path = createFromString(d);\r\n inheritStyle(parentGroup, path);\r\n parseAttributes(xmlNode, path, this._defs);\r\n return path;\r\n }\r\n };\r\n })();\r\n return SVGParser;\r\n }());\r\n var defineParsers = {\r\n 'lineargradient': function (xmlNode) {\r\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\r\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\r\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\r\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\r\n var gradient = new LinearGradient(x1, y1, x2, y2);\r\n _parseGradientColorStops(xmlNode, gradient);\r\n return gradient;\r\n }\r\n };\r\n function _parseGradientColorStops(xmlNode, gradient) {\r\n var stop = xmlNode.firstChild;\r\n while (stop) {\r\n if (stop.nodeType === 1) {\r\n var offsetStr = stop.getAttribute('offset');\r\n var offset = void 0;\r\n if (offsetStr.indexOf('%') > 0) {\r\n offset = parseInt(offsetStr, 10) / 100;\r\n }\r\n else if (offsetStr) {\r\n offset = parseFloat(offsetStr);\r\n }\r\n else {\r\n offset = 0;\r\n }\r\n var stopColor = stop.getAttribute('stop-color') || '#000000';\r\n gradient.colorStops.push({\r\n offset: offset,\r\n color: stopColor\r\n });\r\n }\r\n stop = stop.nextSibling;\r\n }\r\n }\r\n function inheritStyle(parent, child) {\r\n if (parent && parent.__inheritedStyle) {\r\n if (!child.__inheritedStyle) {\r\n child.__inheritedStyle = {};\r\n }\r\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\r\n }\r\n }\r\n function parsePoints(pointsString) {\r\n var list = trim(pointsString).split(DILIMITER_REG);\r\n var points = [];\r\n for (var i = 0; i < list.length; i += 2) {\r\n var x = parseFloat(list[i]);\r\n var y = parseFloat(list[i + 1]);\r\n points.push([x, y]);\r\n }\r\n return points;\r\n }\r\n var attributesMap = {\r\n 'fill': 'fill',\r\n 'stroke': 'stroke',\r\n 'stroke-width': 'lineWidth',\r\n 'opacity': 'opacity',\r\n 'fill-opacity': 'fillOpacity',\r\n 'stroke-opacity': 'strokeOpacity',\r\n 'stroke-dasharray': 'lineDash',\r\n 'stroke-dashoffset': 'lineDashOffset',\r\n 'stroke-linecap': 'lineCap',\r\n 'stroke-linejoin': 'lineJoin',\r\n 'stroke-miterlimit': 'miterLimit',\r\n 'font-family': 'fontFamily',\r\n 'font-size': 'fontSize',\r\n 'font-style': 'fontStyle',\r\n 'font-weight': 'fontWeight',\r\n 'text-align': 'textAlign',\r\n 'alignment-baseline': 'textBaseline'\r\n };\r\n function parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\r\n var disp = el;\r\n var zrStyle = disp.__inheritedStyle || {};\r\n if (xmlNode.nodeType === 1) {\r\n parseTransformAttribute(xmlNode, el);\r\n extend(zrStyle, parseStyleAttribute(xmlNode));\r\n if (!onlyInlineStyle) {\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName)) {\r\n var attrValue = xmlNode.getAttribute(svgAttrName);\r\n if (attrValue != null) {\r\n zrStyle[attributesMap[svgAttrName]] = attrValue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n disp.style = disp.style || {};\r\n zrStyle.fill != null && (disp.style.fill = getPaint(zrStyle.fill, defs));\r\n zrStyle.stroke != null && (disp.style.stroke = getPaint(zrStyle.stroke, defs));\r\n each([\r\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = parseFloat(zrStyle[propName]));\r\n });\r\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\r\n zrStyle.textBaseline = 'alphabetic';\r\n }\r\n if (zrStyle.textBaseline === 'alphabetic') {\r\n zrStyle.textBaseline = 'bottom';\r\n }\r\n if (zrStyle.textAlign === 'start') {\r\n zrStyle.textAlign = 'left';\r\n }\r\n if (zrStyle.textAlign === 'end') {\r\n zrStyle.textAlign = 'right';\r\n }\r\n each(['lineDashOffset', 'lineCap', 'lineJoin',\r\n 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'\r\n ], function (propName) {\r\n zrStyle[propName] != null && (disp.style[propName] = zrStyle[propName]);\r\n });\r\n if (zrStyle.lineDash) {\r\n disp.style.lineDash = map(trim(zrStyle.lineDash).split(DILIMITER_REG), function (str) {\r\n return parseFloat(str);\r\n });\r\n }\r\n disp.__inheritedStyle = zrStyle;\r\n }\r\n var urlRegex = /url\\(\\s*#(.*?)\\)/;\r\n function getPaint(str, defs) {\r\n var urlMatch = defs && str && str.match(urlRegex);\r\n if (urlMatch) {\r\n var url = trim(urlMatch[1]);\r\n var def = defs[url];\r\n return def;\r\n }\r\n return str;\r\n }\r\n var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\r\n function parseTransformAttribute(xmlNode, node) {\r\n var transform = xmlNode.getAttribute('transform');\r\n if (transform) {\r\n transform = transform.replace(/,/g, ' ');\r\n var transformOps_1 = [];\r\n var m = null;\r\n transform.replace(transformRegex, function (str, type, value) {\r\n transformOps_1.push(type, value);\r\n return '';\r\n });\r\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\r\n var value = transformOps_1[i];\r\n var type = transformOps_1[i - 1];\r\n var valueArr = void 0;\r\n m = m || create$1();\r\n switch (type) {\r\n case 'translate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n translate(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\r\n break;\r\n case 'scale':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n scale$1(m, m, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\r\n break;\r\n case 'rotate':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n rotate(m, m, parseFloat(valueArr[0]));\r\n break;\r\n case 'skew':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n console.warn('Skew transform is not supported yet');\r\n break;\r\n case 'matrix':\r\n valueArr = trim(value).split(DILIMITER_REG);\r\n m[0] = parseFloat(valueArr[0]);\r\n m[1] = parseFloat(valueArr[1]);\r\n m[2] = parseFloat(valueArr[2]);\r\n m[3] = parseFloat(valueArr[3]);\r\n m[4] = parseFloat(valueArr[4]);\r\n m[5] = parseFloat(valueArr[5]);\r\n break;\r\n }\r\n }\r\n node.setLocalTransform(m);\r\n }\r\n }\r\n var styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\r\n function parseStyleAttribute(xmlNode) {\r\n var style = xmlNode.getAttribute('style');\r\n var result = {};\r\n if (!style) {\r\n return result;\r\n }\r\n var styleList = {};\r\n styleRegex.lastIndex = 0;\r\n var styleRegResult;\r\n while ((styleRegResult = styleRegex.exec(style)) != null) {\r\n styleList[styleRegResult[1]] = styleRegResult[2];\r\n }\r\n for (var svgAttrName in attributesMap) {\r\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\r\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\r\n }\r\n }\r\n return result;\r\n }\r\n function makeViewBoxTransform(viewBoxRect, width, height) {\r\n var scaleX = width / viewBoxRect.width;\r\n var scaleY = height / viewBoxRect.height;\r\n var scale = Math.min(scaleX, scaleY);\r\n return {\r\n scale: scale,\r\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2,\r\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2\r\n };\r\n }\r\n function parseSVG(xml, opt) {\r\n var parser = new SVGParser();\r\n return parser.parse(xml, opt);\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CMD$3 = PathProxy.CMD;\r\n var PI2$6 = Math.PI * 2;\r\n var PROP_XY = ['x', 'y'];\r\n var PROP_WH = ['width', 'height'];\r\n var tmpArr = [];\r\n function aroundEqual(a, b) {\r\n return Math.abs(a - b) < 1e-5;\r\n }\r\n function pathToBezierCurves(path) {\r\n var data = path.data;\r\n var len = path.len();\r\n var bezierArray = [];\r\n var currentSubpath;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n function createNewSubpath(x, y) {\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n currentSubpath = [x, y];\r\n }\r\n function addLine(x0, y0, x1, y1) {\r\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\r\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\r\n }\r\n }\r\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\r\n var delta = Math.abs(endAngle - startAngle);\r\n var len = Math.tan(delta / 4) * 4 / 3;\r\n var dir = endAngle < startAngle ? -1 : 1;\r\n var c1 = Math.cos(startAngle);\r\n var s1 = Math.sin(startAngle);\r\n var c2 = Math.cos(endAngle);\r\n var s2 = Math.sin(endAngle);\r\n var x1 = c1 * rx + cx;\r\n var y1 = s1 * ry + cy;\r\n var x4 = c2 * rx + cx;\r\n var y4 = s2 * ry + cy;\r\n var hx = rx * len * dir;\r\n var hy = ry * len * dir;\r\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\r\n }\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n if (cmd === CMD$3.L || cmd === CMD$3.C || cmd === CMD$3.Q) {\r\n currentSubpath = [x0, y0];\r\n }\r\n }\r\n switch (cmd) {\r\n case CMD$3.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n createNewSubpath(x0, y0);\r\n break;\r\n case CMD$3.L:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n addLine(xi, yi, x1, y1);\r\n xi = x1;\r\n yi = y1;\r\n break;\r\n case CMD$3.C:\r\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\r\n break;\r\n case CMD$3.Q:\r\n x1 = data[i++];\r\n y1 = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n x1 = Math.cos(startAngle) * rx + cx;\r\n y1 = Math.sin(startAngle) * ry + cy;\r\n if (isFirst) {\r\n x0 = x1;\r\n y0 = y1;\r\n createNewSubpath(x0, y0);\r\n }\r\n else {\r\n addLine(xi, yi, x1, y1);\r\n }\r\n xi = Math.cos(endAngle) * rx + cx;\r\n yi = Math.sin(endAngle) * ry + cy;\r\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\r\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\r\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\r\n : Math.min(angle + step, endAngle);\r\n addArc(angle, nextAngle, cx, cy, rx, ry);\r\n }\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n x1 = x0 + data[i++];\r\n y1 = y0 + data[i++];\r\n createNewSubpath(x1, y0);\r\n addLine(x1, y0, x1, y1);\r\n addLine(x1, y1, x0, y1);\r\n addLine(x0, y1, x0, y0);\r\n addLine(x0, y0, x1, y0);\r\n break;\r\n case CMD$3.Z:\r\n currentSubpath && addLine(xi, yi, x0, y0);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (currentSubpath && currentSubpath.length > 2) {\r\n bezierArray.push(currentSubpath);\r\n }\r\n return bezierArray;\r\n }\r\n function alignSubpath(subpath1, subpath2) {\r\n var len1 = subpath1.length;\r\n var len2 = subpath2.length;\r\n if (len1 === len2) {\r\n return [subpath1, subpath2];\r\n }\r\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\r\n var shorterLen = Math.min(len1, len2);\r\n var diff = Math.abs(len2 - len1) / 6;\r\n var shorterBezierCount = (shorterLen - 2) / 6;\r\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\r\n var newSubpath = [shorterPath[0], shorterPath[1]];\r\n var remained = diff;\r\n var tmpSegX = [];\r\n var tmpSegY = [];\r\n for (var i = 2; i < shorterLen;) {\r\n var x0 = shorterPath[i - 2];\r\n var y0 = shorterPath[i - 1];\r\n var x1 = shorterPath[i++];\r\n var y1 = shorterPath[i++];\r\n var x2 = shorterPath[i++];\r\n var y2 = shorterPath[i++];\r\n var x3 = shorterPath[i++];\r\n var y3 = shorterPath[i++];\r\n if (remained <= 0) {\r\n newSubpath.push(x1, y1, x2, y2, x3, y3);\r\n continue;\r\n }\r\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\r\n for (var k = 1; k <= actualSubDivCount; k++) {\r\n var p = k / actualSubDivCount;\r\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\r\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\r\n x0 = tmpSegX[3];\r\n y0 = tmpSegY[3];\r\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\r\n x1 = tmpSegX[5];\r\n y1 = tmpSegY[5];\r\n x2 = tmpSegX[6];\r\n y2 = tmpSegY[6];\r\n }\r\n remained -= actualSubDivCount - 1;\r\n }\r\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\r\n }\r\n function createSubpath(lastSubpathSubpath, otherSubpath) {\r\n var len = lastSubpathSubpath.length;\r\n var lastX = lastSubpathSubpath[len - 2];\r\n var lastY = lastSubpathSubpath[len - 1];\r\n var newSubpath = [];\r\n for (var i = 0; i < otherSubpath.length;) {\r\n newSubpath[i++] = lastX;\r\n newSubpath[i++] = lastY;\r\n }\r\n return newSubpath;\r\n }\r\n function alignBezierCurves(array1, array2) {\r\n var _a;\r\n var lastSubpath1;\r\n var lastSubpath2;\r\n var newArray1 = [];\r\n var newArray2 = [];\r\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\r\n var subpath1 = array1[i];\r\n var subpath2 = array2[i];\r\n var newSubpath1 = void 0;\r\n var newSubpath2 = void 0;\r\n if (!subpath1) {\r\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\r\n newSubpath2 = subpath2;\r\n }\r\n else if (!subpath2) {\r\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\r\n newSubpath1 = subpath1;\r\n }\r\n else {\r\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\r\n lastSubpath1 = newSubpath1;\r\n lastSubpath2 = newSubpath2;\r\n }\r\n newArray1.push(newSubpath1);\r\n newArray2.push(newSubpath2);\r\n }\r\n return [newArray1, newArray2];\r\n }\r\n function centroid(array) {\r\n var signedArea = 0;\r\n var cx = 0;\r\n var cy = 0;\r\n var len = array.length;\r\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\r\n var x0 = array[j];\r\n var y0 = array[j + 1];\r\n var x1 = array[i];\r\n var y1 = array[i + 1];\r\n var a = x0 * y1 - x1 * y0;\r\n signedArea += a;\r\n cx += (x0 + x1) * a;\r\n cy += (y0 + y1) * a;\r\n }\r\n if (signedArea === 0) {\r\n return [array[0] || 0, array[1] || 0];\r\n }\r\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\r\n }\r\n function findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\r\n var bezierCount = (fromSubBeziers.length - 2) / 6;\r\n var bestScore = Infinity;\r\n var bestOffset = 0;\r\n var len = fromSubBeziers.length;\r\n var len2 = len - 2;\r\n for (var offset = 0; offset < bezierCount; offset++) {\r\n var cursorOffset = offset * 6;\r\n var score = 0;\r\n for (var k = 0; k < len; k += 2) {\r\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\r\n var x0 = fromSubBeziers[idx] - fromCp[0];\r\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\r\n var x1 = toSubBeziers[k] - toCp[0];\r\n var y1 = toSubBeziers[k + 1] - toCp[1];\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestOffset = offset;\r\n }\r\n }\r\n return bestOffset;\r\n }\r\n function reverse(array) {\r\n var newArr = [];\r\n var len = array.length;\r\n for (var i = 0; i < len; i += 2) {\r\n newArr[i] = array[len - i - 2];\r\n newArr[i + 1] = array[len - i - 1];\r\n }\r\n return newArr;\r\n }\r\n function findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\r\n var result = [];\r\n var fromNeedsReverse;\r\n for (var i = 0; i < fromArr.length; i++) {\r\n var fromSubpathBezier = fromArr[i];\r\n var toSubpathBezier = toArr[i];\r\n var fromCp = centroid(fromSubpathBezier);\r\n var toCp = centroid(toSubpathBezier);\r\n if (fromNeedsReverse == null) {\r\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\r\n }\r\n var newFromSubpathBezier = [];\r\n var newToSubpathBezier = [];\r\n var bestAngle = 0;\r\n var bestScore = Infinity;\r\n var tmpArr_1 = [];\r\n var len = fromSubpathBezier.length;\r\n if (fromNeedsReverse) {\r\n fromSubpathBezier = reverse(fromSubpathBezier);\r\n }\r\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\r\n var len2 = len - 2;\r\n for (var k = 0; k < len2; k += 2) {\r\n var idx = (offset + k) % len2 + 2;\r\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\r\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\r\n }\r\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\r\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\r\n if (searchAngleIteration > 0) {\r\n var step = searchAngleRange / searchAngleIteration;\r\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n var score = 0;\r\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\r\n var x0 = newFromSubpathBezier[k];\r\n var y0 = newFromSubpathBezier[k + 1];\r\n var x1 = toSubpathBezier[k] - toCp[0];\r\n var y1 = toSubpathBezier[k + 1] - toCp[1];\r\n var newX1 = x1 * ca - y1 * sa;\r\n var newY1 = x1 * sa + y1 * ca;\r\n tmpArr_1[k] = newX1;\r\n tmpArr_1[k + 1] = newY1;\r\n var dx = newX1 - x0;\r\n var dy = newY1 - y0;\r\n score += dx * dx + dy * dy;\r\n }\r\n if (score < bestScore) {\r\n bestScore = score;\r\n bestAngle = angle;\r\n for (var m = 0; m < tmpArr_1.length; m++) {\r\n newToSubpathBezier[m] = tmpArr_1[m];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\r\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\r\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\r\n }\r\n }\r\n result.push({\r\n from: newFromSubpathBezier,\r\n to: newToSubpathBezier,\r\n fromCp: fromCp,\r\n toCp: toCp,\r\n rotation: -bestAngle\r\n });\r\n }\r\n return result;\r\n }\r\n function morphPath(fromPath, toPath, animationOpts) {\r\n var fromPathProxy;\r\n var toPathProxy;\r\n if (!fromPath || !toPath) {\r\n return toPath;\r\n }\r\n !fromPath.path && fromPath.createPathProxy();\r\n fromPathProxy = fromPath.path;\r\n fromPathProxy.beginPath();\r\n fromPath.buildPath(fromPathProxy, fromPath.shape);\r\n !toPath.path && toPath.createPathProxy();\r\n toPathProxy = toPath.path;\r\n toPathProxy === fromPathProxy && (toPathProxy = new PathProxy(false));\r\n toPathProxy.beginPath();\r\n if (isIndividualMorphingPath(toPath)) {\r\n toPath.__oldBuildPath(toPathProxy, toPath.shape);\r\n }\r\n else {\r\n toPath.buildPath(toPathProxy, toPath.shape);\r\n }\r\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\r\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\r\n becomeIndividualMorphingPath(toPath, morphingData, 0);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n toPath.animateTo({\r\n __morphT: 1\r\n }, defaults({\r\n during: function (p) {\r\n toPath.dirtyShape();\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n restoreIndividualMorphingPath(toPath);\r\n toPath.createPathProxy();\r\n toPath.dirtyShape();\r\n oldDone && oldDone();\r\n },\r\n aborted: function () {\r\n oldAborted && oldAborted();\r\n }\r\n }, animationOpts));\r\n return toPath;\r\n }\r\n function morphingPathBuildPath(path) {\r\n var morphingData = this.__morphingData;\r\n var t = this.__morphT;\r\n var onet = 1 - t;\r\n var newCp = [];\r\n for (var i = 0; i < morphingData.length; i++) {\r\n var item = morphingData[i];\r\n var from = item.from;\r\n var to = item.to;\r\n var angle = item.rotation * t;\r\n var fromCp = item.fromCp;\r\n var toCp = item.toCp;\r\n var sa = Math.sin(angle);\r\n var ca = Math.cos(angle);\r\n lerp(newCp, fromCp, toCp, t);\r\n for (var m = 0; m < from.length; m += 2) {\r\n var x0 = from[m];\r\n var y0 = from[m + 1];\r\n var x1 = to[m];\r\n var y1 = to[m + 1];\r\n var x = x0 * onet + x1 * t;\r\n var y = y0 * onet + y1 * t;\r\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\r\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\r\n }\r\n for (var m = 0; m < from.length;) {\r\n if (m === 0) {\r\n path.moveTo(tmpArr[m++], tmpArr[m++]);\r\n }\r\n path.bezierCurveTo(tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++], tmpArr[m++]);\r\n }\r\n }\r\n }\r\n function becomeIndividualMorphingPath(path, morphingData, morphT) {\r\n if (isIndividualMorphingPath(path)) {\r\n updateIndividualMorphingPath(path, morphingData, morphT);\r\n return;\r\n }\r\n var morphingPath = path;\r\n morphingPath.__oldBuildPath = morphingPath.buildPath;\r\n morphingPath.buildPath = morphingPathBuildPath;\r\n updateIndividualMorphingPath(morphingPath, morphingData, morphT);\r\n }\r\n function updateIndividualMorphingPath(morphingPath, morphingData, morphT) {\r\n morphingPath.__morphingData = morphingData;\r\n morphingPath.__morphT = morphT;\r\n }\r\n function restoreIndividualMorphingPath(path) {\r\n if (isIndividualMorphingPath(path)) {\r\n path.buildPath = path.__oldBuildPath;\r\n path.__oldBuildPath = path.__morphingData = null;\r\n }\r\n }\r\n function isIndividualMorphingPath(path) {\r\n return path.__oldBuildPath != null;\r\n }\r\n function isCombiningPath(path) {\r\n return !!path.__combiningSubList;\r\n }\r\n function isInAnyMorphing(path) {\r\n return isIndividualMorphingPath(path) || isCombiningPath(path);\r\n }\r\n function combine(fromPathList, toPath, animationOpts, copyPropsIfDivided) {\r\n var fromIndividuals = [];\r\n var separateCount = 0;\r\n for (var i = 0; i < fromPathList.length; i++) {\r\n var fromPath = fromPathList[i];\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n for (var j = 0; j < fromCombiningSubList.length; j++) {\r\n fromIndividuals.push(fromCombiningSubList[j]);\r\n }\r\n separateCount += fromCombiningSubList.length;\r\n }\r\n else {\r\n fromIndividuals.push(fromPath);\r\n separateCount++;\r\n }\r\n }\r\n if (!separateCount) {\r\n return;\r\n }\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var toPathSplittedList = divideShape(toPath, separateCount, dividingMethod);\r\n assert(toPathSplittedList.length === separateCount);\r\n var oldDone = animationOpts && animationOpts.done;\r\n var oldAborted = animationOpts && animationOpts.aborted;\r\n var oldDuring = animationOpts && animationOpts.during;\r\n var doneCount = 0;\r\n var abortedCalled = false;\r\n var morphAnimationOpts = defaults({\r\n during: function (p) {\r\n oldDuring && oldDuring(p);\r\n },\r\n done: function () {\r\n doneCount++;\r\n if (doneCount === toPathSplittedList.length) {\r\n restoreCombiningPath(toPath);\r\n oldDone && oldDone();\r\n }\r\n },\r\n aborted: function () {\r\n if (!abortedCalled) {\r\n abortedCalled = true;\r\n oldAborted && oldAborted();\r\n }\r\n }\r\n }, animationOpts);\r\n for (var i = 0; i < separateCount; i++) {\r\n var from = fromIndividuals[i];\r\n var to = toPathSplittedList[i];\r\n copyPropsIfDivided && copyPropsIfDivided(toPath, to, true);\r\n morphPath(from, to, morphAnimationOpts);\r\n }\r\n becomeCombiningPath(toPath, toPathSplittedList);\r\n return {\r\n fromIndividuals: fromIndividuals,\r\n toIndividuals: toPathSplittedList,\r\n count: separateCount\r\n };\r\n }\r\n function becomeCombiningPath(path, combiningSubList) {\r\n if (isCombiningPath(path)) {\r\n updateCombiningPathSubList(path, combiningSubList);\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, combiningSubList);\r\n combiningPath.__oldAddSelfToZr = path.addSelfToZr;\r\n combiningPath.__oldRemoveSelfFromZr = path.removeSelfFromZr;\r\n combiningPath.addSelfToZr = combiningAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningRemoveSelfFromZr;\r\n combiningPath.__oldBuildPath = combiningPath.buildPath;\r\n combiningPath.buildPath = noop;\r\n combiningPath.childrenRef = combiningChildrenRef;\r\n }\r\n function restoreCombiningPath(path) {\r\n if (!isCombiningPath(path)) {\r\n return;\r\n }\r\n var combiningPath = path;\r\n updateCombiningPathSubList(combiningPath, null);\r\n combiningPath.addSelfToZr = combiningPath.__oldAddSelfToZr;\r\n combiningPath.removeSelfFromZr = combiningPath.__oldRemoveSelfFromZr;\r\n combiningPath.buildPath = combiningPath.__oldBuildPath;\r\n combiningPath.childrenRef =\r\n combiningPath.__combiningSubList =\r\n combiningPath.__oldAddSelfToZr =\r\n combiningPath.__oldRemoveSelfFromZr =\r\n combiningPath.__oldBuildPath = null;\r\n }\r\n function updateCombiningPathSubList(combiningPath, combiningSubList) {\r\n if (combiningPath.__combiningSubList !== combiningSubList) {\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'removeSelfFromZr');\r\n combiningPath.__combiningSubList = combiningSubList;\r\n if (combiningSubList) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n combiningSubList[i].parent = combiningPath;\r\n }\r\n }\r\n combiningPathSubListAddRemoveWithZr(combiningPath, 'addSelfToZr');\r\n }\r\n }\r\n function combiningAddSelfToZr(zr) {\r\n this.__oldAddSelfToZr(zr);\r\n combiningPathSubListAddRemoveWithZr(this, 'addSelfToZr');\r\n }\r\n function combiningPathSubListAddRemoveWithZr(path, method) {\r\n var combiningSubList = path.__combiningSubList;\r\n var zr = path.__zr;\r\n if (combiningSubList && zr) {\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child[method](zr);\r\n }\r\n }\r\n }\r\n function combiningRemoveSelfFromZr(zr) {\r\n this.__oldRemoveSelfFromZr(zr);\r\n var combiningSubList = this.__combiningSubList;\r\n for (var i = 0; i < combiningSubList.length; i++) {\r\n var child = combiningSubList[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n }\r\n function combiningChildrenRef() {\r\n return this.__combiningSubList;\r\n }\r\n function separate(fromPath, toPathList, animationOpts, copyPropsIfDivided) {\r\n var toPathListLen = toPathList.length;\r\n var fromPathList;\r\n var dividingMethod = animationOpts ? animationOpts.dividingMethod : null;\r\n var copyProps = false;\r\n if (isCombiningPath(fromPath)) {\r\n var fromCombiningSubList = fromPath.__combiningSubList;\r\n if (fromCombiningSubList.length === toPathListLen) {\r\n fromPathList = fromCombiningSubList;\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n }\r\n else {\r\n fromPathList = divideShape(fromPath, toPathListLen, dividingMethod);\r\n copyProps = true;\r\n }\r\n assert(fromPathList.length === toPathListLen);\r\n for (var i = 0; i < toPathListLen; i++) {\r\n if (copyProps && copyPropsIfDivided) {\r\n copyPropsIfDivided(fromPath, fromPathList[i], false);\r\n }\r\n morphPath(fromPathList[i], toPathList[i], animationOpts);\r\n }\r\n return {\r\n fromIndividuals: fromPathList,\r\n toIndividuals: toPathList,\r\n count: toPathListLen\r\n };\r\n }\r\n function divideShape(path, separateCount, dividingMethod) {\r\n return dividingMethod === 'duplicate'\r\n ? duplicateShape(path, separateCount)\r\n : splitShape(path, separateCount);\r\n }\r\n function splitShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n if (separateCount === 1) {\r\n return duplicateShape(path, separateCount);\r\n }\r\n if (path instanceof Rect) {\r\n var toPathShape = path.shape;\r\n var splitPropIdx = toPathShape.height > toPathShape.width ? 1 : 0;\r\n var propWH = PROP_WH[splitPropIdx];\r\n var propXY = PROP_XY[splitPropIdx];\r\n var subWH = toPathShape[propWH] / separateCount;\r\n var xyCurr = toPathShape[propXY];\r\n for (var i = 0; i < separateCount; i++, xyCurr += subWH) {\r\n var subShape = {\r\n x: toPathShape.x,\r\n y: toPathShape.y,\r\n width: toPathShape.width,\r\n height: toPathShape.height\r\n };\r\n subShape[propXY] = xyCurr;\r\n subShape[propWH] = i < separateCount - 1\r\n ? subWH\r\n : toPathShape[propXY] + toPathShape[propWH] - xyCurr;\r\n var splitted = new Rect({ shape: subShape });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else if (path instanceof Sector) {\r\n var toPathShape = path.shape;\r\n var clockwise = toPathShape.clockwise;\r\n var startAngle = toPathShape.startAngle;\r\n var endAngle = toPathShape.endAngle;\r\n var endAngleNormalized = normalizeRadian$1(startAngle, toPathShape.endAngle, clockwise);\r\n var step = (endAngleNormalized - startAngle) / separateCount;\r\n var angleCurr = startAngle;\r\n for (var i = 0; i < separateCount; i++, angleCurr += step) {\r\n var splitted = new Sector({\r\n shape: {\r\n cx: toPathShape.cx,\r\n cy: toPathShape.cy,\r\n r: toPathShape.r,\r\n r0: toPathShape.r0,\r\n clockwise: clockwise,\r\n startAngle: angleCurr,\r\n endAngle: i === separateCount - 1 ? endAngle : angleCurr + step\r\n }\r\n });\r\n resultPaths.push(splitted);\r\n }\r\n }\r\n else {\r\n return duplicateShape(path, separateCount);\r\n }\r\n return resultPaths;\r\n }\r\n function duplicateShape(path, separateCount) {\r\n var resultPaths = [];\r\n if (separateCount <= 0) {\r\n return resultPaths;\r\n }\r\n var ctor = path.constructor;\r\n for (var i = 0; i < separateCount; i++) {\r\n var sub = new ctor({\r\n shape: clone(path.shape)\r\n });\r\n resultPaths.push(sub);\r\n }\r\n return resultPaths;\r\n }\r\n function normalizeRadian$1(start, end, clockwise) {\r\n return end + PI2$6 * (Math[clockwise ? 'ceil' : 'floor']((start - end) / PI2$6));\r\n }\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy$1(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n var instances = {};\r\n function delInstance(id) {\r\n delete instances[id];\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n instances[zr.id] = zr;\r\n return zr;\r\n }\r\n function dispose(zr) {\r\n zr.dispose();\r\n }\r\n function disposeAll() {\r\n for (var key in instances) {\r\n if (instances.hasOwnProperty(key)) {\r\n instances[key].dispose();\r\n }\r\n }\r\n instances = {};\r\n }\r\n function getInstance(id) {\r\n return instances[id];\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\r\n var version = '5.0.1';\n\n var zrender = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init,\n dispose: dispose,\n disposeAll: disposeAll,\n getInstance: getInstance,\n registerPainter: registerPainter,\n version: version\n });\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function asc(arr) {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n }\r\n function getPrecision(val) {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n var e = 1;\r\n var count = 0;\r\n while (Math.round(val * e) / e !== val) {\r\n e *= 10;\r\n count++;\r\n }\r\n return count;\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n var MAX_SAFE_INTEGER = 9007199254740991;\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function quantile(ascArr, p) {\r\n var H = (ascArr.length - 1) * p + 1;\r\n var h = Math.floor(H);\r\n var v = +ascArr[h - 1];\r\n var e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n }\r\n function reformIntervals(list) {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n var curr = -Infinity;\r\n var currClose = 1;\r\n for (var i = 0; i < list.length;) {\r\n var interval = list[i].interval;\r\n var close_1 = list[i].close;\r\n for (var lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close_1[lg] = (!lg ? 1 - currClose : 1);\r\n }\r\n curr = interval[lg];\r\n currClose = close_1[lg];\r\n }\r\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return list;\r\n function littleThan(a, b, lg) {\r\n return a.interval[lg] < b.interval[lg]\r\n || (a.interval[lg] === b.interval[lg]\r\n && ((a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))));\r\n }\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var numberUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n linearMap: linearMap,\n parsePercent: parsePercent$2,\n round: round$1,\n asc: asc,\n getPrecision: getPrecision,\n getPrecisionSafe: getPrecisionSafe,\n getPixelPrecision: getPixelPrecision,\n getPercentWithPrecision: getPercentWithPrecision,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,\n remRadian: remRadian,\n isRadianAroundZero: isRadianAroundZero,\n parseDate: parseDate,\n quantity: quantity,\n quantityExponent: quantityExponent,\n nice: nice,\n quantile: quantile,\n reformIntervals: reformIntervals,\n numericToNumber: numericToNumber,\n isNumeric: isNumeric,\n getRandomIdBase: getRandomIdBase,\n getGreatestCommonDividor: getGreatestCommonDividor,\n getLeastCommonMultiple: getLeastCommonMultiple\n });\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function makeInternalComponentId(idSuffix) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function compressBatches(batchA, batchB) {\r\n var mapA = {};\r\n var mapB = {};\r\n makeMap(batchA || [], mapA);\r\n makeMap(batchB || [], mapB, mapA);\r\n return [mapToArray(mapA), mapToArray(mapB)];\r\n function makeMap(sourceBatch, map, otherMap) {\r\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\r\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\r\n if (seriesId == null) {\r\n return;\r\n }\r\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\r\n var otherDataIndices = otherMap && otherMap[seriesId];\r\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\r\n var dataIndex = dataIndices[j];\r\n if (otherDataIndices && otherDataIndices[dataIndex]) {\r\n otherDataIndices[dataIndex] = null;\r\n }\r\n else {\r\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\r\n }\r\n }\r\n }\r\n }\r\n function mapToArray(map, isData) {\r\n var result = [];\r\n for (var i in map) {\r\n if (map.hasOwnProperty(i) && map[i] != null) {\r\n if (isData) {\r\n result.push(+i);\r\n }\r\n else {\r\n var dataIndices = mapToArray(map[i], true);\r\n dataIndices.length && result.push({ seriesId: i, dataIndex: dataIndices });\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n var MULTIPLE_REFERRING = { useDefault: false, enableAll: true, enableNone: true };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function getTooltipRenderMode(renderModeOption) {\r\n if (renderModeOption === 'auto') {\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n }\r\n function groupData(array, getKey) {\r\n var buckets = createHashMap();\r\n var keys = [];\r\n each(array, function (item) {\r\n var key = getKey(item);\r\n (buckets.get(key)\r\n || (keys.push(key), buckets.set(key, []))).push(item);\r\n });\r\n return {\r\n keys: keys,\r\n buckets: buckets\r\n };\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color$1) {\r\n if (typeof color$1 !== 'string') {\r\n return color$1;\r\n }\r\n var liftedColor = liftedColorCache.get(color$1);\r\n if (!liftedColor) {\r\n liftedColor = lift(color$1, -0.1);\r\n liftedColorCache.put(color$1, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n var mathMax$4 = Math.max;\r\n var mathMin$4 = Math.min;\r\n var _customShapeMap = {};\r\n function extendShape(opts) {\r\n return Path.extend(opts);\r\n }\r\n var extendPathFromString = extendFromString;\r\n function extendPath(pathData, opts) {\r\n return extendPathFromString(pathData, opts);\r\n }\r\n function registerShape(name, ShapeClass) {\r\n _customShapeMap[name] = ShapeClass;\r\n }\r\n function getShapeClass(name) {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n }\r\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n var mergePath$1 = mergePath;\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function subPixelOptimizeLine$1(param) {\r\n subPixelOptimizeLine(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n function subPixelOptimizeRect$1(param) {\r\n subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n }\r\n var subPixelOptimize$1 = subPixelOptimize;\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function getTransform(target, ancestor) {\r\n var mat = identity([]);\r\n while (target && target !== ancestor) {\r\n mul$1(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n return mat;\r\n }\r\n function applyTransform$1(target, transform, invert$1) {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n if (invert$1) {\r\n transform = invert([], transform);\r\n }\r\n return applyTransform([], target, transform);\r\n }\r\n function transformDirection(direction, transform, invert) {\r\n var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n var vertex = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n vertex = applyTransform$1(vertex, transform, invert);\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\r\n function clipPointsByRect(points, rect) {\r\n return map(points, function (point) {\r\n var x = point[0];\r\n x = mathMax$4(x, rect.x);\r\n x = mathMin$4(x, rect.x + rect.width);\r\n var y = point[1];\r\n y = mathMax$4(y, rect.y);\r\n y = mathMin$4(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n }\r\n function clipRectByRect(targetRect, rect) {\r\n var x = mathMax$4(targetRect.x, rect.x);\r\n var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width);\r\n var y = mathMax$4(targetRect.y, rect.y);\r\n var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height);\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n }\r\n function createIcon(iconStr, opt, rect) {\r\n var innerOpts = extend({ rectHover: true }, opt);\r\n var style = innerOpts.style = { strokeNoScale: true };\r\n rect = rect || { x: -1, y: -1, width: 2, height: 2 };\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (style.image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts))\r\n : (makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'));\r\n }\r\n }\r\n function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\r\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n var p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n }\r\n function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\r\n var mx = a2x - a1x;\r\n var my = a2y - a1y;\r\n var nx = b2x - b1x;\r\n var ny = b2y - b1y;\r\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n var b1a1x = a1x - b1x;\r\n var b1a1y = a1y - b1y;\r\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function crossProduct2d(x1, y1, x2, y2) {\r\n return x1 * y2 - x2 * y1;\r\n }\r\n function nearZero(val) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n }\r\n registerShape('circle', Circle);\r\n registerShape('ellipse', Ellipse);\r\n registerShape('sector', Sector);\r\n registerShape('ring', Ring);\r\n registerShape('polygon', Polygon);\r\n registerShape('polyline', Polyline);\r\n registerShape('rect', Rect);\r\n registerShape('line', Line);\r\n registerShape('bezierCurve', BezierCurve);\r\n registerShape('arc', Arc);\n\n var graphic = /*#__PURE__*/Object.freeze({\n __proto__: null,\n extendShape: extendShape,\n extendPath: extendPath,\n registerShape: registerShape,\n getShapeClass: getShapeClass,\n makePath: makePath,\n makeImage: makeImage,\n mergePath: mergePath$1,\n resizePath: resizePath,\n subPixelOptimizeLine: subPixelOptimizeLine$1,\n subPixelOptimizeRect: subPixelOptimizeRect$1,\n subPixelOptimize: subPixelOptimize$1,\n updateProps: updateProps,\n initProps: initProps,\n removeElement: removeElement,\n removeElementWithFadeOut: removeElementWithFadeOut,\n isElementRemoved: isElementRemoved,\n getTransform: getTransform,\n applyTransform: applyTransform$1,\n transformDirection: transformDirection,\n groupTransition: groupTransition,\n clipPointsByRect: clipPointsByRect,\n clipRectByRect: clipRectByRect,\n createIcon: createIcon,\n linePolygonIntersect: linePolygonIntersect,\n lineLineIntersect: lineLineIntersect,\n Group: Group,\n Image: ZRImage,\n Text: ZRText,\n Circle: Circle,\n Ellipse: Ellipse,\n Sector: Sector,\n Ring: Ring,\n Polygon: Polygon,\n Polyline: Polyline,\n Rect: Rect,\n Line: Line,\n BezierCurve: BezierCurve,\n Arc: Arc,\n IncrementalDisplayable: IncrementalDisplayble,\n CompoundPath: CompoundPath,\n LinearGradient: LinearGradient,\n RadialGradient: RadialGradient,\n BoundingRect: BoundingRect,\n OrientedBoundingRect: OrientedBoundingRect,\n Point: Point,\n Path: Path\n });\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}-{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\r\n deprecateLog('getTextRect is deprecated.');\r\n var textEl = new ZRText({\r\n style: {\r\n text: text,\r\n font: font,\r\n align: align,\r\n verticalAlign: verticalAlign,\r\n padding: padding,\r\n rich: rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight: lineHeight\r\n }\r\n });\r\n return textEl.getBoundingRect();\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n function toCamelCase(str, upperCaseFirst) {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n return str;\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n function makeValueReadable(value, valueType, useUTC) {\r\n var USER_READABLE_DEFUALT_TIME_PATTERN = 'yyyy-MM-dd hh:mm:ss';\r\n function stringToUserReadable(str) {\r\n return (str && trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num) {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n var isTypeTime = valueType === 'time';\r\n var isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n var date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n }\r\n if (valueType === 'ordinal') {\r\n return isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n var numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : '-';\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function formatTplSimple(tpl, param, encode) {\r\n each(param, function (value, key) {\r\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\r\n });\r\n return tpl;\r\n }\r\n function getTooltipMarker(inOpt, extraCssText) {\r\n var opt = isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {});\r\n var color = opt.color;\r\n var type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n var renderMode = opt.renderMode || 'html';\r\n if (!color) {\r\n return '';\r\n }\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n var markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n }\r\n function formatTime(tpl, value, isUTC) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year') {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n var date = parseDate(value);\r\n var utc = isUTC ? 'UTC' : '';\r\n var y = date['get' + utc + 'FullYear']();\r\n var M = date['get' + utc + 'Month']() + 1;\r\n var d = date['get' + utc + 'Date']();\r\n var h = date['get' + utc + 'Hours']();\r\n var m = date['get' + utc + 'Minutes']();\r\n var s = date['get' + utc + 'Seconds']();\r\n var S = date['get' + utc + 'Milliseconds']();\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', y % 100 + '')\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n return tpl;\r\n }\r\n function capitalFirst(str) {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\r\n function windowOpen(link, target) {\r\n if (target === '_blank' || target === 'blank') {\r\n var blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n }\n\n var formatUtil = /*#__PURE__*/Object.freeze({\n __proto__: null,\n addCommas: addCommas,\n toCamelCase: toCamelCase,\n normalizeCssArray: normalizeCssArray$1,\n encodeHTML: encodeHTML,\n makeValueReadable: makeValueReadable,\n formatTpl: formatTpl,\n formatTplSimple: formatTplSimple,\n getTooltipMarker: getTooltipMarker,\n formatTime: formatTime,\n capitalFirst: capitalFirst,\n convertToColorString: convertToColorString,\n windowOpen: windowOpen,\n truncateText: truncateText,\n getTextRect: getTextRect\n });\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var box = boxLayout;\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getAvailableSize(positionInfo, containerRect, margin) {\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var x = parsePercent$2(positionInfo.left, containerWidth);\r\n var y = parsePercent$2(positionInfo.top, containerHeight);\r\n var x2 = parsePercent$2(positionInfo.right, containerWidth);\r\n var y2 = parsePercent$2(positionInfo.bottom, containerHeight);\r\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\r\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\r\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\r\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\r\n margin = normalizeCssArray$1(margin || 0);\r\n return {\r\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\r\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\r\n };\r\n }\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function positionElement(el, positionInfo, containerRect, margin, opt) {\r\n var h = !opt || !opt.hv || opt.hv[0];\r\n var v = !opt || !opt.hv || opt.hv[1];\r\n var boundingMode = opt && opt.boundingMode || 'all';\r\n if (!h && !v) {\r\n return;\r\n }\r\n var rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n var transform = el.getLocalTransform();\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n var layoutRect = getLayoutRect(defaults({ width: rect.width, height: rect.height }, positionInfo), containerRect, margin);\r\n var dx = h ? layoutRect.x - rect.x : 0;\r\n var dy = v ? layoutRect.y - rect.y : 0;\r\n if (boundingMode === 'raw') {\r\n el.x = dx;\r\n el.y = dy;\r\n }\r\n else {\r\n el.x += dx;\r\n el.y += dy;\r\n }\r\n el.markRedraw();\r\n }\r\n function sizeCalculable(option, hvIdx) {\r\n return option[HV_NAMES[hvIdx][0]] != null\r\n || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null);\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function registerInternalOptionCreator(mainType, creator) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n }\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set$1(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set$1(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\r\n function normalizeTooltipFormatResult(result) {\r\n var markupText;\r\n var markupFragment;\r\n if (isObject(result)) {\r\n if (result.type) {\r\n markupFragment = result;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n return {\r\n markupText: markupText,\r\n markupFragment: markupFragment\r\n };\r\n }\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\r\n function getRawValueParser(type) {\r\n return valueParserMap.get(type);\r\n }\r\n var ORDER_COMPARISON_OP_MAP = {\r\n lt: function (lval, rval) { return lval < rval; },\r\n lte: function (lval, rval) { return lval <= rval; },\r\n gt: function (lval, rval) { return lval > rval; },\r\n gte: function (lval, rval) { return lval >= rval; }\r\n };\r\n var FilterOrderComparator = (function () {\r\n function FilterOrderComparator(op, rval) {\r\n if (typeof rval !== 'number') {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\r\n }\r\n throwError(errMsg);\r\n }\r\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterOrderComparator.prototype.evaluate = function (lval) {\r\n return typeof lval === 'number'\r\n ? this._opFn(lval, this._rvalFloat)\r\n : this._opFn(numericToNumber(lval), this._rvalFloat);\r\n };\r\n return FilterOrderComparator;\r\n }());\r\n var SortOrderComparator = (function () {\r\n function SortOrderComparator(order, incomparable) {\r\n var isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\r\n var lvalTypeof = typeof lval;\r\n var rvalTypeof = typeof rval;\r\n var lvalFloat = lvalTypeof === 'number' ? lval : numericToNumber(lval);\r\n var rvalFloat = rvalTypeof === 'number' ? rval : numericToNumber(rval);\r\n var lvalNotNumeric = isNaN(lvalFloat);\r\n var rvalNotNumeric = isNaN(rvalFloat);\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n var lvalIsStr = lvalTypeof === 'string';\r\n var rvalIsStr = rvalTypeof === 'string';\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval : 0;\r\n }\r\n }\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? -this._resultLT\r\n : 0;\r\n };\r\n return SortOrderComparator;\r\n }());\r\n var FilterEqualityComparator = (function () {\r\n function FilterEqualityComparator(isEq, rval) {\r\n this._rval = rval;\r\n this._isEQ = isEq;\r\n this._rvalTypeof = typeof rval;\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n FilterEqualityComparator.prototype.evaluate = function (lval) {\r\n var eqResult = lval === this._rval;\r\n if (!eqResult) {\r\n var lvalTypeof = typeof lval;\r\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\r\n eqResult = numericToNumber(lval) === this._rvalFloat;\r\n }\r\n }\r\n return this._isEQ ? eqResult : !eqResult;\r\n };\r\n return FilterEqualityComparator;\r\n }());\r\n function createFilterComparator(op, rval) {\r\n return (op === 'eq' || op === 'ne')\r\n ? new FilterEqualityComparator(op === 'eq', rval)\r\n : hasOwn(ORDER_COMPARISON_OP_MAP, op)\r\n ? new FilterOrderComparator(op, rval)\r\n : null;\r\n }\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n var TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';\r\n var TOOLTIP_TEXT_STYLE_RICH = {\r\n fontSize: 12,\r\n fill: '#6e7079'\r\n };\r\n var TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';\r\n var TOOLTIP_VALUE_TEXT_STYLE_RICH = {\r\n fontSize: 14,\r\n fill: '#464646',\r\n fontWeight: 900\r\n };\r\n var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\n var HTML_GAPS = [0, 10, 20, 30];\r\n var RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function getBuilder(fragment) {\r\n return hasOwn(builderMap, fragment.type) && builderMap[fragment.type];\r\n }\r\n var builderMap = {\r\n section: {\r\n planLayout: function (fragment) {\r\n var subBlockLen = fragment.blocks.length;\r\n var thisBlockHasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !fragment.noHeader);\r\n var thisGapLevelBetweenSubBlocks = 0;\r\n each(fragment.blocks, function (subBlock) {\r\n getBuilder(subBlock).planLayout(subBlock);\r\n var subGapLevel = subBlock.__gapLevelBetweenSubBlocks;\r\n if (subGapLevel >= thisGapLevelBetweenSubBlocks) {\r\n thisGapLevelBetweenSubBlocks = subGapLevel + ((thisBlockHasInnerGap && (!subGapLevel\r\n || (subBlock.type === 'section' && !subBlock.noHeader))) ? 1 : 0);\r\n }\r\n });\r\n fragment.__gapLevelBetweenSubBlocks = thisGapLevelBetweenSubBlocks;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var noHeader = fragment.noHeader;\r\n var gaps = getGap(fragment);\r\n var subMarkupText = buildSubBlocks(ctx, fragment, noHeader ? topMarginForOuterGap : gaps.html);\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\"
\"\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText, topMarginForOuterGap);\r\n }\r\n }\r\n },\r\n nameValue: {\r\n planLayout: function (fragment) {\r\n fragment.__gapLevelBetweenSubBlocks = 0;\r\n },\r\n build: function (ctx, fragment, topMarginForOuterGap) {\r\n var renderMode = ctx.renderMode;\r\n var noName = fragment.noName;\r\n var noValue = fragment.noValue;\r\n var noMarker = !fragment.markerType;\r\n var name = fragment.name;\r\n var value = fragment.value;\r\n var useUTC = ctx.useUTC;\r\n if (noName && noValue) {\r\n return;\r\n }\r\n var markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\r\n var readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n var valueTypeOption = fragment.valueType;\r\n var readableValueList = noValue\r\n ? []\r\n : (isArray(value)\r\n ? map(value, function (val, idx) { return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); })\r\n : [makeValueReadable(value, isArray(valueTypeOption) ? valueTypeOption[0] : valueTypeOption, useUTC)]);\r\n var valueAlignRight = !noMarker || !noName;\r\n var valueCloseToMarker = !noMarker && noName;\r\n return renderMode === 'richText'\r\n ? ((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName))\r\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker)))\r\n : wrapBlockHTML((noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker))\r\n + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker)), topMarginForOuterGap);\r\n }\r\n }\r\n };\r\n function buildSubBlocks(ctx, fragment, topMarginForOuterGap) {\r\n var subMarkupTextList = [];\r\n var subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n var orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n var orderMap = { valueAsc: 'asc', valueDesc: 'desc' };\r\n if (hasOwn(orderMap, orderMode)) {\r\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\r\n subBlocks.sort(function (a, b) { return comparator_1.evaluate(a.sortParam, b.sortParam); });\r\n }\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n var gaps = getGap(fragment);\r\n each(subBlocks, function (subBlock, idx) {\r\n var subMarkupText = getBuilder(subBlock).build(ctx, subBlock, idx > 0 ? gaps.html : 0);\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n if (!subMarkupTextList.length) {\r\n return;\r\n }\r\n return ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(subMarkupTextList.join(''), topMarginForOuterGap);\r\n }\r\n function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC) {\r\n if (!fragment) {\r\n return;\r\n }\r\n var builder = getBuilder(fragment);\r\n builder.planLayout(fragment);\r\n var ctx = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator\r\n };\r\n return builder.build(ctx, fragment, 0);\r\n }\r\n function getGap(fragment) {\r\n var gapLevelBetweenSubBlocks = fragment.__gapLevelBetweenSubBlocks;\r\n return {\r\n html: HTML_GAPS[gapLevelBetweenSubBlocks],\r\n richText: RICH_TEXT_GAPS[gapLevelBetweenSubBlocks]\r\n };\r\n }\r\n function wrapBlockHTML(encodedContent, topGap) {\r\n var clearfix = '
';\r\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\r\n return \"
\"\r\n + encodedContent + clearfix\r\n + '
';\r\n }\r\n function wrapInlineNameHTML(name, leftHasMarker) {\r\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return \"\"\r\n + encodeHTML(name)\r\n + '';\r\n }\r\n function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker) {\r\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\r\n return (\"\"\r\n + map(valueList, function (value) { return encodeHTML(value); }).join('  ')\r\n + '');\r\n }\r\n function wrapInlineNameRichText(ctx, name) {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, TOOLTIP_TEXT_STYLE_RICH);\r\n }\r\n function wrapInlineValueRichText(ctx, valueList, alignRight, valueCloseToMarker) {\r\n var styles = [TOOLTIP_VALUE_TEXT_STYLE_RICH];\r\n var paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n return ctx.markupStyleCreator.wrapRichTextStyle(valueList.join(' '), styles);\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\r\n function getPaddingFromTooltipModel(model, renderMode) {\r\n var padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n }\r\n var TooltipMarkupStyleCreator = (function () {\r\n function TooltipMarkupStyleCreator() {\r\n this.richTextStyles = {};\r\n this._nextStyleNameId = getRandomIdBase();\r\n }\r\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n };\r\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\r\n var markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n var marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode: renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n };\r\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\r\n var finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, function (stl) { return extend(finalStl, stl); });\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n var styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return \"{\" + styleName + \"|\" + text + \"}\";\r\n };\r\n return TooltipMarkupStyleCreator;\r\n }());\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n var ORIGIN_METHOD = '\\0__throttleOriginMethod';\r\n var RATE = '\\0__throttleRate';\r\n var THROTTLE_TYPE = '\\0__throttleType';\r\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\r\n function createOrUpdate(obj, fnAttr, rate, throttleType) {\r\n var fn = obj[fnAttr];\r\n if (!fn) {\r\n return;\r\n }\r\n var originFn = fn[ORIGIN_METHOD] || fn;\r\n var lastThrottleType = fn[THROTTLE_TYPE];\r\n var lastRate = fn[RATE];\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\r\n fn[ORIGIN_METHOD] = originFn;\r\n fn[THROTTLE_TYPE] = throttleType;\r\n fn[RATE] = rate;\r\n }\r\n return fn;\r\n }\r\n function clear(obj, fnAttr) {\r\n var fn = obj[fnAttr];\r\n if (fn && fn[ORIGIN_METHOD]) {\r\n obj[fnAttr] = fn[ORIGIN_METHOD];\r\n }\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function setItemVisualFromData(data, dataIndex, key, value) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n style[data.getVisual('drawType')] = value;\r\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\r\n break;\r\n case 'opacity':\r\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\r\n break;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n data.setItemVisual(dataIndex, key, value);\r\n break;\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$7 = Math.PI * 2;\r\n var CMD$4 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$7 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$7;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$7;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$7 >= startAngle && angle + PI2$7 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$4.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$4.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$4.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$4.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$4.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr$1 = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr$1, false);\r\n tmpProjPoint.fromArray(tmpArr$1);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version$1 = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.1'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances$1, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances$1[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances$1, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances$1 = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances$1[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose$1(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances$1[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances$1[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function getLayoutOnAxis(opt) {\r\n var params = [];\r\n var baseAxis = opt.axis;\r\n var axisKey = 'axis0';\r\n if (baseAxis.type !== 'category') {\r\n return;\r\n }\r\n var bandWidth = baseAxis.getBandWidth();\r\n for (var i = 0; i < opt.count || 0; i++) {\r\n params.push(defaults({\r\n bandWidth: bandWidth,\r\n axisKey: axisKey,\r\n stackId: STACK_PREFIX + i\r\n }, opt));\r\n }\r\n var widthAndOffsets = doCalBarWidthAndOffset(params);\r\n var result = [];\r\n for (var i = 0; i < opt.count; i++) {\r\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\r\n item.offsetCenter = item.offset + item.width / 2;\r\n result.push(item);\r\n }\r\n return result;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n function createList(seriesModel) {\r\n return createListFromArray(seriesModel.getSource(), seriesModel);\r\n }\r\n var dataStack$1 = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n };\r\n function createScale(dataExtent, option) {\r\n var axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n }\r\n var scale = createScaleByModel(axisModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n niceScaleExtent(scale, axisModel);\r\n return scale;\r\n }\r\n function mixinAxisModelCommonMethods(Model) {\r\n mixin(Model, AxisModelCommonMixin);\r\n }\n\n var helper = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createList: createList,\n getLayoutRect: getLayoutRect,\n dataStack: dataStack$1,\n createScale: createScale,\n mixinAxisModelCommonMethods: mixinAxisModelCommonMethods,\n getECData: getECData,\n createDimensions: createDimensions,\n createSymbol: createSymbol\n });\n\n var EPSILON$3 = 1e-8;\r\n function isAroundEqual$1(a, b) {\r\n return Math.abs(a - b) < EPSILON$3;\r\n }\r\n function contain$2(points, x, y) {\r\n var w = 0;\r\n var p = points[0];\r\n if (!p) {\r\n return false;\r\n }\r\n for (var i = 1; i < points.length; i++) {\r\n var p2 = points[i];\r\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\r\n p = p2;\r\n }\r\n var p0 = points[0];\r\n if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) {\r\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\r\n }\r\n return w !== 0;\r\n }\n\n var Region = (function () {\r\n function Region(name, geometries, cp) {\r\n this.name = name;\r\n this.geometries = geometries;\r\n if (!cp) {\r\n var rect = this.getBoundingRect();\r\n cp = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n else {\r\n cp = [cp[0], cp[1]];\r\n }\r\n this.center = cp;\r\n }\r\n Region.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n if (rect) {\r\n return rect;\r\n }\r\n var MAX_NUMBER = Number.MAX_VALUE;\r\n var min$1 = [MAX_NUMBER, MAX_NUMBER];\r\n var max$1 = [-MAX_NUMBER, -MAX_NUMBER];\r\n var min2 = [];\r\n var max2 = [];\r\n var geometries = this.geometries;\r\n var i = 0;\r\n for (; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n fromPoints(exterior, min2, max2);\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return (this._rect = new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]));\r\n };\r\n Region.prototype.contain = function (coord) {\r\n var rect = this.getBoundingRect();\r\n var geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n if (contain$2(exterior, coord[0], coord[1])) {\r\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (contain$2(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Region.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n var target = new BoundingRect(x, y, width, height);\r\n var transform = rect.calculateTransform(target);\r\n var geometries = this.geometries;\r\n for (var i = 0; i < geometries.length; i++) {\r\n if (geometries[i].type !== 'polygon') {\r\n continue;\r\n }\r\n var exterior = geometries[i].exterior;\r\n var interiors = geometries[i].interiors;\r\n for (var p = 0; p < exterior.length; p++) {\r\n applyTransform(exterior[p], exterior[p], transform);\r\n }\r\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\r\n for (var p = 0; p < interiors[h].length; p++) {\r\n applyTransform(interiors[h][p], interiors[h][p], transform);\r\n }\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n this.center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n };\r\n Region.prototype.cloneShallow = function (name) {\r\n name == null && (name = this.name);\r\n var newRegion = new Region(name, this.geometries, this.center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null;\r\n return newRegion;\r\n };\r\n return Region;\r\n }());\n\n function decode(json) {\r\n if (!json.UTF8Encoding) {\r\n return json;\r\n }\r\n var jsonCompressed = json;\r\n var encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n var features = jsonCompressed.features;\r\n for (var f = 0; f < features.length; f++) {\r\n var feature = features[f];\r\n var geometry = feature.geometry;\r\n if (geometry.type === 'Polygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\r\n }\r\n }\r\n else if (geometry.type === 'MultiPolygon') {\r\n var coordinates = geometry.coordinates;\r\n for (var c = 0; c < coordinates.length; c++) {\r\n var coordinate = coordinates[c];\r\n for (var c2 = 0; c2 < coordinate.length; c2++) {\r\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\r\n }\r\n }\r\n }\r\n }\r\n jsonCompressed.UTF8Encoding = false;\r\n return jsonCompressed;\r\n }\r\n function decodePolygon(coordinate, encodeOffsets, encodeScale) {\r\n var result = [];\r\n var prevX = encodeOffsets[0];\r\n var prevY = encodeOffsets[1];\r\n for (var i = 0; i < coordinate.length; i += 2) {\r\n var x = coordinate.charCodeAt(i) - 64;\r\n var y = coordinate.charCodeAt(i + 1) - 64;\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n x += prevX;\r\n y += prevY;\r\n prevX = x;\r\n prevY = y;\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n return result;\r\n }\r\n function parseGeoJSON(geoJson, nameProperty) {\r\n geoJson = decode(geoJson);\r\n return map(filter(geoJson.features, function (featureObj) {\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n var properties = featureObj.properties;\r\n var geo = featureObj.geometry;\r\n var geometries = [];\r\n if (geo.type === 'Polygon') {\r\n var coordinates = geo.coordinates;\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: coordinates[0],\r\n interiors: coordinates.slice(1)\r\n });\r\n }\r\n if (geo.type === 'MultiPolygon') {\r\n var coordinates = geo.coordinates;\r\n each(coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push({\r\n type: 'polygon',\r\n exterior: item[0],\r\n interiors: item.slice(1)\r\n });\r\n }\r\n });\r\n }\r\n var region = new Region(properties[nameProperty || 'name'], geometries, properties.cp);\r\n region.properties = properties;\r\n return region;\r\n });\r\n }\n\n var inner$4 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$4(axis)[prop] || (inner$4(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$4(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$4(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$4(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var parseGeoJson = parseGeoJSON;\r\n var number = {};\r\n each([\r\n 'linearMap',\r\n 'round',\r\n 'asc',\r\n 'getPrecision',\r\n 'getPrecisionSafe',\r\n 'getPixelPrecision',\r\n 'getPercentWithPrecision',\r\n 'MAX_SAFE_INTEGER',\r\n 'remRadian',\r\n 'isRadianAroundZero',\r\n 'parseDate',\r\n 'quantity',\r\n 'quantityExponent',\r\n 'nice',\r\n 'quantile',\r\n 'reformIntervals',\r\n 'isNumeric',\r\n 'numericToNumber'\r\n ], function (name) {\r\n number[name] = numberUtil[name];\r\n });\r\n var format$1 = {};\r\n each([\r\n 'addCommas',\r\n 'toCamelCase',\r\n 'normalizeCssArray',\r\n 'encodeHTML',\r\n 'formatTpl',\r\n 'getTooltipMarker',\r\n 'formatTime',\r\n 'capitalFirst',\r\n 'truncateText',\r\n 'getTextRect'\r\n ], function (name) {\r\n format$1[name] = formatUtil[name];\r\n });\r\n var time = {\r\n parse: parseDate,\r\n format: format\r\n };\r\n var ecUtil = {};\r\n each([\r\n 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',\r\n 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',\r\n 'extend', 'defaults', 'clone', 'merge'\r\n ], function (name) {\r\n ecUtil[name] = zrUtil[name];\r\n });\r\n var GRAPHIC_KEYS = [\r\n 'extendShape', 'extendPath', 'makePath', 'makeImage',\r\n 'mergePath', 'resizePath', 'createIcon',\r\n 'updateProps', 'initProps', 'getTransform',\r\n 'clipPointsByRect', 'clipRectByRect',\r\n 'registerShape', 'getShapeClass',\r\n 'Group',\r\n 'Image',\r\n 'Text',\r\n 'Circle',\r\n 'Ellipse',\r\n 'Sector',\r\n 'Ring',\r\n 'Polygon',\r\n 'Polyline',\r\n 'Rect',\r\n 'Line',\r\n 'BezierCurve',\r\n 'Arc',\r\n 'IncrementalDisplayable',\r\n 'CompoundPath',\r\n 'LinearGradient',\r\n 'RadialGradient',\r\n 'BoundingRect'\r\n ];\r\n var graphic$1 = {};\r\n each(GRAPHIC_KEYS, function (name) {\r\n graphic$1[name] = graphic[name];\r\n });\n\n var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\r\n value: 'eq',\r\n '<': 'lt',\r\n '<=': 'lte',\r\n '>': 'gt',\r\n '>=': 'gte',\r\n '=': 'eq',\r\n '!=': 'ne',\r\n '<>': 'ne'\r\n };\r\n var RegExpEvaluator = (function () {\r\n function RegExpEvaluator(rVal) {\r\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal)\r\n : isRegExp(rVal) ? rVal\r\n : null;\r\n if (condValue == null) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n RegExpEvaluator.prototype.evaluate = function (lVal) {\r\n var type = typeof lVal;\r\n return type === 'string' ? this._condVal.test(lVal)\r\n : type === 'number' ? this._condVal.test(lVal + '')\r\n : false;\r\n };\r\n return RegExpEvaluator;\r\n }());\r\n var ConstConditionInternal = (function () {\r\n function ConstConditionInternal() {\r\n }\r\n ConstConditionInternal.prototype.evaluate = function () {\r\n return this.value;\r\n };\r\n return ConstConditionInternal;\r\n }());\r\n var AndConditionInternal = (function () {\r\n function AndConditionInternal() {\r\n }\r\n AndConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (!children[i].evaluate()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return AndConditionInternal;\r\n }());\r\n var OrConditionInternal = (function () {\r\n function OrConditionInternal() {\r\n }\r\n OrConditionInternal.prototype.evaluate = function () {\r\n var children = this.children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].evaluate()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return OrConditionInternal;\r\n }());\r\n var NotConditionInternal = (function () {\r\n function NotConditionInternal() {\r\n }\r\n NotConditionInternal.prototype.evaluate = function () {\r\n return !this.child.evaluate();\r\n };\r\n return NotConditionInternal;\r\n }());\r\n var RelationalConditionInternal = (function () {\r\n function RelationalConditionInternal() {\r\n }\r\n RelationalConditionInternal.prototype.evaluate = function () {\r\n var needParse = !!this.valueParser;\r\n var getValue = this.getValue;\r\n var tarValRaw = getValue(this.valueGetterParam);\r\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\r\n for (var i = 0; i < this.subCondList.length; i++) {\r\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return RelationalConditionInternal;\r\n }());\r\n function parseOption(exprOption, getters) {\r\n if (exprOption === true || exprOption === false) {\r\n var cond = new ConstConditionInternal();\r\n cond.value = exprOption;\r\n return cond;\r\n }\r\n var errMsg = '';\r\n if (!isObjectNotArray(exprOption)) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n if (exprOption.and) {\r\n return parseAndOrOption('and', exprOption, getters);\r\n }\r\n else if (exprOption.or) {\r\n return parseAndOrOption('or', exprOption, getters);\r\n }\r\n else if (exprOption.not) {\r\n return parseNotOption(exprOption, getters);\r\n }\r\n return parseRelationalOption(exprOption, getters);\r\n }\r\n function parseAndOrOption(op, exprOption, getters) {\r\n var subOptionArr = exprOption[op];\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isArray(subOptionArr)) {\r\n throwError(errMsg);\r\n }\r\n if (!subOptionArr.length) {\r\n throwError(errMsg);\r\n }\r\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\r\n cond.children = map(subOptionArr, function (subOption) { return parseOption(subOption, getters); });\r\n if (!cond.children.length) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n }\r\n function parseNotOption(exprOption, getters) {\r\n var subOption = exprOption.not;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\r\n }\r\n if (!isObjectNotArray(subOption)) {\r\n throwError(errMsg);\r\n }\r\n var cond = new NotConditionInternal();\r\n cond.child = parseOption(subOption, getters);\r\n if (!cond.child) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n }\r\n function parseRelationalOption(exprOption, getters) {\r\n var errMsg = '';\r\n var valueGetterParam = getters.prepareGetValue(exprOption);\r\n var subCondList = [];\r\n var exprKeys = keys(exprOption);\r\n var parserName = exprOption.parser;\r\n var valueParser = parserName ? getRawValueParser(parserName) : null;\r\n for (var i = 0; i < exprKeys.length; i++) {\r\n var keyRaw = exprKeys[i];\r\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\r\n continue;\r\n }\r\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw)\r\n ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw]\r\n : keyRaw;\r\n var condValueRaw = exprOption[keyRaw];\r\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\r\n var evaluator = createFilterComparator(op, condValueParsed)\r\n || (op === 'reg' && new RegExpEvaluator(condValueParsed));\r\n if (!evaluator) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n subCondList.push(evaluator);\r\n }\r\n if (!subCondList.length) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var cond = new RelationalConditionInternal();\r\n cond.valueGetterParam = valueGetterParam;\r\n cond.valueParser = valueParser;\r\n cond.getValue = getters.getValue;\r\n cond.subCondList = subCondList;\r\n return cond;\r\n }\r\n function isObjectNotArray(val) {\r\n return isObject(val) && !isArrayLike(val);\r\n }\r\n var ConditionalExpressionParsed = (function () {\r\n function ConditionalExpressionParsed(exprOption, getters) {\r\n this._cond = parseOption(exprOption, getters);\r\n }\r\n ConditionalExpressionParsed.prototype.evaluate = function () {\r\n return this._cond.evaluate();\r\n };\r\n return ConditionalExpressionParsed;\r\n }());\r\n function parseConditionalExpression(exprOption, getters) {\r\n return new ConditionalExpressionParsed(exprOption, getters);\r\n }\n\n var filterTransform = {\r\n type: 'echarts:filter',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var rawItem;\r\n var condition = parseConditionalExpression(params.config, {\r\n valueGetterAttrMap: createHashMap({ dimension: true }),\r\n prepareGetValue: function (exprOption) {\r\n var errMsg = '';\r\n var dimLoose = exprOption.dimension;\r\n if (!hasOwn(exprOption, 'dimension')) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\r\n }\r\n throwError(errMsg);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n return { dimIdx: dimInfo.index };\r\n },\r\n getValue: function (param) {\r\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\r\n }\r\n });\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n rawItem = upstream.getRawDataItem(i);\r\n if (condition.evaluate()) {\r\n resultData.push(rawItem);\r\n }\r\n }\r\n return {\r\n data: resultData\r\n };\r\n }\r\n };\n\n var sampleLog = '';\r\n if (__DEV__) {\r\n sampleLog = [\r\n 'Valid config is like:',\r\n '{ dimension: \"age\", order: \"asc\" }',\r\n 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'\r\n ].join(' ');\r\n }\r\n var sortTransform = {\r\n type: 'echarts:sort',\r\n transform: function (params) {\r\n var upstream = params.upstream;\r\n var config = params.config;\r\n var errMsg = '';\r\n var orderExprList = normalizeToArray(config);\r\n if (!orderExprList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Empty `config` in sort transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var orderDefList = [];\r\n each(orderExprList, function (orderExpr) {\r\n var dimLoose = orderExpr.dimension;\r\n var order = orderExpr.order;\r\n var parserName = orderExpr.parser;\r\n var incomparable = orderExpr.incomparable;\r\n if (dimLoose == null) {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n if (incomparable && (incomparable !== 'min' && incomparable !== 'max')) {\r\n var errMsg_1 = '';\r\n if (__DEV__) {\r\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\r\n }\r\n throwError(errMsg_1);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n var errMsg_2 = '';\r\n if (__DEV__) {\r\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\r\n }\r\n throwError(errMsg_2);\r\n }\r\n var dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n var parser = parserName ? getRawValueParser(parserName) : null;\r\n if (parserName && !parser) {\r\n if (__DEV__) {\r\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\r\n }\r\n throwError(errMsg);\r\n }\r\n orderDefList.push({\r\n dimIdx: dimInfo.index,\r\n parser: parser,\r\n comparator: new SortOrderComparator(order, incomparable)\r\n });\r\n });\r\n var sourceFormat = upstream.sourceFormat;\r\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (__DEV__) {\r\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = [];\r\n for (var i = 0, len = upstream.count(); i < len; i++) {\r\n resultData.push(upstream.getRawDataItem(i));\r\n }\r\n resultData.sort(function (item0, item1) {\r\n for (var i = 0; i < orderDefList.length; i++) {\r\n var orderDef = orderDefList[i];\r\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\r\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\r\n if (orderDef.parser) {\r\n val0 = orderDef.parser(val0);\r\n val1 = orderDef.parser(val1);\r\n }\r\n var result = orderDef.comparator.evaluate(val0, val1);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n return 0;\r\n });\r\n return {\r\n data: resultData\r\n };\r\n }\r\n };\n\n registerTransform(filterTransform);\r\n registerTransform(sortTransform);\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$5 = Math.min;\r\n var mathMax$5 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\r\n nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\r\n nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\r\n nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\r\n cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\r\n cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\r\n cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function collect(ecModel, api) {\r\n var result = {\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n collectAxesInfo(result, ecModel, api);\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n return result;\r\n }\r\n function collectAxesInfo(result, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\r\n var linksOption = globalAxisPointerModel.get('link', true) || [];\r\n var linkGroups = [];\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n var coordSysKey = makeKey(coordSys.model);\r\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n var coordSysModel = coordSys.model;\r\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n && baseTooltipModel.get('show')) {\r\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\r\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\r\n var axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel))) {\r\n return;\r\n }\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip)\r\n : axisPointerModel;\r\n var snap = axisPointerModel.get('snap');\r\n var axisKey = makeKey(axis.model);\r\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n var axisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n var groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n var linkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = { axesInfo: {} });\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n }\r\n function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\r\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n var fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ];\r\n var volatileOption = {};\r\n each(fields, function (field) {\r\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n var labelOption = volatileOption.label || (volatileOption.label = {});\r\n labelOption.show == null && (labelOption.show = false);\r\n if (fromTooltip === 'cross') {\r\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n if (!triggerTooltip) {\r\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\r\n }\r\n function collectSeriesInfo(result, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false) {\r\n return;\r\n }\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n var axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n });\r\n }\r\n function getLinkGroupIndex(linksOption, axis) {\r\n var axisModel = axis.model;\r\n var dim = axis.dim;\r\n for (var i = 0; i < linksOption.length; i++) {\r\n var linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\r\n return i;\r\n }\r\n }\r\n }\r\n function checkPropInLink(linkPropValue, axisPropValue) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n }\r\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$5 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$5(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$5(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$5(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$6 = Math.max;\r\n var mathMin$6 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$6(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$6(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$6(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$6(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$6(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$6(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$8 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$8;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$8 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$8 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$8 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var ScatterSeriesModel = (function (_super) {\r\n __extends(ScatterSeriesModel, _super);\r\n function ScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n ScatterSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n ScatterSeriesModel.type = 'series.scatter';\r\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n ScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n symbolSize: 10,\r\n large: false,\r\n largeThreshold: 2000,\r\n itemStyle: {\r\n opacity: 0.8\r\n },\r\n emphasis: {\r\n scale: true\r\n },\r\n clip: true,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return ScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ScatterSeriesModel);\n\n var BOOST_SIZE_THRESHOLD = 4;\r\n var LargeSymbolPathShape = (function () {\r\n function LargeSymbolPathShape() {\r\n }\r\n return LargeSymbolPathShape;\r\n }());\r\n var LargeSymbolPath = (function (_super) {\r\n __extends(LargeSymbolPath, _super);\r\n function LargeSymbolPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeSymbolPath.prototype.getDefaultShape = function () {\r\n return new LargeSymbolPathShape();\r\n };\r\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\r\n var points = shape.points;\r\n var size = shape.size;\r\n var symbolProxy = this.symbolProxy;\r\n var symbolProxyShape = symbolProxy.shape;\r\n var ctx = path.getContext\r\n ? path.getContext()\r\n : path;\r\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n this._ctx = null;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n };\r\n LargeSymbolPath.prototype.afterBrush = function () {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var ctx = this._ctx;\r\n if (!ctx) {\r\n return;\r\n }\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (this.softClipShape && !this.softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\r\n }\r\n };\r\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var points = shape.points;\r\n var size = shape.size;\r\n var w = Math.max(size[0], 4);\r\n var h = Math.max(size[1], 4);\r\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n var i = idx * 2;\r\n var x0 = points[i] - w / 2;\r\n var y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeSymbolPath;\r\n }(Path));\r\n var LargeSymbolDraw = (function () {\r\n function LargeSymbolDraw() {\r\n this.group = new Group();\r\n }\r\n LargeSymbolDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\r\n this.group.removeAll();\r\n var symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, false, opt);\r\n this.group.add(symbolEl);\r\n this._incremental = null;\r\n };\r\n LargeSymbolDraw.prototype.updateLayout = function (data) {\r\n if (this._incremental) {\r\n return;\r\n }\r\n var points = data.getLayout('points');\r\n this.group.eachChild(function (child) {\r\n if (child.startIndex != null) {\r\n var len = (child.endIndex - child.startIndex) * 2;\r\n var byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n });\r\n };\r\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 2e6) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n var symbolEl;\r\n if (this._incremental) {\r\n symbolEl = new LargeSymbolPath();\r\n this._incremental.addDisplayable(symbolEl, true);\r\n }\r\n else {\r\n symbolEl = new LargeSymbolPath({\r\n rectHover: true,\r\n cursor: 'default',\r\n startIndex: taskParams.start,\r\n endIndex: taskParams.end\r\n });\r\n symbolEl.incremental = true;\r\n this.group.add(symbolEl);\r\n }\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, !!this._incremental, opt);\r\n };\r\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, isIncremental, opt) {\r\n var hostModel = data.hostModel;\r\n opt = opt || {};\r\n var size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\r\n var globalStyle = data.getVisual('style');\r\n var visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(symbolEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex >= 0) {\r\n ecData_1.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n };\r\n LargeSymbolDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeSymbolDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeSymbolDraw;\r\n }());\n\n var ScatterView = (function (_super) {\r\n __extends(ScatterView, _super);\r\n function ScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScatterView.type;\r\n return _this;\r\n }\r\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.updateData(data, {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = true;\r\n };\r\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n this._finished = false;\r\n };\r\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n };\r\n ScatterView.prototype._getClipShape = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n };\r\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\r\n var symbolDraw = this._symbolDraw;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(symbolDraw.group);\r\n return symbolDraw;\r\n };\r\n ScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n };\r\n ScatterView.prototype.dispose = function () { };\r\n ScatterView.type = 'scatter';\r\n return ScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(ScatterView);\n\n registerLayout(pointsLayout('scatter'));\n\n var IndicatorAxis = (function (_super) {\r\n __extends(IndicatorAxis, _super);\r\n function IndicatorAxis(dim, scale, radiusExtent) {\r\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\r\n _this.type = 'value';\r\n _this.angle = 0;\r\n _this.name = '';\r\n return _this;\r\n }\r\n return IndicatorAxis;\r\n }(Axis));\n\n var Radar = (function () {\r\n function Radar(radarModel, ecModel, api) {\r\n this.dimensions = [];\r\n this._model = radarModel;\r\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\r\n var dim = 'indicator_' + idx;\r\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());\r\n indicatorAxis.name = indicatorModel.get('name');\r\n indicatorAxis.model = indicatorModel;\r\n indicatorModel.axis = indicatorAxis;\r\n this.dimensions.push(dim);\r\n return indicatorAxis;\r\n }, this);\r\n this.resize(radarModel, api);\r\n }\r\n Radar.prototype.getIndicatorAxes = function () {\r\n return this._indicatorAxes;\r\n };\r\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\r\n };\r\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\r\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n var angle = indicatorAxis.angle;\r\n var x = this.cx + coord * Math.cos(angle);\r\n var y = this.cy - coord * Math.sin(angle);\r\n return [x, y];\r\n };\r\n Radar.prototype.pointToData = function (pt) {\r\n var dx = pt[0] - this.cx;\r\n var dy = pt[1] - this.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx);\r\n var minRadianDiff = Infinity;\r\n var closestAxis;\r\n var closestAxisIdx = -1;\r\n for (var i = 0; i < this._indicatorAxes.length; i++) {\r\n var indicatorAxis = this._indicatorAxes[i];\r\n var diff = Math.abs(radian - indicatorAxis.angle);\r\n if (diff < minRadianDiff) {\r\n closestAxis = indicatorAxis;\r\n closestAxisIdx = i;\r\n minRadianDiff = diff;\r\n }\r\n }\r\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\r\n };\r\n Radar.prototype.resize = function (radarModel, api) {\r\n var center = radarModel.get('center');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\r\n this.cx = parsePercent$2(center[0], viewWidth);\r\n this.cy = parsePercent$2(center[1], viewHeight);\r\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\r\n var radius = radarModel.get('radius');\r\n if (typeof radius === 'string' || typeof radius === 'number') {\r\n radius = [0, radius];\r\n }\r\n this.r0 = parsePercent$2(radius[0], viewSize);\r\n this.r = parsePercent$2(radius[1], viewSize);\r\n each(this._indicatorAxes, function (indicatorAxis, idx) {\r\n indicatorAxis.setExtent(this.r0, this.r);\r\n var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);\r\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\r\n indicatorAxis.angle = angle;\r\n }, this);\r\n };\r\n Radar.prototype.update = function (ecModel, api) {\r\n var indicatorAxes = this._indicatorAxes;\r\n var radarModel = this._model;\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\r\n if (radarSeries.get('coordinateSystem') !== 'radar'\r\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\r\n return;\r\n }\r\n var data = radarSeries.getData();\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\r\n });\r\n }, this);\r\n var splitNumber = radarModel.get('splitNumber');\r\n function increaseInterval(interval) {\r\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10));\r\n var f = interval / exp10;\r\n if (f === 2) {\r\n f = 5;\r\n }\r\n else {\r\n f *= 2;\r\n }\r\n return f * exp10;\r\n }\r\n each(indicatorAxes, function (indicatorAxis, idx) {\r\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\r\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\r\n var axisModel = indicatorAxis.model;\r\n var scale = indicatorAxis.scale;\r\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\r\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\r\n var interval = scale.getInterval();\r\n if (fixedMin != null && fixedMax != null) {\r\n scale.setExtent(+fixedMin, +fixedMax);\r\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\r\n }\r\n else if (fixedMin != null) {\r\n var max = void 0;\r\n do {\r\n max = fixedMin + interval * splitNumber;\r\n scale.setExtent(+fixedMin, max);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\r\n }\r\n else if (fixedMax != null) {\r\n var min = void 0;\r\n do {\r\n min = fixedMax - interval * splitNumber;\r\n scale.setExtent(min, +fixedMax);\r\n scale.setInterval(interval);\r\n interval = increaseInterval(interval);\r\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\r\n }\r\n else {\r\n var nicedSplitNumber = scale.getTicks().length - 1;\r\n if (nicedSplitNumber > splitNumber) {\r\n interval = increaseInterval(interval);\r\n }\r\n var max = Math.ceil(rawExtent[1] / interval) * interval;\r\n var min = round$1(max - interval * splitNumber);\r\n scale.setExtent(min, max);\r\n scale.setInterval(interval);\r\n }\r\n });\r\n };\r\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n console.warn('Not implemented.');\r\n return null;\r\n };\r\n Radar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Radar.create = function (ecModel, api) {\r\n var radarList = [];\r\n ecModel.eachComponent('radar', function (radarModel) {\r\n var radar = new Radar(radarModel, ecModel, api);\r\n radarList.push(radar);\r\n radarModel.coordinateSystem = radar;\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries) {\r\n if (radarSeries.get('coordinateSystem') === 'radar') {\r\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\r\n }\r\n });\r\n return radarList;\r\n };\r\n Radar.dimensions = [];\r\n return Radar;\r\n }());\r\n CoordinateSystemManager.register('radar', Radar);\n\n var valueAxisDefault = axisDefault.value;\r\n function defaultsShow(opt, show) {\r\n return defaults({\r\n show: show\r\n }, opt);\r\n }\r\n var RadarModel = (function (_super) {\r\n __extends(RadarModel, _super);\r\n function RadarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarModel.type;\r\n return _this;\r\n }\r\n RadarModel.prototype.optionUpdated = function () {\r\n var boundaryGap = this.get('boundaryGap');\r\n var splitNumber = this.get('splitNumber');\r\n var scale = this.get('scale');\r\n var axisLine = this.get('axisLine');\r\n var axisTick = this.get('axisTick');\r\n var axisLabel = this.get('axisLabel');\r\n var nameTextStyle = this.get('axisName');\r\n var showName = this.get(['axisName', 'show']);\r\n var nameFormatter = this.get(['axisName', 'formatter']);\r\n var nameGap = this.get('axisNameGap');\r\n var triggerEvent = this.get('triggerEvent');\r\n var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) {\r\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\r\n indicatorOpt.min = 0;\r\n }\r\n else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\r\n indicatorOpt.max = 0;\r\n }\r\n var iNameTextStyle = nameTextStyle;\r\n if (indicatorOpt.color != null) {\r\n iNameTextStyle = defaults({\r\n color: indicatorOpt.color\r\n }, nameTextStyle);\r\n }\r\n var innerIndicatorOpt = merge(clone(indicatorOpt), {\r\n boundaryGap: boundaryGap,\r\n splitNumber: splitNumber,\r\n scale: scale,\r\n axisLine: axisLine,\r\n axisTick: axisTick,\r\n axisLabel: axisLabel,\r\n name: indicatorOpt.text,\r\n nameLocation: 'end',\r\n nameGap: nameGap,\r\n nameTextStyle: iNameTextStyle,\r\n triggerEvent: triggerEvent\r\n }, false);\r\n if (!showName) {\r\n innerIndicatorOpt.name = '';\r\n }\r\n if (typeof nameFormatter === 'string') {\r\n var indName = innerIndicatorOpt.name;\r\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\r\n }\r\n else if (typeof nameFormatter === 'function') {\r\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\r\n }\r\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\r\n mixin(model, AxisModelCommonMixin.prototype);\r\n model.mainType = 'radar';\r\n model.componentIndex = this.componentIndex;\r\n return model;\r\n }, this);\r\n this._indicatorModels = indicatorModels;\r\n };\r\n RadarModel.prototype.getIndicatorModels = function () {\r\n return this._indicatorModels;\r\n };\r\n RadarModel.type = 'radar';\r\n RadarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '75%',\r\n startAngle: 90,\r\n axisName: {\r\n show: true\r\n },\r\n boundaryGap: [0, 0],\r\n splitNumber: 5,\r\n axisNameGap: 15,\r\n scale: false,\r\n shape: 'polygon',\r\n axisLine: merge({\r\n lineStyle: {\r\n color: '#bbb'\r\n }\r\n }, valueAxisDefault.axisLine),\r\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\r\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\r\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\r\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\r\n indicator: []\r\n };\r\n return RadarModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(RadarModel);\n\n var axisBuilderAttrs$1 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var RadarView = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (radarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n this._buildAxes(radarModel);\r\n this._buildSplitLineAndArea(radarModel);\r\n };\r\n RadarView.prototype._buildAxes = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n var axisBuilders = map(indicatorAxes, function (indicatorAxis) {\r\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\r\n position: [radar.cx, radar.cy],\r\n rotation: indicatorAxis.angle,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1\r\n });\r\n return axisBuilder;\r\n });\r\n each(axisBuilders, function (axisBuilder) {\r\n each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder);\r\n this.group.add(axisBuilder.getGroup());\r\n }, this);\r\n };\r\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\r\n var radar = radarModel.coordinateSystem;\r\n var indicatorAxes = radar.getIndicatorAxes();\r\n if (!indicatorAxes.length) {\r\n return;\r\n }\r\n var shape = radarModel.get('shape');\r\n var splitLineModel = radarModel.getModel('splitLine');\r\n var splitAreaModel = radarModel.getModel('splitArea');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var showSplitLine = splitLineModel.get('show');\r\n var showSplitArea = splitAreaModel.get('show');\r\n var splitLineColors = lineStyleModel.get('color');\r\n var splitAreaColors = areaStyleModel.get('color');\r\n var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors];\r\n var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\r\n var splitLines = [];\r\n var splitAreas = [];\r\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\r\n var colorIndex = idx % areaOrLineColorList.length;\r\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\r\n return colorIndex;\r\n }\r\n if (shape === 'circle') {\r\n var ticksRadius = indicatorAxes[0].getTicksCoords();\r\n var cx = radar.cx;\r\n var cy = radar.cy;\r\n for (var i = 0; i < ticksRadius.length; i++) {\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r: ticksRadius[i].coord\r\n }\r\n }));\r\n }\r\n if (showSplitArea && i < ticksRadius.length - 1) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\r\n splitAreas[colorIndex].push(new Ring({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r0: ticksRadius[i].coord,\r\n r: ticksRadius[i + 1].coord\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n else {\r\n var realSplitNumber_1;\r\n var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) {\r\n var ticksCoords = indicatorAxis.getTicksCoords();\r\n realSplitNumber_1 = realSplitNumber_1 == null\r\n ? ticksCoords.length - 1\r\n : Math.min(ticksCoords.length - 1, realSplitNumber_1);\r\n return map(ticksCoords, function (tickCoord) {\r\n return radar.coordToPoint(tickCoord.coord, idx);\r\n });\r\n });\r\n var prevPoints = [];\r\n for (var i = 0; i <= realSplitNumber_1; i++) {\r\n var points = [];\r\n for (var j = 0; j < indicatorAxes.length; j++) {\r\n points.push(axesTicksPoints[j][i]);\r\n }\r\n if (points[0]) {\r\n points.push(points[0].slice());\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.error('Can\\'t draw value axis ' + i);\r\n }\r\n }\r\n if (showSplitLine) {\r\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n }\r\n if (showSplitArea && prevPoints) {\r\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\r\n splitAreas[colorIndex].push(new Polygon({\r\n shape: {\r\n points: points.concat(prevPoints)\r\n }\r\n }));\r\n }\r\n prevPoints = points.slice().reverse();\r\n }\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n each(splitAreas, function (splitAreas, idx) {\r\n this.group.add(mergePath$1(splitAreas, {\r\n style: defaults({\r\n stroke: 'none',\r\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\r\n }, areaStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n each(splitLines, function (splitLines, idx) {\r\n this.group.add(mergePath$1(splitLines, {\r\n style: defaults({\r\n fill: 'none',\r\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }, this);\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n }(ComponentView));\r\n ComponentView.registerClass(RadarView);\n\n var RadarSeriesModel = (function (_super) {\r\n __extends(RadarSeriesModel, _super);\r\n function RadarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n RadarSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n generateCoord: 'indicator_',\r\n generateCoordCount: Infinity\r\n });\r\n };\r\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n var name = this.getData().getName(dataIndex);\r\n var nameToDisplay = name === '' ? this.name : name;\r\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: nameToDisplay,\r\n sortBlocks: true,\r\n blocks: map(indicatorAxes, function (axis) {\r\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\r\n return createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: markerColor,\r\n name: axis.name,\r\n value: val,\r\n sortParam: val\r\n });\r\n })\r\n });\r\n };\r\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var data_1 = this.getData();\r\n var coordSys = this.coordinateSystem;\r\n var values = data_1.getValues(map(coordSys.dimensions, function (dim) {\r\n return data_1.mapDimension(dim);\r\n }), dataIndex);\r\n for (var i = 0, len = values.length; i < len; i++) {\r\n if (!isNaN(values[i])) {\r\n var indicatorAxes = coordSys.getIndicatorAxes();\r\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\r\n }\r\n }\r\n }\r\n };\r\n RadarSeriesModel.type = 'series.radar';\r\n RadarSeriesModel.dependencies = ['radar'];\r\n RadarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'radar',\r\n legendHoverLink: true,\r\n radarIndex: 0,\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n label: {\r\n position: 'top'\r\n },\r\n symbol: 'emptyCircle',\r\n symbolSize: 4\r\n };\r\n return RadarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(RadarSeriesModel);\n\n function normalizeSymbolSize(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n }\r\n var RadarView$1 = (function (_super) {\r\n __extends(RadarView, _super);\r\n function RadarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadarView.type;\r\n return _this;\r\n }\r\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var polar = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n function createSymbol$1(data, idx) {\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n if (symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2);\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\r\n symbolPath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 100,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2,\r\n rotation: symbolRotate * Math.PI / 180 || 0\r\n });\r\n return symbolPath;\r\n }\r\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\r\n symbolGroup.removeAll();\r\n for (var i = 0; i < newPoints.length - 1; i++) {\r\n var symbolPath = createSymbol$1(data, idx);\r\n if (symbolPath) {\r\n symbolPath.__dimIdx = i;\r\n if (oldPoints[i]) {\r\n symbolPath.setPosition(oldPoints[i]);\r\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\r\n x: newPoints[i][0],\r\n y: newPoints[i][1]\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n symbolPath.setPosition(newPoints[i]);\r\n }\r\n symbolGroup.add(symbolPath);\r\n }\r\n }\r\n }\r\n function getInitialPoints(points) {\r\n return map(points, function (pt) {\r\n return [polar.cx, polar.cy];\r\n });\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var points = data.getItemLayout(idx);\r\n if (!points) {\r\n return;\r\n }\r\n var polygon = new Polygon();\r\n var polyline = new Polyline();\r\n var target = {\r\n shape: {\r\n points: points\r\n }\r\n };\r\n polygon.shape.points = getInitialPoints(points);\r\n polyline.shape.points = getInitialPoints(points);\r\n initProps(polygon, target, seriesModel, idx);\r\n initProps(polyline, target, seriesModel, idx);\r\n var itemGroup = new Group();\r\n var symbolGroup = new Group();\r\n itemGroup.add(polyline);\r\n itemGroup.add(polygon);\r\n itemGroup.add(symbolGroup);\r\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\r\n data.setItemGraphicEl(idx, itemGroup);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var target = {\r\n shape: {\r\n points: data.getItemLayout(newIdx)\r\n }\r\n };\r\n if (!target.shape.points) {\r\n return;\r\n }\r\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\r\n updateProps(polyline, target, seriesModel);\r\n updateProps(polygon, target, seriesModel);\r\n data.setItemGraphicEl(newIdx, itemGroup);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n data.eachItemGraphicEl(function (itemGroup, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var polyline = itemGroup.childAt(0);\r\n var polygon = itemGroup.childAt(1);\r\n var symbolGroup = itemGroup.childAt(2);\r\n var itemStyle = data.getItemVisual(idx, 'style');\r\n var color = itemStyle.fill;\r\n group.add(itemGroup);\r\n polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), {\r\n fill: 'none',\r\n stroke: color\r\n }));\r\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\r\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\r\n var areaStyleModel = itemModel.getModel('areaStyle');\r\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\r\n polygon.ignore = polygonIgnore;\r\n each(['emphasis', 'select', 'blur'], function (stateName) {\r\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\r\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\r\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\r\n });\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: color,\r\n opacity: 0.7,\r\n decal: itemStyle.decal\r\n }));\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n symbolGroup.eachChild(function (symbolPath) {\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, itemStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(itemStyle);\r\n symbolPath.setColor(color);\r\n }\r\n var pathEmphasisState = symbolPath.ensureState('emphasis');\r\n pathEmphasisState.style = clone(itemHoverStyle);\r\n var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);\r\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\r\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n labelDimIndex: symbolPath.__dimIdx,\r\n defaultText: defaultText,\r\n inheritColor: color,\r\n defaultOpacity: itemStyle.opacity\r\n });\r\n });\r\n enableHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n });\r\n this._data = data;\r\n };\r\n RadarView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n RadarView.type = 'radar';\r\n return RadarView;\r\n }(ChartView));\r\n ChartView.registerClass(RadarView$1);\n\n function radarLayout(ecModel) {\r\n ecModel.eachSeriesByType('radar', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var axes = coordSys.getIndicatorAxes();\r\n each(axes, function (axis, axisIndex) {\r\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\r\n points[dataIndex] = points[dataIndex] || [];\r\n var point = coordSys.dataToPoint(val, axisIndex);\r\n points[dataIndex][axisIndex] = isValidPoint(point)\r\n ? point : getValueMissingPoint(coordSys);\r\n });\r\n });\r\n data.each(function (idx) {\r\n var firstPoint = find(points[idx], function (point) {\r\n return isValidPoint(point);\r\n }) || getValueMissingPoint(coordSys);\r\n points[idx].push(firstPoint.slice());\r\n data.setItemLayout(idx, points[idx]);\r\n });\r\n });\r\n }\r\n function isValidPoint(point) {\r\n return !isNaN(point[0]) && !isNaN(point[1]);\r\n }\r\n function getValueMissingPoint(coordSys) {\r\n return [coordSys.cx, coordSys.cy];\r\n }\n\n function radarBackwardCompat(option) {\r\n var polarOptArr = option.polar;\r\n if (polarOptArr) {\r\n if (!isArray(polarOptArr)) {\r\n polarOptArr = [polarOptArr];\r\n }\r\n var polarNotRadar_1 = [];\r\n each(polarOptArr, function (polarOpt, idx) {\r\n if (polarOpt.indicator) {\r\n if (polarOpt.type && !polarOpt.shape) {\r\n polarOpt.shape = polarOpt.type;\r\n }\r\n option.radar = option.radar || [];\r\n if (!isArray(option.radar)) {\r\n option.radar = [option.radar];\r\n }\r\n option.radar.push(polarOpt);\r\n }\r\n else {\r\n polarNotRadar_1.push(polarOpt);\r\n }\r\n });\r\n option.polar = polarNotRadar_1;\r\n }\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\r\n seriesOpt.radarIndex = seriesOpt.polarIndex;\r\n }\r\n });\r\n }\n\n registerLayout(radarLayout);\r\n registerProcessor(dataFilter('radar'));\r\n registerPreprocessor(radarBackwardCompat);\n\n var geoCoord = [126, 25];\r\n var points$1 = [\r\n [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7],\r\n [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]],\r\n [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]],\r\n [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]],\r\n [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]],\r\n [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]],\r\n [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]],\r\n [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]],\r\n [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]],\r\n [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]],\r\n [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]],\r\n [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]],\r\n [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4],\r\n [1, 92.4], [1, 3.5], [0, 3.5]]\r\n ];\r\n for (var i = 0; i < points$1.length; i++) {\r\n for (var k = 0; k < points$1[i].length; k++) {\r\n points$1[i][k][0] /= 10.5;\r\n points$1[i][k][1] /= -10.5 / 0.75;\r\n points$1[i][k][0] += geoCoord[0];\r\n points$1[i][k][1] += geoCoord[1];\r\n }\r\n }\r\n function fixNanhai(mapType, regions) {\r\n if (mapType === 'china') {\r\n regions.push(new Region('南海诸岛', map(points$1, function (exterior) {\r\n return {\r\n type: 'polygon',\r\n exterior: exterior\r\n };\r\n }), geoCoord));\r\n }\r\n }\n\n var coordsOffsetMap = {\r\n '南海诸岛': [32, 80],\r\n '广东': [0, -10],\r\n '香港': [10, 5],\r\n '澳门': [-10, 10],\r\n '天津': [5, 5]\r\n };\r\n function fixTextCoords(mapType, region) {\r\n if (mapType === 'china') {\r\n var coordFix = coordsOffsetMap[region.name];\r\n if (coordFix) {\r\n var cp = region.center;\r\n cp[0] += coordFix[0] / 10.5;\r\n cp[1] += -coordFix[1] / (10.5 / 0.75);\r\n }\r\n }\r\n }\n\n var geoCoordMap = {\r\n 'Russia': [100, 60],\r\n 'United States': [-99, 38],\r\n 'United States of America': [-99, 38]\r\n };\r\n function fixGeoCoords(mapType, region) {\r\n if (mapType === 'world') {\r\n var geoCoord = geoCoordMap[region.name];\r\n if (geoCoord) {\r\n var cp = region.center;\r\n cp[0] = geoCoord[0];\r\n cp[1] = geoCoord[1];\r\n }\r\n }\r\n }\n\n var points$2 = [\r\n [\r\n [123.45165252685547, 25.73527164402261],\r\n [123.49731445312499, 25.73527164402261],\r\n [123.49731445312499, 25.750734064600884],\r\n [123.45165252685547, 25.750734064600884],\r\n [123.45165252685547, 25.73527164402261]\r\n ]\r\n ];\r\n function fixDiaoyuIsland(mapType, region) {\r\n if (mapType === 'china' && region.name === '台湾') {\r\n region.geometries.push({\r\n type: 'polygon',\r\n exterior: points$2[0]\r\n });\r\n }\r\n }\n\n var inner$6 = makeInner();\r\n var geoJSONLoader = {\r\n load: function (mapName, mapRecord, nameProperty) {\r\n var parsed = inner$6(mapRecord).parsed;\r\n if (parsed) {\r\n return parsed;\r\n }\r\n var specialAreas = mapRecord.specialAreas || {};\r\n var geoJSON = mapRecord.geoJSON;\r\n var regions;\r\n try {\r\n regions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];\r\n }\r\n catch (e) {\r\n throw new Error('Invalid geoJson format\\n' + e.message);\r\n }\r\n fixNanhai(mapName, regions);\r\n each(regions, function (region) {\r\n var regionName = region.name;\r\n fixTextCoords(mapName, region);\r\n fixGeoCoords(mapName, region);\r\n fixDiaoyuIsland(mapName, region);\r\n var specialArea = specialAreas[regionName];\r\n if (specialArea) {\r\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\r\n }\r\n });\r\n return (inner$6(mapRecord).parsed = {\r\n regions: regions,\r\n boundingRect: getBoundingRect$1(regions)\r\n });\r\n }\r\n };\r\n function getBoundingRect$1(regions) {\r\n var rect;\r\n for (var i = 0; i < regions.length; i++) {\r\n var regionRect = regions[i].getBoundingRect();\r\n rect = rect || regionRect.clone();\r\n rect.union(regionRect);\r\n }\r\n return rect;\r\n }\n\n var inner$7 = makeInner();\r\n var geoSVGLoader = {\r\n load: function (mapName, mapRecord) {\r\n var originRoot = inner$7(mapRecord).originRoot;\r\n if (originRoot) {\r\n return {\r\n root: originRoot,\r\n boundingRect: inner$7(mapRecord).boundingRect\r\n };\r\n }\r\n var graphic = buildGraphic(mapRecord);\r\n inner$7(mapRecord).originRoot = graphic.root;\r\n inner$7(mapRecord).boundingRect = graphic.boundingRect;\r\n return graphic;\r\n },\r\n makeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap || (field.rootMap = createHashMap());\r\n var root = rootMap.get(hostKey);\r\n if (root) {\r\n return root;\r\n }\r\n var originRoot = field.originRoot;\r\n var boundingRect = field.boundingRect;\r\n if (!field.originRootHostKey) {\r\n field.originRootHostKey = hostKey;\r\n root = originRoot;\r\n }\r\n else {\r\n root = buildGraphic(mapRecord, boundingRect).root;\r\n }\r\n return rootMap.set(hostKey, root);\r\n },\r\n removeGraphic: function (mapName, mapRecord, hostKey) {\r\n var field = inner$7(mapRecord);\r\n var rootMap = field.rootMap;\r\n rootMap && rootMap.removeKey(hostKey);\r\n if (hostKey === field.originRootHostKey) {\r\n field.originRootHostKey = null;\r\n }\r\n }\r\n };\r\n function buildGraphic(mapRecord, boundingRect) {\r\n var svgXML = mapRecord.svgXML;\r\n var result;\r\n var root;\r\n try {\r\n result = svgXML && parseSVG(svgXML, {\r\n ignoreViewBox: true,\r\n ignoreRootClip: true\r\n }) || {};\r\n root = result.root;\r\n assert(root != null);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid svg format\\n' + e.message);\r\n }\r\n var svgWidth = result.width;\r\n var svgHeight = result.height;\r\n var viewBoxRect = result.viewBoxRect;\r\n if (!boundingRect) {\r\n boundingRect = (svgWidth == null || svgHeight == null)\r\n ? root.getBoundingRect()\r\n : new BoundingRect(0, 0, 0, 0);\r\n if (svgWidth != null) {\r\n boundingRect.width = svgWidth;\r\n }\r\n if (svgHeight != null) {\r\n boundingRect.height = svgHeight;\r\n }\r\n }\r\n if (viewBoxRect) {\r\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height);\r\n var elRoot = root;\r\n root = new Group();\r\n root.add(elRoot);\r\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\r\n elRoot.x = viewBoxTransform.x;\r\n elRoot.y = viewBoxTransform.y;\r\n }\r\n root.setClipPath(new Rect({\r\n shape: boundingRect.plain()\r\n }));\r\n return {\r\n root: root,\r\n boundingRect: boundingRect\r\n };\r\n }\n\n var loaders = {\r\n geoJSON: geoJSONLoader,\r\n svg: geoSVGLoader\r\n };\r\n var geoSourceManager = {\r\n load: function (mapName, nameMap, nameProperty) {\r\n var regions = [];\r\n var regionsMap = createHashMap();\r\n var nameCoordMap = createHashMap();\r\n var boundingRect;\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var singleSource = loaders[record.type].load(mapName, record, nameProperty);\r\n each(singleSource.regions, function (region) {\r\n var regionName = region.name;\r\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\r\n region = region.cloneShallow(regionName = nameMap[regionName]);\r\n }\r\n regions.push(region);\r\n regionsMap.set(regionName, region);\r\n nameCoordMap.set(regionName, region.center);\r\n });\r\n var rect = singleSource.boundingRect;\r\n if (rect) {\r\n boundingRect\r\n ? boundingRect.union(rect)\r\n : (boundingRect = rect.clone());\r\n }\r\n });\r\n return {\r\n regions: regions,\r\n regionsMap: regionsMap,\r\n nameCoordMap: nameCoordMap,\r\n boundingRect: boundingRect || new BoundingRect(0, 0, 0, 0)\r\n };\r\n },\r\n makeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n var results = [];\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && results.push(method(mapName, record, hostKey));\r\n });\r\n return results;\r\n },\r\n removeGraphic: function (mapName, hostKey) {\r\n var mapRecords = retrieveMap(mapName);\r\n each(mapRecords, function (record) {\r\n var method = loaders[record.type].makeGraphic;\r\n method && method(mapName, record, hostKey);\r\n });\r\n }\r\n };\r\n function mapNotExistsError(mapName) {\r\n if (__DEV__) {\r\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\r\n }\r\n }\r\n function retrieveMap(mapName) {\r\n var mapRecords = mapDataStorage.retrieveMap(mapName) || [];\r\n if (__DEV__) {\r\n if (!mapRecords.length) {\r\n mapNotExistsError(mapName);\r\n }\r\n }\r\n return mapRecords;\r\n }\n\n var MapSeries = (function (_super) {\r\n __extends(MapSeries, _super);\r\n function MapSeries() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapSeries.type;\r\n _this.needsDrawMap = false;\r\n _this.seriesGroup = [];\r\n _this.getTooltipPosition = function (dataIndex) {\r\n if (dataIndex != null) {\r\n var name_1 = this.getData().getName(dataIndex);\r\n var geo = this.coordinateSystem;\r\n var region = geo.getRegion(name_1);\r\n return region && geo.dataToPoint(region.center);\r\n }\r\n };\r\n return _this;\r\n }\r\n MapSeries.prototype.getInitialData = function (option) {\r\n var data = createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n var dataNameMap = createHashMap();\r\n var toAppendNames = [];\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n var name_2 = data.getName(i);\r\n dataNameMap.set(name_2, true);\r\n }\r\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\r\n each(geoSource.regions, function (region) {\r\n var name = region.name;\r\n if (!dataNameMap.get(name)) {\r\n toAppendNames.push(name);\r\n }\r\n });\r\n data.appendValues([], toAppendNames);\r\n return data;\r\n };\r\n MapSeries.prototype.getHostGeoModel = function () {\r\n var geoIndex = this.option.geoIndex;\r\n return geoIndex != null\r\n ? this.ecModel.getComponent('geo', geoIndex)\r\n : null;\r\n };\r\n MapSeries.prototype.getMapType = function () {\r\n return (this.getHostGeoModel() || this).option.map;\r\n };\r\n MapSeries.prototype.getRawValue = function (dataIndex) {\r\n var data = this.getData();\r\n return data.get(data.mapDimension('value'), dataIndex);\r\n };\r\n MapSeries.prototype.getRegionModel = function (regionName) {\r\n var data = this.getData();\r\n return data.getItemModel(data.indexOfName(regionName));\r\n };\r\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var seriesGroup = this.seriesGroup;\r\n var seriesNames = [];\r\n for (var i = 0; i < seriesGroup.length; i++) {\r\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\r\n var valueDim = data.mapDimension('value');\r\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\r\n seriesNames.push(seriesGroup[i].name);\r\n }\r\n }\r\n return createTooltipMarkup('section', {\r\n header: seriesNames.join(', '),\r\n noHeader: !seriesNames.length,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: name, value: value\r\n })]\r\n });\r\n };\r\n MapSeries.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n MapSeries.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n MapSeries.type = 'series.map';\r\n MapSeries.dependencies = ['geo'];\r\n MapSeries.layoutMode = 'box';\r\n MapSeries.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'geo',\r\n map: '',\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: 0.75,\r\n showLegendSymbol: true,\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n selectedMode: true,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n areaColor: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n areaColor: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n nameProperty: 'name'\r\n };\r\n return MapSeries;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(MapSeries);\n\n var ATTR = '\\0_ec_interaction_mutex';\r\n function take(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n }\r\n function release(zr, resourceKey, userKey) {\r\n var store = getStore(zr);\r\n var uKey = store[resourceKey];\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n }\r\n function isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n }\r\n function getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n }\r\n registerAction({ type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update' }, function () { });\n\n var RoamController = (function (_super) {\r\n __extends(RoamController, _super);\r\n function RoamController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._zr = zr;\r\n var mousedownHandler = bind(_this._mousedownHandler, _this);\r\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\r\n var mouseupHandler = bind(_this._mouseupHandler, _this);\r\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\r\n var pinchHandler = bind(_this._pinchHandler, _this);\r\n _this.enable = function (controlType, opt) {\r\n this.disable();\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n _this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n return _this;\r\n }\r\n RoamController.prototype.isDragging = function () {\r\n return this._dragging;\r\n };\r\n RoamController.prototype.isPinching = function () {\r\n return this._pinching;\r\n };\r\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\r\n this.pointerChecker = pointerChecker;\r\n };\r\n RoamController.prototype.dispose = function () {\r\n this.disable();\r\n };\r\n RoamController.prototype._mousedownHandler = function (e) {\r\n if (isMiddleOrRightButtonOnMouseUpDown(e)\r\n || (e.target && e.target.draggable)) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n };\r\n RoamController.prototype._mousemoveHandler = function (e) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var oldX = this._x;\r\n var oldY = this._y;\r\n var dx = x - oldX;\r\n var dy = y - oldY;\r\n this._x = x;\r\n this._y = y;\r\n this._opt.preventDefaultMouseMove && stop(e.event);\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n };\r\n RoamController.prototype._mouseupHandler = function (e) {\r\n if (!isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n };\r\n RoamController.prototype._mousewheelHandler = function (e) {\r\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n var wheelDelta = e.wheelDelta;\r\n var absWheelDeltaDelta = Math.abs(wheelDelta);\r\n var originX = e.offsetX;\r\n var originY = e.offsetY;\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n if (shouldZoom) {\r\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n var scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n if (shouldMove) {\r\n var absDelta = Math.abs(wheelDelta);\r\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n };\r\n RoamController.prototype._pinchHandler = function (e) {\r\n if (isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n };\r\n return RoamController;\r\n }(Eventful));\r\n function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\r\n stop(e.event);\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n }\r\n function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n controller.trigger(eventName, contollerEvent);\r\n }\r\n function isAvailableBehavior(behaviorToCheck, e, settings) {\r\n var setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (setting && (!isString(setting) || e.event[setting + 'Key']));\r\n }\n\n function updateViewOnPan(controllerHost, dx, dy) {\r\n var target = controllerHost.target;\r\n target.x += dx;\r\n target.y += dy;\r\n target.dirty();\r\n }\r\n function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\r\n var target = controllerHost.target;\r\n var zoomLimit = controllerHost.zoomLimit;\r\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\r\n }\r\n var zoomScale = newZoom / controllerHost.zoom;\r\n controllerHost.zoom = newZoom;\r\n target.x -= (zoomX - target.x) * (zoomScale - 1);\r\n target.y -= (zoomY - target.y) * (zoomScale - 1);\r\n target.scaleX *= zoomScale;\r\n target.scaleY *= zoomScale;\r\n target.dirty();\r\n }\n\n var IRRELEVANT_EXCLUDES = { 'axisPointer': 1, 'tooltip': 1, 'brush': 1 };\r\n function onIrrelevantElement(e, api, targetCoordSysModel) {\r\n var model = api.getComponentByElement(e.topTarget);\r\n var coordSys = model && model.coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n }\n\n function getFixedItemStyle(model) {\r\n var itemStyle = model.getItemStyle();\r\n var areaColor = model.get('areaColor');\r\n if (areaColor != null) {\r\n itemStyle.fill = areaColor;\r\n }\r\n return itemStyle;\r\n }\r\n var MapDraw = (function () {\r\n function MapDraw(api) {\r\n var group = new Group();\r\n this.uid = getUID('ec_map_draw');\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = { target: group };\r\n this.group = group;\r\n group.add(this._regionsGroup = new Group());\r\n group.add(this._backgroundGroup = new Group());\r\n }\r\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\r\n var isGeo = mapOrGeoModel.mainType === 'geo';\r\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\r\n isGeo && ecModel.eachComponent({ mainType: 'series', subType: 'map' }, function (mapSeries) {\r\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\r\n data = mapSeries.getData();\r\n }\r\n });\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n this._updateBackground(geo);\r\n var regionsGroup = this._regionsGroup;\r\n var group = this.group;\r\n var transformInfo = geo.getTransformInfo();\r\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\r\n var targetScaleX;\r\n var targetScaleY;\r\n if (isFirstDraw) {\r\n group.transform = transformInfo.roamTransform;\r\n group.decomposeTransform();\r\n group.dirty();\r\n }\r\n else {\r\n var target = new Transformable();\r\n target.transform = transformInfo.roamTransform;\r\n target.decomposeTransform();\r\n var props = {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n x: target.x,\r\n y: target.y\r\n };\r\n targetScaleX = target.scaleX;\r\n targetScaleY = target.scaleY;\r\n updateProps(group, props, mapOrGeoModel);\r\n }\r\n regionsGroup.removeAll();\r\n var nameMap = createHashMap();\r\n var isVisualEncodedByVisualMap = data\r\n && data.getVisual('visualMeta')\r\n && data.getVisual('visualMeta').length > 0;\r\n each(geo.regions, function (region) {\r\n var regionGroup = nameMap.get(region.name)\r\n || nameMap.set(region.name, new Group());\r\n var compoundPath = new CompoundPath({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n paths: []\r\n }\r\n });\r\n regionGroup.add(compoundPath);\r\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\r\n var itemStyleModel = regionModel.getModel('itemStyle');\r\n var emphasisModel = regionModel.getModel('emphasis');\r\n var emphasisItemStyleModel = emphasisModel.getModel('itemStyle');\r\n var blurItemStyleModel = regionModel.getModel(['blur', 'itemStyle']);\r\n var selectItemStyleModel = regionModel.getModel(['select', 'itemStyle']);\r\n var itemStyle = getFixedItemStyle(itemStyleModel);\r\n var emphasisItemStyle = getFixedItemStyle(emphasisItemStyleModel);\r\n var blurItemStyle = getFixedItemStyle(blurItemStyleModel);\r\n var selectItemStyle = getFixedItemStyle(selectItemStyleModel);\r\n var dataIdx;\r\n if (data) {\r\n dataIdx = data.indexOfName(region.name);\r\n var style = data.getItemVisual(dataIdx, 'style');\r\n var decal = data.getItemVisual(dataIdx, 'decal');\r\n if (isVisualEncodedByVisualMap && style.fill) {\r\n itemStyle.fill = style.fill;\r\n }\r\n if (decal) {\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n }\r\n var sx = transformInfo.rawScaleX;\r\n var sy = transformInfo.rawScaleY;\r\n var offsetX = transformInfo.rawX;\r\n var offsetY = transformInfo.rawY;\r\n var transformPoint = function (point) {\r\n return [\r\n point[0] * sx + offsetX,\r\n point[1] * sy + offsetY\r\n ];\r\n };\r\n each(region.geometries, function (geometry) {\r\n if (geometry.type !== 'polygon') {\r\n return;\r\n }\r\n var points = [];\r\n for (var i = 0; i < geometry.exterior.length; ++i) {\r\n points.push(transformPoint(geometry.exterior[i]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); ++i) {\r\n var interior = geometry.interiors[i];\r\n var points_1 = [];\r\n for (var j = 0; j < interior.length; ++j) {\r\n points_1.push(transformPoint(interior[j]));\r\n }\r\n compoundPath.shape.paths.push(new Polygon({\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n points: points_1\r\n }\r\n }));\r\n }\r\n });\r\n compoundPath.setStyle(itemStyle);\r\n compoundPath.style.strokeNoScale = true;\r\n compoundPath.culling = true;\r\n compoundPath.ensureState('emphasis').style = emphasisItemStyle;\r\n compoundPath.ensureState('blur').style = blurItemStyle;\r\n compoundPath.ensureState('select').style = selectItemStyle;\r\n var showLabel = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n if (regionModel.get(stateName === 'normal' ? ['label', 'show'] : [stateName, 'label', 'show'])) {\r\n showLabel = true;\r\n break;\r\n }\r\n }\r\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\r\n var itemLayout = data && data.getItemLayout(dataIdx);\r\n if ((isGeo || isDataNaN && (showLabel))\r\n || (itemLayout && itemLayout.showLabel)) {\r\n var query = !isGeo ? dataIdx : region.name;\r\n var labelFetcher = void 0;\r\n if (!data || dataIdx >= 0) {\r\n labelFetcher = mapOrGeoModel;\r\n }\r\n var centerPt = transformPoint(region.center);\r\n var textEl = new ZRText({\r\n x: centerPt[0],\r\n y: centerPt[1],\r\n scaleX: 1 / group.scaleX,\r\n scaleY: 1 / group.scaleY,\r\n z2: 10,\r\n silent: true\r\n });\r\n setLabelStyle(textEl, getLabelStatesModels(regionModel), {\r\n labelFetcher: labelFetcher,\r\n labelDataIndex: query,\r\n defaultText: region.name\r\n }, { normal: {\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n } });\r\n compoundPath.setTextContent(textEl);\r\n compoundPath.setTextConfig({\r\n local: true\r\n });\r\n compoundPath.disableLabelAnimation = true;\r\n if (!isFirstDraw) {\r\n updateProps(textEl, {\r\n scaleX: 1 / targetScaleX,\r\n scaleY: 1 / targetScaleY\r\n }, mapOrGeoModel);\r\n }\r\n }\r\n if (data) {\r\n data.setItemGraphicEl(dataIdx, regionGroup);\r\n }\r\n else {\r\n var regionModel_1 = mapOrGeoModel.getRegionModel(region.name);\r\n getECData(compoundPath).eventData = {\r\n componentType: 'geo',\r\n componentIndex: mapOrGeoModel.componentIndex,\r\n geoIndex: mapOrGeoModel.componentIndex,\r\n name: region.name,\r\n region: (regionModel_1 && regionModel_1.option) || {}\r\n };\r\n }\r\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\r\n groupRegions.push(region);\r\n regionGroup.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\r\n enableHoverEmphasis(regionGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n regionsGroup.add(regionGroup);\r\n });\r\n this._updateController(mapOrGeoModel, ecModel, api);\r\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\r\n };\r\n MapDraw.prototype.remove = function () {\r\n this._regionsGroup.removeAll();\r\n this._backgroundGroup.removeAll();\r\n this._controller.dispose();\r\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\r\n this._mapName = null;\r\n this._controllerHost = null;\r\n };\r\n MapDraw.prototype._updateBackground = function (geo) {\r\n var mapName = geo.map;\r\n if (this._mapName !== mapName) {\r\n each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\r\n this._backgroundGroup.add(root);\r\n }, this);\r\n }\r\n this._mapName = mapName;\r\n };\r\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\r\n var geo = mapOrGeoModel.coordinateSystem;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\r\n controllerHost.zoom = geo.getZoom();\r\n controller.enable(mapOrGeoModel.get('roam') || false);\r\n var mainType = mapOrGeoModel.mainType;\r\n function makeActionBase() {\r\n var action = {\r\n type: 'geoRoam',\r\n componentType: mainType\r\n };\r\n action[mainType + 'Id'] = mapOrGeoModel.id;\r\n return action;\r\n }\r\n controller.off('pan').on('pan', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n dx: e.dx,\r\n dy: e.dy\r\n }));\r\n }, this);\r\n controller.off('zoom').on('zoom', function (e) {\r\n this._mouseDownFlag = false;\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction(extend(makeActionBase(), {\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n }));\r\n var group = this.group;\r\n this._regionsGroup.traverse(function (el) {\r\n var textContent = el.getTextContent();\r\n if (textContent) {\r\n textContent.scaleX = 1 / group.scaleX;\r\n textContent.scaleY = 1 / group.scaleY;\r\n textContent.markRedraw();\r\n }\r\n });\r\n }, this);\r\n controller.setPointerChecker(function (e, x, y) {\r\n return geo.getViewRectAfterRoam().contain(x, y)\r\n && !onIrrelevantElement(e, api, mapOrGeoModel);\r\n });\r\n };\r\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\r\n var mapDraw = this;\r\n regionsGroup.off('mousedown');\r\n if (mapOrGeoModel.get('selectedMode')) {\r\n regionsGroup.on('mousedown', function () {\r\n mapDraw._mouseDownFlag = true;\r\n });\r\n regionsGroup.on('click', function (e) {\r\n if (!mapDraw._mouseDownFlag) {\r\n return;\r\n }\r\n mapDraw._mouseDownFlag = false;\r\n });\r\n }\r\n };\r\n return MapDraw;\r\n }());\n\n var MapView = (function (_super) {\r\n __extends(MapView, _super);\r\n function MapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MapView.type;\r\n return _this;\r\n }\r\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\r\n if (payload && payload.type === 'mapToggleSelect'\r\n && payload.from === this.uid) {\r\n return;\r\n }\r\n var group = this.group;\r\n group.removeAll();\r\n if (mapModel.getHostGeoModel()) {\r\n return;\r\n }\r\n if (!(payload && payload.type === 'geoRoam'\r\n && payload.componentType === 'series'\r\n && payload.seriesId === mapModel.id)) {\r\n if (mapModel.needsDrawMap) {\r\n var mapDraw = this._mapDraw || new MapDraw(api);\r\n group.add(mapDraw.group);\r\n mapDraw.draw(mapModel, ecModel, api, this, payload);\r\n this._mapDraw = mapDraw;\r\n }\r\n else {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n }\r\n else {\r\n var mapDraw = this._mapDraw;\r\n mapDraw && group.add(mapDraw.group);\r\n }\r\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')\r\n && this._renderSymbols(mapModel, ecModel, api);\r\n };\r\n MapView.prototype.remove = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n this.group.removeAll();\r\n };\r\n MapView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n };\r\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\r\n var originalData = mapModel.originalData;\r\n var group = this.group;\r\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n var layout = originalData.getItemLayout(originalDataIndex);\r\n if (!layout || !layout.point) {\r\n return;\r\n }\r\n var point = layout.point;\r\n var offset = layout.offset;\r\n var circle = new Circle({\r\n style: {\r\n fill: mapModel.getData().getVisual('style').fill\r\n },\r\n shape: {\r\n cx: point[0] + offset * 9,\r\n cy: point[1],\r\n r: 3\r\n },\r\n silent: true,\r\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\r\n });\r\n if (!offset) {\r\n var fullData = mapModel.mainSeries.getData();\r\n var name_1 = originalData.getName(originalDataIndex);\r\n var fullIndex_1 = fullData.indexOfName(name_1);\r\n var itemModel = originalData.getItemModel(originalDataIndex);\r\n var labelModel = itemModel.getModel('label');\r\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\r\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\r\n labelFetcher: {\r\n getFormattedLabel: function (idx, state) {\r\n return mapModel.getFormattedLabel(fullIndex_1, state);\r\n }\r\n }\r\n });\r\n circle.disableLabelAnimation = true;\r\n if (!labelModel.get('position')) {\r\n circle.setTextConfig({\r\n position: 'bottom'\r\n });\r\n }\r\n regionGroup.onHoverStateChange = function (toState) {\r\n circle.useState(toState);\r\n };\r\n }\r\n group.add(circle);\r\n });\r\n };\r\n MapView.type = 'map';\r\n return MapView;\r\n }(ChartView));\r\n ChartView.registerClass(MapView);\n\n function updateCenterAndZoom(view, payload, zoomLimit) {\r\n var previousZoom = view.getZoom();\r\n var center = view.getCenter();\r\n var zoom = payload.zoom;\r\n var point = view.dataToPoint(center);\r\n if (payload.dx != null && payload.dy != null) {\r\n point[0] -= payload.dx;\r\n point[1] -= payload.dy;\r\n view.setCenter(view.pointToData(point));\r\n }\r\n if (zoom != null) {\r\n if (zoomLimit) {\r\n var zoomMin = zoomLimit.min || 0;\r\n var zoomMax = zoomLimit.max || Infinity;\r\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\r\n }\r\n view.scaleX *= zoom;\r\n view.scaleY *= zoom;\r\n var fixX = (payload.originX - view.x) * (zoom - 1);\r\n var fixY = (payload.originY - view.y) * (zoom - 1);\r\n view.x -= fixX;\r\n view.y -= fixY;\r\n view.updateTransform();\r\n view.setCenter(view.pointToData(point));\r\n view.setZoom(zoom * previousZoom);\r\n }\r\n return {\r\n center: view.getCenter(),\r\n zoom: view.getZoom()\r\n };\r\n }\n\n registerAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n var geo = componentModel.coordinateSystem;\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\r\n componentModel.setCenter\r\n && componentModel.setCenter(res.center);\r\n componentModel.setZoom\r\n && componentModel.setZoom(res.zoom);\r\n if (componentType === 'series') {\r\n each(componentModel.seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n });\r\n });\n\n var v2ApplyTransform = applyTransform;\r\n var View = (function (_super) {\r\n __extends(View, _super);\r\n function View(name) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'view';\r\n _this.dimensions = ['x', 'y'];\r\n _this._roamTransformable = new Transformable();\r\n _this._rawTransformable = new Transformable();\r\n _this.name = name;\r\n return _this;\r\n }\r\n View.prototype.setBoundingRect = function (x, y, width, height) {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n };\r\n View.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n View.prototype.setViewRect = function (x, y, width, height) {\r\n this.transformTo(x, y, width, height);\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n };\r\n View.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var rawTransform = this._rawTransformable;\r\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransform.decomposeTransform();\r\n this._updateTransform();\r\n };\r\n View.prototype.setCenter = function (centerCoord) {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n this._center = centerCoord;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.setZoom = function (zoom) {\r\n zoom = zoom || 1;\r\n var zoomLimit = this.zoomLimit;\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n this._zoom = zoom;\r\n this._updateCenterAndZoom();\r\n };\r\n View.prototype.getDefaultCenter = function () {\r\n var rawRect = this.getBoundingRect();\r\n var cx = rawRect.x + rawRect.width / 2;\r\n var cy = rawRect.y + rawRect.height / 2;\r\n return [cx, cy];\r\n };\r\n View.prototype.getCenter = function () {\r\n return this._center || this.getDefaultCenter();\r\n };\r\n View.prototype.getZoom = function () {\r\n return this._zoom || 1;\r\n };\r\n View.prototype.getRoamTransform = function () {\r\n return this._roamTransformable.getLocalTransform();\r\n };\r\n View.prototype._updateCenterAndZoom = function () {\r\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n var roamTransform = this._roamTransformable;\r\n var defaultCenter = this.getDefaultCenter();\r\n var center = this.getCenter();\r\n var zoom = this.getZoom();\r\n center = applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix);\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n this._updateTransform();\r\n };\r\n View.prototype._updateTransform = function () {\r\n var roamTransformable = this._roamTransformable;\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1());\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n this.invTransform = this.invTransform || [];\r\n invert(this.invTransform, this.transform);\r\n this.decomposeTransform();\r\n };\r\n View.prototype.getTransformInfo = function () {\r\n var roamTransform = this._roamTransformable.transform;\r\n var rawTransformable = this._rawTransformable;\r\n return {\r\n roamTransform: roamTransform ? slice(roamTransform) : create$1(),\r\n rawScaleX: rawTransformable.scaleX,\r\n rawScaleY: rawTransformable.scaleY,\r\n rawX: rawTransformable.x,\r\n rawY: rawTransformable.y\r\n };\r\n };\r\n View.prototype.getViewRect = function () {\r\n return this._viewRect;\r\n };\r\n View.prototype.getViewRectAfterRoam = function () {\r\n var rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n };\r\n View.prototype.dataToPoint = function (data, noRoam, out) {\r\n var transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform\r\n ? v2ApplyTransform(out, data, transform)\r\n : copy(out, data);\r\n };\r\n View.prototype.pointToData = function (point) {\r\n var invTransform = this.invTransform;\r\n return invTransform\r\n ? v2ApplyTransform([], point, invTransform)\r\n : [point[0], point[1]];\r\n };\r\n View.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n View.prototype.containPoint = function (point) {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n };\r\n View.dimensions = ['x', 'y'];\r\n return View;\r\n }(Transformable));\r\n function getCoordSys(finder) {\r\n var seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem : null;\r\n }\n\n var Geo = (function (_super) {\r\n __extends(Geo, _super);\r\n function Geo(name, map, nameMap, invertLongitute) {\r\n var _this = _super.call(this, name) || this;\r\n _this.dimensions = ['lng', 'lat'];\r\n _this.type = 'geo';\r\n _this.map = map;\r\n var source = geoSourceManager.load(map, nameMap);\r\n _this._nameCoordMap = source.nameCoordMap;\r\n _this._regionsMap = source.regionsMap;\r\n _this._invertLongitute = invertLongitute == null ? true : invertLongitute;\r\n _this.regions = source.regions;\r\n _this._rect = source.boundingRect;\r\n return _this;\r\n }\r\n Geo.prototype.containCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Geo.prototype.transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var invertLongitute = this._invertLongitute;\r\n rect = rect.clone();\r\n if (invertLongitute) {\r\n rect.y = -rect.y - rect.height;\r\n }\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n rawTransformable.decomposeTransform();\r\n if (invertLongitute) {\r\n rawTransformable.scaleY = -rawTransformable.scaleY;\r\n }\r\n rawTransformable.updateTransform();\r\n this._updateTransform();\r\n };\r\n Geo.prototype.getRegion = function (name) {\r\n return this._regionsMap.get(name);\r\n };\r\n Geo.prototype.getRegionByCoord = function (coord) {\r\n var regions = this.regions;\r\n for (var i = 0; i < regions.length; i++) {\r\n if (regions[i].contain(coord)) {\r\n return regions[i];\r\n }\r\n }\r\n };\r\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\r\n this._nameCoordMap.set(name, geoCoord);\r\n };\r\n Geo.prototype.getGeoCoord = function (name) {\r\n return this._nameCoordMap.get(name);\r\n };\r\n Geo.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\r\n if (typeof data === 'string') {\r\n data = this.getGeoCoord(data);\r\n }\r\n if (data) {\r\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\r\n }\r\n };\r\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$1(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n return Geo;\r\n }(View));\r\n mixin(Geo, View);\r\n function getCoordSys$1(finder) {\r\n var geoModel = finder.geoModel;\r\n var seriesModel = finder.seriesModel;\r\n return geoModel\r\n ? geoModel.coordinateSystem\r\n : seriesModel\r\n ? (seriesModel.coordinateSystem\r\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem)\r\n : null;\r\n }\n\n function resizeGeo(geoModel, api) {\r\n var boundingCoords = geoModel.get('boundingCoords');\r\n if (boundingCoords != null) {\r\n var leftTop = boundingCoords[0];\r\n var rightBottom = boundingCoords[1];\r\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\r\n if (__DEV__) {\r\n console.error('Invalid boundingCoords');\r\n }\r\n }\r\n else {\r\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\r\n }\r\n }\r\n var rect = this.getBoundingRect();\r\n var centerOption = geoModel.get('layoutCenter');\r\n var sizeOption = geoModel.get('layoutSize');\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n var aspect = rect.width / rect.height * this.aspectScale;\r\n var useCenterAndSize = false;\r\n var center;\r\n var size;\r\n if (centerOption && sizeOption) {\r\n center = [\r\n parsePercent$2(centerOption[0], viewWidth),\r\n parsePercent$2(centerOption[1], viewHeight)\r\n ];\r\n size = parsePercent$2(sizeOption, Math.min(viewWidth, viewHeight));\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n var viewRect;\r\n if (useCenterAndSize) {\r\n viewRect = {};\r\n if (aspect > 1) {\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n }\r\n else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n }\r\n else {\r\n var boxLayoutOption = geoModel.getBoxLayoutParams();\r\n boxLayoutOption.aspect = aspect;\r\n viewRect = getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n this.setCenter(geoModel.get('center'));\r\n this.setZoom(geoModel.get('zoom'));\r\n }\r\n function setGeoCoords(geo, model) {\r\n each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n }\r\n var GeoCreator = (function () {\r\n function GeoCreator() {\r\n this.dimensions = Geo.prototype.dimensions;\r\n }\r\n GeoCreator.prototype.create = function (ecModel, api) {\r\n var geoList = [];\r\n ecModel.eachComponent('geo', function (geoModel, idx) {\r\n var name = geoModel.get('map');\r\n var aspectScale = geoModel.get('aspectScale');\r\n var invertLongitute = true;\r\n var mapRecords = mapDataStorage.retrieveMap(name);\r\n if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') {\r\n aspectScale == null && (aspectScale = 1);\r\n invertLongitute = false;\r\n }\r\n else {\r\n aspectScale == null && (aspectScale = 0.75);\r\n }\r\n var geo = new Geo(name + idx, name, geoModel.get('nameMap'), invertLongitute);\r\n geo.aspectScale = aspectScale;\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo);\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel;\r\n geo.resize = resizeGeo;\r\n geo.resize(geoModel, api);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n if (coordSys === 'geo') {\r\n var geoIndex = seriesModel.get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n });\r\n var mapModelGroupBySeries = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n var mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n var nameMapList = map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n var geo = new Geo(mapType, mapType, mergeAll(nameMapList));\r\n geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo);\r\n geo.resize = resizeGeo;\r\n geo.aspectScale = mapSeries[0].get('aspectScale');\r\n geo.resize(mapSeries[0], api);\r\n each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n return geoList;\r\n };\r\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap) {\r\n var regionsArr = (originRegionArr || []).slice();\r\n var dataNameMap = createHashMap();\r\n for (var i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n var source = geoSourceManager.load(mapName, nameMap);\r\n each(source.regions, function (region) {\r\n var name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({ name: name });\r\n });\r\n return regionsArr;\r\n };\r\n return GeoCreator;\r\n }());\r\n var geoCreator = new GeoCreator();\r\n registerCoordinateSystem('geo', geoCreator);\n\n function mapSymbolLayout(ecModel) {\r\n var processedMapType = {};\r\n ecModel.eachSeriesByType('map', function (mapSeries) {\r\n var mapType = mapSeries.getMapType();\r\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\r\n return;\r\n }\r\n var mapSymbolOffsets = {};\r\n each(mapSeries.seriesGroup, function (subMapSeries) {\r\n var geo = subMapSeries.coordinateSystem;\r\n var data = subMapSeries.originalData;\r\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var name = data.getName(idx);\r\n var region = geo.getRegion(name);\r\n if (!region || isNaN(value)) {\r\n return;\r\n }\r\n var offset = mapSymbolOffsets[name] || 0;\r\n var point = geo.dataToPoint(region.center);\r\n mapSymbolOffsets[name] = offset + 1;\r\n data.setItemLayout(idx, {\r\n point: point,\r\n offset: offset\r\n });\r\n });\r\n }\r\n });\r\n var data = mapSeries.getData();\r\n data.each(function (idx) {\r\n var name = data.getName(idx);\r\n var layout = data.getItemLayout(idx) || {};\r\n layout.showLabel = !mapSymbolOffsets[name];\r\n data.setItemLayout(idx, layout);\r\n });\r\n processedMapType[mapType] = true;\r\n });\r\n }\n\n function dataStatistics(datas, statisticType) {\r\n var dataNameMap = {};\r\n each(datas, function (data) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + data.getName(idx);\r\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\r\n if (!isNaN(value)) {\r\n dataNameMap[mapKey].push(value);\r\n }\r\n });\r\n });\r\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\r\n var mapKey = 'ec-' + datas[0].getName(idx);\r\n var sum = 0;\r\n var min = Infinity;\r\n var max = -Infinity;\r\n var len = dataNameMap[mapKey].length;\r\n for (var i = 0; i < len; i++) {\r\n min = Math.min(min, dataNameMap[mapKey][i]);\r\n max = Math.max(max, dataNameMap[mapKey][i]);\r\n sum += dataNameMap[mapKey][i];\r\n }\r\n var result;\r\n if (statisticType === 'min') {\r\n result = min;\r\n }\r\n else if (statisticType === 'max') {\r\n result = max;\r\n }\r\n else if (statisticType === 'average') {\r\n result = sum / len;\r\n }\r\n else {\r\n result = sum;\r\n }\r\n return len === 0 ? NaN : result;\r\n });\r\n }\r\n function mapDataStatistic(ecModel) {\r\n var seriesGroups = {};\r\n ecModel.eachSeriesByType('map', function (seriesModel) {\r\n var hostGeoModel = seriesModel.getHostGeoModel();\r\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\r\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\r\n });\r\n each(seriesGroups, function (seriesList, key) {\r\n var data = dataStatistics(map(seriesList, function (seriesModel) {\r\n return seriesModel.getData();\r\n }), seriesList[0].get('mapValueCalculation'));\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].originalData = seriesList[i].getData();\r\n }\r\n for (var i = 0; i < seriesList.length; i++) {\r\n seriesList[i].seriesGroup = seriesList;\r\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\r\n seriesList[i].setData(data.cloneShallow());\r\n seriesList[i].mainSeries = seriesList[0];\r\n }\r\n });\r\n }\n\n registerLayout(mapSymbolLayout);\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\r\n createLegacyDataSelectAction('map', registerAction);\n\n var inner$8 = makeInner();\r\n function linkList(opt) {\r\n var mainData = opt.mainData;\r\n var datas = opt.datas;\r\n if (!datas) {\r\n datas = { main: mainData };\r\n opt.datasAttr = { main: 'data' };\r\n }\r\n opt.datas = opt.mainData = null;\r\n linkAll(mainData, datas, opt);\r\n each(datas, function (data) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n });\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n });\r\n assert(datas[mainData.dataType] === mainData);\r\n }\r\n function transferInjection(opt, res) {\r\n if (isMainData(this)) {\r\n var datas = extend({}, inner$8(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n }\r\n else {\r\n linkSingle(res, this.dataType, inner$8(this).mainData, opt);\r\n }\r\n return res;\r\n }\r\n function changeInjection(opt, res) {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n }\r\n function cloneShallowInjection(opt, res) {\r\n each(inner$8(res).datas, function (data, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n }\r\n function getLinkedData(dataType) {\r\n var mainData = inner$8(this).mainData;\r\n return (dataType == null || mainData == null)\r\n ? mainData\r\n : inner$8(mainData).datas[dataType];\r\n }\r\n function getLinkedDataAll() {\r\n var mainData = inner$8(this).mainData;\r\n return (mainData == null)\r\n ? [{ data: mainData }]\r\n : map(keys(inner$8(mainData).datas), function (type) {\r\n return {\r\n type: type,\r\n data: inner$8(mainData).datas[type]\r\n };\r\n });\r\n }\r\n function isMainData(data) {\r\n return inner$8(data).mainData === data;\r\n }\r\n function linkAll(mainData, datas, opt) {\r\n inner$8(mainData).datas = {};\r\n each(datas, function (data, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n }\r\n function linkSingle(data, dataType, mainData, opt) {\r\n inner$8(mainData).datas[dataType] = data;\r\n inner$8(data).mainData = mainData;\r\n data.dataType = dataType;\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n }\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n }\n\n var TreeNode = (function () {\r\n function TreeNode(name, hostTree) {\r\n this.depth = 0;\r\n this.height = 0;\r\n this.dataIndex = -1;\r\n this.children = [];\r\n this.viewChildren = [];\r\n this.isExpand = false;\r\n this.name = name || '';\r\n this.hostTree = hostTree;\r\n }\r\n TreeNode.prototype.isRemoved = function () {\r\n return this.dataIndex < 0;\r\n };\r\n TreeNode.prototype.eachNode = function (options, cb, context) {\r\n if (typeof options === 'function') {\r\n context = cb;\r\n cb = options;\r\n options = null;\r\n }\r\n options = options || {};\r\n if (isString(options)) {\r\n options = { order: options };\r\n }\r\n var order = options.order || 'preorder';\r\n var children = this[options.attr || 'children'];\r\n var suppressVisitSub;\r\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\r\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\r\n children[i].eachNode(options, cb, context);\r\n }\r\n order === 'postorder' && cb.call(context, this);\r\n };\r\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\r\n var height = 0;\r\n this.depth = depth;\r\n for (var i = 0; i < this.children.length; i++) {\r\n var child = this.children[i];\r\n child.updateDepthAndHeight(depth + 1);\r\n if (child.height > height) {\r\n height = child.height;\r\n }\r\n }\r\n this.height = height + 1;\r\n };\r\n TreeNode.prototype.getNodeById = function (id) {\r\n if (this.getId() === id) {\r\n return this;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].getNodeById(id);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.contains = function (node) {\r\n if (node === this) {\r\n return true;\r\n }\r\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\r\n var res = children[i].contains(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n };\r\n TreeNode.prototype.getAncestors = function (includeSelf) {\r\n var ancestors = [];\r\n var node = includeSelf ? this : this.parentNode;\r\n while (node) {\r\n ancestors.push(node);\r\n node = node.parentNode;\r\n }\r\n ancestors.reverse();\r\n return ancestors;\r\n };\r\n TreeNode.prototype.getAncestorsIndices = function () {\r\n var indices = [];\r\n var currNode = this;\r\n while (currNode) {\r\n indices.push(currNode.dataIndex);\r\n currNode = currNode.parentNode;\r\n }\r\n indices.reverse();\r\n return indices;\r\n };\r\n TreeNode.prototype.getDescendantIndices = function () {\r\n var indices = [];\r\n this.eachNode(function (childNode) {\r\n indices.push(childNode.dataIndex);\r\n });\r\n return indices;\r\n };\r\n TreeNode.prototype.getValue = function (dimension) {\r\n var data = this.hostTree.data;\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n };\r\n TreeNode.prototype.setLayout = function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\r\n };\r\n TreeNode.prototype.getLayout = function () {\r\n return this.hostTree.data.getItemLayout(this.dataIndex);\r\n };\r\n TreeNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var hostTree = this.hostTree;\r\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n TreeNode.prototype.getLevelModel = function () {\r\n return (this.hostTree.levelModels || [])[this.depth];\r\n };\r\n TreeNode.prototype.setVisual = function (key, value) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\r\n };\r\n TreeNode.prototype.getVisual = function (key) {\r\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\r\n };\r\n TreeNode.prototype.getRawIndex = function () {\r\n return this.hostTree.data.getRawIndex(this.dataIndex);\r\n };\r\n TreeNode.prototype.getId = function () {\r\n return this.hostTree.data.getId(this.dataIndex);\r\n };\r\n TreeNode.prototype.isAncestorOf = function (node) {\r\n var parent = node.parentNode;\r\n while (parent) {\r\n if (parent === this) {\r\n return true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return false;\r\n };\r\n TreeNode.prototype.isDescendantOf = function (node) {\r\n return node !== this && node.isAncestorOf(this);\r\n };\r\n return TreeNode;\r\n }());\r\n var Tree = (function () {\r\n function Tree(hostModel) {\r\n this.type = 'tree';\r\n this._nodes = [];\r\n this.hostModel = hostModel;\r\n }\r\n Tree.prototype.eachNode = function (options, cb, context) {\r\n this.root.eachNode(options, cb, context);\r\n };\r\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\r\n var rawIndex = this.data.getRawIndex(dataIndex);\r\n return this._nodes[rawIndex];\r\n };\r\n Tree.prototype.getNodeById = function (name) {\r\n return this.root.getNodeById(name);\r\n };\r\n Tree.prototype.update = function () {\r\n var data = this.data;\r\n var nodes = this._nodes;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Tree.prototype.clearLayouts = function () {\r\n this.data.clearItemLayouts();\r\n };\r\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\r\n var tree = new Tree(hostModel);\r\n var listData = [];\r\n var dimMax = 1;\r\n buildHierarchy(dataRoot);\r\n function buildHierarchy(dataNode, parentNode) {\r\n var value = dataNode.value;\r\n dimMax = Math.max(dimMax, isArray(value) ? value.length : 1);\r\n listData.push(dataNode);\r\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\r\n parentNode\r\n ? addChild(node, parentNode)\r\n : (tree.root = node);\r\n tree._nodes.push(node);\r\n var children = dataNode.children;\r\n if (children) {\r\n for (var i = 0; i < children.length; i++) {\r\n buildHierarchy(children[i], node);\r\n }\r\n }\r\n }\r\n tree.root.updateDepthAndHeight(0);\r\n var dimensionsInfo = createDimensions(listData, {\r\n coordDimensions: ['value'],\r\n dimensionsCount: dimMax\r\n });\r\n var list = new List(dimensionsInfo, hostModel);\r\n list.initData(listData);\r\n beforeLink && beforeLink(list);\r\n linkList({\r\n mainData: list,\r\n struct: tree,\r\n structAttr: 'tree'\r\n });\r\n tree.update();\r\n return tree;\r\n };\r\n return Tree;\r\n }());\r\n function addChild(child, node) {\r\n var children = node.children;\r\n if (child.parentNode === node) {\r\n return;\r\n }\r\n children.push(child);\r\n child.parentNode = node;\r\n }\n\n var TreeSeriesModel = (function (_super) {\r\n __extends(TreeSeriesModel, _super);\r\n function TreeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.hasSymbolVisual = true;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n TreeSeriesModel.prototype.getInitialData = function (option) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n var leaves = option.leaves || {};\r\n var leavesModel = new Model(leaves, this, this.ecModel);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n if (!node.children.length || !node.isExpand) {\r\n model.parentModel = leavesModel;\r\n }\r\n return model;\r\n });\r\n }\r\n var treeDepth = 0;\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n var expandAndCollapse = option.expandAndCollapse;\r\n var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0)\r\n ? option.initialTreeDepth : treeDepth;\r\n tree.root.eachNode('preorder', function (node) {\r\n var item = node.hostTree.data.getRawDataItem(node.dataIndex);\r\n node.isExpand = (item && item.collapsed != null)\r\n ? !item.collapsed\r\n : node.depth <= expandTreeDepth;\r\n });\r\n return tree.data;\r\n };\r\n TreeSeriesModel.prototype.getOrient = function () {\r\n var orient = this.get('orient');\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n }\r\n else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n return orient;\r\n };\r\n TreeSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n TreeSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var tree = this.getData().tree;\r\n var realRoot = tree.root.children[0];\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n var value = node.getValue();\r\n var name = node.name;\r\n while (node && (node !== realRoot)) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value) || value == null\r\n });\r\n };\r\n TreeSeriesModel.type = 'series.tree';\r\n TreeSeriesModel.layoutMode = 'box';\r\n TreeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n layout: 'orthogonal',\r\n edgeShape: 'curve',\r\n edgeForkPosition: '50%',\r\n roam: false,\r\n nodeScaleRatio: 0.4,\r\n center: null,\r\n zoom: 1,\r\n orient: 'LR',\r\n symbol: 'emptyCircle',\r\n symbolSize: 7,\r\n expandAndCollapse: true,\r\n initialTreeDepth: 2,\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n label: {\r\n show: true\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 700,\r\n animationDurationUpdate: 500\r\n };\r\n return TreeSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(TreeSeriesModel);\n\n function init$2(inRoot) {\r\n var root = inRoot;\r\n root.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: root,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: 0,\r\n thread: null\r\n };\r\n var nodes = [root];\r\n var node;\r\n var children;\r\n while (node = nodes.pop()) {\r\n children = node.children;\r\n if (node.isExpand && children.length) {\r\n var n = children.length;\r\n for (var i = n - 1; i >= 0; i--) {\r\n var child = children[i];\r\n child.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: child,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: i,\r\n thread: null\r\n };\r\n nodes.push(child);\r\n }\r\n }\r\n }\r\n }\r\n function firstWalk(node, separation) {\r\n var children = node.isExpand ? node.children : [];\r\n var siblings = node.parentNode.children;\r\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\r\n if (children.length) {\r\n executeShifts(node);\r\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\r\n if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\r\n }\r\n else {\r\n node.hierNode.prelim = midPoint;\r\n }\r\n }\r\n else if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n }\r\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\r\n }\r\n function secondWalk(node) {\r\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\r\n node.setLayout({ x: nodeX }, true);\r\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\r\n }\r\n function separation(cb) {\r\n return arguments.length ? cb : defaultSeparation;\r\n }\r\n function radialCoordinate(rad, r) {\r\n rad -= Math.PI / 2;\r\n return {\r\n x: r * Math.cos(rad),\r\n y: r * Math.sin(rad)\r\n };\r\n }\r\n function getViewRect$1(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function executeShifts(node) {\r\n var children = node.children;\r\n var n = children.length;\r\n var shift = 0;\r\n var change = 0;\r\n while (--n >= 0) {\r\n var child = children[n];\r\n child.hierNode.prelim += shift;\r\n child.hierNode.modifier += shift;\r\n change += child.hierNode.change;\r\n shift += child.hierNode.shift + change;\r\n }\r\n }\r\n function apportion(subtreeV, subtreeW, ancestor, separation) {\r\n if (subtreeW) {\r\n var nodeOutRight = subtreeV;\r\n var nodeInRight = subtreeV;\r\n var nodeOutLeft = nodeInRight.parentNode.children[0];\r\n var nodeInLeft = subtreeW;\r\n var sumOutRight = nodeOutRight.hierNode.modifier;\r\n var sumInRight = nodeInRight.hierNode.modifier;\r\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\r\n var sumInLeft = nodeInLeft.hierNode.modifier;\r\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\r\n nodeOutRight = nextRight(nodeOutRight);\r\n nodeOutLeft = nextLeft(nodeOutLeft);\r\n nodeOutRight.hierNode.ancestor = subtreeV;\r\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim\r\n - sumInRight + separation(nodeInLeft, nodeInRight);\r\n if (shift > 0) {\r\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\r\n sumInRight += shift;\r\n sumOutRight += shift;\r\n }\r\n sumInLeft += nodeInLeft.hierNode.modifier;\r\n sumInRight += nodeInRight.hierNode.modifier;\r\n sumOutRight += nodeOutRight.hierNode.modifier;\r\n sumOutLeft += nodeOutLeft.hierNode.modifier;\r\n }\r\n if (nodeInLeft && !nextRight(nodeOutRight)) {\r\n nodeOutRight.hierNode.thread = nodeInLeft;\r\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\r\n }\r\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\r\n nodeOutLeft.hierNode.thread = nodeInRight;\r\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\r\n ancestor = subtreeV;\r\n }\r\n }\r\n return ancestor;\r\n }\r\n function nextRight(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\r\n }\r\n function nextLeft(node) {\r\n var children = node.children;\r\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\r\n }\r\n function nextAncestor(nodeInLeft, node, ancestor) {\r\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode\r\n ? nodeInLeft.hierNode.ancestor : ancestor;\r\n }\r\n function moveSubtree(wl, wr, shift) {\r\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\r\n wr.hierNode.change -= change;\r\n wr.hierNode.shift += shift;\r\n wr.hierNode.modifier += shift;\r\n wr.hierNode.prelim += shift;\r\n wl.hierNode.change += change;\r\n }\r\n function defaultSeparation(node1, node2) {\r\n return node1.parentNode === node2.parentNode ? 1 : 2;\r\n }\n\n var TreeEdgeShape = (function () {\r\n function TreeEdgeShape() {\r\n this.parentPoint = [];\r\n this.childPoints = [];\r\n }\r\n return TreeEdgeShape;\r\n }());\r\n var TreePath = (function (_super) {\r\n __extends(TreePath, _super);\r\n function TreePath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n TreePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n TreePath.prototype.getDefaultShape = function () {\r\n return new TreeEdgeShape();\r\n };\r\n TreePath.prototype.buildPath = function (ctx, shape) {\r\n var childPoints = shape.childPoints;\r\n var childLen = childPoints.length;\r\n var parentPoint = shape.parentPoint;\r\n var firstChildPos = childPoints[0];\r\n var lastChildPos = childPoints[childLen - 1];\r\n if (childLen === 1) {\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\r\n return;\r\n }\r\n var orient = shape.orient;\r\n var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;\r\n var otherDim = 1 - forkDim;\r\n var forkPosition = parsePercent$2(shape.forkPosition, 1);\r\n var tmpPoint = [];\r\n tmpPoint[forkDim] = parentPoint[forkDim];\r\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\r\n tmpPoint[forkDim] = firstChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n tmpPoint[forkDim] = lastChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\r\n for (var i = 1; i < childLen - 1; i++) {\r\n var point = childPoints[i];\r\n ctx.moveTo(point[0], point[1]);\r\n tmpPoint[forkDim] = point[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n }\r\n };\r\n return TreePath;\r\n }(Path));\r\n var TreeView = (function (_super) {\r\n __extends(TreeView, _super);\r\n function TreeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreeView.type;\r\n _this._mainGroup = new Group();\r\n return _this;\r\n }\r\n TreeView.prototype.init = function (ecModel, api) {\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: this.group\r\n };\r\n this.group.add(this._mainGroup);\r\n };\r\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var group = this._mainGroup;\r\n var layout = seriesModel.get('layout');\r\n if (layout === 'radial') {\r\n group.x = layoutInfo.x + layoutInfo.width / 2;\r\n group.y = layoutInfo.y + layoutInfo.height / 2;\r\n }\r\n else {\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n }\r\n this._updateViewCoordSys(seriesModel);\r\n this._updateController(seriesModel, ecModel, api);\r\n var oldData = this._data;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (symbolNeedsDraw$1(data, newIdx)) {\r\n updateNode(data, newIdx, null, group, seriesModel);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!symbolNeedsDraw$1(data, newIdx)) {\r\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n return;\r\n }\r\n updateNode(data, newIdx, symbolEl, group, seriesModel);\r\n })\r\n .remove(function (oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (symbolEl) {\r\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n }\r\n })\r\n .execute();\r\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\r\n this._updateNodeAndLinkScale(seriesModel);\r\n if (seriesModel.get('expandAndCollapse') === true) {\r\n data.eachItemGraphicEl(function (el, dataIndex) {\r\n el.off('click').on('click', function () {\r\n api.dispatchAction({\r\n type: 'treeExpandAndCollapse',\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndex\r\n });\r\n });\r\n });\r\n }\r\n this._data = data;\r\n };\r\n TreeView.prototype._updateViewCoordSys = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var points = [];\r\n data.each(function (idx) {\r\n var layout = data.getItemLayout(idx);\r\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\r\n points.push([+layout.x, +layout.y]);\r\n }\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(points, min, max);\r\n var oldMin = this._min;\r\n var oldMax = this._max;\r\n if (max[0] - min[0] === 0) {\r\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\r\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\r\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\r\n }\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n this.group.attr({\r\n x: viewCoordSys.x,\r\n y: viewCoordSys.y,\r\n scaleX: viewCoordSys.scaleX,\r\n scaleY: viewCoordSys.scaleY\r\n });\r\n this._min = min;\r\n this._max = max;\r\n };\r\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale(seriesModel);\r\n api.updateLabelLayout();\r\n });\r\n };\r\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var nodeScale = this._getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = this._nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX || 1;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n };\r\n TreeView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n TreeView.prototype.remove = function () {\r\n this._mainGroup.removeAll();\r\n this._data = null;\r\n };\r\n TreeView.type = 'tree';\r\n return TreeView;\r\n }(ChartView));\r\n function symbolNeedsDraw$1(data, dataIndex) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return layout\r\n && !isNaN(layout.x) && !isNaN(layout.y);\r\n }\r\n function updateNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var isInit = !symbolEl;\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var itemModel = node.getModel();\r\n var visualColor = node.getVisual('style').fill;\r\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0\r\n ? visualColor : '#fff';\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceLayout = source.getLayout();\r\n var sourceOldLayout = sourceSymbolEl\r\n ? {\r\n x: sourceSymbolEl.__oldX,\r\n y: sourceSymbolEl.__oldY,\r\n rawX: sourceSymbolEl.__radialOldRawX,\r\n rawY: sourceSymbolEl.__radialOldRawY\r\n }\r\n : sourceLayout;\r\n var targetLayout = node.getLayout();\r\n if (isInit) {\r\n symbolEl = new Symbol(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n symbolEl.x = sourceOldLayout.x;\r\n symbolEl.y = sourceOldLayout.y;\r\n }\r\n else {\r\n symbolEl.updateData(data, dataIndex, null, {\r\n symbolInnerColor: symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n }\r\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\r\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\r\n symbolEl.__radialRawX = targetLayout.rawX;\r\n symbolEl.__radialRawY = targetLayout.rawY;\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(dataIndex, symbolEl);\r\n symbolEl.__oldX = symbolEl.x;\r\n symbolEl.__oldY = symbolEl.y;\r\n updateProps(symbolEl, {\r\n x: targetLayout.x,\r\n y: targetLayout.y\r\n }, seriesModel);\r\n var symbolPath = symbolEl.getSymbolPath();\r\n if (seriesModel.get('layout') === 'radial') {\r\n var realRoot = virtualRoot.children[0];\r\n var rootLayout = realRoot.getLayout();\r\n var length_1 = realRoot.children.length;\r\n var rad = void 0;\r\n var isLeft = void 0;\r\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\r\n var center = {\r\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\r\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\r\n };\r\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n isLeft = center.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {\r\n isLeft = targetLayout.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n isLeft = targetLayout.x > rootLayout.x;\r\n if (!isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n var normalLabelModel = itemModel.getModel('label');\r\n var rotate = normalLabelModel.get('rotate');\r\n var labelRotateRadian = rotate * (Math.PI / 180);\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n symbolPath.setTextConfig({\r\n position: normalLabelModel.get('position') || textPosition,\r\n rotation: rotate == null ? -rad : labelRotateRadian,\r\n origin: 'center'\r\n });\r\n textContent.setStyle('verticalAlign', 'middle');\r\n }\r\n }\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n if (focusDataIndices) {\r\n getECData(symbolEl).focus = focusDataIndices;\r\n }\r\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\r\n if (symbolEl.__edge) {\r\n symbolEl.onHoverStateChange = function (toState) {\r\n if (toState !== 'blur') {\r\n var parentEl = node.parentNode\r\n && data.getItemGraphicEl(node.parentNode.dataIndex);\r\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\r\n setStatesFlag(symbolEl.__edge, toState);\r\n }\r\n }\r\n };\r\n }\r\n }\r\n function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\r\n var itemModel = node.getModel();\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layout = seriesModel.get('layout');\r\n var orient = seriesModel.getOrient();\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\r\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\r\n var edge = symbolEl.__edge;\r\n if (edgeShape === 'curve') {\r\n if (node.parentNode && node.parentNode !== virtualRoot) {\r\n if (!edge) {\r\n edge = symbolEl.__edge = new BezierCurve({\r\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\r\n }, seriesModel);\r\n }\r\n }\r\n else if (edgeShape === 'polyline') {\r\n if (layout === 'orthogonal') {\r\n if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {\r\n var children = node.children;\r\n var childPoints = [];\r\n for (var i = 0; i < children.length; i++) {\r\n var childLayout = children[i].getLayout();\r\n childPoints.push([childLayout.x, childLayout.y]);\r\n }\r\n if (!edge) {\r\n edge = symbolEl.__edge = new TreePath({\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: [[targetLayout.x, targetLayout.y]],\r\n orient: orient,\r\n forkPosition: edgeForkPosition\r\n }\r\n });\r\n }\r\n updateProps(edge, {\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: childPoints\r\n }\r\n }, seriesModel);\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\r\n }\r\n }\r\n }\r\n if (edge) {\r\n edge.useStyle(defaults({\r\n strokeNoScale: true, fill: null\r\n }, lineStyle));\r\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\r\n setDefaultStateProxy(edge);\r\n group.add(edge);\r\n }\r\n }\r\n function removeNode(data, dataIndex, symbolEl, group, seriesModel) {\r\n var node = data.tree.getNodeByDataIndex(dataIndex);\r\n var virtualRoot = data.tree.root;\r\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n var sourceLayout;\r\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\r\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\r\n }\r\n var removeAnimationOpt = {\r\n duration: seriesModel.get('animationDurationUpdate'),\r\n easing: seriesModel.get('animationEasingUpdate')\r\n };\r\n removeElement(symbolEl, {\r\n x: sourceLayout.x + 1,\r\n y: sourceLayout.y + 1\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(symbolEl);\r\n data.setItemGraphicEl(dataIndex, null);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n symbolEl.fadeOut(null, {\r\n fadeLabel: true,\r\n animation: removeAnimationOpt\r\n });\r\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\r\n var sourceEdge = sourceSymbolEl.__edge;\r\n var edge = symbolEl.__edge\r\n || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);\r\n var edgeShape = seriesModel.get('edgeShape');\r\n var layoutOpt = seriesModel.get('layout');\r\n var orient = seriesModel.get('orient');\r\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n if (edge) {\r\n if (edgeShape === 'curve') {\r\n removeElement(edge, {\r\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\r\n removeElement(edge, {\r\n shape: {\r\n parentPoint: [sourceLayout.x, sourceLayout.y],\r\n childPoints: [[sourceLayout.x, sourceLayout.y]]\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb: function () {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n }\r\n }\r\n function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n var x1;\r\n var x2;\r\n var y1;\r\n var y2;\r\n if (layoutOpt === 'radial') {\r\n x1 = sourceLayout.rawX;\r\n y1 = sourceLayout.rawY;\r\n x2 = targetLayout.rawX;\r\n y2 = targetLayout.rawY;\r\n var radialCoor1 = radialCoordinate(x1, y1);\r\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\r\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\r\n var radialCoor4 = radialCoordinate(x2, y2);\r\n return {\r\n x1: radialCoor1.x || 0,\r\n y1: radialCoor1.y || 0,\r\n x2: radialCoor4.x || 0,\r\n y2: radialCoor4.y || 0,\r\n cpx1: radialCoor2.x || 0,\r\n cpy1: radialCoor2.y || 0,\r\n cpx2: radialCoor3.x || 0,\r\n cpy2: radialCoor3.y || 0\r\n };\r\n }\r\n else {\r\n x1 = sourceLayout.x;\r\n y1 = sourceLayout.y;\r\n x2 = targetLayout.x;\r\n y2 = targetLayout.y;\r\n if (orient === 'LR' || orient === 'RL') {\r\n cpx1 = x1 + (x2 - x1) * curvature;\r\n cpy1 = y1;\r\n cpx2 = x2 + (x1 - x2) * curvature;\r\n cpy2 = y2;\r\n }\r\n if (orient === 'TB' || orient === 'BT') {\r\n cpx1 = x1;\r\n cpy1 = y1 + (y2 - y1) * curvature;\r\n cpx2 = x2;\r\n cpy2 = y2 + (y1 - y2) * curvature;\r\n }\r\n }\r\n return {\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n };\r\n }\r\n ChartView.registerClass(TreeView);\n\n registerAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var dataIndex = payload.dataIndex;\r\n var tree = seriesModel.getData().tree;\r\n var node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n });\r\n registerAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n update: 'none'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\n\n function eachAfter(root, callback, separation) {\r\n var nodes = [root];\r\n var next = [];\r\n var node;\r\n while (node = nodes.pop()) {\r\n next.push(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = 0; i < children.length; i++) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n while (node = next.pop()) {\r\n callback(node, separation);\r\n }\r\n }\r\n function eachBefore(root, callback) {\r\n var nodes = [root];\r\n var node;\r\n while (node = nodes.pop()) {\r\n callback(node);\r\n if (node.isExpand) {\r\n var children = node.children;\r\n if (children.length) {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n }\n\n function treeLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n commonLayout(seriesModel, api);\r\n });\r\n }\r\n function commonLayout(seriesModel, api) {\r\n var layoutInfo = getViewRect$1(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var layout = seriesModel.get('layout');\r\n var width = 0;\r\n var height = 0;\r\n var separation$1 = null;\r\n if (layout === 'radial') {\r\n width = 2 * Math.PI;\r\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\r\n separation$1 = separation(function (node1, node2) {\r\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\r\n });\r\n }\r\n else {\r\n width = layoutInfo.width;\r\n height = layoutInfo.height;\r\n separation$1 = separation();\r\n }\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var realRoot = virtualRoot.children[0];\r\n if (realRoot) {\r\n init$2(virtualRoot);\r\n eachAfter(realRoot, firstWalk, separation$1);\r\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\r\n eachBefore(realRoot, secondWalk);\r\n var left_1 = realRoot;\r\n var right_1 = realRoot;\r\n var bottom_1 = realRoot;\r\n eachBefore(realRoot, function (node) {\r\n var x = node.getLayout().x;\r\n if (x < left_1.getLayout().x) {\r\n left_1 = node;\r\n }\r\n if (x > right_1.getLayout().x) {\r\n right_1 = node;\r\n }\r\n if (node.depth > bottom_1.depth) {\r\n bottom_1 = node;\r\n }\r\n });\r\n var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2;\r\n var tx_1 = delta - left_1.getLayout().x;\r\n var kx_1 = 0;\r\n var ky_1 = 0;\r\n var coorX_1 = 0;\r\n var coorY_1 = 0;\r\n if (layout === 'radial') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = (node.depth - 1) * ky_1;\r\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\r\n node.setLayout({ x: finalCoor.x, y: finalCoor.y, rawX: coorX_1, rawY: coorY_1 }, true);\r\n });\r\n }\r\n else {\r\n var orient_1 = seriesModel.getOrient();\r\n if (orient_1 === 'RL' || orient_1 === 'LR') {\r\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\r\n kx_1 = width / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\r\n coorX_1 = orient_1 === 'LR'\r\n ? (node.depth - 1) * kx_1\r\n : width - (node.depth - 1) * kx_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n else if (orient_1 === 'TB' || orient_1 === 'BT') {\r\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\r\n ky_1 = height / ((bottom_1.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\r\n coorY_1 = orient_1 === 'TB'\r\n ? (node.depth - 1) * ky_1\r\n : height - (node.depth - 1) * ky_1;\r\n node.setLayout({ x: coorX_1, y: coorY_1 }, true);\r\n });\r\n }\r\n }\r\n }\r\n }\n\n function treeVisual(ecModel) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n }\n\n registerLayout(treeLayout);\r\n registerVisual(treeVisual);\n\n function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\r\n if (payload && indexOf(validPayloadTypes, payload.type) >= 0) {\r\n var root = seriesModel.getData().tree.root;\r\n var targetNode = payload.targetNode;\r\n if (typeof targetNode === 'string') {\r\n targetNode = root.getNodeById(targetNode);\r\n }\r\n if (targetNode && root.contains(targetNode)) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n var targetNodeId = payload.targetNodeId;\r\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n }\r\n }\r\n function getPathToRoot(node) {\r\n var path = [];\r\n while (node) {\r\n node = node.parentNode;\r\n node && path.push(node);\r\n }\r\n return path.reverse();\r\n }\r\n function aboveViewRoot(viewRoot, node) {\r\n var viewPath = getPathToRoot(viewRoot);\r\n return indexOf(viewPath, node) >= 0;\r\n }\r\n function wrapTreePathInfo(node, seriesModel) {\r\n var treePathInfo = [];\r\n while (node) {\r\n var nodeDataIndex = node.dataIndex;\r\n treePathInfo.push({\r\n name: node.name,\r\n dataIndex: nodeDataIndex,\r\n value: seriesModel.getRawValue(nodeDataIndex)\r\n });\r\n node = node.parentNode;\r\n }\r\n treePathInfo.reverse();\r\n return treePathInfo;\r\n }\n\n function enableAriaDecalForTree(seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n var decalPaletteScope = {};\r\n tree.eachNode(function (node) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\r\n node.setVisual('decal', decal);\r\n });\r\n }\n\n var TreemapSeriesModel = (function (_super) {\r\n __extends(TreemapSeriesModel, _super);\r\n function TreemapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapSeriesModel.type;\r\n _this.preventUsingHoverLayer = true;\r\n return _this;\r\n }\r\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n completeTreeValue(root);\r\n var levels = option.levels || [];\r\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\r\n var designatedVisualModel = new Model({ itemStyle: designatedVisualItemStyle }, this, ecModel);\r\n levels = option.levels = setDefault(levels, ecModel);\r\n var levelModels = map(levels || [], function (levelDefine) {\r\n return new Model(levelDefine, designatedVisualModel, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n model.parentModel = levelModel || designatedVisualModel;\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n TreemapSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var name = data.getName(dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\r\n this.layoutInfo = this.layoutInfo || {};\r\n extend(this.layoutInfo, layoutInfo);\r\n };\r\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\r\n var idIndexMap = this._idIndexMap;\r\n if (!idIndexMap) {\r\n idIndexMap = this._idIndexMap = createHashMap();\r\n this._idIndexMapCount = 0;\r\n }\r\n var index = idIndexMap.get(id);\r\n if (index == null) {\r\n idIndexMap.set(id, index = this._idIndexMapCount++);\r\n }\r\n return index;\r\n };\r\n TreemapSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n TreemapSeriesModel.type = 'series.treemap';\r\n TreemapSeriesModel.layoutMode = 'box';\r\n TreemapSeriesModel.defaultOption = {\r\n progressive: 0,\r\n left: 'center',\r\n top: 'middle',\r\n width: '80%',\r\n height: '80%',\r\n sort: true,\r\n clipWindow: 'origin',\r\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\r\n leafDepth: null,\r\n drillDownIcon: '▶',\r\n zoomToNodeRatio: 0.32 * 0.32,\r\n roam: true,\r\n nodeClick: 'zoomToNode',\r\n animation: true,\r\n animationDurationUpdate: 900,\r\n animationEasing: 'quinticInOut',\r\n breadcrumb: {\r\n show: true,\r\n height: 22,\r\n left: 'center',\r\n top: 'bottom',\r\n emptyItemWidth: 25,\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.7)',\r\n textStyle: {\r\n color: '#fff'\r\n }\r\n }\r\n },\r\n label: {\r\n show: true,\r\n distance: 0,\r\n padding: 5,\r\n position: 'inside',\r\n color: '#fff',\r\n overflow: 'truncate'\r\n },\r\n upperLabel: {\r\n show: false,\r\n position: [0, '50%'],\r\n height: 20,\r\n overflow: 'truncate',\r\n verticalAlign: 'middle'\r\n },\r\n itemStyle: {\r\n color: null,\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n borderWidth: 0,\r\n gapWidth: 0,\r\n borderColor: '#fff',\r\n borderColorSaturation: null\r\n },\r\n emphasis: {\r\n upperLabel: {\r\n show: true,\r\n position: [0, '50%'],\r\n ellipsis: true,\r\n verticalAlign: 'middle'\r\n }\r\n },\r\n visualDimension: 0,\r\n visualMin: null,\r\n visualMax: null,\r\n color: [],\r\n colorAlpha: null,\r\n colorSaturation: null,\r\n colorMappingBy: 'index',\r\n visibleMin: 10,\r\n childrenVisibleMin: null,\r\n levels: []\r\n };\r\n return TreemapSeriesModel;\r\n }(SeriesModel));\r\n function completeTreeValue(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n }\r\n function setDefault(levels, ecModel) {\r\n var globalColorList = normalizeToArray(ecModel.get('color'));\r\n var globalDecalList = normalizeToArray(ecModel.get('decals'));\r\n if (!globalColorList) {\r\n return;\r\n }\r\n levels = levels || [];\r\n var hasColorDefine;\r\n var hasDecalDefine;\r\n each(levels, function (levelDefine) {\r\n var model = new Model(levelDefine);\r\n var modelColor = model.get('color');\r\n var modelDecal = model.get('decal');\r\n if (model.get(['itemStyle', 'color'])\r\n || (modelColor && modelColor !== 'none')) {\r\n hasColorDefine = true;\r\n }\r\n if (model.get(['itemStyle', 'decal'])\r\n || (modelDecal && modelDecal !== 'none')) {\r\n hasDecalDefine = true;\r\n }\r\n });\r\n var level0 = levels[0] || (levels[0] = {});\r\n if (!hasColorDefine) {\r\n level0.color = globalColorList.slice();\r\n }\r\n if (!hasDecalDefine && globalDecalList) {\r\n level0.decal = globalDecalList.slice();\r\n }\r\n return levels;\r\n }\r\n SeriesModel.registerClass(TreemapSeriesModel);\n\n var TEXT_PADDING = 8;\r\n var ITEM_GAP = 8;\r\n var ARRAY_LENGTH = 5;\r\n var Breadcrumb = (function () {\r\n function Breadcrumb(containerGroup) {\r\n this.group = new Group();\r\n containerGroup.add(this.group);\r\n }\r\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\r\n var model = seriesModel.getModel('breadcrumb');\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n var normalStyleModel = model.getModel('itemStyle');\r\n var textStyleModel = normalStyleModel.getModel('textStyle');\r\n var layoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\r\n positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n };\r\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\r\n for (var node = targetNode; node; node = node.parentNode) {\r\n var text = convertOptionIdName(node.getModel().get('name'), '');\r\n var textRect = textStyleModel.getTextRect(text);\r\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n };\r\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\r\n var lastX = 0;\r\n var emptyItemWidth = layoutParam.emptyItemWidth;\r\n var height = seriesModel.get(['breadcrumb', 'height']);\r\n var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box);\r\n var totalWidth = layoutParam.totalWidth;\r\n var renderList = layoutParam.renderList;\r\n for (var i = renderList.length - 1; i >= 0; i--) {\r\n var item = renderList[i];\r\n var itemNode = item.node;\r\n var itemWidth = item.width;\r\n var text = item.text;\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n var el = new Polygon({\r\n shape: {\r\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\r\n },\r\n style: defaults(normalStyleModel.getItemStyle(), {\r\n lineJoin: 'bevel'\r\n }),\r\n textContent: new ZRText({\r\n style: {\r\n text: text,\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z: 10,\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n el.disableLabelAnimation = true;\r\n this.group.add(el);\r\n packEventData(el, seriesModel, itemNode);\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n };\r\n Breadcrumb.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n return Breadcrumb;\r\n }());\r\n function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\r\n var points = [\r\n [head ? x : x - ARRAY_LENGTH, y],\r\n [x + itemWidth, y],\r\n [x + itemWidth, y + itemHeight],\r\n [head ? x : x - ARRAY_LENGTH, y + itemHeight]\r\n ];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n }\r\n function packEventData(el, seriesModel, itemNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.componentIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb',\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n }\n\n var AnimationWrap = (function () {\r\n function AnimationWrap() {\r\n this._storage = [];\r\n this._elExistsMap = {};\r\n }\r\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\r\n if (this._elExistsMap[el.id]) {\r\n return false;\r\n }\r\n this._elExistsMap[el.id] = true;\r\n this._storage.push({\r\n el: el,\r\n target: target,\r\n duration: duration,\r\n delay: delay,\r\n easing: easing\r\n });\r\n return true;\r\n };\r\n AnimationWrap.prototype.finished = function (callback) {\r\n this._finishedCallback = callback;\r\n return this;\r\n };\r\n AnimationWrap.prototype.start = function () {\r\n var _this = this;\r\n var count = this._storage.length;\r\n var checkTerminate = function () {\r\n count--;\r\n if (count <= 0) {\r\n _this._storage.length = 0;\r\n _this._elExistsMap = {};\r\n _this._finishedCallback && _this._finishedCallback();\r\n }\r\n };\r\n for (var i = 0, len = this._storage.length; i < len; i++) {\r\n var item = this._storage[i];\r\n item.el.animateTo(item.target, {\r\n duration: item.duration,\r\n delay: item.delay,\r\n easing: item.easing,\r\n setToFinal: true,\r\n done: checkTerminate,\r\n aborted: checkTerminate\r\n });\r\n }\r\n return this;\r\n };\r\n return AnimationWrap;\r\n }());\r\n function createWrap() {\r\n return new AnimationWrap();\r\n }\n\n var Group$1 = Group;\r\n var Rect$1 = Rect;\r\n var DRAG_THRESHOLD = 3;\r\n var PATH_LABEL_NOAMAL = 'label';\r\n var PATH_UPPERLABEL_NORMAL = 'upperLabel';\r\n var Z_BASE = 10;\r\n var Z_BG = 1;\r\n var Z_CONTENT = 2;\r\n var getStateItemStyle = makeStyleMapper([\r\n ['fill', 'color'],\r\n ['stroke', 'strokeColor'],\r\n ['lineWidth', 'strokeWidth'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor']\r\n ]);\r\n var getItemStyleNormal = function (model) {\r\n var itemStyle = getStateItemStyle(model);\r\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\r\n return itemStyle;\r\n };\r\n var inner$9 = makeInner();\r\n var TreemapView = (function (_super) {\r\n __extends(TreemapView, _super);\r\n function TreemapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TreemapView.type;\r\n _this._state = 'ready';\r\n _this._storage = createStorage();\r\n return _this;\r\n }\r\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var models = ecModel.findComponents({\r\n mainType: 'series', subType: 'treemap', query: payload\r\n });\r\n if (indexOf(models, seriesModel) < 0) {\r\n return;\r\n }\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var payloadType = payload && payload.type;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var isInit = !this._oldTree;\r\n var thisStorage = this._storage;\r\n var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)\r\n ? {\r\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\r\n direction: payload.direction\r\n }\r\n : null;\r\n var containerGroup = this._giveContainerGroup(layoutInfo);\r\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\r\n (!isInit && (!payloadType\r\n || payloadType === 'treemapZoomToNode'\r\n || payloadType === 'treemapRootToNode'))\r\n ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)\r\n : renderResult.renderFinally();\r\n this._resetController(api);\r\n this._renderBreadcrumb(seriesModel, api, targetInfo);\r\n };\r\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\r\n var containerGroup = this._containerGroup;\r\n if (!containerGroup) {\r\n containerGroup = this._containerGroup = new Group$1();\r\n this._initEvents(containerGroup);\r\n this.group.add(containerGroup);\r\n }\r\n containerGroup.x = layoutInfo.x;\r\n containerGroup.y = layoutInfo.y;\r\n return containerGroup;\r\n };\r\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\r\n var thisTree = seriesModel.getData().tree;\r\n var oldTree = this._oldTree;\r\n var lastsForAnimation = createStorage();\r\n var thisStorage = createStorage();\r\n var oldStorage = this._storage;\r\n var willInvisibleEls = [];\r\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\r\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\r\n }\r\n dualTravel(thisTree.root ? [thisTree.root] : [], (oldTree && oldTree.root) ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\r\n var willDeleteEls = clearStorage(oldStorage);\r\n this._oldTree = thisTree;\r\n this._storage = thisStorage;\r\n return {\r\n lastsForAnimation: lastsForAnimation,\r\n willDeleteEls: willDeleteEls,\r\n renderFinally: renderFinally\r\n };\r\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\r\n if (sameTree) {\r\n oldViewChildren = thisViewChildren;\r\n each(thisViewChildren, function (child, index) {\r\n !child.isRemoved() && processNode(index, index);\r\n });\r\n }\r\n else {\r\n (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n }\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIndex, oldIndex) {\r\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\r\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\r\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\r\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\r\n }\r\n }\r\n function clearStorage(storage) {\r\n var willDeleteEls = createStorage();\r\n storage && each(storage, function (store, storageName) {\r\n var delEls = willDeleteEls[storageName];\r\n each(store, function (el) {\r\n el && (delEls.push(el), inner$9(el).willDelete = true);\r\n });\r\n });\r\n return willDeleteEls;\r\n }\r\n function renderFinally() {\r\n each(willDeleteEls, function (els) {\r\n each(els, function (el) {\r\n el.parent && el.parent.remove(el);\r\n });\r\n });\r\n each(willInvisibleEls, function (el) {\r\n el.invisible = true;\r\n el.dirty();\r\n });\r\n }\r\n };\r\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\r\n if (!seriesModel.get('animation')) {\r\n return;\r\n }\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n var easingOption = seriesModel.get('animationEasing');\r\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\r\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\r\n var animationWrap = createWrap();\r\n each(renderResult.willDeleteEls, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n if (el.invisible) {\r\n return;\r\n }\r\n var parent = el.parent;\r\n var target;\r\n var innerStore = inner$9(parent);\r\n if (reRoot && reRoot.direction === 'drillDown') {\r\n target = parent === reRoot.rootNodeGroup\r\n ? {\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: innerStore.nodeWidth,\r\n height: innerStore.nodeHeight\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }\r\n : { style: { opacity: 0 } };\r\n }\r\n else {\r\n var targetX = 0;\r\n var targetY = 0;\r\n if (!innerStore.willDelete) {\r\n targetX = innerStore.nodeWidth / 2;\r\n targetY = innerStore.nodeHeight / 2;\r\n }\r\n target = storageName === 'nodeGroup'\r\n ? { x: targetX, y: targetY, style: { opacity: 0 } }\r\n : {\r\n shape: { x: targetX, y: targetY, width: 0, height: 0 },\r\n style: { opacity: 0 }\r\n };\r\n }\r\n target && animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n });\r\n each(this._storage, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\r\n var target = {};\r\n if (!last) {\r\n return;\r\n }\r\n if (el instanceof Group) {\r\n if (last.oldX != null) {\r\n target.x = el.x;\r\n target.y = el.y;\r\n el.x = last.oldX;\r\n el.y = last.oldY;\r\n }\r\n }\r\n else {\r\n if (last.oldShape) {\r\n target.shape = extend({}, el.shape);\r\n el.setShape(last.oldShape);\r\n }\r\n if (last.fadein) {\r\n el.setStyle('opacity', 0);\r\n target.style = { opacity: 1 };\r\n }\r\n else if (el.style.opacity !== 1) {\r\n target.style = { opacity: 1 };\r\n }\r\n }\r\n animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n }, this);\r\n this._state = 'animating';\r\n animationWrap\r\n .finished(bind(function () {\r\n this._state = 'ready';\r\n renderResult.renderFinally();\r\n }, this))\r\n .start();\r\n };\r\n TreemapView.prototype._resetController = function (api) {\r\n var controller = this._controller;\r\n if (!controller) {\r\n controller = this._controller = new RoamController(api.getZr());\r\n controller.enable(this.seriesModel.get('roam'));\r\n controller.on('pan', bind(this._onPan, this));\r\n controller.on('zoom', bind(this._onZoom, this));\r\n }\r\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\r\n controller.setPointerChecker(function (e, x, y) {\r\n return rect.contain(x, y);\r\n });\r\n };\r\n TreemapView.prototype._clearController = function () {\r\n var controller = this._controller;\r\n if (controller) {\r\n controller.dispose();\r\n controller = null;\r\n }\r\n };\r\n TreemapView.prototype._onPan = function (e) {\r\n if (this._state !== 'animating'\r\n && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n this.api.dispatchAction({\r\n type: 'treemapMove',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rootLayout.x + e.dx, y: rootLayout.y + e.dy,\r\n width: rootLayout.width, height: rootLayout.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._onZoom = function (e) {\r\n var mouseX = e.originX;\r\n var mouseY = e.originY;\r\n if (this._state !== 'animating') {\r\n var root = this.seriesModel.getData().tree.root;\r\n if (!root) {\r\n return;\r\n }\r\n var rootLayout = root.getLayout();\r\n if (!rootLayout) {\r\n return;\r\n }\r\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\r\n var layoutInfo = this.seriesModel.layoutInfo;\r\n mouseX -= layoutInfo.x;\r\n mouseY -= layoutInfo.y;\r\n var m = create$1();\r\n translate(m, m, [-mouseX, -mouseY]);\r\n scale$1(m, m, [e.scale, e.scale]);\r\n translate(m, m, [mouseX, mouseY]);\r\n rect.applyTransform(m);\r\n this.api.dispatchAction({\r\n type: 'treemapRender',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rect.x, y: rect.y,\r\n width: rect.width, height: rect.height\r\n }\r\n });\r\n }\r\n };\r\n TreemapView.prototype._initEvents = function (containerGroup) {\r\n var _this = this;\r\n containerGroup.on('click', function (e) {\r\n if (_this._state !== 'ready') {\r\n return;\r\n }\r\n var nodeClick = _this.seriesModel.get('nodeClick', true);\r\n if (!nodeClick) {\r\n return;\r\n }\r\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\r\n if (!targetInfo) {\r\n return;\r\n }\r\n var node = targetInfo.node;\r\n if (node.getLayout().isLeafRoot) {\r\n _this._rootToNode(targetInfo);\r\n }\r\n else {\r\n if (nodeClick === 'zoomToNode') {\r\n _this._zoomToNode(targetInfo);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\r\n var link = itemModel.get('link', true);\r\n var linkTarget = itemModel.get('target', true) || 'blank';\r\n link && windowOpen(link, linkTarget);\r\n }\r\n }\r\n }, this);\r\n };\r\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\r\n var _this = this;\r\n if (!targetInfo) {\r\n targetInfo = seriesModel.get('leafDepth', true) != null\r\n ? { node: seriesModel.getViewRoot() }\r\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\r\n if (!targetInfo) {\r\n targetInfo = { node: seriesModel.getData().tree.root };\r\n }\r\n }\r\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group)))\r\n .render(seriesModel, api, targetInfo.node, function (node) {\r\n if (_this._state !== 'animating') {\r\n aboveViewRoot(seriesModel.getViewRoot(), node)\r\n ? _this._rootToNode({ node: node })\r\n : _this._zoomToNode({ node: node });\r\n }\r\n });\r\n };\r\n TreemapView.prototype.remove = function () {\r\n this._clearController();\r\n this._containerGroup && this._containerGroup.removeAll();\r\n this._storage = createStorage();\r\n this._state = 'ready';\r\n this._breadcrumb && this._breadcrumb.remove();\r\n };\r\n TreemapView.prototype.dispose = function () {\r\n this._clearController();\r\n };\r\n TreemapView.prototype._zoomToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapZoomToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype._rootToNode = function (targetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapRootToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n };\r\n TreemapView.prototype.findTarget = function (x, y) {\r\n var targetInfo;\r\n var viewRoot = this.seriesModel.getViewRoot();\r\n viewRoot.eachNode({ attr: 'viewChildren', order: 'preorder' }, function (node) {\r\n var bgEl = this._storage.background[node.getRawIndex()];\r\n if (bgEl) {\r\n var point = bgEl.transformCoordToLocal(x, y);\r\n var shape = bgEl.shape;\r\n if (shape.x <= point[0]\r\n && point[0] <= shape.x + shape.width\r\n && shape.y <= point[1]\r\n && point[1] <= shape.y + shape.height) {\r\n targetInfo = {\r\n node: node,\r\n offsetX: point[0],\r\n offsetY: point[1]\r\n };\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }, this);\r\n return targetInfo;\r\n };\r\n TreemapView.type = 'treemap';\r\n return TreemapView;\r\n }(ChartView));\r\n function createStorage() {\r\n return {\r\n nodeGroup: [],\r\n background: [],\r\n content: []\r\n };\r\n }\r\n function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\r\n if (!thisNode) {\r\n return;\r\n }\r\n var thisLayout = thisNode.getLayout();\r\n var data = seriesModel.getData();\r\n var nodeModel = thisNode.getModel();\r\n data.setItemGraphicEl(thisNode.dataIndex, null);\r\n if (!thisLayout || !thisLayout.isInView) {\r\n return;\r\n }\r\n var thisWidth = thisLayout.width;\r\n var thisHeight = thisLayout.height;\r\n var borderWidth = thisLayout.borderWidth;\r\n var thisInvisible = thisLayout.invisible;\r\n var thisRawIndex = thisNode.getRawIndex();\r\n var oldRawIndex = oldNode && oldNode.getRawIndex();\r\n var thisViewChildren = thisNode.viewChildren;\r\n var upperHeight = thisLayout.upperHeight;\r\n var isParent = thisViewChildren && thisViewChildren.length;\r\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\r\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\r\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\r\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\r\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\r\n var group = giveGraphic('nodeGroup', Group$1);\r\n if (!group) {\r\n return;\r\n }\r\n parentGroup.add(group);\r\n group.x = thisLayout.x || 0;\r\n group.y = thisLayout.y || 0;\r\n group.markRedraw();\r\n inner$9(group).nodeWidth = thisWidth;\r\n inner$9(group).nodeHeight = thisHeight;\r\n if (thisLayout.isAboveViewRoot) {\r\n return group;\r\n }\r\n var bg = giveGraphic('background', Rect$1, depth, Z_BG);\r\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\r\n var focus = nodeModel.get(['emphasis', 'focus']);\r\n var blurScope = nodeModel.get(['emphasis', 'blurScope']);\r\n var focusDataIndices = focus === 'ancestor'\r\n ? thisNode.getAncestorsIndices()\r\n : focus === 'descendant' ? thisNode.getDescendantIndices() : null;\r\n if (isParent) {\r\n if (isHighDownDispatcher(group)) {\r\n setAsHighDownDispatcher(group, false);\r\n }\r\n if (bg) {\r\n setAsHighDownDispatcher(bg, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, bg);\r\n enableHoverFocus(bg, focusDataIndices || focus, blurScope);\r\n }\r\n }\r\n else {\r\n var content = giveGraphic('content', Rect$1, depth, Z_CONTENT);\r\n content && renderContent(group, content);\r\n if (bg && isHighDownDispatcher(bg)) {\r\n setAsHighDownDispatcher(bg, false);\r\n }\r\n setAsHighDownDispatcher(group, true);\r\n data.setItemGraphicEl(thisNode.dataIndex, group);\r\n enableHoverFocus(group, focusDataIndices || focus, blurScope);\r\n }\r\n return group;\r\n function renderBackground(group, bg, useUpperLabel) {\r\n var ecData = getECData(bg);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius });\r\n if (thisInvisible) {\r\n processInvisible(bg);\r\n }\r\n else {\r\n bg.invisible = false;\r\n var style = thisNode.getVisual('style');\r\n var visualBorderColor = style.stroke;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualBorderColor;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\r\n if (useUpperLabel) {\r\n var upperLabelWidth = thisWidth - 2 * borderWidth;\r\n prepareText(bg, visualBorderColor, upperLabelWidth, upperHeight, style.opacity, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight });\r\n }\r\n else {\r\n bg.removeTextContent();\r\n }\r\n bg.setStyle(normalStyle);\r\n bg.ensureState('emphasis').style = emphasisStyle;\r\n bg.ensureState('blur').style = blurStyle;\r\n bg.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(bg);\r\n }\r\n group.add(bg);\r\n }\r\n function renderContent(group, content) {\r\n var ecData = getECData(content);\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\r\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\r\n content.culling = true;\r\n content.setShape({\r\n x: borderWidth,\r\n y: borderWidth,\r\n width: contentWidth,\r\n height: contentHeight,\r\n r: borderRadius\r\n });\r\n if (thisInvisible) {\r\n processInvisible(content);\r\n }\r\n else {\r\n content.invisible = false;\r\n var nodeStyle = thisNode.getVisual('style');\r\n var visualColor = nodeStyle.fill;\r\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualColor;\r\n normalStyle.decal = nodeStyle.decal;\r\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n prepareText(content, visualColor, contentWidth, nodeStyle.opacity);\r\n content.setStyle(normalStyle);\r\n content.ensureState('emphasis').style = emphasisStyle;\r\n content.ensureState('blur').style = blurStyle;\r\n content.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(content);\r\n }\r\n group.add(content);\r\n }\r\n function processInvisible(element) {\r\n !element.invisible && willInvisibleEls.push(element);\r\n }\r\n function prepareText(rectEl, visualColor, visualOpacity, width, height, upperLabelRect) {\r\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\r\n var text = retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, normalLabelModel.get('formatter')), convertOptionIdName(nodeModel.get('name'), null));\r\n if (!upperLabelRect && thisLayout.isLeafRoot) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n var isShow = normalLabelModel.getShallow('show');\r\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\r\n defaultText: isShow ? text : null,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: thisNode.dataIndex\r\n });\r\n var textEl = rectEl.getTextContent();\r\n var textStyle = textEl.style;\r\n var textPadding = normalizeCssArray(textStyle.padding || 0);\r\n if (upperLabelRect) {\r\n rectEl.setTextConfig({\r\n layoutRect: upperLabelRect\r\n });\r\n textEl.disableLabelLayout = true;\r\n }\r\n textEl.beforeUpdate = function () {\r\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\r\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\r\n if (textStyle.width !== width || textStyle.height !== height) {\r\n textEl.setStyle({\r\n width: width,\r\n height: height\r\n });\r\n }\r\n };\r\n textStyle.truncateMinChar = 2;\r\n textStyle.lineOverflow = 'truncate';\r\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\r\n var textEmphasisState = textEl.getState('emphasis');\r\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\r\n }\r\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\r\n var text = style ? style.text : null;\r\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\r\n var iconChar = seriesModel.get('drillDownIcon', true);\r\n style.text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n }\r\n function giveGraphic(storageName, Ctor, depth, z) {\r\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\r\n var lasts = lastsForAnimation[storageName];\r\n if (element) {\r\n oldStorage[storageName][oldRawIndex] = null;\r\n prepareAnimationWhenHasOld(lasts, element);\r\n }\r\n else if (!thisInvisible) {\r\n element = new Ctor();\r\n if (element instanceof Displayable) {\r\n element.z = calculateZ(depth, z);\r\n }\r\n prepareAnimationWhenNoOld(lasts, element);\r\n }\r\n return (thisStorage[storageName][thisRawIndex] = element);\r\n }\r\n function prepareAnimationWhenHasOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n if (element instanceof Group$1) {\r\n lastCfg.oldX = element.x;\r\n lastCfg.oldY = element.y;\r\n }\r\n else {\r\n lastCfg.oldShape = extend({}, element.shape);\r\n }\r\n }\r\n function prepareAnimationWhenNoOld(lasts, element) {\r\n var lastCfg = lasts[thisRawIndex] = {};\r\n var parentNode = thisNode.parentNode;\r\n var isGroup = element instanceof Group;\r\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\r\n var parentOldX = 0;\r\n var parentOldY = 0;\r\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\r\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\r\n parentOldX = parentOldBg.oldShape.width;\r\n parentOldY = parentOldBg.oldShape.height;\r\n }\r\n if (isGroup) {\r\n lastCfg.oldX = 0;\r\n lastCfg.oldY = parentOldY;\r\n }\r\n else {\r\n lastCfg.oldShape = { x: parentOldX, y: parentOldY, width: 0, height: 0 };\r\n }\r\n }\r\n lastCfg.fadein = !isGroup;\r\n }\r\n }\r\n function calculateZ(depth, zInLevel) {\r\n var zb = depth * Z_BASE + zInLevel;\r\n return (zb - 1) / zb;\r\n }\r\n ChartView.registerClass(TreemapView);\n\n var noop$1 = function () { };\r\n var actionTypes = [\r\n 'treemapZoomToNode',\r\n 'treemapRender',\r\n 'treemapMove'\r\n ];\r\n for (var i$1 = 0; i$1 < actionTypes.length; i$1++) {\r\n registerAction({\r\n type: actionTypes[i$1],\r\n update: 'updateView'\r\n }, noop$1);\r\n }\r\n registerAction({ type: 'treemapRootToNode', update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'treemap', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n });\n\n var each$4 = each;\r\n var isObject$4 = isObject;\r\n var CATEGORY_DEFAULT_VISUAL_INDEX = -1;\r\n var VisualMapping = (function () {\r\n function VisualMapping(option) {\r\n var mappingMethod = option.mappingMethod;\r\n var visualType = option.type;\r\n var thisOption = this.option = clone(option);\r\n this.type = visualType;\r\n this.mappingMethod = mappingMethod;\r\n this._normalizeData = normalizers[mappingMethod];\r\n var visualHandler = VisualMapping.visualHandlers[visualType];\r\n this.applyVisual = visualHandler.applyVisual;\r\n this.getColorMapper = visualHandler.getColorMapper;\r\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\r\n if (mappingMethod === 'piecewise') {\r\n normalizeVisualRange(thisOption);\r\n preprocessForPiecewise(thisOption);\r\n }\r\n else if (mappingMethod === 'category') {\r\n thisOption.categories\r\n ? preprocessForSpecifiedCategory(thisOption)\r\n : normalizeVisualRange(thisOption, true);\r\n }\r\n else {\r\n assert(mappingMethod !== 'linear' || thisOption.dataExtent);\r\n normalizeVisualRange(thisOption);\r\n }\r\n }\r\n VisualMapping.prototype.mapValueToVisual = function (value) {\r\n var normalized = this._normalizeData(value);\r\n return this._normalizedToVisual(normalized, value);\r\n };\r\n VisualMapping.prototype.getNormalizer = function () {\r\n return bind(this._normalizeData, this);\r\n };\r\n VisualMapping.listVisualTypes = function () {\r\n return keys(VisualMapping.visualHandlers);\r\n };\r\n VisualMapping.isValidType = function (visualType) {\r\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\r\n };\r\n VisualMapping.eachVisual = function (visual, callback, context) {\r\n if (isObject(visual)) {\r\n each(visual, callback, context);\r\n }\r\n else {\r\n callback.call(context, visual);\r\n }\r\n };\r\n VisualMapping.mapVisual = function (visual, callback, context) {\r\n var isPrimary;\r\n var newVisual = isArray(visual)\r\n ? []\r\n : isObject(visual)\r\n ? {}\r\n : (isPrimary = true, null);\r\n VisualMapping.eachVisual(visual, function (v, key) {\r\n var newVal = callback.call(context, v, key);\r\n isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal);\r\n });\r\n return newVisual;\r\n };\r\n VisualMapping.retrieveVisuals = function (obj) {\r\n var ret = {};\r\n var hasVisual;\r\n obj && each$4(VisualMapping.visualHandlers, function (h, visualType) {\r\n if (obj.hasOwnProperty(visualType)) {\r\n ret[visualType] = obj[visualType];\r\n hasVisual = true;\r\n }\r\n });\r\n return hasVisual ? ret : null;\r\n };\r\n VisualMapping.prepareVisualTypes = function (visualTypes) {\r\n if (isArray(visualTypes)) {\r\n visualTypes = visualTypes.slice();\r\n }\r\n else if (isObject$4(visualTypes)) {\r\n var types_1 = [];\r\n each$4(visualTypes, function (item, type) {\r\n types_1.push(type);\r\n });\r\n visualTypes = types_1;\r\n }\r\n else {\r\n return [];\r\n }\r\n visualTypes.sort(function (type1, type2) {\r\n return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)\r\n ? 1 : -1;\r\n });\r\n return visualTypes;\r\n };\r\n VisualMapping.dependsOn = function (visualType1, visualType2) {\r\n return visualType2 === 'color'\r\n ? !!(visualType1 && visualType1.indexOf(visualType2) === 0)\r\n : visualType1 === visualType2;\r\n };\r\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\r\n var possibleI;\r\n var abs = Infinity;\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var pieceValue = pieceList[i].value;\r\n if (pieceValue != null) {\r\n if (pieceValue === value\r\n || (typeof pieceValue === 'string' && pieceValue === value + '')) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(pieceValue, i);\r\n }\r\n }\r\n for (var i = 0, len = pieceList.length; i < len; i++) {\r\n var piece = pieceList[i];\r\n var interval = piece.interval;\r\n var close_1 = piece.close;\r\n if (interval) {\r\n if (interval[0] === -Infinity) {\r\n if (littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n }\r\n else if (interval[1] === Infinity) {\r\n if (littleThan(close_1[0], interval[0], value)) {\r\n return i;\r\n }\r\n }\r\n else if (littleThan(close_1[0], interval[0], value)\r\n && littleThan(close_1[1], value, interval[1])) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(interval[0], i);\r\n findClosestWhenOutside && updatePossible(interval[1], i);\r\n }\r\n }\r\n if (findClosestWhenOutside) {\r\n return value === Infinity\r\n ? pieceList.length - 1\r\n : value === -Infinity\r\n ? 0\r\n : possibleI;\r\n }\r\n function updatePossible(val, index) {\r\n var newAbs = Math.abs(val - value);\r\n if (newAbs < abs) {\r\n abs = newAbs;\r\n possibleI = index;\r\n }\r\n }\r\n };\r\n VisualMapping.visualHandlers = {\r\n color: {\r\n applyVisual: makeApplyVisual('color'),\r\n getColorMapper: function () {\r\n var thisOption = this.option;\r\n return bind(thisOption.mappingMethod === 'category'\r\n ? function (value, isNormalized) {\r\n !isNormalized && (value = this._normalizeData(value));\r\n return doMapCategory.call(this, value);\r\n }\r\n : function (value, isNormalized, out) {\r\n var returnRGBArray = !!out;\r\n !isNormalized && (value = this._normalizeData(value));\r\n out = fastLerp(value, thisOption.parsedVisual, out);\r\n return returnRGBArray ? out : stringify(out, 'rgba');\r\n }, this);\r\n },\r\n _normalizedToVisual: {\r\n linear: function (normalized) {\r\n return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba');\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n colorHue: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, value);\r\n }),\r\n colorSaturation: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, value);\r\n }),\r\n colorLightness: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyHSL(color$1, null, null, value);\r\n }),\r\n colorAlpha: makePartialColorVisualHandler(function (color$1, value) {\r\n return modifyAlpha(color$1, value);\r\n }),\r\n decal: {\r\n applyVisual: makeApplyVisual('decal'),\r\n _normalizedToVisual: {\r\n linear: null,\r\n category: doMapCategory,\r\n piecewise: null,\r\n fixed: null\r\n }\r\n },\r\n opacity: {\r\n applyVisual: makeApplyVisual('opacity'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n },\r\n liftZ: {\r\n applyVisual: makeApplyVisual('liftZ'),\r\n _normalizedToVisual: {\r\n linear: doMapFixed,\r\n category: doMapFixed,\r\n piecewise: doMapFixed,\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbol: {\r\n applyVisual: function (value, getter, setter) {\r\n var symbolCfg = this.mapValueToVisual(value);\r\n setter('symbol', symbolCfg);\r\n },\r\n _normalizedToVisual: {\r\n linear: doMapToArray,\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = doMapToArray.call(this, normalized);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n symbolSize: {\r\n applyVisual: makeApplyVisual('symbolSize'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n }\r\n };\r\n return VisualMapping;\r\n }());\r\n function preprocessForPiecewise(thisOption) {\r\n var pieceList = thisOption.pieceList;\r\n thisOption.hasSpecialVisual = false;\r\n each(pieceList, function (piece, index) {\r\n piece.originIndex = index;\r\n if (piece.visual != null) {\r\n thisOption.hasSpecialVisual = true;\r\n }\r\n });\r\n }\r\n function preprocessForSpecifiedCategory(thisOption) {\r\n var categories = thisOption.categories;\r\n var categoryMap = thisOption.categoryMap = {};\r\n var visual = thisOption.visual;\r\n each$4(categories, function (cate, index) {\r\n categoryMap[cate] = index;\r\n });\r\n if (!isArray(visual)) {\r\n var visualArr_1 = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v, cate) {\r\n var index = categoryMap[cate];\r\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\r\n });\r\n }\r\n else {\r\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\r\n }\r\n visual = setVisualToOption(thisOption, visualArr_1);\r\n }\r\n for (var i = categories.length - 1; i >= 0; i--) {\r\n if (visual[i] == null) {\r\n delete categoryMap[categories[i]];\r\n categories.pop();\r\n }\r\n }\r\n }\r\n function normalizeVisualRange(thisOption, isCategory) {\r\n var visual = thisOption.visual;\r\n var visualArr = [];\r\n if (isObject(visual)) {\r\n each$4(visual, function (v) {\r\n visualArr.push(v);\r\n });\r\n }\r\n else if (visual != null) {\r\n visualArr.push(visual);\r\n }\r\n var doNotNeedPair = { color: 1, symbol: 1 };\r\n if (!isCategory\r\n && visualArr.length === 1\r\n && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\r\n visualArr[1] = visualArr[0];\r\n }\r\n setVisualToOption(thisOption, visualArr);\r\n }\r\n function makePartialColorVisualHandler(applyValue) {\r\n return {\r\n applyVisual: function (value, getter, setter) {\r\n var colorChannel = this.mapValueToVisual(value);\r\n setter('color', applyValue(getter('color'), colorChannel));\r\n },\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n };\r\n }\r\n function doMapToArray(normalized) {\r\n var visual = this.option.visual;\r\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};\r\n }\r\n function makeApplyVisual(visualType) {\r\n return function (value, getter, setter) {\r\n setter(visualType, this.mapValueToVisual(value));\r\n };\r\n }\r\n function doMapCategory(normalized) {\r\n var visual = this.option.visual;\r\n return visual[(this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)\r\n ? normalized % visual.length\r\n : normalized];\r\n }\r\n function doMapFixed() {\r\n return this.option.visual[0];\r\n }\r\n function createNormalizedToNumericVisual(sourceExtent) {\r\n return {\r\n linear: function (normalized) {\r\n return linearMap(normalized, sourceExtent, this.option.visual, true);\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n var result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n };\r\n }\r\n function getSpecifiedVisual(value) {\r\n var thisOption = this.option;\r\n var pieceList = thisOption.pieceList;\r\n if (thisOption.hasSpecialVisual) {\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\r\n var piece = pieceList[pieceIndex];\r\n if (piece && piece.visual) {\r\n return piece.visual[this.type];\r\n }\r\n }\r\n }\r\n function setVisualToOption(thisOption, visualArr) {\r\n thisOption.visual = visualArr;\r\n if (thisOption.type === 'color') {\r\n thisOption.parsedVisual = map(visualArr, function (item) {\r\n return parse(item);\r\n });\r\n }\r\n return visualArr;\r\n }\r\n var normalizers = {\r\n linear: function (value) {\r\n return linearMap(value, this.option.dataExtent, [0, 1], true);\r\n },\r\n piecewise: function (value) {\r\n var pieceList = this.option.pieceList;\r\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\r\n if (pieceIndex != null) {\r\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\r\n }\r\n },\r\n category: function (value) {\r\n var index = this.option.categories\r\n ? this.option.categoryMap[value]\r\n : value;\r\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\r\n },\r\n fixed: noop\r\n };\r\n function littleThan(close, a, b) {\r\n return close ? a <= b : a < b;\r\n }\n\n var ITEM_STYLE_NORMAL = 'itemStyle';\r\n var inner$a = makeInner();\r\n var treemapVisual = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel) {\r\n var tree = seriesModel.getData().tree;\r\n var root = tree.root;\r\n if (root.isRemoved()) {\r\n return;\r\n }\r\n travelTree(root, {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\r\n }\r\n };\r\n function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\r\n var nodeModel = node.getModel();\r\n var nodeLayout = node.getLayout();\r\n var data = node.hostTree.data;\r\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\r\n return;\r\n }\r\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\r\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n var borderColor = nodeItemStyleModel.get('borderColor');\r\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\r\n var thisNodeColor;\r\n if (borderColorSaturation != null) {\r\n thisNodeColor = calculateColor(visuals);\r\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\r\n }\r\n existsStyle.stroke = borderColor;\r\n var viewChildren = node.viewChildren;\r\n if (!viewChildren || !viewChildren.length) {\r\n thisNodeColor = calculateColor(visuals);\r\n existsStyle.fill = thisNodeColor;\r\n }\r\n else {\r\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\r\n each(viewChildren, function (child, index) {\r\n if (child.depth >= viewRootAncestors.length\r\n || child === viewRootAncestors[child.depth]) {\r\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\r\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\r\n }\r\n });\r\n }\r\n }\r\n function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\r\n var visuals = extend({}, designatedVisual);\r\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\r\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\r\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\r\n var val = nodeItemStyleModel.get(visualName);\r\n designatedVisualItemStyle[visualName] = null;\r\n val != null && (visuals[visualName] = val);\r\n });\r\n return visuals;\r\n }\r\n function calculateColor(visuals) {\r\n var color = getValueVisualDefine(visuals, 'color');\r\n if (color) {\r\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\r\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\r\n if (colorSaturation) {\r\n color = modifyHSL(color, null, null, colorSaturation);\r\n }\r\n if (colorAlpha) {\r\n color = modifyAlpha(color, colorAlpha);\r\n }\r\n return color;\r\n }\r\n }\r\n function calculateBorderColor(borderColorSaturation, thisNodeColor) {\r\n return thisNodeColor != null\r\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation)\r\n : null;\r\n }\r\n function getValueVisualDefine(visuals, name) {\r\n var value = visuals[name];\r\n if (value != null && value !== 'none') {\r\n return value;\r\n }\r\n }\r\n function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\r\n if (!viewChildren || !viewChildren.length) {\r\n return;\r\n }\r\n var rangeVisual = getRangeVisual(nodeModel, 'color')\r\n || (visuals.color != null\r\n && visuals.color !== 'none'\r\n && (getRangeVisual(nodeModel, 'colorAlpha')\r\n || getRangeVisual(nodeModel, 'colorSaturation')));\r\n if (!rangeVisual) {\r\n return;\r\n }\r\n var visualMin = nodeModel.get('visualMin');\r\n var visualMax = nodeModel.get('visualMax');\r\n var dataExtent = nodeLayout.dataExtent.slice();\r\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\r\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\r\n var colorMappingBy = nodeModel.get('colorMappingBy');\r\n var opt = {\r\n type: rangeVisual.name,\r\n dataExtent: dataExtent,\r\n visual: rangeVisual.range\r\n };\r\n if (opt.type === 'color'\r\n && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\r\n opt.mappingMethod = 'category';\r\n opt.loop = true;\r\n }\r\n else {\r\n opt.mappingMethod = 'linear';\r\n }\r\n var mapping = new VisualMapping(opt);\r\n inner$a(mapping).drColorMappingBy = colorMappingBy;\r\n return mapping;\r\n }\r\n function getRangeVisual(nodeModel, name) {\r\n var range = nodeModel.get(name);\r\n return (isArray(range) && range.length) ? {\r\n name: name,\r\n range: range\r\n } : null;\r\n }\r\n function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\r\n var childVisuals = extend({}, visuals);\r\n if (mapping) {\r\n var mappingType = mapping.type;\r\n var colorMappingBy = mappingType === 'color' && inner$a(mapping).drColorMappingBy;\r\n var value = colorMappingBy === 'index'\r\n ? index\r\n : colorMappingBy === 'id'\r\n ? seriesModel.mapIdToIndex(child.getId())\r\n : child.getValue(nodeModel.get('visualDimension'));\r\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\r\n }\r\n return childVisuals;\r\n }\n\n var mathMax$7 = Math.max;\r\n var mathMin$7 = Math.min;\r\n var retrieveValue = retrieve;\r\n var each$5 = each;\r\n var PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\r\n var PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\r\n var PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\r\n var PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\r\n var treemapLayout = {\r\n seriesType: 'treemap',\r\n reset: function (seriesModel, ecModel, api, payload) {\r\n var ecWidth = api.getWidth();\r\n var ecHeight = api.getHeight();\r\n var seriesOption = seriesModel.option;\r\n var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n var size = seriesOption.size || [];\r\n var containerWidth = parsePercent$2(retrieveValue(layoutInfo.width, size[0]), ecWidth);\r\n var containerHeight = parsePercent$2(retrieveValue(layoutInfo.height, size[1]), ecHeight);\r\n var payloadType = payload && payload.type;\r\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n var targetInfo = retrieveTargetInfo(payload, types, seriesModel);\r\n var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')\r\n ? payload.rootRect : null;\r\n var viewRoot = seriesModel.getViewRoot();\r\n var viewAbovePath = getPathToRoot(viewRoot);\r\n if (payloadType !== 'treemapMove') {\r\n var rootSize = payloadType === 'treemapZoomToNode'\r\n ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight)\r\n : rootRect\r\n ? [rootRect.width, rootRect.height]\r\n : [containerWidth, containerHeight];\r\n var sort_1 = seriesOption.sort;\r\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\r\n sort_1 = 'desc';\r\n }\r\n var options = {\r\n squareRatio: seriesOption.squareRatio,\r\n sort: sort_1,\r\n leafDepth: seriesOption.leafDepth\r\n };\r\n viewRoot.hostTree.clearLayouts();\r\n var viewRootLayout_1 = {\r\n x: 0,\r\n y: 0,\r\n width: rootSize[0],\r\n height: rootSize[1],\r\n area: rootSize[0] * rootSize[1]\r\n };\r\n viewRoot.setLayout(viewRootLayout_1);\r\n squarify(viewRoot, options, false, 0);\r\n viewRootLayout_1 = viewRoot.getLayout();\r\n each$5(viewAbovePath, function (node, index) {\r\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\r\n node.setLayout(extend({\r\n dataExtent: [childValue, childValue],\r\n borderWidth: 0,\r\n upperHeight: 0\r\n }, viewRootLayout_1));\r\n });\r\n }\r\n var treeRoot = seriesModel.getData().tree.root;\r\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\r\n seriesModel.setLayoutInfo(layoutInfo);\r\n prunning(treeRoot, new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\r\n }\r\n };\r\n function squarify(node, options, hideChildren, depth) {\r\n var width;\r\n var height;\r\n if (node.isRemoved()) {\r\n return;\r\n }\r\n var thisLayout = node.getLayout();\r\n width = thisLayout.width;\r\n height = thisLayout.height;\r\n var nodeModel = node.getModel();\r\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\r\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\r\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\r\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\r\n var layoutOffset = borderWidth - halfGapWidth;\r\n var layoutOffsetUpper = upperHeight - halfGapWidth;\r\n node.setLayout({\r\n borderWidth: borderWidth,\r\n upperHeight: upperHeight,\r\n upperLabelHeight: upperLabelHeight\r\n }, true);\r\n width = mathMax$7(width - 2 * layoutOffset, 0);\r\n height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0);\r\n var totalArea = width * height;\r\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\r\n if (!viewChildren.length) {\r\n return;\r\n }\r\n var rect = { x: layoutOffset, y: layoutOffsetUpper, width: width, height: height };\r\n var rowFixedLength = mathMin$7(width, height);\r\n var best = Infinity;\r\n var row = [];\r\n row.area = 0;\r\n for (var i = 0, len = viewChildren.length; i < len;) {\r\n var child = viewChildren[i];\r\n row.push(child);\r\n row.area += child.getLayout().area;\r\n var score = worst(row, rowFixedLength, options.squareRatio);\r\n if (score <= best) {\r\n i++;\r\n best = score;\r\n }\r\n else {\r\n row.area -= row.pop().getLayout().area;\r\n position(row, rowFixedLength, rect, halfGapWidth, false);\r\n rowFixedLength = mathMin$7(rect.width, rect.height);\r\n row.length = row.area = 0;\r\n best = Infinity;\r\n }\r\n }\r\n if (row.length) {\r\n position(row, rowFixedLength, rect, halfGapWidth, true);\r\n }\r\n if (!hideChildren) {\r\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\r\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\r\n hideChildren = true;\r\n }\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n squarify(viewChildren[i], options, hideChildren, depth + 1);\r\n }\r\n }\r\n function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\r\n var viewChildren = node.children || [];\r\n var orderBy = options.sort;\r\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\r\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\r\n if (hideChildren && !overLeafDepth) {\r\n return (node.viewChildren = []);\r\n }\r\n viewChildren = filter(viewChildren, function (child) {\r\n return !child.isRemoved();\r\n });\r\n sort$1(viewChildren, orderBy);\r\n var info = statistic(nodeModel, viewChildren, orderBy);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n for (var i = 0, len = viewChildren.length; i < len; i++) {\r\n var area = viewChildren[i].getValue() / info.sum * totalArea;\r\n viewChildren[i].setLayout({\r\n area: area\r\n });\r\n }\r\n if (overLeafDepth) {\r\n viewChildren.length && node.setLayout({\r\n isLeafRoot: true\r\n }, true);\r\n viewChildren.length = 0;\r\n }\r\n node.viewChildren = viewChildren;\r\n node.setLayout({\r\n dataExtent: info.dataExtent\r\n }, true);\r\n return viewChildren;\r\n }\r\n function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\r\n if (!orderBy) {\r\n return sum;\r\n }\r\n var visibleMin = nodeModel.get('visibleMin');\r\n var len = orderedChildren.length;\r\n var deletePoint = len;\r\n for (var i = len - 1; i >= 0; i--) {\r\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\r\n if (value / sum * totalArea < visibleMin) {\r\n deletePoint = i;\r\n sum -= value;\r\n }\r\n }\r\n orderBy === 'asc'\r\n ? orderedChildren.splice(0, len - deletePoint)\r\n : orderedChildren.splice(deletePoint, len - deletePoint);\r\n return sum;\r\n }\r\n function sort$1(viewChildren, orderBy) {\r\n if (orderBy) {\r\n viewChildren.sort(function (a, b) {\r\n var diff = orderBy === 'asc'\r\n ? a.getValue() - b.getValue()\r\n : b.getValue() - a.getValue();\r\n return diff === 0\r\n ? (orderBy === 'asc'\r\n ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex)\r\n : diff;\r\n });\r\n }\r\n return viewChildren;\r\n }\r\n function statistic(nodeModel, children, orderBy) {\r\n var sum = 0;\r\n for (var i = 0, len = children.length; i < len; i++) {\r\n sum += children[i].getValue();\r\n }\r\n var dimension = nodeModel.get('visualDimension');\r\n var dataExtent;\r\n if (!children || !children.length) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n else if (dimension === 'value' && orderBy) {\r\n dataExtent = [\r\n children[children.length - 1].getValue(),\r\n children[0].getValue()\r\n ];\r\n orderBy === 'asc' && dataExtent.reverse();\r\n }\r\n else {\r\n dataExtent = [Infinity, -Infinity];\r\n each$5(children, function (child) {\r\n var value = child.getValue(dimension);\r\n value < dataExtent[0] && (dataExtent[0] = value);\r\n value > dataExtent[1] && (dataExtent[1] = value);\r\n });\r\n }\r\n return { sum: sum, dataExtent: dataExtent };\r\n }\r\n function worst(row, rowFixedLength, ratio) {\r\n var areaMax = 0;\r\n var areaMin = Infinity;\r\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\r\n area = row[i].getLayout().area;\r\n if (area) {\r\n area < areaMin && (areaMin = area);\r\n area > areaMax && (areaMax = area);\r\n }\r\n }\r\n var squareArea = row.area * row.area;\r\n var f = rowFixedLength * rowFixedLength * ratio;\r\n return squareArea\r\n ? mathMax$7((f * areaMax) / squareArea, squareArea / (f * areaMin))\r\n : Infinity;\r\n }\r\n function position(row, rowFixedLength, rect, halfGapWidth, flush) {\r\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\r\n var idx1WhenH = 1 - idx0WhenH;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var last = rect[xy[idx0WhenH]];\r\n var rowOtherLength = rowFixedLength\r\n ? row.area / rowFixedLength : 0;\r\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\r\n rowOtherLength = rect[wh[idx1WhenH]];\r\n }\r\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\r\n var node = row[i];\r\n var nodeLayout = {};\r\n var step = rowOtherLength\r\n ? node.getLayout().area / rowOtherLength : 0;\r\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0);\r\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\r\n var modWH = (i === rowLen - 1 || remain < step) ? remain : step;\r\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0);\r\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2);\r\n nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2);\r\n last += modWH;\r\n node.setLayout(nodeLayout, true);\r\n }\r\n rect[xy[idx1WhenH]] += rowOtherLength;\r\n rect[wh[idx1WhenH]] -= rowOtherLength;\r\n }\r\n function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\r\n var currNode = (targetInfo || {}).node;\r\n var defaultSize = [containerWidth, containerHeight];\r\n if (!currNode || currNode === viewRoot) {\r\n return defaultSize;\r\n }\r\n var parent;\r\n var viewArea = containerWidth * containerHeight;\r\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\r\n while (parent = currNode.parentNode) {\r\n var sum = 0;\r\n var siblings = parent.children;\r\n for (var i = 0, len = siblings.length; i < len; i++) {\r\n sum += siblings[i].getValue();\r\n }\r\n var currNodeValue = currNode.getValue();\r\n if (currNodeValue === 0) {\r\n return defaultSize;\r\n }\r\n area *= sum / currNodeValue;\r\n var parentModel = parent.getModel();\r\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\r\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\r\n area += 4 * borderWidth * borderWidth\r\n + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\r\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\r\n currNode = parent;\r\n }\r\n area < viewArea && (area = viewArea);\r\n var scale = Math.pow(area / viewArea, 0.5);\r\n return [containerWidth * scale, containerHeight * scale];\r\n }\r\n function calculateRootPosition(layoutInfo, rootRect, targetInfo) {\r\n if (rootRect) {\r\n return { x: rootRect.x, y: rootRect.y };\r\n }\r\n var defaultPosition = { x: 0, y: 0 };\r\n if (!targetInfo) {\r\n return defaultPosition;\r\n }\r\n var targetNode = targetInfo.node;\r\n var layout = targetNode.getLayout();\r\n if (!layout) {\r\n return defaultPosition;\r\n }\r\n var targetCenter = [layout.width / 2, layout.height / 2];\r\n var node = targetNode;\r\n while (node) {\r\n var nodeLayout = node.getLayout();\r\n targetCenter[0] += nodeLayout.x;\r\n targetCenter[1] += nodeLayout.y;\r\n node = node.parentNode;\r\n }\r\n return {\r\n x: layoutInfo.width / 2 - targetCenter[0],\r\n y: layoutInfo.height / 2 - targetCenter[1]\r\n };\r\n }\r\n function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\r\n var nodeLayout = node.getLayout();\r\n var nodeInViewAbovePath = viewAbovePath[depth];\r\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\r\n if ((nodeInViewAbovePath && !isAboveViewRoot)\r\n || (depth === viewAbovePath.length && node !== viewRoot)) {\r\n return;\r\n }\r\n node.setLayout({\r\n isInView: true,\r\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\r\n isAboveViewRoot: isAboveViewRoot\r\n }, true);\r\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\r\n each$5(node.viewChildren || [], function (child) {\r\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\r\n });\r\n }\r\n function getUpperLabelHeight(model) {\r\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\r\n }\n\n registerVisual(treemapVisual);\r\n registerLayout(treemapLayout);\n\n function generateNodeKey(id) {\r\n return '_EC_' + id;\r\n }\r\n var Graph = (function () {\r\n function Graph(directed) {\r\n this.type = 'graph';\r\n this.nodes = [];\r\n this.edges = [];\r\n this._nodesMap = {};\r\n this._edgesMap = {};\r\n this._directed = directed || false;\r\n }\r\n Graph.prototype.isDirected = function () {\r\n return this._directed;\r\n };\r\n Graph.prototype.addNode = function (id, dataIndex) {\r\n id = id == null ? ('' + dataIndex) : ('' + id);\r\n var nodesMap = this._nodesMap;\r\n if (nodesMap[generateNodeKey(id)]) {\r\n if (__DEV__) {\r\n console.error('Graph nodes have duplicate name or id');\r\n }\r\n return;\r\n }\r\n var node = new GraphNode(id, dataIndex);\r\n node.hostGraph = this;\r\n this.nodes.push(node);\r\n nodesMap[generateNodeKey(id)] = node;\r\n return node;\r\n };\r\n Graph.prototype.getNodeByIndex = function (dataIndex) {\r\n var rawIdx = this.data.getRawIndex(dataIndex);\r\n return this.nodes[rawIdx];\r\n };\r\n Graph.prototype.getNodeById = function (id) {\r\n return this._nodesMap[generateNodeKey(id)];\r\n };\r\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\r\n var nodesMap = this._nodesMap;\r\n var edgesMap = this._edgesMap;\r\n if (typeof n1 === 'number') {\r\n n1 = this.nodes[n1];\r\n }\r\n if (typeof n2 === 'number') {\r\n n2 = this.nodes[n2];\r\n }\r\n if (!(n1 instanceof GraphNode)) {\r\n n1 = nodesMap[generateNodeKey(n1)];\r\n }\r\n if (!(n2 instanceof GraphNode)) {\r\n n2 = nodesMap[generateNodeKey(n2)];\r\n }\r\n if (!n1 || !n2) {\r\n return;\r\n }\r\n var key = n1.id + '-' + n2.id;\r\n var edge = new GraphEdge(n1, n2, dataIndex);\r\n edge.hostGraph = this;\r\n if (this._directed) {\r\n n1.outEdges.push(edge);\r\n n2.inEdges.push(edge);\r\n }\r\n n1.edges.push(edge);\r\n if (n1 !== n2) {\r\n n2.edges.push(edge);\r\n }\r\n this.edges.push(edge);\r\n edgesMap[key] = edge;\r\n return edge;\r\n };\r\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\r\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\r\n return this.edges[rawIdx];\r\n };\r\n Graph.prototype.getEdge = function (n1, n2) {\r\n if (n1 instanceof GraphNode) {\r\n n1 = n1.id;\r\n }\r\n if (n2 instanceof GraphNode) {\r\n n2 = n2.id;\r\n }\r\n var edgesMap = this._edgesMap;\r\n if (this._directed) {\r\n return edgesMap[n1 + '-' + n2];\r\n }\r\n else {\r\n return edgesMap[n1 + '-' + n2]\r\n || edgesMap[n2 + '-' + n1];\r\n }\r\n };\r\n Graph.prototype.eachNode = function (cb, context) {\r\n var nodes = this.nodes;\r\n var len = nodes.length;\r\n for (var i = 0; i < len; i++) {\r\n if (nodes[i].dataIndex >= 0) {\r\n cb.call(context, nodes[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.eachEdge = function (cb, context) {\r\n var edges = this.edges;\r\n var len = edges.length;\r\n for (var i = 0; i < len; i++) {\r\n if (edges[i].dataIndex >= 0\r\n && edges[i].node1.dataIndex >= 0\r\n && edges[i].node2.dataIndex >= 0) {\r\n cb.call(context, edges[i], i);\r\n }\r\n }\r\n };\r\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\r\n if (!(startNode instanceof GraphNode)) {\r\n startNode = this._nodesMap[generateNodeKey(startNode)];\r\n }\r\n if (!startNode) {\r\n return;\r\n }\r\n var edgeType = direction === 'out'\r\n ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');\r\n for (var i = 0; i < this.nodes.length; i++) {\r\n this.nodes[i].__visited = false;\r\n }\r\n if (cb.call(context, startNode, null)) {\r\n return;\r\n }\r\n var queue = [startNode];\r\n while (queue.length) {\r\n var currentNode = queue.shift();\r\n var edges = currentNode[edgeType];\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n var otherNode = e.node1 === currentNode\r\n ? e.node2 : e.node1;\r\n if (!otherNode.__visited) {\r\n if (cb.call(context, otherNode, currentNode)) {\r\n return;\r\n }\r\n queue.push(otherNode);\r\n otherNode.__visited = true;\r\n }\r\n }\r\n }\r\n };\r\n Graph.prototype.update = function () {\r\n var data = this.data;\r\n var edgeData = this.edgeData;\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n edgeData.filterSelf(function (idx) {\r\n var edge = edges[edgeData.getRawIndex(idx)];\r\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\r\n });\r\n for (var i = 0, len = edges.length; i < len; i++) {\r\n edges[i].dataIndex = -1;\r\n }\r\n for (var i = 0, len = edgeData.count(); i < len; i++) {\r\n edges[edgeData.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n Graph.prototype.clone = function () {\r\n var graph = new Graph(this._directed);\r\n var nodes = this.nodes;\r\n var edges = this.edges;\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\r\n }\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\r\n }\r\n return graph;\r\n };\r\n return Graph;\r\n }());\r\n var GraphNode = (function () {\r\n function GraphNode(id, dataIndex) {\r\n this.inEdges = [];\r\n this.outEdges = [];\r\n this.edges = [];\r\n this.dataIndex = -1;\r\n this.id = id == null ? '' : id;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphNode.prototype.degree = function () {\r\n return this.edges.length;\r\n };\r\n GraphNode.prototype.inDegree = function () {\r\n return this.inEdges.length;\r\n };\r\n GraphNode.prototype.outDegree = function () {\r\n return this.outEdges.length;\r\n };\r\n GraphNode.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphNode.prototype.getAdjacentDataIndices = function () {\r\n var dataIndices = {\r\n edge: [],\r\n node: []\r\n };\r\n for (var i = 0; i < this.edges.length; i++) {\r\n var adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n dataIndices.edge.push(adjacentEdge.dataIndex);\r\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\r\n }\r\n return dataIndices;\r\n };\r\n return GraphNode;\r\n }());\r\n var GraphEdge = (function () {\r\n function GraphEdge(n1, n2, dataIndex) {\r\n this.dataIndex = -1;\r\n this.node1 = n1;\r\n this.node2 = n2;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n GraphEdge.prototype.getModel = function (path) {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n var graph = this.hostGraph;\r\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path);\r\n };\r\n GraphEdge.prototype.getAdjacentDataIndices = function () {\r\n return {\r\n edge: [this.dataIndex],\r\n node: [this.node1.dataIndex, this.node2.dataIndex]\r\n };\r\n };\r\n return GraphEdge;\r\n }());\r\n function createGraphDataProxyMixin(hostName, dataName) {\r\n return {\r\n getValue: function (dimension) {\r\n var data = this[hostName][dataName];\r\n return data.get(data.getDimension(dimension || 'value'), this.dataIndex);\r\n },\r\n setVisual: function (key, value) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\r\n },\r\n getVisual: function (key) {\r\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\r\n },\r\n setLayout: function (layout, merge) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\r\n },\r\n getLayout: function () {\r\n return this[hostName][dataName].getItemLayout(this.dataIndex);\r\n },\r\n getGraphicEl: function () {\r\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\r\n },\r\n getRawIndex: function () {\r\n return this[hostName][dataName].getRawIndex(this.dataIndex);\r\n }\r\n };\r\n }\r\n mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\r\n mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\n\n function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\r\n var graph = new Graph(directed);\r\n for (var i = 0; i < nodes.length; i++) {\r\n graph.addNode(retrieve(nodes[i].id, nodes[i].name, i), i);\r\n }\r\n var linkNameList = [];\r\n var validEdges = [];\r\n var linkCount = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n var link = edges[i];\r\n var source = link.source;\r\n var target = link.target;\r\n if (graph.addEdge(source, target, linkCount)) {\r\n validEdges.push(link);\r\n linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\r\n linkCount++;\r\n }\r\n }\r\n var coordSys = seriesModel.get('coordinateSystem');\r\n var nodeData;\r\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\r\n nodeData = createListFromArray(nodes, seriesModel);\r\n }\r\n else {\r\n var coordSysCtor = CoordinateSystemManager.get(coordSys);\r\n var coordDimensions = coordSysCtor\r\n ? (coordSysCtor.dimensions || []) : [];\r\n if (indexOf(coordDimensions, 'value') < 0) {\r\n coordDimensions.concat(['value']);\r\n }\r\n var dimensionNames = createDimensions(nodes, {\r\n coordDimensions: coordDimensions\r\n });\r\n nodeData = new List(dimensionNames, seriesModel);\r\n nodeData.initData(nodes);\r\n }\r\n var edgeData = new List(['value'], seriesModel);\r\n edgeData.initData(validEdges, linkNameList);\r\n beforeLink && beforeLink(nodeData, edgeData);\r\n linkList({\r\n mainData: nodeData,\r\n struct: graph,\r\n structAttr: 'graph',\r\n datas: { node: nodeData, edge: edgeData },\r\n datasAttr: { node: 'data', edge: 'edgeData' }\r\n });\r\n graph.update();\r\n return graph;\r\n }\n\n var KEY_DELIMITER = '-->';\r\n var getAutoCurvenessParams = function (seriesModel) {\r\n return seriesModel.get('autoCurveness') || null;\r\n };\r\n var createCurveness = function (seriesModel, appendLength) {\r\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\r\n var length = 20;\r\n var curvenessList = [];\r\n if (typeof autoCurvenessParmas === 'number') {\r\n length = autoCurvenessParmas;\r\n }\r\n else if (isArray(autoCurvenessParmas)) {\r\n seriesModel.__curvenessList = autoCurvenessParmas;\r\n return;\r\n }\r\n if (appendLength > length) {\r\n length = appendLength;\r\n }\r\n var len = length % 2 ? length + 2 : length + 3;\r\n curvenessList = [];\r\n for (var i = 0; i < len; i++) {\r\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\r\n }\r\n seriesModel.__curvenessList = curvenessList;\r\n };\r\n var getKeyOfEdges = function (n1, n2, seriesModel) {\r\n var source = [n1.id, n1.dataIndex].join('.');\r\n var target = [n2.id, n2.dataIndex].join('.');\r\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\r\n };\r\n var getOppositeKey = function (key) {\r\n var keys = key.split(KEY_DELIMITER);\r\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\r\n };\r\n var getEdgeFromMap = function (edge, seriesModel) {\r\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n return seriesModel.__edgeMap[key];\r\n };\r\n var getTotalLengthBetweenNodes = function (edge, seriesModel) {\r\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\r\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\r\n return len + lenV;\r\n };\r\n var getEdgeMapLengthWithKey = function (key, seriesModel) {\r\n var edgeMap = seriesModel.__edgeMap;\r\n return edgeMap[key] ? edgeMap[key].length : 0;\r\n };\r\n function initCurvenessList(seriesModel) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n seriesModel.__curvenessList = [];\r\n seriesModel.__edgeMap = {};\r\n createCurveness(seriesModel);\r\n }\r\n function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n var key = getKeyOfEdges(n1, n2, seriesModel);\r\n var edgeMap = seriesModel.__edgeMap;\r\n var oppositeEdges = edgeMap[getOppositeKey(key)];\r\n if (edgeMap[key] && !oppositeEdges) {\r\n edgeMap[key].isForward = true;\r\n }\r\n else if (oppositeEdges && edgeMap[key]) {\r\n oppositeEdges.isForward = true;\r\n edgeMap[key].isForward = false;\r\n }\r\n edgeMap[key] = edgeMap[key] || [];\r\n edgeMap[key].push(index);\r\n }\r\n function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\r\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\r\n var isArrayParam = isArray(autoCurvenessParams);\r\n if (!autoCurvenessParams) {\r\n return null;\r\n }\r\n var edgeArray = getEdgeFromMap(edge, seriesModel);\r\n if (!edgeArray) {\r\n return null;\r\n }\r\n var edgeIndex = -1;\r\n for (var i = 0; i < edgeArray.length; i++) {\r\n if (edgeArray[i] === index) {\r\n edgeIndex = i;\r\n break;\r\n }\r\n }\r\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\r\n createCurveness(seriesModel, totalLen);\r\n edge.lineStyle = edge.lineStyle || {};\r\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n var curvenessList = seriesModel.__curvenessList;\r\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\r\n if (!edgeArray.isForward) {\r\n var oppositeKey = getOppositeKey(curKey);\r\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\r\n var resValue = curvenessList[edgeIndex + len + parityCorrection];\r\n if (needReverse) {\r\n if (isArrayParam) {\r\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n else {\r\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return curvenessList[edgeIndex + len + parityCorrection];\r\n }\r\n }\r\n else {\r\n return curvenessList[parityCorrection + edgeIndex];\r\n }\r\n }\n\n var GraphSeriesModel = (function (_super) {\r\n __extends(GraphSeriesModel, _super);\r\n function GraphSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n GraphSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n var self = this;\r\n function getCategoriesData() {\r\n return self._categoriesData;\r\n }\r\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this.fillDataTextStyle(option.edges || option.links);\r\n this._updateCategoriesData();\r\n };\r\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\r\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\r\n defaultEmphasis(option, 'edgeLabel', ['show']);\r\n };\r\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var edges = option.edges || option.links || [];\r\n var nodes = option.data || option.nodes || [];\r\n var self = this;\r\n if (nodes && edges) {\r\n initCurvenessList(this);\r\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\r\n each(graph.edges, function (edge) {\r\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\r\n }, this);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model) {\r\n var categoriesModels = self._categoriesModels;\r\n var categoryIdx = model.getShallow('category');\r\n var categoryModel = categoriesModels[categoryIdx];\r\n if (categoryModel) {\r\n categoryModel.parentModel = model.parentModel;\r\n model.parentModel = categoryModel;\r\n }\r\n return model;\r\n });\r\n var oldGetModel = Model.prototype.getModel;\r\n function newGetModel(path, parentModel) {\r\n var model = oldGetModel.call(this, path, parentModel);\r\n model.resolveParentPath = resolveParentPath;\r\n return model;\r\n }\r\n edgeData.wrapMethod('getItemModel', function (model) {\r\n model.resolveParentPath = resolveParentPath;\r\n model.getModel = newGetModel;\r\n return model;\r\n });\r\n function resolveParentPath(pathArr) {\r\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\r\n var newPathArr = pathArr.slice();\r\n if (pathArr[0] === 'label') {\r\n newPathArr[0] = 'edgeLabel';\r\n }\r\n else if (pathArr[1] === 'label') {\r\n newPathArr[1] = 'edgeLabel';\r\n }\r\n return newPathArr;\r\n }\r\n return pathArr;\r\n }\r\n }\r\n };\r\n GraphSeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n GraphSeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n GraphSeriesModel.prototype.getCategoriesData = function () {\r\n return this._categoriesData;\r\n };\r\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n if (dataType === 'edge') {\r\n var nodeData = this.getData();\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\r\n var sourceName = nodeData.getName(edge.node1.dataIndex);\r\n var targetName = nodeData.getName(edge.node2.dataIndex);\r\n var nameArr = [];\r\n sourceName != null && nameArr.push(sourceName);\r\n targetName != null && nameArr.push(targetName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > '),\r\n value: params.value,\r\n noValue: params.value == null\r\n });\r\n }\r\n var nodeMarkup = defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n return nodeMarkup;\r\n };\r\n GraphSeriesModel.prototype._updateCategoriesData = function () {\r\n var categories = map(this.option.categories || [], function (category) {\r\n return category.value != null ? category : extend({\r\n value: 0\r\n }, category);\r\n });\r\n var categoriesData = new List(['value'], this);\r\n categoriesData.initData(categories);\r\n this._categoriesData = categoriesData;\r\n this._categoriesModels = categoriesData.mapArray(function (idx) {\r\n return categoriesData.getItemModel(idx);\r\n });\r\n };\r\n GraphSeriesModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GraphSeriesModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\r\n return _super.prototype.isAnimationEnabled.call(this)\r\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\r\n };\r\n GraphSeriesModel.type = 'series.graph';\r\n GraphSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n legendHoverLink: true,\r\n layout: null,\r\n focusNodeAdjacency: false,\r\n circular: {\r\n rotateLabel: false\r\n },\r\n force: {\r\n initLayout: null,\r\n repulsion: [0, 50],\r\n gravity: 0.1,\r\n friction: 0.6,\r\n edgeLength: 30,\r\n layoutAnimation: true\r\n },\r\n left: 'center',\r\n top: 'center',\r\n symbol: 'circle',\r\n symbolSize: 10,\r\n edgeSymbol: ['none', 'none'],\r\n edgeSymbolSize: 10,\r\n edgeLabel: {\r\n position: 'middle',\r\n distance: 5\r\n },\r\n draggable: false,\r\n roam: false,\r\n center: null,\r\n zoom: 1,\r\n nodeScaleRatio: 0.6,\r\n label: {\r\n show: false,\r\n formatter: '{b}'\r\n },\r\n itemStyle: {},\r\n lineStyle: {\r\n color: '#aaa',\r\n width: 1,\r\n opacity: 0.5\r\n },\r\n emphasis: {\r\n scale: true,\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return GraphSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(GraphSeriesModel);\n\n var straightLineProto = Line.prototype;\r\n var bezierCurveProto = BezierCurve.prototype;\r\n var StraightLineShape = (function () {\r\n function StraightLineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return StraightLineShape;\r\n }());\r\n var CurveShape = (function (_super) {\r\n __extends(CurveShape, _super);\r\n function CurveShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return CurveShape;\r\n }(StraightLineShape));\r\n function isStraightLine(shape) {\r\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\r\n }\r\n var ECLinePath = (function (_super) {\r\n __extends(ECLinePath, _super);\r\n function ECLinePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-line';\r\n return _this;\r\n }\r\n ECLinePath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECLinePath.prototype.getDefaultShape = function () {\r\n return new StraightLineShape();\r\n };\r\n ECLinePath.prototype.buildPath = function (ctx, shape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n };\r\n ECLinePath.prototype.pointAt = function (t) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n };\r\n ECLinePath.prototype.tangentAt = function (t) {\r\n var shape = this.shape;\r\n var p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return normalize(p, p);\r\n };\r\n return ECLinePath;\r\n }(Path));\n\n var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\r\n function makeSymbolTypeKey(symbolCategory) {\r\n return '_' + symbolCategory + 'Type';\r\n }\r\n function createSymbol$1(name, lineData, idx) {\r\n var symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\r\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\r\n var symbolSizeArr = isArray(symbolSize)\r\n ? symbolSize : [symbolSize, symbolSize];\r\n var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2, -symbolSizeArr[1] / 2, symbolSizeArr[0], symbolSizeArr[1]);\r\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n symbolPath.name = name;\r\n return symbolPath;\r\n }\r\n function createLine(points) {\r\n var line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n }\r\n function setLinePoints(targetShape, points) {\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n var cp1 = points[2];\r\n if (cp1) {\r\n targetShape.cpx1 = cp1[0];\r\n targetShape.cpy1 = cp1[1];\r\n }\r\n else {\r\n targetShape.cpx1 = NaN;\r\n targetShape.cpy1 = NaN;\r\n }\r\n }\r\n var Line$1 = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createLine(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var linePoints = lineData.getItemLayout(idx);\r\n var line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n this.add(line);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var linePoints = lineData.getItemLayout(idx);\r\n var target = {\r\n shape: {}\r\n };\r\n setLinePoints(target.shape, linePoints);\r\n updateProps(line, target, seriesModel, idx);\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbolType = lineData.getItemVisual(idx, symbolCategory);\r\n var key = makeSymbolTypeKey(symbolCategory);\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n var symbol = createSymbol$1(symbolCategory, lineData, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Line.prototype.getLinePath = function () {\r\n return this.childAt(0);\r\n };\r\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childOfName('line');\r\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n var itemModel = lineData.getItemModel(idx);\r\n emphasisLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var visualColor = lineStyle.stroke;\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n var symbol = this.childOfName(symbolCategory);\r\n if (symbol) {\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var lineState = line.getState(stateName);\r\n if (lineState) {\r\n var lineStateStyle = lineState.style || {};\r\n var state = symbol.ensureState(stateName);\r\n var stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n var rawVal = seriesModel.getRawValue(idx);\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel: function (dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round$1(rawVal)\r\n : rawVal) + ''\r\n });\r\n var label = this.getTextContent();\r\n if (label) {\r\n var labelNormalModel = labelStatesModels.normal;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n var distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false\r\n });\r\n enableHoverEmphasis(this);\r\n };\r\n Line.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n Line.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n Line.prototype.updateLayout = function (lineData, idx) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n };\r\n Line.prototype.setLinePoints = function (points) {\r\n var linePath = this.childOfName('line');\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n };\r\n Line.prototype.beforeUpdate = function () {\r\n var lineGroup = this;\r\n var symbolFrom = lineGroup.childOfName('fromSymbol');\r\n var symbolTo = lineGroup.childOfName('toSymbol');\r\n var label = lineGroup.getTextContent();\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n var invScale = 1;\r\n var parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n var line = lineGroup.childOfName('line');\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n var percent = line.shape.percent;\r\n var fromPos = line.pointAt(0);\r\n var toPos = line.pointAt(percent);\r\n var d = sub([], toPos, fromPos);\r\n normalize(d, d);\r\n function setSymbolRotation(symbol, percent) {\r\n var specifiedRotation = symbol.__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n var tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var distance = label.__labelDistance;\r\n var distanceX = distance[0] * invScale;\r\n var distanceY = distance[1] * invScale;\r\n var halfPercent = percent / 2;\r\n var tangent = line.tangentAt(halfPercent);\r\n var n = [tangent[1], -tangent[0]];\r\n var cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n var dir = tangent[0] < 0 ? -1 : 1;\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n var rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n var dy = void 0;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n };\r\n return Line;\r\n }(Group));\n\n var LineDraw = (function () {\r\n function LineDraw(LineCtor) {\r\n this.group = new Group();\r\n this._LineCtor = LineCtor || Line$1;\r\n }\r\n LineDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n LineDraw.prototype.updateData = function (lineData) {\r\n var _this = this;\r\n var lineDraw = this;\r\n var group = lineDraw.group;\r\n var oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n var seriesScope = makeSeriesScope$1(lineData);\r\n lineData.diff(oldLineData)\r\n .add(function (idx) {\r\n _this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n LineDraw.prototype.updateLayout = function () {\r\n var lineData = this._lineData;\r\n if (!lineData) {\r\n return;\r\n }\r\n lineData.eachItemGraphicEl(function (el, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\r\n this._seriesScope = makeSeriesScope$1(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (lineNeedsDraw(itemLayout)) {\r\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n LineDraw.prototype.remove = function () {\r\n this.group.removeAll();\r\n };\r\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\r\n var itemLayout = lineData.getItemLayout(idx);\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n var el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n };\r\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\r\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n this.group.add(itemEl);\r\n };\r\n return LineDraw;\r\n }());\r\n function isEffectObject(el) {\r\n return el.animators && el.animators.length > 0;\r\n }\r\n function makeSeriesScope$1(lineData) {\r\n var hostModel = lineData.hostModel;\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: hostModel.getModel(['emphasis', 'lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n }\r\n function isPointNaN(pt) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n }\r\n function lineNeedsDraw(pts) {\r\n return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n }\n\n function getNodeGlobalScale(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\r\n var groupZoom = coordSys.scaleX;\r\n var roamZoom = coordSys.getZoom();\r\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n return nodeScale / groupZoom;\r\n }\r\n function getSymbolSize(node) {\r\n var symbolSize = node.getVisual('symbolSize');\r\n if (symbolSize instanceof Array) {\r\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\r\n }\r\n return +symbolSize;\r\n }\n\n var v1 = [];\r\n var v2 = [];\r\n var v3 = [];\r\n var quadraticAt$1 = quadraticAt;\r\n var v2DistSquare = distSquare;\r\n var mathAbs$2 = Math.abs;\r\n function intersectCurveCircle(curvePoints, center, radius) {\r\n var p0 = curvePoints[0];\r\n var p1 = curvePoints[1];\r\n var p2 = curvePoints[2];\r\n var d = Infinity;\r\n var t;\r\n var radiusSquare = radius * radius;\r\n var interval = 0.1;\r\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\r\n v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t);\r\n v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t);\r\n var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare);\r\n if (diff < d) {\r\n d = diff;\r\n t = _t;\r\n }\r\n }\r\n for (var i = 0; i < 32; i++) {\r\n var next = t + interval;\r\n v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t);\r\n v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t);\r\n v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next);\r\n v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next);\r\n var diff = v2DistSquare(v2, center) - radiusSquare;\r\n if (mathAbs$2(diff) < 1e-2) {\r\n break;\r\n }\r\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\r\n interval /= 2;\r\n if (diff < 0) {\r\n if (nextDiff >= 0) {\r\n t = t + interval;\r\n }\r\n else {\r\n t = t - interval;\r\n }\r\n }\r\n else {\r\n if (nextDiff >= 0) {\r\n t = t - interval;\r\n }\r\n else {\r\n t = t + interval;\r\n }\r\n }\r\n }\r\n return t;\r\n }\r\n function adjustEdge(graph, scale) {\r\n var tmp0 = [];\r\n var quadraticSubdivide$1 = quadraticSubdivide;\r\n var pts = [[], [], []];\r\n var pts2 = [[], []];\r\n var v = [];\r\n scale /= 2;\r\n graph.eachEdge(function (edge, idx) {\r\n var linePoints = edge.getLayout();\r\n var fromSymbol = edge.getVisual('fromSymbol');\r\n var toSymbol = edge.getVisual('toSymbol');\r\n if (!linePoints.__original) {\r\n linePoints.__original = [\r\n clone$1(linePoints[0]),\r\n clone$1(linePoints[1])\r\n ];\r\n if (linePoints[2]) {\r\n linePoints.__original.push(clone$1(linePoints[2]));\r\n }\r\n }\r\n var originalPoints = linePoints.__original;\r\n if (linePoints[2] != null) {\r\n copy(pts[0], originalPoints[0]);\r\n copy(pts[1], originalPoints[2]);\r\n copy(pts[2], originalPoints[1]);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[0][0] = tmp0[3];\r\n pts[1][0] = tmp0[4];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[0][1] = tmp0[3];\r\n pts[1][1] = tmp0[4];\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\r\n quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[1][0] = tmp0[1];\r\n pts[2][0] = tmp0[2];\r\n quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[1][1] = tmp0[1];\r\n pts[2][1] = tmp0[2];\r\n }\r\n copy(linePoints[0], pts[0]);\r\n copy(linePoints[1], pts[2]);\r\n copy(linePoints[2], pts[1]);\r\n }\r\n else {\r\n copy(pts2[0], originalPoints[0]);\r\n copy(pts2[1], originalPoints[1]);\r\n sub(v, pts2[1], pts2[0]);\r\n normalize(v, v);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node1);\r\n scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n var symbolSize = getSymbolSize(edge.node2);\r\n scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\r\n }\r\n copy(linePoints[0], pts2[0]);\r\n copy(linePoints[1], pts2[1]);\r\n }\r\n });\r\n }\n\n function isViewCoordSys(coordSys) {\r\n return coordSys.type === 'view';\r\n }\r\n var GraphView = (function (_super) {\r\n __extends(GraphView, _super);\r\n function GraphView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphView.type;\r\n return _this;\r\n }\r\n GraphView.prototype.init = function (ecModel, api) {\r\n var symbolDraw = new SymbolDraw();\r\n var lineDraw = new LineDraw();\r\n var group = this.group;\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: group\r\n };\r\n group.add(symbolDraw.group);\r\n group.add(lineDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineDraw = lineDraw;\r\n this._firstRender = true;\r\n };\r\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n this._model = seriesModel;\r\n var symbolDraw = this._symbolDraw;\r\n var lineDraw = this._lineDraw;\r\n var group = this.group;\r\n if (isViewCoordSys(coordSys)) {\r\n var groupNewProp = {\r\n x: coordSys.x, y: coordSys.y,\r\n scaleX: coordSys.scaleX, scaleY: coordSys.scaleY\r\n };\r\n if (this._firstRender) {\r\n group.attr(groupNewProp);\r\n }\r\n else {\r\n updateProps(group, groupNewProp, seriesModel);\r\n }\r\n }\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n var data = seriesModel.getData();\r\n symbolDraw.updateData(data);\r\n var edgeData = seriesModel.getEdgeData();\r\n lineDraw.updateData(edgeData);\r\n this._updateNodeAndLinkScale();\r\n this._updateController(seriesModel, ecModel, api);\r\n clearTimeout(this._layoutTimeout);\r\n var forceLayout = seriesModel.forceLayout;\r\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\r\n if (forceLayout) {\r\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n }\r\n data.graph.eachNode(function (node) {\r\n var idx = node.dataIndex;\r\n var el = node.getGraphicEl();\r\n var itemModel = node.getModel();\r\n el.off('drag').off('dragend');\r\n var draggable = itemModel.get('draggable');\r\n if (draggable) {\r\n el.on('drag', function () {\r\n if (forceLayout) {\r\n forceLayout.warmUp();\r\n !_this._layouting\r\n && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n forceLayout.setFixed(idx);\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n }\r\n }).on('dragend', function () {\r\n if (forceLayout) {\r\n forceLayout.setUnfixed(idx);\r\n }\r\n });\r\n }\r\n el.setDraggable(draggable && !!forceLayout);\r\n var focus = itemModel.get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = node.getAdjacentDataIndices();\r\n }\r\n });\r\n data.graph.eachEdge(function (edge) {\r\n var el = edge.getGraphicEl();\r\n var focus = edge.getModel().get(['emphasis', 'focus']);\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = {\r\n edge: [edge.dataIndex],\r\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\r\n };\r\n }\r\n });\r\n var circularRotateLabel = seriesModel.get('layout') === 'circular'\r\n && seriesModel.get(['circular', 'rotateLabel']);\r\n var cx = data.getLayout('cx');\r\n var cy = data.getLayout('cy');\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelRotate = itemModel.get(['label', 'rotate']) || 0;\r\n var symbolPath = el.getSymbolPath();\r\n if (circularRotateLabel) {\r\n var pos = data.getItemLayout(idx);\r\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n var isLeft = pos[0] < cx;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n var textPosition = isLeft ? 'left' : 'right';\r\n symbolPath.setTextConfig({\r\n rotation: -rad,\r\n position: textPosition,\r\n origin: 'center'\r\n });\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\r\n position: textPosition\r\n });\r\n }\r\n else {\r\n symbolPath.setTextConfig({\r\n rotation: labelRotate *= Math.PI / 180\r\n });\r\n }\r\n });\r\n this._firstRender = false;\r\n };\r\n GraphView.prototype.dispose = function () {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n };\r\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\r\n var self = this;\r\n (function step() {\r\n forceLayout.step(function (stopped) {\r\n self.updateLayout(self._model);\r\n (self._layouting = !stopped) && (layoutAnimation\r\n ? (self._layoutTimeout = setTimeout(step, 16))\r\n : step());\r\n });\r\n })();\r\n };\r\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var controller = this._controller;\r\n var controllerHost = this._controllerHost;\r\n var group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n var rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\r\n controller.disable();\r\n return;\r\n }\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', function (e) {\r\n updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', function (e) {\r\n updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n _this._updateNodeAndLinkScale();\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n _this._lineDraw.updateLayout();\r\n api.updateLabelLayout();\r\n });\r\n };\r\n GraphView.prototype._updateNodeAndLinkScale = function () {\r\n var seriesModel = this._model;\r\n var data = seriesModel.getData();\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n data.eachItemGraphicEl(function (el, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n };\r\n GraphView.prototype.updateLayout = function (seriesModel) {\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n this._symbolDraw.updateLayout();\r\n this._lineDraw.updateLayout();\r\n };\r\n GraphView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove();\r\n this._lineDraw && this._lineDraw.remove();\r\n };\r\n GraphView.type = 'graph';\r\n return GraphView;\r\n }(ChartView));\r\n ChartView.registerClass(GraphView);\n\n registerAction({\r\n type: 'focusNodeAdjacency',\r\n event: 'focusNodeAdjacency',\r\n update: 'series:focusNodeAdjacency'\r\n }, function () { });\r\n registerAction({\r\n type: 'unfocusNodeAdjacency',\r\n event: 'unfocusNodeAdjacency',\r\n update: 'series:unfocusNodeAdjacency'\r\n }, function () { });\n\n var actionInfo = {\r\n type: 'graphRoam',\r\n event: 'graphRoam',\r\n update: 'none'\r\n };\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', query: payload\r\n }, function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var res = updateCenterAndZoom(coordSys, payload);\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\n\n function categoryFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var categoriesData = graphSeries.getCategoriesData();\r\n var graph = graphSeries.getGraph();\r\n var data = graph.data;\r\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n data.filterSelf(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var category = model.getShallow('category');\r\n if (category != null) {\r\n if (typeof category === 'number') {\r\n category = categoryNames[category];\r\n }\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n });\r\n }\n\n function categoryVisual(ecModel) {\r\n var paletteScope = {};\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var categoriesData = seriesModel.getCategoriesData();\r\n var data = seriesModel.getData();\r\n var categoryNameIdxMap = {};\r\n categoriesData.each(function (idx) {\r\n var name = categoriesData.getName(idx);\r\n categoryNameIdxMap['ec-' + name] = idx;\r\n var itemModel = categoriesData.getItemModel(idx);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\r\n }\r\n categoriesData.setItemVisual(idx, 'style', style);\r\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < symbolVisualList.length; i++) {\r\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\r\n if (symbolVisual != null) {\r\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\r\n }\r\n }\r\n });\r\n if (categoriesData.count()) {\r\n data.each(function (idx) {\r\n var model = data.getItemModel(idx);\r\n var categoryIdx = model.getShallow('category');\r\n if (categoryIdx != null) {\r\n if (typeof categoryIdx === 'string') {\r\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\r\n }\r\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\r\n var style = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(style, categoryStyle);\r\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\r\n for (var i = 0; i < visualList.length; i++) {\r\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\n\n function normalize$2(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n }\r\n function graphEdgeVisual(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var edgeData = seriesModel.getEdgeData();\r\n var symbolType = normalize$2(seriesModel.get('edgeSymbol'));\r\n var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize'));\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n edgeData.each(function (idx) {\r\n var itemModel = edgeData.getItemModel(idx);\r\n var edge = graph.getEdgeByIndex(idx);\r\n var symbolType = normalize$2(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true));\r\n var style = itemModel.getModel('lineStyle').getLineStyle();\r\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n switch (existsStyle.stroke) {\r\n case 'source': {\r\n var nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n case 'target': {\r\n var nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n }\n\n function simpleLayout(seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var graph = seriesModel.getGraph();\r\n graph.eachNode(function (node) {\r\n var model = node.getModel();\r\n node.setLayout([+model.get('x'), +model.get('y')]);\r\n });\r\n simpleLayoutEdge(graph, seriesModel);\r\n }\r\n function simpleLayoutEdge(graph, seriesModel) {\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var points = [p1, p2];\r\n if (+curveness) {\r\n points.push([\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness\r\n ]);\r\n }\r\n edge.setLayout(points);\r\n });\r\n }\n\n function graphSimpleLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var layout = seriesModel.get('layout');\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n var data_1 = seriesModel.getData();\r\n var dimensions_1 = [];\r\n each(coordSys.dimensions, function (coordDim) {\r\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\r\n });\r\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\r\n var value = [];\r\n var hasValue = false;\r\n for (var i = 0; i < dimensions_1.length; i++) {\r\n var val = data_1.get(dimensions_1[i], dataIndex);\r\n if (!isNaN(val)) {\r\n hasValue = true;\r\n }\r\n value.push(val);\r\n }\r\n if (hasValue) {\r\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\r\n }\r\n else {\r\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\r\n }\r\n }\r\n simpleLayoutEdge(data_1.graph, seriesModel);\r\n }\r\n else if (!layout || layout === 'none') {\r\n simpleLayout(seriesModel);\r\n }\r\n });\r\n }\n\n var PI$7 = Math.PI;\r\n var _symbolRadiansHalf = [];\r\n function circularLayout(seriesModel, basedOn) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n var rect = coordSys.getBoundingRect();\r\n var nodeData = seriesModel.getData();\r\n var graph = nodeData.graph;\r\n var cx = rect.width / 2 + rect.x;\r\n var cy = rect.height / 2 + rect.y;\r\n var r = Math.min(rect.width, rect.height) / 2;\r\n var count = nodeData.count();\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n if (!count) {\r\n return;\r\n }\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n graph.eachEdge(function (edge, index) {\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\r\n var p1 = clone$1(edge.node1.getLayout());\r\n var p2 = clone$1(edge.node2.getLayout());\r\n var cp1;\r\n var x12 = (p1[0] + p2[0]) / 2;\r\n var y12 = (p1[1] + p2[1]) / 2;\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [\r\n cx * curveness + x12 * (1 - curveness),\r\n cy * curveness + y12 * (1 - curveness)\r\n ];\r\n }\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n }\r\n var _layoutNodesBasedOn = {\r\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var angle = 0;\r\n var sum = nodeData.getSum('value');\r\n var unitAngle = Math.PI * 2 / (sum || count);\r\n graph.eachNode(function (node) {\r\n var value = node.getValue('value');\r\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n },\r\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\r\n var sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n var nodeScale = getNodeGlobalScale(seriesModel);\r\n graph.eachNode(function (node) {\r\n var symbolSize = getSymbolSize(node);\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n symbolSize *= nodeScale;\r\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$7 / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n var halfRemainRadian = (2 * PI$7 - sumRadian) / count / 2;\r\n var angle = 0;\r\n graph.eachNode(function (node) {\r\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n }\r\n };\n\n function graphCircularLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n if (seriesModel.get('layout') === 'circular') {\r\n circularLayout(seriesModel, 'symbolSize');\r\n }\r\n });\r\n }\n\n var scaleAndAdd$1 = scaleAndAdd;\r\n function forceLayout(inNodes, inEdges, opts) {\r\n var nodes = inNodes;\r\n var edges = inEdges;\r\n var rect = opts.rect;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var center = [rect.x + width / 2, rect.y + height / 2];\r\n var gravity = opts.gravity == null ? 0.1 : opts.gravity;\r\n for (var i = 0; i < nodes.length; i++) {\r\n var n = nodes[i];\r\n if (!n.p) {\r\n n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\r\n }\r\n n.pp = clone$1(n.p);\r\n n.edges = null;\r\n }\r\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\r\n var friction = initialFriction;\r\n var beforeStepCallback;\r\n var afterStepCallback;\r\n return {\r\n warmUp: function () {\r\n friction = initialFriction * 0.8;\r\n },\r\n setFixed: function (idx) {\r\n nodes[idx].fixed = true;\r\n },\r\n setUnfixed: function (idx) {\r\n nodes[idx].fixed = false;\r\n },\r\n beforeStep: function (cb) {\r\n beforeStepCallback = cb;\r\n },\r\n afterStep: function (cb) {\r\n afterStepCallback = cb;\r\n },\r\n step: function (cb) {\r\n beforeStepCallback && beforeStepCallback(nodes, edges);\r\n var v12 = [];\r\n var nLen = nodes.length;\r\n for (var i = 0; i < edges.length; i++) {\r\n var e = edges[i];\r\n if (e.ignoreForceLayout) {\r\n continue;\r\n }\r\n var n1 = e.n1;\r\n var n2 = e.n2;\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12) - e.d;\r\n var w = n2.w / (n1.w + n2.w);\r\n if (isNaN(w)) {\r\n w = 0;\r\n }\r\n normalize(v12, v12);\r\n !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction);\r\n !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction);\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v12, center, n.p);\r\n scaleAndAdd$1(n.p, n.p, v12, gravity * friction);\r\n }\r\n }\r\n for (var i = 0; i < nLen; i++) {\r\n var n1 = nodes[i];\r\n for (var j = i + 1; j < nLen; j++) {\r\n var n2 = nodes[j];\r\n sub(v12, n2.p, n1.p);\r\n var d = len(v12);\r\n if (d === 0) {\r\n set(v12, Math.random() - 0.5, Math.random() - 0.5);\r\n d = 1;\r\n }\r\n var repFact = (n1.rep + n2.rep) / d / d;\r\n !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact);\r\n !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact);\r\n }\r\n }\r\n var v = [];\r\n for (var i = 0; i < nLen; i++) {\r\n var n = nodes[i];\r\n if (!n.fixed) {\r\n sub(v, n.p, n.pp);\r\n scaleAndAdd$1(n.p, n.p, v, friction);\r\n copy(n.pp, n.p);\r\n }\r\n }\r\n friction = friction * 0.992;\r\n var finished = friction < 0.01;\r\n afterStepCallback && afterStepCallback(nodes, edges, finished);\r\n cb && cb(finished);\r\n }\r\n };\r\n }\n\n function graphForceLayout(ecModel) {\r\n ecModel.eachSeriesByType('graph', function (graphSeries) {\r\n var coordSys = graphSeries.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n if (graphSeries.get('layout') === 'force') {\r\n var preservedPoints_1 = graphSeries.preservedPoints || {};\r\n var graph_1 = graphSeries.getGraph();\r\n var nodeData_1 = graph_1.data;\r\n var edgeData = graph_1.edgeData;\r\n var forceModel = graphSeries.getModel('force');\r\n var initLayout = forceModel.get('initLayout');\r\n if (graphSeries.preservedPoints) {\r\n nodeData_1.each(function (idx) {\r\n var id = nodeData_1.getId(idx);\r\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\r\n });\r\n }\r\n else if (!initLayout || initLayout === 'none') {\r\n simpleLayout(graphSeries);\r\n }\r\n else if (initLayout === 'circular') {\r\n circularLayout(graphSeries, 'value');\r\n }\r\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\r\n var edgeDataExtent_1 = edgeData.getDataExtent('value');\r\n var repulsion = forceModel.get('repulsion');\r\n var edgeLength = forceModel.get('edgeLength');\r\n var repulsionArr_1 = isArray(repulsion)\r\n ? repulsion : [repulsion, repulsion];\r\n var edgeLengthArr_1 = isArray(edgeLength)\r\n ? edgeLength : [edgeLength, edgeLength];\r\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\r\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\r\n var point = nodeData_1.getItemLayout(idx);\r\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\r\n if (isNaN(rep)) {\r\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\r\n }\r\n return {\r\n w: rep,\r\n rep: rep,\r\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\r\n p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point\r\n };\r\n });\r\n var edges = edgeData.mapArray('value', function (value, idx) {\r\n var edge = graph_1.getEdgeByIndex(idx);\r\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\r\n if (isNaN(d)) {\r\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\r\n }\r\n var edgeModel = edge.getModel();\r\n var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\r\n return {\r\n n1: nodes_1[edge.node1.dataIndex],\r\n n2: nodes_1[edge.node2.dataIndex],\r\n d: d,\r\n curveness: curveness,\r\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\r\n };\r\n });\r\n var rect = coordSys.getBoundingRect();\r\n var forceInstance = forceLayout(nodes_1, edges, {\r\n rect: rect,\r\n gravity: forceModel.get('gravity'),\r\n friction: forceModel.get('friction')\r\n });\r\n forceInstance.beforeStep(function (nodes, edges) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (nodes[i].fixed) {\r\n copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\r\n }\r\n }\r\n });\r\n forceInstance.afterStep(function (nodes, edges, stopped) {\r\n for (var i = 0, l = nodes.length; i < l; i++) {\r\n if (!nodes[i].fixed) {\r\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\r\n }\r\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\r\n }\r\n for (var i = 0, l = edges.length; i < l; i++) {\r\n var e = edges[i];\r\n var edge = graph_1.getEdgeByIndex(i);\r\n var p1 = e.n1.p;\r\n var p2 = e.n2.p;\r\n var points = edge.getLayout();\r\n points = points ? points.slice() : [];\r\n points[0] = points[0] || [];\r\n points[1] = points[1] || [];\r\n copy(points[0], p1);\r\n copy(points[1], p2);\r\n if (+e.curveness) {\r\n points[2] = [\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness\r\n ];\r\n }\r\n edge.setLayout(points);\r\n }\r\n });\r\n graphSeries.forceLayout = forceInstance;\r\n graphSeries.preservedPoints = preservedPoints_1;\r\n forceInstance.step();\r\n }\r\n else {\r\n graphSeries.forceLayout = null;\r\n }\r\n });\r\n }\n\n function getViewRect$2(seriesModel, api, aspect) {\r\n var option = extend(seriesModel.getBoxLayoutParams(), {\r\n aspect: aspect\r\n });\r\n return getLayoutRect(option, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function createViewCoordSys(ecModel, api) {\r\n var viewList = [];\r\n ecModel.eachSeriesByType('graph', function (seriesModel) {\r\n var coordSysType = seriesModel.get('coordinateSystem');\r\n if (!coordSysType || coordSysType === 'view') {\r\n var data_1 = seriesModel.getData();\r\n var positions = data_1.mapArray(function (idx) {\r\n var itemModel = data_1.getItemModel(idx);\r\n return [+itemModel.get('x'), +itemModel.get('y')];\r\n });\r\n var min = [];\r\n var max = [];\r\n fromPoints(positions, min, max);\r\n if (max[0] - min[0] === 0) {\r\n max[0] += 1;\r\n min[0] -= 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n max[1] += 1;\r\n min[1] -= 1;\r\n }\r\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\r\n var viewRect = getViewRect$2(seriesModel, api, aspect);\r\n if (isNaN(aspect)) {\r\n min = [viewRect.x, viewRect.y];\r\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\r\n }\r\n var bbWidth = max[0] - min[0];\r\n var bbHeight = max[1] - min[1];\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\r\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\r\n viewCoordSys.setCenter(seriesModel.get('center'));\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n viewList.push(viewCoordSys);\r\n }\r\n });\r\n return viewList;\r\n }\n\n registerProcessor(categoryFilter);\r\n registerVisual(categoryVisual);\r\n registerVisual(graphEdgeVisual);\r\n registerLayout(graphSimpleLayout);\r\n registerLayout(PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);\r\n registerLayout(graphForceLayout);\r\n registerCoordinateSystem('graphView', {\r\n dimensions: View.dimensions,\r\n create: createViewCoordSys\r\n });\n\n var GaugeSeriesModel = (function (_super) {\r\n __extends(GaugeSeriesModel, _super);\r\n function GaugeSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeSeriesModel.type;\r\n _this.visualStyleAccessPath = 'itemStyle';\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, ['value']);\r\n };\r\n GaugeSeriesModel.type = 'series.gauge';\r\n GaugeSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n legendHoverLink: true,\r\n radius: '75%',\r\n startAngle: 225,\r\n endAngle: -45,\r\n clockwise: true,\r\n min: 0,\r\n max: 100,\r\n splitNumber: 10,\r\n axisLine: {\r\n show: true,\r\n roundCap: false,\r\n lineStyle: {\r\n color: [[1, '#E6EBF8']],\r\n width: 10\r\n }\r\n },\r\n progress: {\r\n show: false,\r\n overlap: true,\r\n width: 10,\r\n roundCap: false,\r\n clip: true\r\n },\r\n splitLine: {\r\n show: true,\r\n length: 10,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 3,\r\n type: 'solid'\r\n }\r\n },\r\n axisTick: {\r\n show: true,\r\n splitNumber: 5,\r\n length: 6,\r\n distance: 10,\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n distance: 15,\r\n color: '#464646',\r\n fontSize: 12\r\n },\r\n pointer: {\r\n icon: null,\r\n offsetCenter: [0, 0],\r\n show: true,\r\n length: '60%',\r\n width: 6,\r\n keepAspect: false\r\n },\r\n anchor: {\r\n show: false,\r\n showAbove: false,\r\n size: 6,\r\n icon: 'circle',\r\n offsetCenter: [0, 0],\r\n keepAspect: false,\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 0,\r\n borderColor: '#5470c6'\r\n }\r\n },\r\n title: {\r\n show: true,\r\n offsetCenter: [0, '20%'],\r\n color: '#464646',\r\n fontSize: 16,\r\n valueAnimation: false\r\n },\r\n detail: {\r\n show: true,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 0,\r\n borderColor: '#ccc',\r\n width: 100,\r\n height: null,\r\n padding: [5, 10],\r\n offsetCenter: [0, '40%'],\r\n color: '#464646',\r\n fontSize: 30,\r\n fontWeight: 'bold',\r\n lineHeight: 30,\r\n valueAnimation: false\r\n }\r\n };\r\n return GaugeSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(GaugeSeriesModel);\n\n var PointerShape = (function () {\r\n function PointerShape() {\r\n this.angle = 0;\r\n this.width = 10;\r\n this.r = 10;\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n return PointerShape;\r\n }());\r\n var PointerPath = (function (_super) {\r\n __extends(PointerPath, _super);\r\n function PointerPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'pointer';\r\n return _this;\r\n }\r\n PointerPath.prototype.getDefaultShape = function () {\r\n return new PointerShape();\r\n };\r\n PointerPath.prototype.buildPath = function (ctx, shape) {\r\n var mathCos = Math.cos;\r\n var mathSin = Math.sin;\r\n var r = shape.r;\r\n var width = shape.width;\r\n var angle = shape.angle;\r\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\r\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\r\n angle = shape.angle - Math.PI / 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\r\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\r\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\r\n ctx.lineTo(x, y);\r\n };\r\n return PointerPath;\r\n }(Path));\n\n function parsePosition(seriesModel, api) {\r\n var center = seriesModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], api.getWidth());\r\n var cy = parsePercent$2(center[1], api.getHeight());\r\n var r = parsePercent$2(seriesModel.get('radius'), size / 2);\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r: r\r\n };\r\n }\r\n function formatLabel(value, labelFormatter) {\r\n var label = value == null ? '' : (value + '');\r\n if (labelFormatter) {\r\n if (typeof labelFormatter === 'string') {\r\n label = labelFormatter.replace('{value}', label);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n label = labelFormatter(value);\r\n }\r\n }\r\n return label;\r\n }\r\n var PI2$9 = Math.PI * 2;\r\n var GaugeView = (function (_super) {\r\n __extends(GaugeView, _super);\r\n function GaugeView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GaugeView.type;\r\n return _this;\r\n }\r\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\r\n var posInfo = parsePosition(seriesModel, api);\r\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\r\n this._data = seriesModel.getData();\r\n };\r\n GaugeView.prototype.dispose = function () { };\r\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\r\n var group = this.group;\r\n var clockwise = seriesModel.get('clockwise');\r\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\r\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\r\n var axisLineModel = seriesModel.getModel('axisLine');\r\n var roundCap = axisLineModel.get('roundCap');\r\n var MainPath = roundCap ? SausagePath : Sector;\r\n var showAxis = axisLineModel.get('show');\r\n var lineStyleModel = axisLineModel.getModel('lineStyle');\r\n var axisLineWidth = lineStyleModel.get('width');\r\n var angleRangeSpan = !((endAngle - startAngle) % PI2$9) && endAngle !== startAngle\r\n ? PI2$9 : (endAngle - startAngle) % PI2$9;\r\n var prevEndAngle = startAngle;\r\n for (var i = 0; showAxis && i < colorList.length; i++) {\r\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\r\n endAngle = startAngle + angleRangeSpan * percent;\r\n var sector = new MainPath({\r\n shape: {\r\n startAngle: prevEndAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: posInfo.r - axisLineWidth,\r\n r: posInfo.r\r\n },\r\n silent: true\r\n });\r\n sector.setStyle({\r\n fill: colorList[i][1]\r\n });\r\n sector.setStyle(lineStyleModel.getLineStyle(['color', 'width']));\r\n group.add(sector);\r\n prevEndAngle = endAngle;\r\n }\r\n var getColor = function (percent) {\r\n if (percent <= 0) {\r\n return colorList[0][1];\r\n }\r\n var i;\r\n for (i = 0; i < colorList.length; i++) {\r\n if (colorList[i][0] >= percent\r\n && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\r\n return colorList[i][1];\r\n }\r\n }\r\n return colorList[i - 1][1];\r\n };\r\n if (!clockwise) {\r\n var tmp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp;\r\n }\r\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\r\n this._renderAnchor(seriesModel, posInfo);\r\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\r\n };\r\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var cx = posInfo.cx;\r\n var cy = posInfo.cy;\r\n var r = posInfo.r;\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var splitLineModel = seriesModel.getModel('splitLine');\r\n var tickModel = seriesModel.getModel('axisTick');\r\n var labelModel = seriesModel.getModel('axisLabel');\r\n var splitNumber = seriesModel.get('splitNumber');\r\n var subSplitNumber = tickModel.get('splitNumber');\r\n var splitLineLen = parsePercent$2(splitLineModel.get('length'), r);\r\n var tickLen = parsePercent$2(tickModel.get('length'), r);\r\n var angle = startAngle;\r\n var step = (endAngle - startAngle) / splitNumber;\r\n var subStep = step / subSplitNumber;\r\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\r\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\r\n var splitLineDistance = splitLineModel.get('distance');\r\n var unitX;\r\n var unitY;\r\n for (var i = 0; i <= splitNumber; i++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n if (splitLineModel.get('show')) {\r\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\r\n var splitLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - splitLineLen - distance) + cx,\r\n y2: unitY * (r - splitLineLen - distance) + cy\r\n },\r\n style: splitLineStyle,\r\n silent: true\r\n });\r\n if (splitLineStyle.stroke === 'auto') {\r\n splitLine.setStyle({\r\n stroke: getColor(i / splitNumber)\r\n });\r\n }\r\n group.add(splitLine);\r\n }\r\n if (labelModel.get('show')) {\r\n var distance = labelModel.get('distance') + splitLineDistance;\r\n var label = formatLabel(round$1(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\r\n var autoColor = getColor(i / splitNumber);\r\n group.add(new ZRText({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: unitX * (r - splitLineLen - distance) + cx,\r\n y: unitY * (r - splitLineLen - distance) + cy,\r\n verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'),\r\n align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true\r\n }));\r\n }\r\n if (tickModel.get('show') && i !== splitNumber) {\r\n var distance = tickModel.get('distance');\r\n distance = distance ? distance + axisLineWidth : axisLineWidth;\r\n for (var j = 0; j <= subSplitNumber; j++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n var tickLine = new Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - tickLen - distance) + cx,\r\n y2: unitY * (r - tickLen - distance) + cy\r\n },\r\n silent: true,\r\n style: tickLineStyle\r\n });\r\n if (tickLineStyle.stroke === 'auto') {\r\n tickLine.setStyle({\r\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\r\n });\r\n }\r\n group.add(tickLine);\r\n angle += subStep;\r\n }\r\n angle -= subStep;\r\n }\r\n else {\r\n angle += step;\r\n }\r\n }\r\n };\r\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n var oldProgressData = this._progressEls;\r\n var progressList = [];\r\n var showPointer = seriesModel.get(['pointer', 'show']);\r\n var progressModel = seriesModel.getModel('progress');\r\n var showProgress = progressModel.get('show');\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var valueExtent = [minVal, maxVal];\r\n var angleExtent = [startAngle, endAngle];\r\n function createPointer(idx, angle) {\r\n var itemModel = data.getItemModel(idx);\r\n var pointerModel = itemModel.getModel('pointer');\r\n var pointerWidth = parsePercent$2(pointerModel.get('width'), posInfo.r);\r\n var pointerLength = parsePercent$2(pointerModel.get('length'), posInfo.r);\r\n var pointerStr = seriesModel.get(['pointer', 'icon']);\r\n var pointerOffset = pointerModel.get('offsetCenter');\r\n var pointerKeepAspect = pointerModel.get('keepAspect');\r\n var pointer;\r\n if (pointerStr) {\r\n pointer = createSymbol(pointerStr, parsePercent$2(pointerOffset[0], posInfo.r) - pointerWidth / 2, parsePercent$2(pointerOffset[1], posInfo.r) - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\r\n }\r\n else {\r\n pointer = new PointerPath({\r\n shape: {\r\n angle: -Math.PI / 2,\r\n width: parsePercent$2(pointerModel.get('width'), posInfo.r),\r\n r: parsePercent$2(pointerModel.get('length'), posInfo.r)\r\n }\r\n });\r\n }\r\n pointer.rotation = -(angle + Math.PI / 2);\r\n pointer.x = posInfo.cx;\r\n pointer.y = posInfo.cy;\r\n return pointer;\r\n }\r\n function createProgress(idx, endAngle) {\r\n var roundCap = progressModel.get('roundCap');\r\n var ProgressPath = roundCap ? SausagePath : Sector;\r\n var isOverlap = progressModel.get('overlap');\r\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\r\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\r\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\r\n var progress = new ProgressPath({\r\n shape: {\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: r0,\r\n r: r\r\n }\r\n });\r\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\r\n return progress;\r\n }\r\n if (showProgress || showPointer) {\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n if (showPointer) {\r\n var pointer = createPointer(idx, startAngle);\r\n initProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(idx, pointer);\r\n }\r\n if (showProgress) {\r\n var progress = createProgress(idx, startAngle);\r\n var isClip = progressModel.get('clip');\r\n initProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[idx] = progress;\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n if (showPointer) {\r\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\r\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\r\n var pointer = createPointer(newIdx, previousRotate);\r\n pointer.rotation = previousRotate;\r\n updateProps(pointer, {\r\n rotation: -(linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true)\r\n + Math.PI / 2)\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(newIdx, pointer);\r\n }\r\n if (showProgress) {\r\n var previousProgress = oldProgressData[oldIdx];\r\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\r\n var progress = createProgress(newIdx, previousEndAngle);\r\n var isClip = progressModel.get('clip');\r\n updateProps(progress, {\r\n shape: {\r\n endAngle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n progressList[newIdx] = progress;\r\n }\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n if (showPointer) {\r\n var pointer = data.getItemGraphicEl(idx);\r\n pointer.useStyle(data.getItemVisual(idx, 'style'));\r\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\r\n if (pointer.style.fill === 'auto') {\r\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\r\n }\r\n pointer.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(pointer, itemModel);\r\n enableHoverEmphasis(pointer, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n if (showProgress) {\r\n var progress = progressList[idx];\r\n progress.useStyle(data.getItemVisual(idx, 'style'));\r\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\r\n progress.z2EmphasisLift = 0;\r\n setStatesStylesFromModel(progress, itemModel);\r\n enableHoverEmphasis(progress, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n });\r\n this._progressEls = progressList;\r\n }\r\n };\r\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\r\n var anchorModel = seriesModel.getModel('anchor');\r\n var showAnchor = anchorModel.get('show');\r\n if (showAnchor) {\r\n var anchorSize = anchorModel.get('size');\r\n var anchorType = anchorModel.get('icon');\r\n var offsetCenter = anchorModel.get('offsetCenter');\r\n var anchorKeepAspect = anchorModel.get('keepAspect');\r\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$2(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$2(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\r\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\r\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\r\n this.group.add(anchor);\r\n }\r\n };\r\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\r\n var _this = this;\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var minVal = +seriesModel.get('min');\r\n var maxVal = +seriesModel.get('max');\r\n var contentGroup = new Group();\r\n var newTitleEls = [];\r\n var newDetailEls = [];\r\n var hasAnimation = seriesModel.isAnimationEnabled();\r\n data.diff(this._data)\r\n .add(function (idx) {\r\n newTitleEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n newDetailEls[idx] = new ZRText({\r\n silent: true\r\n });\r\n })\r\n .update(function (idx, oldIdx) {\r\n newTitleEls[idx] = _this._titleEls[oldIdx];\r\n newDetailEls[idx] = _this._detailEls[oldIdx];\r\n })\r\n .execute();\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var value = data.get(valueDim, idx);\r\n var itemGroup = new Group();\r\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\r\n var itemTitleModel = itemModel.getModel('title');\r\n if (itemTitleModel.get('show')) {\r\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\r\n var titleX = posInfo.cx + parsePercent$2(titleOffsetCenter[0], posInfo.r);\r\n var titleY = posInfo.cy + parsePercent$2(titleOffsetCenter[1], posInfo.r);\r\n var labelEl = newTitleEls[idx];\r\n labelEl.attr({\r\n style: createTextStyle(itemTitleModel, {\r\n x: titleX,\r\n y: titleY,\r\n text: data.getName(idx),\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: autoColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemTitleModel }, seriesModel.getRawValue(idx), function () { return data.getName(idx); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n var itemDetailModel = itemModel.getModel('detail');\r\n if (itemDetailModel.get('show')) {\r\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\r\n var detailX = posInfo.cx + parsePercent$2(detailOffsetCenter[0], posInfo.r);\r\n var detailY = posInfo.cy + parsePercent$2(detailOffsetCenter[1], posInfo.r);\r\n var width = parsePercent$2(itemDetailModel.get('width'), posInfo.r);\r\n var height = parsePercent$2(itemDetailModel.get('height'), posInfo.r);\r\n var detailColor = (seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor);\r\n var labelEl = newDetailEls[idx];\r\n var formatter_1 = itemDetailModel.get('formatter');\r\n labelEl.attr({\r\n style: createTextStyle(itemDetailModel, {\r\n x: detailX,\r\n y: detailY,\r\n text: formatLabel(value, formatter_1),\r\n width: isNaN(width) ? null : width,\r\n height: isNaN(height) ? null : height,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, { inheritColor: detailColor })\r\n });\r\n setLabelValueAnimation(labelEl, { normal: itemDetailModel }, seriesModel.getRawValue(idx), function (value) { return formatLabel(value, formatter_1); });\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel);\r\n itemGroup.add(labelEl);\r\n }\r\n contentGroup.add(itemGroup);\r\n });\r\n this.group.add(contentGroup);\r\n this._titleEls = newTitleEls;\r\n this._detailEls = newDetailEls;\r\n };\r\n GaugeView.type = 'gauge';\r\n return GaugeView;\r\n }(ChartView));\r\n ChartView.registerClass(GaugeView);\n\n var FunnelSeriesModel = (function (_super) {\r\n __extends(FunnelSeriesModel, _super);\r\n function FunnelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n FunnelSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueDim = data.mapDimension('value');\r\n var sum = data.getSum(valueDim);\r\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n FunnelSeriesModel.type = 'series.funnel';\r\n FunnelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n minSize: '0%',\r\n maxSize: '100%',\r\n sort: 'descending',\r\n orient: 'vertical',\r\n gap: 0,\r\n funnelAlign: 'center',\r\n label: {\r\n show: true,\r\n position: 'outer'\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 20,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n itemStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return FunnelSeriesModel;\r\n }(SeriesModel));\r\n ComponentModel.registerClass(FunnelSeriesModel);\n\n var opacityAccessPath = ['itemStyle', 'opacity'];\r\n var FunnelPiece = (function (_super) {\r\n __extends(FunnelPiece, _super);\r\n function FunnelPiece(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var polygon = _this;\r\n var labelLine = new Polyline();\r\n var text = new ZRText();\r\n polygon.setTextContent(text);\r\n _this.setTextGuideLine(labelLine);\r\n _this.updateData(data, idx, true);\r\n return _this;\r\n }\r\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\r\n var polygon = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var opacity = itemModel.get(opacityAccessPath);\r\n opacity = opacity == null ? 1 : opacity;\r\n polygon.useStyle(data.getItemVisual(idx, 'style'));\r\n polygon.style.lineJoin = 'round';\r\n if (firstCreate) {\r\n polygon.setShape({\r\n points: layout.points\r\n });\r\n polygon.style.opacity = 0;\r\n initProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n updateProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n },\r\n shape: {\r\n points: layout.points\r\n }\r\n }, seriesModel, idx);\r\n }\r\n setStatesStylesFromModel(polygon, itemModel);\r\n this._updateLabel(data, idx);\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n FunnelPiece.prototype._updateLabel = function (data, idx) {\r\n var polygon = this;\r\n var labelLine = this.getTextGuideLine();\r\n var labelText = polygon.getTextContent();\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var layout = data.getItemLayout(idx);\r\n var labelLayout = layout.label;\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style.fill;\r\n setLabelStyle(labelText, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: data.getName(idx)\r\n }, { normal: {\r\n align: labelLayout.textAlign,\r\n verticalAlign: labelLayout.verticalAlign\r\n } });\r\n polygon.setTextConfig({\r\n local: true,\r\n inside: !!labelLayout.inside,\r\n insideStroke: visualColor,\r\n outsideFill: visualColor\r\n });\r\n var linePoints = labelLayout.linePoints;\r\n labelLine.setShape({\r\n points: linePoints\r\n });\r\n polygon.textGuideLineConfig = {\r\n anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null\r\n };\r\n updateProps(labelText, {\r\n style: {\r\n x: labelLayout.x,\r\n y: labelLayout.y\r\n }\r\n }, seriesModel, idx);\r\n labelText.attr({\r\n rotation: labelLayout.rotation,\r\n originX: labelLayout.x,\r\n originY: labelLayout.y,\r\n z2: 10\r\n });\r\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor\r\n });\r\n };\r\n return FunnelPiece;\r\n }(Polygon));\r\n var FunnelView = (function (_super) {\r\n __extends(FunnelView, _super);\r\n function FunnelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = FunnelView.type;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var funnelPiece = new FunnelPiece(data, idx);\r\n data.setItemGraphicEl(idx, funnelPiece);\r\n group.add(funnelPiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piece = oldData.getItemGraphicEl(oldIdx);\r\n piece.updateData(data, newIdx);\r\n group.add(piece);\r\n data.setItemGraphicEl(newIdx, piece);\r\n })\r\n .remove(function (idx) {\r\n var piece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piece, seriesModel, idx);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n FunnelView.prototype.remove = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n FunnelView.prototype.dispose = function () { };\r\n FunnelView.type = 'funnel';\r\n return FunnelView;\r\n }(ChartView));\r\n ChartView.registerClass(FunnelView);\n\n function getViewRect$3(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function getSortedIndices(data, sort) {\r\n var valueDim = data.mapDimension('value');\r\n var valueArr = data.mapArray(valueDim, function (val) {\r\n return val;\r\n });\r\n var indices = [];\r\n var isAscending = sort === 'ascending';\r\n for (var i = 0, len = data.count(); i < len; i++) {\r\n indices[i] = i;\r\n }\r\n if (typeof sort === 'function') {\r\n indices.sort(sort);\r\n }\r\n else if (sort !== 'none') {\r\n indices.sort(function (a, b) {\r\n return isAscending\r\n ? valueArr[a] - valueArr[b]\r\n : valueArr[b] - valueArr[a];\r\n });\r\n }\r\n return indices;\r\n }\r\n function labelLayout(data) {\r\n var seriesModel = data.hostModel;\r\n var orient = seriesModel.get('orient');\r\n data.each(function (idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var layout = data.getItemLayout(idx);\r\n var points = layout.points;\r\n var isLabelInside = labelPosition === 'inner'\r\n || labelPosition === 'inside' || labelPosition === 'center'\r\n || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\r\n var textAlign;\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n if (isLabelInside) {\r\n if (labelPosition === 'insideLeft') {\r\n textX = (points[0][0] + points[3][0]) / 2 + 5;\r\n textY = (points[0][1] + points[3][1]) / 2;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'insideRight') {\r\n textX = (points[1][0] + points[2][0]) / 2 - 5;\r\n textY = (points[1][1] + points[2][1]) / 2;\r\n textAlign = 'right';\r\n }\r\n else {\r\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\r\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\r\n textAlign = 'center';\r\n }\r\n linePoints = [\r\n [textX, textY], [textX, textY]\r\n ];\r\n }\r\n else {\r\n var x1 = void 0;\r\n var y1 = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var labelLineLen = labelLineModel.get('length');\r\n if (__DEV__) {\r\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'left';\r\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\r\n }\r\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\r\n labelPosition = 'bottom';\r\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\r\n }\r\n }\r\n if (labelPosition === 'left') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n else if (labelPosition === 'right') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'top') {\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'bottom') {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'rightTop') {\r\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\r\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'top';\r\n }\r\n }\r\n else if (labelPosition === 'rightBottom') {\r\n x1 = points[2][0];\r\n y1 = points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'bottom';\r\n }\r\n }\r\n else if (labelPosition === 'leftTop') {\r\n x1 = points[0][0];\r\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (labelPosition === 'leftBottom') {\r\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\r\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else {\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n }\r\n if (orient === 'horizontal') {\r\n x2 = x1;\r\n textX = x2;\r\n }\r\n else {\r\n y2 = y1;\r\n textY = y2;\r\n }\r\n linePoints = [[x1, y1], [x2, y2]];\r\n }\r\n layout.label = {\r\n linePoints: linePoints,\r\n x: textX,\r\n y: textY,\r\n verticalAlign: 'middle',\r\n textAlign: textAlign,\r\n inside: isLabelInside\r\n };\r\n });\r\n }\r\n function funnelLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var sort = seriesModel.get('sort');\r\n var viewRect = getViewRect$3(seriesModel, api);\r\n var orient = seriesModel.get('orient');\r\n var viewWidth = viewRect.width;\r\n var viewHeight = viewRect.height;\r\n var indices = getSortedIndices(data, sort);\r\n var x = viewRect.x;\r\n var y = viewRect.y;\r\n var sizeExtent = orient === 'horizontal' ? [\r\n parsePercent$2(seriesModel.get('minSize'), viewHeight),\r\n parsePercent$2(seriesModel.get('maxSize'), viewHeight)\r\n ] : [\r\n parsePercent$2(seriesModel.get('minSize'), viewWidth),\r\n parsePercent$2(seriesModel.get('maxSize'), viewWidth)\r\n ];\r\n var dataExtent = data.getDataExtent(valueDim);\r\n var min = seriesModel.get('min');\r\n var max = seriesModel.get('max');\r\n if (min == null) {\r\n min = Math.min(dataExtent[0], 0);\r\n }\r\n if (max == null) {\r\n max = dataExtent[1];\r\n }\r\n var funnelAlign = seriesModel.get('funnelAlign');\r\n var gap = seriesModel.get('gap');\r\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\r\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\r\n var getLinePoints = function (idx, offset) {\r\n if (orient === 'horizontal') {\r\n var val_1 = data.get(valueDim, idx) || 0;\r\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\r\n var y0 = void 0;\r\n switch (funnelAlign) {\r\n case 'top':\r\n y0 = y;\r\n break;\r\n case 'center':\r\n y0 = y + (viewHeight - itemHeight) / 2;\r\n break;\r\n case 'bottom':\r\n y0 = y + (viewHeight - itemHeight);\r\n break;\r\n }\r\n return [\r\n [offset, y0],\r\n [offset, y0 + itemHeight]\r\n ];\r\n }\r\n var val = data.get(valueDim, idx) || 0;\r\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\r\n var x0;\r\n switch (funnelAlign) {\r\n case 'left':\r\n x0 = x;\r\n break;\r\n case 'center':\r\n x0 = x + (viewWidth - itemWidth) / 2;\r\n break;\r\n case 'right':\r\n x0 = x + viewWidth - itemWidth;\r\n break;\r\n }\r\n return [\r\n [x0, offset],\r\n [x0 + itemWidth, offset]\r\n ];\r\n };\r\n if (sort === 'ascending') {\r\n itemSize = -itemSize;\r\n gap = -gap;\r\n if (orient === 'horizontal') {\r\n x += viewWidth;\r\n }\r\n else {\r\n y += viewHeight;\r\n }\r\n indices = indices.reverse();\r\n }\r\n for (var i = 0; i < indices.length; i++) {\r\n var idx = indices[i];\r\n var nextIdx = indices[i + 1];\r\n var itemModel = data.getItemModel(idx);\r\n if (orient === 'horizontal') {\r\n var width = itemModel.get(['itemStyle', 'width']);\r\n if (width == null) {\r\n width = itemSize;\r\n }\r\n else {\r\n width = parsePercent$2(width, viewWidth);\r\n if (sort === 'ascending') {\r\n width = -width;\r\n }\r\n }\r\n var start = getLinePoints(idx, x);\r\n var end = getLinePoints(nextIdx, x + width);\r\n x += width + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n else {\r\n var height = itemModel.get(['itemStyle', 'height']);\r\n if (height == null) {\r\n height = itemSize;\r\n }\r\n else {\r\n height = parsePercent$2(height, viewHeight);\r\n if (sort === 'ascending') {\r\n height = -height;\r\n }\r\n }\r\n var start = getLinePoints(idx, y);\r\n var end = getLinePoints(nextIdx, y + height);\r\n y += height + gap;\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n }\r\n labelLayout(data);\r\n });\r\n }\n\n registerLayout(funnelLayout);\r\n registerProcessor(dataFilter('funnel'));\n\n function parallelPreprocessor(option) {\r\n createParallelIfNeeded(option);\r\n mergeAxisOptionFromParallel(option);\r\n }\r\n function createParallelIfNeeded(option) {\r\n if (option.parallel) {\r\n return;\r\n }\r\n var hasParallelSeries = false;\r\n each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'parallel') {\r\n hasParallelSeries = true;\r\n }\r\n });\r\n if (hasParallelSeries) {\r\n option.parallel = [{}];\r\n }\r\n }\r\n function mergeAxisOptionFromParallel(option) {\r\n var axes = normalizeToArray(option.parallelAxis);\r\n each(axes, function (axisOption) {\r\n if (!isObject(axisOption)) {\r\n return;\r\n }\r\n var parallelIndex = axisOption.parallelIndex || 0;\r\n var parallelOption = normalizeToArray(option.parallel)[parallelIndex];\r\n if (parallelOption && parallelOption.parallelAxisDefault) {\r\n merge(axisOption, parallelOption.parallelAxisDefault, false);\r\n }\r\n });\r\n }\n\n var ParallelAxis = (function (_super) {\r\n __extends(ParallelAxis, _super);\r\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.axisIndex = axisIndex;\r\n return _this;\r\n }\r\n ParallelAxis.prototype.isHorizontal = function () {\r\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\r\n };\r\n return ParallelAxis;\r\n }(Axis));\n\n function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\r\n delta = delta || 0;\r\n var extentSpan = extent[1] - extent[0];\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n handleEnds[handleIndex] += delta;\r\n var extentMinSpan = minSpan || 0;\r\n var realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n var currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n return handleEnds;\r\n }\r\n function getSpanSign(handleEnds, handleIndex) {\r\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n return { span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 };\r\n }\r\n function restrict(value, extend) {\r\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\r\n }\n\n var each$6 = each;\r\n var mathMin$8 = Math.min;\r\n var mathMax$8 = Math.max;\r\n var mathFloor$2 = Math.floor;\r\n var mathCeil$1 = Math.ceil;\r\n var round$2 = round$1;\r\n var PI$8 = Math.PI;\r\n var Parallel = (function () {\r\n function Parallel(parallelModel, ecModel, api) {\r\n this.type = 'parallel';\r\n this._axesMap = createHashMap();\r\n this._axesLayout = {};\r\n this.dimensions = parallelModel.dimensions;\r\n this._model = parallelModel;\r\n this._init(parallelModel, ecModel, api);\r\n }\r\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\r\n var dimensions = parallelModel.dimensions;\r\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\r\n each$6(dimensions, function (dim, idx) {\r\n var axisIndex = parallelAxisIndex[idx];\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = axisModel.coordinateSystem = this;\r\n }, this);\r\n };\r\n Parallel.prototype.update = function (ecModel, api) {\r\n this._updateAxesFromSeries(this._model, ecModel);\r\n };\r\n Parallel.prototype.containPoint = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var axisBase = layoutInfo.axisBase;\r\n var layoutBase = layoutInfo.layoutBase;\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var pAxis = point[1 - pixelDimIndex];\r\n var pLayout = point[pixelDimIndex];\r\n return pAxis >= axisBase\r\n && pAxis <= axisBase + layoutInfo.axisLength\r\n && pLayout >= layoutBase\r\n && pLayout <= layoutBase + layoutInfo.layoutLength;\r\n };\r\n Parallel.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!parallelModel.contains(seriesModel, ecModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n each$6(this.dimensions, function (dim) {\r\n var axis = this._axesMap.get(dim);\r\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\r\n niceScaleExtent(axis.scale, axis.model);\r\n }, this);\r\n }, this);\r\n };\r\n Parallel.prototype.resize = function (parallelModel, api) {\r\n this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._layoutAxes();\r\n };\r\n Parallel.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Parallel.prototype._makeLayoutInfo = function () {\r\n var parallelModel = this._model;\r\n var rect = this._rect;\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n var layout = parallelModel.get('layout');\r\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\r\n var layoutLength = rect[wh[pixelDimIndex]];\r\n var layoutExtent = [0, layoutLength];\r\n var axisCount = this.dimensions.length;\r\n var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent);\r\n var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\r\n var axisExpandable = parallelModel.get('axisExpandable')\r\n && axisCount > 3\r\n && axisCount > axisExpandCount\r\n && axisExpandCount > 1\r\n && axisExpandWidth > 0\r\n && layoutLength > 0;\r\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\r\n var winSize;\r\n if (!axisExpandWindow) {\r\n winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\r\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2);\r\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n else {\r\n winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\r\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\r\n var winInnerIndices = [\r\n mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,\r\n mathCeil$1(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1\r\n ];\r\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\r\n return {\r\n layout: layout,\r\n pixelDimIndex: pixelDimIndex,\r\n layoutBase: rect[xy[pixelDimIndex]],\r\n layoutLength: layoutLength,\r\n axisBase: rect[xy[1 - pixelDimIndex]],\r\n axisLength: rect[wh[1 - pixelDimIndex]],\r\n axisExpandable: axisExpandable,\r\n axisExpandWidth: axisExpandWidth,\r\n axisCollapseWidth: axisCollapseWidth,\r\n axisExpandWindow: axisExpandWindow,\r\n axisCount: axisCount,\r\n winInnerIndices: winInnerIndices,\r\n axisExpandWindow0Pos: axisExpandWindow0Pos\r\n };\r\n };\r\n Parallel.prototype._layoutAxes = function () {\r\n var rect = this._rect;\r\n var axes = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var layoutInfo = this._makeLayoutInfo();\r\n var layout = layoutInfo.layout;\r\n axes.each(function (axis) {\r\n var axisExtent = [0, layoutInfo.axisLength];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\r\n });\r\n each$6(dimensions, function (dim, idx) {\r\n var posInfo = (layoutInfo.axisExpandable\r\n ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\r\n var positionTable = {\r\n horizontal: {\r\n x: posInfo.position,\r\n y: layoutInfo.axisLength\r\n },\r\n vertical: {\r\n x: 0,\r\n y: posInfo.position\r\n }\r\n };\r\n var rotationTable = {\r\n horizontal: PI$8 / 2,\r\n vertical: 0\r\n };\r\n var position = [\r\n positionTable[layout].x + rect.x,\r\n positionTable[layout].y + rect.y\r\n ];\r\n var rotation = rotationTable[layout];\r\n var transform = create$1();\r\n rotate(transform, transform, rotation);\r\n translate(transform, transform, position);\r\n this._axesLayout[dim] = {\r\n position: position,\r\n rotation: rotation,\r\n transform: transform,\r\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\r\n axisLabelShow: posInfo.axisLabelShow,\r\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\r\n tickDirection: 1,\r\n labelDirection: 1\r\n };\r\n }, this);\r\n };\r\n Parallel.prototype.getAxis = function (dim) {\r\n return this._axesMap.get(dim);\r\n };\r\n Parallel.prototype.dataToPoint = function (value, dim) {\r\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\r\n };\r\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\r\n start == null && (start = 0);\r\n end == null && (end = data.count());\r\n var axesMap = this._axesMap;\r\n var dimensions = this.dimensions;\r\n var dataDimensions = [];\r\n var axisModels = [];\r\n each(dimensions, function (axisDim) {\r\n dataDimensions.push(data.mapDimension(axisDim));\r\n axisModels.push(axesMap.get(axisDim).model);\r\n });\r\n var hasActiveSet = this.hasAxisBrushed();\r\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\r\n var activeState = void 0;\r\n if (!hasActiveSet) {\r\n activeState = 'normal';\r\n }\r\n else {\r\n activeState = 'active';\r\n var values = data.getValues(dataDimensions, dataIndex);\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n var state = axisModels[j].getActiveState(values[j]);\r\n if (state === 'inactive') {\r\n activeState = 'inactive';\r\n break;\r\n }\r\n }\r\n }\r\n callback(activeState, dataIndex);\r\n }\r\n };\r\n Parallel.prototype.hasAxisBrushed = function () {\r\n var dimensions = this.dimensions;\r\n var axesMap = this._axesMap;\r\n var hasActiveSet = false;\r\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\r\n hasActiveSet = true;\r\n }\r\n }\r\n return hasActiveSet;\r\n };\r\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\r\n var axisLayout = this._axesLayout[dim];\r\n return applyTransform$1([coord, 0], axisLayout.transform);\r\n };\r\n Parallel.prototype.getAxisLayout = function (dim) {\r\n return clone(this._axesLayout[dim]);\r\n };\r\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\r\n var layoutInfo = this._makeLayoutInfo();\r\n var pixelDimIndex = layoutInfo.pixelDimIndex;\r\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\r\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\r\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\r\n if (!this.containPoint(point)) {\r\n return { behavior: 'none', axisExpandWindow: axisExpandWindow };\r\n }\r\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\r\n var delta;\r\n var behavior = 'slide';\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var triggerArea = this._model.get('axisExpandSlideTriggerArea');\r\n var useJump = triggerArea[0] != null;\r\n if (axisCollapseWidth) {\r\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * triggerArea[2];\r\n }\r\n else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * (1 - triggerArea[2]);\r\n }\r\n else {\r\n (delta = pointCoord - winSize * triggerArea[1]) >= 0\r\n && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0\r\n && (delta = 0);\r\n }\r\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\r\n delta\r\n ? sliderMove(delta, axisExpandWindow, extent, 'all')\r\n : (behavior = 'none');\r\n }\r\n else {\r\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\r\n var pos = extent[1] * pointCoord / winSize2;\r\n axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)];\r\n axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2);\r\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\r\n }\r\n return {\r\n axisExpandWindow: axisExpandWindow,\r\n behavior: behavior\r\n };\r\n };\r\n return Parallel;\r\n }());\r\n function restrict$1(len, extent) {\r\n return mathMin$8(mathMax$8(len, extent[0]), extent[1]);\r\n }\r\n function layoutAxisWithoutExpand(axisIndex, layoutInfo) {\r\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\r\n return {\r\n position: step * axisIndex,\r\n axisNameAvailableWidth: step,\r\n axisLabelShow: true\r\n };\r\n }\r\n function layoutAxisWithExpand(axisIndex, layoutInfo) {\r\n var layoutLength = layoutInfo.layoutLength;\r\n var axisExpandWidth = layoutInfo.axisExpandWidth;\r\n var axisCount = layoutInfo.axisCount;\r\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n var winInnerIndices = layoutInfo.winInnerIndices;\r\n var position;\r\n var axisNameAvailableWidth = axisCollapseWidth;\r\n var axisLabelShow = false;\r\n var nameTruncateMaxWidth;\r\n if (axisIndex < winInnerIndices[0]) {\r\n position = axisIndex * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n else if (axisIndex <= winInnerIndices[1]) {\r\n position = layoutInfo.axisExpandWindow0Pos\r\n + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\r\n axisNameAvailableWidth = axisExpandWidth;\r\n axisLabelShow = true;\r\n }\r\n else {\r\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n return {\r\n position: position,\r\n axisNameAvailableWidth: axisNameAvailableWidth,\r\n axisLabelShow: axisLabelShow,\r\n nameTruncateMaxWidth: nameTruncateMaxWidth\r\n };\r\n }\n\n function create$2(ecModel, api) {\r\n var coordSysList = [];\r\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\r\n var coordSys = new Parallel(parallelModel, ecModel, api);\r\n coordSys.name = 'parallel_' + idx;\r\n coordSys.resize(parallelModel, api);\r\n parallelModel.coordinateSystem = coordSys;\r\n coordSys.model = parallelModel;\r\n coordSysList.push(coordSys);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'parallel') {\r\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\r\n }\r\n });\r\n return coordSysList;\r\n }\r\n CoordinateSystemManager.register('parallel', { create: create$2 });\n\n var ParallelAxisModel = (function (_super) {\r\n __extends(ParallelAxisModel, _super);\r\n function ParallelAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisModel.type;\r\n _this.activeIntervals = [];\r\n return _this;\r\n }\r\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\r\n return makeStyleMapper([\r\n ['fill', 'color'],\r\n ['lineWidth', 'borderWidth'],\r\n ['stroke', 'borderColor'],\r\n ['width', 'width'],\r\n ['opacity', 'opacity']\r\n ])(this.getModel('areaSelectStyle'));\r\n };\r\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\r\n var activeIntervals = this.activeIntervals = clone(intervals);\r\n if (activeIntervals) {\r\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\r\n asc(activeIntervals[i]);\r\n }\r\n }\r\n };\r\n ParallelAxisModel.prototype.getActiveState = function (value) {\r\n var activeIntervals = this.activeIntervals;\r\n if (!activeIntervals.length) {\r\n return 'normal';\r\n }\r\n if (value == null || isNaN(+value)) {\r\n return 'inactive';\r\n }\r\n if (activeIntervals.length === 1) {\r\n var interval = activeIntervals[0];\r\n if (interval[0] <= value && value <= interval[1]) {\r\n return 'active';\r\n }\r\n }\r\n else {\r\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\r\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\r\n return 'active';\r\n }\r\n }\r\n }\r\n return 'inactive';\r\n };\r\n return ParallelAxisModel;\r\n }(ComponentModel));\r\n var defaultOption$1 = {\r\n type: 'value',\r\n areaSelectStyle: {\r\n width: 20,\r\n borderWidth: 1,\r\n borderColor: 'rgba(160,197,232)',\r\n color: 'rgba(160,197,232)',\r\n opacity: 0.3\r\n },\r\n realtime: true,\r\n z: 10\r\n };\r\n ComponentModel.registerClass(ParallelAxisModel);\r\n mixin(ParallelAxisModel, AxisModelCommonMixin);\r\n axisModelCreator('parallel', ParallelAxisModel, defaultOption$1);\n\n var ParallelModel = (function (_super) {\r\n __extends(ParallelModel, _super);\r\n function ParallelModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelModel.type;\r\n return _this;\r\n }\r\n ParallelModel.prototype.init = function () {\r\n _super.prototype.init.apply(this, arguments);\r\n this.mergeOption({});\r\n };\r\n ParallelModel.prototype.mergeOption = function (newOption) {\r\n var thisOption = this.option;\r\n newOption && merge(thisOption, newOption, true);\r\n this._initDimensions();\r\n };\r\n ParallelModel.prototype.contains = function (model, ecModel) {\r\n var parallelIndex = model.get('parallelIndex');\r\n return parallelIndex != null\r\n && ecModel.getComponent('parallel', parallelIndex) === this;\r\n };\r\n ParallelModel.prototype.setAxisExpand = function (opt) {\r\n each([\r\n 'axisExpandable',\r\n 'axisExpandCenter',\r\n 'axisExpandCount',\r\n 'axisExpandWidth',\r\n 'axisExpandWindow'\r\n ], function (name) {\r\n if (opt.hasOwnProperty(name)) {\r\n this.option[name] = opt[name];\r\n }\r\n }, this);\r\n };\r\n ParallelModel.prototype._initDimensions = function () {\r\n var dimensions = this.dimensions = [];\r\n var parallelAxisIndex = this.parallelAxisIndex = [];\r\n var axisModels = filter(this.ecModel.queryComponents({ mainType: 'parallelAxis' }), function (axisModel) {\r\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\r\n }, this);\r\n each(axisModels, function (axisModel) {\r\n dimensions.push('dim' + axisModel.get('dim'));\r\n parallelAxisIndex.push(axisModel.componentIndex);\r\n });\r\n };\r\n ParallelModel.type = 'parallel';\r\n ParallelModel.dependencies = ['parallelAxis'];\r\n ParallelModel.layoutMode = 'box';\r\n ParallelModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n layout: 'horizontal',\r\n axisExpandable: false,\r\n axisExpandCenter: null,\r\n axisExpandCount: 0,\r\n axisExpandWidth: 50,\r\n axisExpandRate: 17,\r\n axisExpandDebounce: 50,\r\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\r\n axisExpandTriggerOn: 'click',\r\n parallelAxisDefault: null\r\n };\r\n return ParallelModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ParallelModel);\n\n var actionInfo$1 = {\r\n type: 'axisAreaSelect',\r\n event: 'axisAreaSelected'\r\n };\r\n registerAction(actionInfo$1, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallelAxis', query: payload }, function (parallelAxisModel) {\r\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\r\n });\r\n });\r\n registerAction('parallelAxisExpand', function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'parallel', query: payload }, function (parallelModel) {\r\n parallelModel.setAxisExpand(payload);\r\n });\r\n });\n\n var BRUSH_PANEL_GLOBAL = true;\r\n var mathMin$9 = Math.min;\r\n var mathMax$9 = Math.max;\r\n var mathPow$2 = Math.pow;\r\n var COVER_Z = 10000;\r\n var UNSELECT_THRESHOLD = 6;\r\n var MIN_RESIZE_LINE_WIDTH = 6;\r\n var MUTEX_RESOURCE_KEY = 'globalPan';\r\n var DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n };\r\n var CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n };\r\n var DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n };\r\n var baseUID = 0;\r\n var BrushController = (function (_super) {\r\n __extends(BrushController, _super);\r\n function BrushController(zr) {\r\n var _this = _super.call(this) || this;\r\n _this._track = [];\r\n _this._covers = [];\r\n _this._handlers = {};\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n _this._zr = zr;\r\n _this.group = new Group();\r\n _this._uid = 'brushController_' + baseUID++;\r\n each(pointerHandlers, function (handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, _this);\r\n return _this;\r\n }\r\n BrushController.prototype.enableBrush = function (brushOption) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n this._brushType && this._doDisableBrush();\r\n brushOption.brushType && this._doEnableBrush(brushOption);\r\n return this;\r\n };\r\n BrushController.prototype._doEnableBrush = function (brushOption) {\r\n var zr = this._zr;\r\n if (!this._enableGlobalPan) {\r\n take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\r\n };\r\n BrushController.prototype._doDisableBrush = function () {\r\n var zr = this._zr;\r\n release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n this._brushType = this._brushOption = null;\r\n };\r\n BrushController.prototype.setPanels = function (panelOpts) {\r\n if (panelOpts && panelOpts.length) {\r\n var panels_1 = this._panels = {};\r\n each(panelOpts, function (panelOpts) {\r\n panels_1[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.mount = function (opt) {\r\n opt = opt || {};\r\n if (__DEV__) {\r\n this._mounted = true;\r\n }\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n var thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n return this;\r\n };\r\n BrushController.prototype.updateCovers = function (coverConfigList) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n });\r\n var tmpIdPrefix = '\\0-brush-index-';\r\n var oldCovers = this._covers;\r\n var newCovers = this._covers = [];\r\n var controller = this;\r\n var creatingCover = this._creatingCover;\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n return this;\r\n function getKey(brushOption, index) {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n function oldGetKey(cover, index) {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n function addOrUpdate(newIndex, oldIndex) {\r\n var newBrushInternal = coverConfigList[newIndex];\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n var cover = newCovers[newIndex] = oldIndex != null\r\n ? (oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex])\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n function remove(oldIndex) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n };\r\n BrushController.prototype.unmount = function () {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n this.enableBrush(false);\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n if (__DEV__) {\r\n this._mounted = false;\r\n }\r\n return this;\r\n };\r\n BrushController.prototype.dispose = function () {\r\n this.unmount();\r\n this.off();\r\n };\r\n return BrushController;\r\n }(Eventful));\r\n function createCover(controller, brushOption) {\r\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n }\r\n function endCreating(controller, creatingCover) {\r\n var coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n }\r\n function updateCoverShape(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\r\n }\r\n function updateZ(cover, brushOption) {\r\n var z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el) {\r\n el.z = z;\r\n el.z2 = z;\r\n });\r\n }\r\n function updateCoverAfterCreation(controller, cover) {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n }\r\n function getCoverRenderer(cover) {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n }\r\n function getPanelByPoint(controller, e, localCursorPoint) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panel;\r\n var transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n }\r\n function getPanelByCover(controller, cover) {\r\n var panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL;\r\n }\r\n var panelId = cover.__brushOption.panelId;\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n }\r\n function clearCovers(controller) {\r\n var covers = controller._covers;\r\n var originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n return !!originalLength;\r\n }\r\n function trigger$1(controller, opt) {\r\n var areas = map(controller._covers, function (cover) {\r\n var brushOption = cover.__brushOption;\r\n var range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n }\r\n function shouldShowCover(controller) {\r\n var track = controller._track;\r\n if (!track.length) {\r\n return false;\r\n }\r\n var p2 = track[track.length - 1];\r\n var p1 = track[0];\r\n var dx = p2[0] - p1[0];\r\n var dy = p2[1] - p1[1];\r\n var dist = mathPow$2(dx * dx + dy * dy, 0.5);\r\n return dist > UNSELECT_THRESHOLD;\r\n }\r\n function getTrackEnds(track) {\r\n var tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n }\r\n function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\r\n var cover = new Group();\r\n cover.add(new Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n each(edgeNameSequences, function (nameSequence) {\r\n cover.add(new Rect({\r\n name: nameSequence.join(''),\r\n style: { opacity: 0 },\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n });\r\n return cover;\r\n }\r\n function updateBaseRect(controller, cover, localRange, brushOption) {\r\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n var x = localRange[0][0];\r\n var y = localRange[1][0];\r\n var xa = x - lineWidth / 2;\r\n var ya = y - lineWidth / 2;\r\n var x2 = localRange[0][1];\r\n var y2 = localRange[1][1];\r\n var x2a = x2 - handleSize + lineWidth / 2;\r\n var y2a = y2 - handleSize + lineWidth / 2;\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var widtha = width + lineWidth;\r\n var heighta = height + lineWidth;\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n }\r\n function updateCommon(controller, cover) {\r\n var brushOption = cover.__brushOption;\r\n var transformable = brushOption.transformable;\r\n var mainEl = cover.childAt(0);\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\r\n var el = cover.childOfName(nameSequence.join(''));\r\n var globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n });\r\n }\r\n function updateRectShape(controller, cover, name, x, y, w, h) {\r\n var el = cover.childOfName(name);\r\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\r\n }\r\n function makeStyle(brushOption) {\r\n return defaults({ strokeNoScale: true }, brushOption.brushStyle);\r\n }\r\n function formatRectRange(x, y, x2, y2) {\r\n var min = [mathMin$9(x, x2), mathMin$9(y, y2)];\r\n var max = [mathMax$9(x, x2), mathMax$9(y, y2)];\r\n return [\r\n [min[0], max[0]],\r\n [min[1], max[1]]\r\n ];\r\n }\r\n function getTransform$1(controller) {\r\n return getTransform(controller.group);\r\n }\r\n function getGlobalDirection1(controller, localDirName) {\r\n var map = { w: 'left', e: 'right', n: 'top', s: 'bottom' };\r\n var inverseMap = { left: 'w', right: 'e', top: 'n', bottom: 's' };\r\n var dir = transformDirection(map[localDirName], getTransform$1(controller));\r\n return inverseMap[dir];\r\n }\r\n function getGlobalDirection2(controller, localDirNameSeq) {\r\n var globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('');\r\n }\r\n function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\r\n var brushOption = cover.__brushOption;\r\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(dirNameSequence, function (dirName) {\r\n var ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function driftPolygon(controller, cover, dx, dy) {\r\n var range = cover.__brushOption.range;\r\n var localDelta = toLocalDelta(controller, dx, dy);\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n updateCoverAfterCreation(controller, cover);\r\n trigger$1(controller, { isEnd: false });\r\n }\r\n function toLocalDelta(controller, dx, dy) {\r\n var thisGroup = controller.group;\r\n var localD = thisGroup.transformCoordToLocal(dx, dy);\r\n var localZero = thisGroup.transformCoordToLocal(0, 0);\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n }\r\n function clipByPanel(controller, cover, data) {\r\n var panel = getPanelByCover(controller, cover);\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n }\r\n function pointsToRect(points) {\r\n var xmin = mathMin$9(points[0][0], points[1][0]);\r\n var ymin = mathMin$9(points[0][1], points[1][1]);\r\n var xmax = mathMax$9(points[0][0], points[1][0]);\r\n var ymax = mathMax$9(points[0][1], points[1][1]);\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n }\r\n function resetCursor(controller, e, localCursorPoint) {\r\n if (!controller._brushType\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\r\n return;\r\n }\r\n var zr = controller._zr;\r\n var covers = controller._covers;\r\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n if (!controller._dragging) {\r\n for (var i = 0; i < covers.length; i++) {\r\n var brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\r\n return;\r\n }\r\n }\r\n }\r\n currPanel && zr.setCursorStyle('crosshair');\r\n }\r\n function preventDefault(e) {\r\n var rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n }\r\n function mainShapeContain(cover, x, y) {\r\n return cover.childOfName('main').contain(x, y);\r\n }\r\n function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\r\n var creatingCover = controller._creatingCover;\r\n var panel = controller._creatingPanel;\r\n var thisBrushOption = controller._brushOption;\r\n var eventParams;\r\n controller._track.push(localCursorPoint.slice());\r\n if (shouldShowCover(controller) || creatingCover) {\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n var brushOption = clone(thisBrushOption);\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n if (creatingCover) {\r\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\r\n var coverBrushOption = creatingCover.__brushOption;\r\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n updateCoverShape(controller, creatingCover);\r\n eventParams = { isEnd: isEnd };\r\n }\r\n }\r\n else if (isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick) {\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = { isEnd: isEnd, removeOnClick: true };\r\n }\r\n }\r\n return eventParams;\r\n }\r\n function determineBrushType(brushType, panel) {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType;\r\n }\r\n var pointerHandlers = {\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n preventDefault(e);\r\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n this._creatingCover = null;\r\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n mousemove: function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n resetCursor(this, e, localCursorPoint);\r\n if (this._dragging) {\r\n preventDefault(e);\r\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger$1(this, eventParams);\r\n }\r\n },\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n };\r\n function handleDragEnd(controller, e) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n eventParams && trigger$1(controller, eventParams);\r\n }\r\n }\r\n function isOutsideZrArea(controller, x, y) {\r\n var zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n }\r\n var coverRenderers = {\r\n lineX: getLineRenderer(0),\r\n lineY: getLineRenderer(1),\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range) {\r\n return range;\r\n }\r\n return createBaseRectCover({\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n var cover = new Group();\r\n cover.add(new Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n return cover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n cover.add(new Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger$1, controller, { isEnd: true })\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n cover.childAt(0).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n };\r\n function getLineRenderer(xyIndex) {\r\n return {\r\n createCover: function (controller, brushOption) {\r\n return createBaseRectCover({\r\n toRectRange: function (range) {\r\n var rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange) {\r\n return rectRange[xyIndex];\r\n }\r\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\r\n },\r\n getCreatingRange: function (localTrack) {\r\n var ends = getTrackEnds(localTrack);\r\n var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]);\r\n return [min, max];\r\n },\r\n updateCoverShape: function (controller, cover, localRange, brushOption) {\r\n var otherExtent;\r\n var panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n var zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n var rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n }\n\n function makeRectPanelClipPath(rect) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints) {\r\n return clipPointsByRect(localPoints, rect);\r\n };\r\n }\r\n function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex) {\r\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n var brushWidth = idx ? rect.width : rect.height;\r\n var base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n }\r\n function makeRectIsTargetByCursor(rect, api, targetModel) {\r\n var boundingRect = normalizeRect(rect);\r\n return function (e, localCursorPoint) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n }\r\n function normalizeRect(rect) {\r\n return BoundingRect.create(rect);\r\n }\n\n var elementList = ['axisLine', 'axisTickLabel', 'axisName'];\r\n var ParallelAxisView = (function (_super) {\r\n __extends(ParallelAxisView, _super);\r\n function ParallelAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelAxisView.type;\r\n return _this;\r\n }\r\n ParallelAxisView.prototype.init = function (ecModel, api) {\r\n _super.prototype.init.apply(this, arguments);\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this));\r\n };\r\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\r\n return;\r\n }\r\n this.axisModel = axisModel;\r\n this.api = api;\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\r\n var coordSys = coordSysModel.coordinateSystem;\r\n var areaSelectStyle = axisModel.getAreaSelectStyle();\r\n var areaWidth = areaSelectStyle.width;\r\n var dim = axisModel.axis.dim;\r\n var axisLayout = coordSys.getAxisLayout(dim);\r\n var builderOpt = extend({ strokeContainThreshold: areaWidth }, axisLayout);\r\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\r\n each(elementList, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n };\r\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\r\n var extent = axisModel.axis.getExtent();\r\n var extentLen = extent[1] - extent[0];\r\n var extra = Math.min(30, Math.abs(extentLen) * 0.1);\r\n var rect = BoundingRect.create({\r\n x: extent[0],\r\n y: -areaWidth / 2,\r\n width: extentLen,\r\n height: areaWidth\r\n });\r\n rect.x -= extra;\r\n rect.width += 2 * extra;\r\n this._brushController\r\n .mount({\r\n enableGlobalPan: true,\r\n rotation: builderOpt.rotation,\r\n x: builderOpt.position[0],\r\n y: builderOpt.position[1]\r\n })\r\n .setPanels([{\r\n panelId: 'pl',\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)\r\n }])\r\n .enableBrush({\r\n brushType: 'lineX',\r\n brushStyle: areaSelectStyle,\r\n removeOnClick: true\r\n })\r\n .updateCovers(getCoverInfoList(axisModel));\r\n };\r\n ParallelAxisView.prototype._onBrush = function (eventParam) {\r\n var coverInfoList = eventParam.areas;\r\n var axisModel = this.axisModel;\r\n var axis = axisModel.axis;\r\n var intervals = map(coverInfoList, function (coverInfo) {\r\n return [\r\n axis.coordToData(coverInfo.range[0], true),\r\n axis.coordToData(coverInfo.range[1], true)\r\n ];\r\n });\r\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\r\n this.api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n parallelAxisId: axisModel.id,\r\n intervals: intervals\r\n });\r\n }\r\n };\r\n ParallelAxisView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n ParallelAxisView.type = 'parallelAxis';\r\n return ParallelAxisView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ParallelAxisView);\r\n function fromAxisAreaSelect(axisModel, ecModel, payload) {\r\n return payload\r\n && payload.type === 'axisAreaSelect'\r\n && ecModel.findComponents({ mainType: 'parallelAxis', query: payload })[0] === axisModel;\r\n }\r\n function getCoverInfoList(axisModel) {\r\n var axis = axisModel.axis;\r\n return map(axisModel.activeIntervals, function (interval) {\r\n return {\r\n brushType: 'lineX',\r\n panelId: 'pl',\r\n range: [\r\n axis.dataToCoord(interval[0], true),\r\n axis.dataToCoord(interval[1], true)\r\n ]\r\n };\r\n });\r\n }\r\n function getCoordSysModel(axisModel, ecModel) {\r\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\r\n }\n\n var CLICK_THRESHOLD = 5;\r\n var ParallelView = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n return _this;\r\n }\r\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\r\n this._model = parallelModel;\r\n this._api = api;\r\n if (!this._handlers) {\r\n this._handlers = {};\r\n each(handlers, function (handler, eventName) {\r\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\r\n }, this);\r\n }\r\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\r\n };\r\n ParallelView.prototype.dispose = function (ecModel, api) {\r\n each(this._handlers, function (handler, eventName) {\r\n api.getZr().off(eventName, handler);\r\n });\r\n this._handlers = null;\r\n };\r\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\r\n this._dispatchExpand(opt);\r\n };\r\n ParallelView.prototype._dispatchExpand = function (opt) {\r\n opt && this._api.dispatchAction(extend({ type: 'parallelAxisExpand' }, opt));\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ParallelView);\r\n var handlers = {\r\n mousedown: function (e) {\r\n if (checkTrigger(this, 'click')) {\r\n this._mouseDownPoint = [e.offsetX, e.offsetY];\r\n }\r\n },\r\n mouseup: function (e) {\r\n var mouseDownPoint = this._mouseDownPoint;\r\n if (checkTrigger(this, 'click') && mouseDownPoint) {\r\n var point = [e.offsetX, e.offsetY];\r\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2)\r\n + Math.pow(mouseDownPoint[1] - point[1], 2);\r\n if (dist > CLICK_THRESHOLD) {\r\n return;\r\n }\r\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n result.behavior !== 'none' && this._dispatchExpand({\r\n axisExpandWindow: result.axisExpandWindow\r\n });\r\n }\r\n this._mouseDownPoint = null;\r\n },\r\n mousemove: function (e) {\r\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\r\n return;\r\n }\r\n var model = this._model;\r\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n var behavior = result.behavior;\r\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\r\n this._throttledDispatchExpand(behavior === 'none'\r\n ? null\r\n : {\r\n axisExpandWindow: result.axisExpandWindow,\r\n animation: behavior === 'jump' ? null : {\r\n duration: 0\r\n }\r\n });\r\n }\r\n };\r\n function checkTrigger(view, triggerOn) {\r\n var model = view._model;\r\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\r\n }\r\n registerPreprocessor(parallelPreprocessor);\n\n var ParallelSeriesModel = (function (_super) {\r\n __extends(ParallelSeriesModel, _super);\r\n function ParallelSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\r\n });\r\n };\r\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\r\n var coordSys = this.coordinateSystem;\r\n var data = this.getData();\r\n var indices = [];\r\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\r\n if (activeState === theActiveState) {\r\n indices.push(data.getRawIndex(dataIndex));\r\n }\r\n });\r\n return indices;\r\n };\r\n ParallelSeriesModel.type = 'series.parallel';\r\n ParallelSeriesModel.dependencies = ['parallel'];\r\n ParallelSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'parallel',\r\n parallelIndex: 0,\r\n label: {\r\n show: false\r\n },\r\n inactiveOpacity: 0.05,\r\n activeOpacity: 1,\r\n lineStyle: {\r\n width: 1,\r\n opacity: 0.45,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n label: {\r\n show: false\r\n }\r\n },\r\n progressive: 500,\r\n smooth: false,\r\n animationEasing: 'linear'\r\n };\r\n return ParallelSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ParallelSeriesModel);\r\n function makeDefaultEncode(seriesModel) {\r\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n if (!parallelModel) {\r\n return;\r\n }\r\n var encodeDefine = {};\r\n each(parallelModel.dimensions, function (axisDim) {\r\n var dataDimIndex = convertDimNameToNumber(axisDim);\r\n encodeDefine[axisDim] = dataDimIndex;\r\n });\r\n return encodeDefine;\r\n }\r\n function convertDimNameToNumber(dimName) {\r\n return +dimName.replace('dim', '');\r\n }\n\n var DEFAULT_SMOOTH = 0.3;\r\n var ParallelView$1 = (function (_super) {\r\n __extends(ParallelView, _super);\r\n function ParallelView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ParallelView.type;\r\n _this._dataGroup = new Group();\r\n _this._initialized = false;\r\n return _this;\r\n }\r\n ParallelView.prototype.init = function () {\r\n this.group.add(this._dataGroup);\r\n };\r\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var dataGroup = this._dataGroup;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n data.diff(oldData)\r\n .add(add)\r\n .update(update)\r\n .remove(remove)\r\n .execute();\r\n function add(newDataIndex) {\r\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function update(newDataIndex, oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\r\n data.setItemGraphicEl(newDataIndex, line);\r\n updateProps(line, { shape: { points: points } }, seriesModel, newDataIndex);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n function remove(oldDataIndex) {\r\n var line = oldData.getItemGraphicEl(oldDataIndex);\r\n dataGroup.remove(line);\r\n }\r\n if (!this._initialized) {\r\n this._initialized = true;\r\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\r\n setTimeout(function () {\r\n dataGroup.removeClipPath();\r\n });\r\n });\r\n dataGroup.setClipPath(clipPath);\r\n }\r\n this._data = data;\r\n };\r\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._initialized = true;\r\n this._data = null;\r\n this._dataGroup.removeAll();\r\n };\r\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var dimensions = coordSys.dimensions;\r\n var seriesScope = makeSeriesScope$2(seriesModel);\r\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\r\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\r\n line.incremental = true;\r\n updateElCommon(line, data, dataIndex, seriesScope);\r\n }\r\n };\r\n ParallelView.prototype.remove = function () {\r\n this._dataGroup && this._dataGroup.removeAll();\r\n this._data = null;\r\n };\r\n ParallelView.type = 'parallel';\r\n return ParallelView;\r\n }(ChartView));\r\n function createGridClipShape(coordSys, seriesModel, cb) {\r\n var parallelModel = coordSys.model;\r\n var rect = coordSys.getRect();\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n });\r\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\r\n rectEl.setShape(dim, 0);\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n function createLinePoints(data, dataIndex, dimensions, coordSys) {\r\n var points = [];\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimName = dimensions[i];\r\n var value = data.get(data.mapDimension(dimName), dataIndex);\r\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\r\n points.push(coordSys.dataToPoint(value, dimName));\r\n }\r\n }\r\n return points;\r\n }\r\n function addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\r\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\r\n var line = new Polyline({\r\n shape: { points: points },\r\n z2: 10\r\n });\r\n dataGroup.add(line);\r\n data.setItemGraphicEl(dataIndex, line);\r\n return line;\r\n }\r\n function makeSeriesScope$2(seriesModel) {\r\n var smooth = seriesModel.get('smooth', true);\r\n smooth === true && (smooth = DEFAULT_SMOOTH);\r\n smooth = numericToNumber(smooth);\r\n eqNaN(smooth) && (smooth = 0);\r\n return { smooth: smooth };\r\n }\r\n function updateElCommon(el, data, dataIndex, seriesScope) {\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.fill = null;\r\n el.setShape('smooth', seriesScope.smooth);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n function isEmptyValue(val, axisType) {\r\n return axisType === 'category'\r\n ? val == null\r\n : (val == null || isNaN(val));\r\n }\r\n ChartView.registerClass(ParallelView$1);\n\n var opacityAccessPath$1 = ['lineStyle', 'opacity'];\r\n var parallelVisual = {\r\n seriesType: 'parallel',\r\n reset: function (seriesModel, ecModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var opacityMap = {\r\n normal: seriesModel.get(['lineStyle', 'opacity']),\r\n active: seriesModel.get('activeOpacity'),\r\n inactive: seriesModel.get('inactiveOpacity')\r\n };\r\n return {\r\n progress: function (params, data) {\r\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\r\n var opacity = opacityMap[activeState];\r\n if (activeState === 'normal' && data.hasItemOption) {\r\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true);\r\n itemOpacity != null && (opacity = itemOpacity);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n existsStyle.opacity = opacity;\r\n }, params.start, params.end);\r\n }\r\n };\r\n }\r\n };\n\n registerVisual(PRIORITY.VISUAL.BRUSH, parallelVisual);\n\n var SankeySeriesModel = (function (_super) {\r\n __extends(SankeySeriesModel, _super);\r\n function SankeySeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeySeriesModel.type;\r\n return _this;\r\n }\r\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var links = option.edges || option.links;\r\n var nodes = option.data || option.nodes;\r\n var levels = option.levels;\r\n this.levelModels = [];\r\n var levelModels = this.levelModels;\r\n for (var i = 0; i < levels.length; i++) {\r\n if (levels[i].depth != null && levels[i].depth >= 0) {\r\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('levels[i].depth is mandatory and should be natural number');\r\n }\r\n }\r\n }\r\n if (nodes && links) {\r\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\r\n return graph.data;\r\n }\r\n function beforeLink(nodeData, edgeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var layout = seriesModel.getData().getItemLayout(idx);\r\n if (layout) {\r\n var nodeDepth = layout.depth;\r\n var levelModel = seriesModel.levelModels[nodeDepth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n edgeData.wrapMethod('getItemModel', function (model, idx) {\r\n var seriesModel = model.parentModel;\r\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\r\n var layout = edge.node1.getLayout();\r\n if (layout) {\r\n var depth = layout.depth;\r\n var levelModel = seriesModel.levelModels[depth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\r\n var dataItem = this.option.data[dataIndex];\r\n dataItem.localX = localPosition[0];\r\n dataItem.localY = localPosition[1];\r\n };\r\n SankeySeriesModel.prototype.getGraph = function () {\r\n return this.getData().graph;\r\n };\r\n SankeySeriesModel.prototype.getEdgeData = function () {\r\n return this.getGraph().edgeData;\r\n };\r\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n function noValue(val) {\r\n return isNaN(val) || val == null;\r\n }\r\n if (dataType === 'edge') {\r\n var params = this.getDataParams(dataIndex, dataType);\r\n var rawDataOpt = params.data;\r\n var edgeValue = params.value;\r\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\r\n return createTooltipMarkup('nameValue', {\r\n name: edgeName,\r\n value: edgeValue,\r\n noValue: noValue(edgeValue)\r\n });\r\n }\r\n else {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var value = node.getLayout().value;\r\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\r\n return createTooltipMarkup('nameValue', {\r\n name: name_1,\r\n value: value,\r\n noValue: noValue(value)\r\n });\r\n }\r\n };\r\n SankeySeriesModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n if (option.focusNodeAdjacency === true) {\r\n option.focusNodeAdjacency = 'allEdges';\r\n }\r\n };\r\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n if (params.value == null && dataType === 'node') {\r\n var node = this.getGraph().getNodeByIndex(dataIndex);\r\n var nodeValue = node.getLayout().value;\r\n params.value = nodeValue;\r\n }\r\n return params;\r\n };\r\n SankeySeriesModel.type = 'series.sankey';\r\n SankeySeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n left: '5%',\r\n top: '5%',\r\n right: '20%',\r\n bottom: '5%',\r\n orient: 'horizontal',\r\n nodeWidth: 20,\r\n nodeGap: 8,\r\n draggable: true,\r\n focusNodeAdjacency: false,\r\n layoutIterations: 32,\r\n label: {\r\n show: true,\r\n position: 'right',\r\n fontSize: 12\r\n },\r\n levels: [],\r\n nodeAlign: 'justify',\r\n lineStyle: {\r\n color: '#314656',\r\n opacity: 0.2,\r\n curveness: 0.5\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n animationEasing: 'linear',\r\n animationDuration: 1000\r\n };\r\n return SankeySeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(SankeySeriesModel);\n\n var SankeyPathShape = (function () {\r\n function SankeyPathShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.cpx2 = 0;\r\n this.cpy2 = 0;\r\n this.extent = 0;\r\n }\r\n return SankeyPathShape;\r\n }());\r\n var SankeyPath = (function (_super) {\r\n __extends(SankeyPath, _super);\r\n function SankeyPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n SankeyPath.prototype.getDefaultShape = function () {\r\n return new SankeyPathShape();\r\n };\r\n SankeyPath.prototype.buildPath = function (ctx, shape) {\r\n var extent = shape.extent;\r\n ctx.moveTo(shape.x1, shape.y1);\r\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\r\n if (shape.orient === 'vertical') {\r\n ctx.lineTo(shape.x2 + extent, shape.y2);\r\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\r\n }\r\n else {\r\n ctx.lineTo(shape.x2, shape.y2 + extent);\r\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\r\n }\r\n ctx.closePath();\r\n };\r\n SankeyPath.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n SankeyPath.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n return SankeyPath;\r\n }(Path));\r\n var SankeyView = (function (_super) {\r\n __extends(SankeyView, _super);\r\n function SankeyView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SankeyView.type;\r\n _this._focusAdjacencyDisabled = false;\r\n return _this;\r\n }\r\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\r\n var sankeyView = this;\r\n var graph = seriesModel.getGraph();\r\n var group = this.group;\r\n var layoutInfo = seriesModel.layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var nodeData = seriesModel.getData();\r\n var edgeData = seriesModel.getData('edge');\r\n var orient = seriesModel.get('orient');\r\n this._model = seriesModel;\r\n group.removeAll();\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n graph.eachEdge(function (edge) {\r\n var curve = new SankeyPath();\r\n var ecData = getECData(curve);\r\n ecData.dataIndex = edge.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataType = 'edge';\r\n var edgeModel = edge.getModel();\r\n var lineStyleModel = edgeModel.getModel('lineStyle');\r\n var curvature = lineStyleModel.get('curveness');\r\n var n1Layout = edge.node1.getLayout();\r\n var node1Model = edge.node1.getModel();\r\n var dragX1 = node1Model.get('localX');\r\n var dragY1 = node1Model.get('localY');\r\n var n2Layout = edge.node2.getLayout();\r\n var node2Model = edge.node2.getModel();\r\n var dragX2 = node2Model.get('localX');\r\n var dragY2 = node2Model.get('localY');\r\n var edgeLayout = edge.getLayout();\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n var cpx1;\r\n var cpy1;\r\n var cpx2;\r\n var cpy2;\r\n curve.shape.extent = Math.max(1, edgeLayout.dy);\r\n curve.shape.orient = orient;\r\n if (orient === 'vertical') {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\r\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\r\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\r\n cpx1 = x1;\r\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\r\n cpx2 = x2;\r\n cpy2 = y1 * curvature + y2 * (1 - curvature);\r\n }\r\n else {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\r\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\r\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\r\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\r\n cpy1 = y1;\r\n cpx2 = x1 * curvature + x2 * (1 - curvature);\r\n cpy2 = y2;\r\n }\r\n curve.setShape({\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n });\r\n curve.useStyle(lineStyleModel.getItemStyle());\r\n switch (curve.style.fill) {\r\n case 'source':\r\n curve.style.fill = edge.node1.getVisual('color');\r\n curve.style.decal = edge.node1.getVisual('style').decal;\r\n break;\r\n case 'target':\r\n curve.style.fill = edge.node2.getVisual('color');\r\n curve.style.decal = edge.node2.getVisual('style').decal;\r\n break;\r\n case 'gradient':\r\n var sourceColor = edge.node1.getVisual('color');\r\n var targetColor = edge.node2.getVisual('color');\r\n if (typeof sourceColor === 'string' && typeof targetColor === 'string') {\r\n curve.style.fill = new LinearGradient(0, 0, 1, 0, [{\r\n color: sourceColor,\r\n offset: 0\r\n }, {\r\n color: targetColor,\r\n offset: 1\r\n }]);\r\n }\r\n }\r\n var emphasisModel = edgeModel.getModel('emphasis');\r\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { return model.getItemStyle(); });\r\n group.add(curve);\r\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n getECData(curve).dataType = 'edge';\r\n });\r\n graph.eachNode(function (node) {\r\n var layout = node.getLayout();\r\n var itemModel = node.getModel();\r\n var dragX = itemModel.get('localX');\r\n var dragY = itemModel.get('localY');\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var rect = new Rect({\r\n shape: {\r\n x: dragX != null ? dragX * width : layout.x,\r\n y: dragY != null ? dragY * height : layout.y,\r\n width: layout.dx,\r\n height: layout.dy\r\n },\r\n style: itemModel.getModel('itemStyle').getItemStyle()\r\n });\r\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: node.dataIndex,\r\n defaultText: node.id\r\n });\r\n rect.disableLabelAnimation = true;\r\n rect.setStyle('fill', node.getVisual('color'));\r\n rect.setStyle('decal', node.getVisual('style').decal);\r\n setStatesStylesFromModel(rect, itemModel);\r\n group.add(rect);\r\n nodeData.setItemGraphicEl(node.dataIndex, rect);\r\n getECData(rect).dataType = 'node';\r\n var focus = emphasisModel.get('focus');\r\n enableHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'));\r\n });\r\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\r\n var itemModel = nodeData.getItemModel(dataIndex);\r\n if (itemModel.get('draggable')) {\r\n el.drift = function (dx, dy) {\r\n sankeyView._focusAdjacencyDisabled = true;\r\n this.shape.x += dx;\r\n this.shape.y += dy;\r\n this.dirty();\r\n api.dispatchAction({\r\n type: 'dragNode',\r\n seriesId: seriesModel.id,\r\n dataIndex: nodeData.getRawIndex(dataIndex),\r\n localX: this.shape.x / width,\r\n localY: this.shape.y / height\r\n });\r\n };\r\n el.ondragend = function () {\r\n sankeyView._focusAdjacencyDisabled = false;\r\n };\r\n el.draggable = true;\r\n el.cursor = 'move';\r\n }\r\n });\r\n if (!this._data && seriesModel.isAnimationEnabled()) {\r\n group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () {\r\n group.removeClipPath();\r\n }));\r\n }\r\n this._data = seriesModel.getData();\r\n };\r\n SankeyView.prototype.dispose = function () {\r\n };\r\n SankeyView.type = 'sankey';\r\n return SankeyView;\r\n }(ChartView));\r\n function createGridClipShape$1(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n width: rect.width + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n ChartView.registerClass(SankeyView);\n\n registerAction({\r\n type: 'dragNode',\r\n event: 'dragnode',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'sankey',\r\n query: payload\r\n }, function (seriesModel) {\r\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\r\n });\r\n });\n\n function sankeyLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var nodeWidth = seriesModel.get('nodeWidth');\r\n var nodeGap = seriesModel.get('nodeGap');\r\n var layoutInfo = getViewRect$4(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n var width = layoutInfo.width;\r\n var height = layoutInfo.height;\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n var edges = graph.edges;\r\n computeNodeValues(nodes);\r\n var filteredNodes = filter(nodes, function (node) {\r\n return node.getLayout().value === 0;\r\n });\r\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\r\n var orient = seriesModel.get('orient');\r\n var nodeAlign = seriesModel.get('nodeAlign');\r\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\r\n });\r\n }\r\n function getViewRect$4(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\r\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\r\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\r\n computeEdgeDepths(nodes, orient);\r\n }\r\n function computeNodeValues(nodes) {\r\n each(nodes, function (node) {\r\n var value1 = sum(node.outEdges, getEdgeValue);\r\n var value2 = sum(node.inEdges, getEdgeValue);\r\n var nodeRawValue = node.getValue() || 0;\r\n var value = Math.max(value1, value2, nodeRawValue);\r\n node.setLayout({ value: value }, true);\r\n });\r\n }\r\n function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\r\n var remainEdges = [];\r\n var indegreeArr = [];\r\n var zeroIndegrees = [];\r\n var nextTargetNode = [];\r\n var x = 0;\r\n for (var i = 0; i < edges.length; i++) {\r\n remainEdges[i] = 1;\r\n }\r\n for (var i = 0; i < nodes.length; i++) {\r\n indegreeArr[i] = nodes[i].inEdges.length;\r\n if (indegreeArr[i] === 0) {\r\n zeroIndegrees.push(nodes[i]);\r\n }\r\n }\r\n var maxNodeDepth = -1;\r\n while (zeroIndegrees.length) {\r\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\r\n var node = zeroIndegrees[idx];\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n var isItemDepth = item.depth != null && item.depth >= 0;\r\n if (isItemDepth && item.depth > maxNodeDepth) {\r\n maxNodeDepth = item.depth;\r\n }\r\n node.setLayout({ depth: isItemDepth ? item.depth : x }, true);\r\n orient === 'vertical'\r\n ? node.setLayout({ dy: nodeWidth }, true)\r\n : node.setLayout({ dx: nodeWidth }, true);\r\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\r\n var edge = node.outEdges[edgeIdx];\r\n var indexEdge = edges.indexOf(edge);\r\n remainEdges[indexEdge] = 0;\r\n var targetNode = edge.node2;\r\n var nodeIndex = nodes.indexOf(targetNode);\r\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\r\n nextTargetNode.push(targetNode);\r\n }\r\n }\r\n }\r\n ++x;\r\n zeroIndegrees = nextTargetNode;\r\n nextTargetNode = [];\r\n }\r\n for (var i = 0; i < remainEdges.length; i++) {\r\n if (remainEdges[i] === 1) {\r\n throw new Error('Sankey is a DAG, the original data has cycle!');\r\n }\r\n }\r\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\r\n if (nodeAlign && nodeAlign !== 'left') {\r\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\r\n }\r\n var kx = orient === 'vertical'\r\n ? (height - nodeWidth) / maxDepth\r\n : (width - nodeWidth) / maxDepth;\r\n scaleNodeBreadths(nodes, kx, orient);\r\n }\r\n function isNodeDepth(node) {\r\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\r\n return item.depth != null && item.depth >= 0;\r\n }\r\n function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\r\n if (nodeAlign === 'right') {\r\n var nextSourceNode = [];\r\n var remainNodes = nodes;\r\n var nodeHeight = 0;\r\n while (remainNodes.length) {\r\n for (var i = 0; i < remainNodes.length; i++) {\r\n var node = remainNodes[i];\r\n node.setLayout({ skNodeHeight: nodeHeight }, true);\r\n for (var j = 0; j < node.inEdges.length; j++) {\r\n var edge = node.inEdges[j];\r\n if (nextSourceNode.indexOf(edge.node1) < 0) {\r\n nextSourceNode.push(edge.node1);\r\n }\r\n }\r\n }\r\n remainNodes = nextSourceNode;\r\n nextSourceNode = [];\r\n ++nodeHeight;\r\n }\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node)) {\r\n node.setLayout({ depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) }, true);\r\n }\r\n });\r\n }\r\n else if (nodeAlign === 'justify') {\r\n moveSinksRight(nodes, maxDepth);\r\n }\r\n }\r\n function moveSinksRight(nodes, maxDepth) {\r\n each(nodes, function (node) {\r\n if (!isNodeDepth(node) && !node.outEdges.length) {\r\n node.setLayout({ depth: maxDepth }, true);\r\n }\r\n });\r\n }\r\n function scaleNodeBreadths(nodes, kx, orient) {\r\n each(nodes, function (node) {\r\n var nodeDepth = node.getLayout().depth * kx;\r\n orient === 'vertical'\r\n ? node.setLayout({ y: nodeDepth }, true)\r\n : node.setLayout({ x: nodeDepth }, true);\r\n });\r\n }\r\n function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\r\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\r\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n for (var alpha = 1; iterations > 0; iterations--) {\r\n alpha *= 0.99;\r\n relaxRightToLeft(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n relaxLeftToRight(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n }\r\n }\r\n function prepareNodesByBreadth(nodes, orient) {\r\n var nodesByBreadth = [];\r\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\r\n var groupResult = groupData(nodes, function (node) {\r\n return node.getLayout()[keyAttr];\r\n });\r\n groupResult.keys.sort(function (a, b) {\r\n return a - b;\r\n });\r\n each(groupResult.keys, function (key) {\r\n nodesByBreadth.push(groupResult.buckets.get(key));\r\n });\r\n return nodesByBreadth;\r\n }\r\n function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\r\n var minKy = Infinity;\r\n each(nodesByBreadth, function (nodes) {\r\n var n = nodes.length;\r\n var sum = 0;\r\n each(nodes, function (node) {\r\n sum += node.getLayout().value;\r\n });\r\n var ky = orient === 'vertical'\r\n ? (width - (n - 1) * nodeGap) / sum\r\n : (height - (n - 1) * nodeGap) / sum;\r\n if (ky < minKy) {\r\n minKy = ky;\r\n }\r\n });\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node, i) {\r\n var nodeDy = node.getLayout().value * minKy;\r\n if (orient === 'vertical') {\r\n node.setLayout({ x: i }, true);\r\n node.setLayout({ dx: nodeDy }, true);\r\n }\r\n else {\r\n node.setLayout({ y: i }, true);\r\n node.setLayout({ dy: nodeDy }, true);\r\n }\r\n });\r\n });\r\n each(edges, function (edge) {\r\n var edgeDy = +edge.getValue() * minKy;\r\n edge.setLayout({ dy: edgeDy }, true);\r\n });\r\n }\r\n function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodesByBreadth, function (nodes) {\r\n nodes.sort(function (a, b) {\r\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\r\n });\r\n var nodeX;\r\n var node;\r\n var dy;\r\n var y0 = 0;\r\n var n = nodes.length;\r\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\r\n for (var i = 0; i < n; i++) {\r\n node = nodes[i];\r\n dy = y0 - node.getLayout()[keyAttr];\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] + dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\r\n }\r\n var viewWidth = orient === 'vertical' ? width : height;\r\n dy = y0 - nodeGap - viewWidth;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n y0 = nodeX;\r\n for (var i = n - 2; i >= 0; --i) {\r\n node = nodes[i];\r\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({ x: nodeX }, true)\r\n : node.setLayout({ y: nodeX }, true);\r\n }\r\n y0 = node.getLayout()[keyAttr];\r\n }\r\n }\r\n });\r\n }\r\n function relaxRightToLeft(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth.slice().reverse(), function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.outEdges.length) {\r\n var y = sum(node.outEdges, weightedTarget, orient)\r\n / sum(node.outEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.outEdges.length;\r\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n function weightedTarget(edge, orient) {\r\n return center$1(edge.node2, orient) * edge.getValue();\r\n }\r\n function centerTarget(edge, orient) {\r\n return center$1(edge.node2, orient);\r\n }\r\n function weightedSource(edge, orient) {\r\n return center$1(edge.node1, orient) * edge.getValue();\r\n }\r\n function centerSource(edge, orient) {\r\n return center$1(edge.node1, orient);\r\n }\r\n function center$1(node, orient) {\r\n return orient === 'vertical'\r\n ? node.getLayout().x + node.getLayout().dx / 2\r\n : node.getLayout().y + node.getLayout().dy / 2;\r\n }\r\n function getEdgeValue(edge) {\r\n return edge.getValue();\r\n }\r\n function sum(array, cb, orient) {\r\n var sum = 0;\r\n var len = array.length;\r\n var i = -1;\r\n while (++i < len) {\r\n var value = +cb(array[i], orient);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n return sum;\r\n }\r\n function relaxLeftToRight(nodesByBreadth, alpha, orient) {\r\n each(nodesByBreadth, function (nodes) {\r\n each(nodes, function (node) {\r\n if (node.inEdges.length) {\r\n var y = sum(node.inEdges, weightedSource, orient)\r\n / sum(node.inEdges, getEdgeValue);\r\n if (isNaN(y)) {\r\n var len = node.inEdges.length;\r\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\r\n }\r\n if (orient === 'vertical') {\r\n var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ x: nodeX }, true);\r\n }\r\n else {\r\n var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha;\r\n node.setLayout({ y: nodeY }, true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n function computeEdgeDepths(nodes, orient) {\r\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n each(nodes, function (node) {\r\n node.outEdges.sort(function (a, b) {\r\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\r\n });\r\n node.inEdges.sort(function (a, b) {\r\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\r\n });\r\n });\r\n each(nodes, function (node) {\r\n var sy = 0;\r\n var ty = 0;\r\n each(node.outEdges, function (edge) {\r\n edge.setLayout({ sy: sy }, true);\r\n sy += edge.getLayout().dy;\r\n });\r\n each(node.inEdges, function (edge) {\r\n edge.setLayout({ ty: ty }, true);\r\n ty += edge.getLayout().dy;\r\n });\r\n });\r\n }\n\n function sankeyVisual(ecModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\r\n var graph = seriesModel.getGraph();\r\n var nodes = graph.nodes;\r\n if (nodes.length) {\r\n var minValue_1 = Infinity;\r\n var maxValue_1 = -Infinity;\r\n each(nodes, function (node) {\r\n var nodeValue = node.getLayout().value;\r\n if (nodeValue < minValue_1) {\r\n minValue_1 = nodeValue;\r\n }\r\n if (nodeValue > maxValue_1) {\r\n maxValue_1 = nodeValue;\r\n }\r\n });\r\n each(nodes, function (node) {\r\n var mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue_1, maxValue_1],\r\n visual: seriesModel.get('color')\r\n });\r\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n var customColor = node.getModel().get(['itemStyle', 'color']);\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', { fill: customColor });\r\n }\r\n else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', { fill: mapValueToColor });\r\n }\r\n });\r\n }\r\n });\r\n }\n\n registerLayout(sankeyLayout);\r\n registerVisual(sankeyVisual);\n\n var WhiskerBoxCommonMixin = (function () {\r\n function WhiskerBoxCommonMixin() {\r\n }\r\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\r\n var ordinalMeta;\r\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\r\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\r\n var xAxisType = xAxisModel.get('type');\r\n var yAxisType = yAxisModel.get('type');\r\n var addOrdinal;\r\n if (xAxisType === 'category') {\r\n option.layout = 'horizontal';\r\n ordinalMeta = xAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else if (yAxisType === 'category') {\r\n option.layout = 'vertical';\r\n ordinalMeta = yAxisModel.getOrdinalMeta();\r\n addOrdinal = true;\r\n }\r\n else {\r\n option.layout = option.layout || 'horizontal';\r\n }\r\n var coordDims = ['x', 'y'];\r\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\r\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\r\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\r\n var axisModels = [xAxisModel, yAxisModel];\r\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\r\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\r\n var data = option.data;\r\n if (data && addOrdinal) {\r\n var newOptionData_1 = [];\r\n each(data, function (item, index) {\r\n var newItem;\r\n if (isArray(item)) {\r\n newItem = item.slice();\r\n item.unshift(index);\r\n }\r\n else if (isArray(item.value)) {\r\n newItem = item.value.slice();\r\n item.value.unshift(index);\r\n }\r\n else {\r\n newItem = item;\r\n }\r\n newOptionData_1.push(newItem);\r\n });\r\n option.data = newOptionData_1;\r\n }\r\n var defaultValueDimensions = this.defaultValueDimensions;\r\n var coordDimensions = [{\r\n name: baseAxisDim,\r\n type: getDimensionTypeByAxis(baseAxisType),\r\n ordinalMeta: ordinalMeta,\r\n otherDims: {\r\n tooltip: false,\r\n itemName: 0\r\n },\r\n dimsDef: ['base']\r\n }, {\r\n name: otherAxisDim,\r\n type: getDimensionTypeByAxis(otherAxisType),\r\n dimsDef: defaultValueDimensions.slice()\r\n }];\r\n return createListSimply(this, {\r\n coordDimensions: coordDimensions,\r\n dimensionsCount: defaultValueDimensions.length + 1,\r\n encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\r\n });\r\n };\r\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\r\n var dim = this._baseAxisDim;\r\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\r\n };\r\n return WhiskerBoxCommonMixin;\r\n }());\n\n var BoxplotSeriesModel = (function (_super) {\r\n __extends(BoxplotSeriesModel, _super);\r\n function BoxplotSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'min', defaultTooltip: true },\r\n { name: 'Q1', defaultTooltip: true },\r\n { name: 'median', defaultTooltip: true },\r\n { name: 'Q3', defaultTooltip: true },\r\n { name: 'max', defaultTooltip: true }\r\n ];\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n BoxplotSeriesModel.type = 'series.boxplot';\r\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n BoxplotSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n boxWidth: [7, 50],\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2,\r\n shadowBlur: 5,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n },\r\n animationDuration: 800\r\n };\r\n return BoxplotSeriesModel;\r\n }(SeriesModel));\r\n mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\r\n SeriesModel.registerClass(BoxplotSeriesModel);\n\n var BoxplotView = (function (_super) {\r\n __extends(BoxplotView, _super);\r\n function BoxplotView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BoxplotView.type;\r\n return _this;\r\n }\r\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var group = this.group;\r\n var oldData = this._data;\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (!symbolEl) {\r\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\r\n }\r\n else {\r\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n BoxplotView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var data = this._data;\r\n this._data = null;\r\n data && data.eachItemGraphicEl(function (el) {\r\n el && group.remove(el);\r\n });\r\n };\r\n BoxplotView.type = 'boxplot';\r\n return BoxplotView;\r\n }(ChartView));\r\n var BoxPathShape = (function () {\r\n function BoxPathShape() {\r\n }\r\n return BoxPathShape;\r\n }());\r\n var BoxPath = (function (_super) {\r\n __extends(BoxPath, _super);\r\n function BoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'boxplotBoxPath';\r\n return _this;\r\n }\r\n BoxPath.prototype.getDefaultShape = function () {\r\n return new BoxPathShape();\r\n };\r\n BoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n var i = 0;\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n for (; i < 4; i++) {\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n ctx.closePath();\r\n for (; i < ends.length; i++) {\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n };\r\n return BoxPath;\r\n }(Path));\r\n function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\r\n var ends = itemLayout.ends;\r\n var el = new BoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, constDim, itemLayout)\r\n : ends\r\n }\r\n });\r\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\r\n return el;\r\n }\r\n function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\r\n var seriesModel = data.hostModel;\r\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\r\n updateMethod(el, { shape: { points: itemLayout.ends } }, seriesModel, dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.z2 = 100;\r\n var itemModel = data.getItemModel(dataIndex);\r\n setStatesStylesFromModel(el, itemModel);\r\n enableHoverEmphasis(el, itemModel.get(['emphasis', 'focus']), itemModel.get(['emphasis', 'blurScope']));\r\n }\r\n function transInit(points, dim, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[dim] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n }\r\n ChartView.registerClass(BoxplotView);\n\n function boxplotVisual(ecModel, api) {\r\n ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n });\r\n }\n\n var each$7 = each;\r\n function boxplotLayout(ecModel) {\r\n var groupResult = groupSeriesByAxis(ecModel);\r\n each$7(groupResult, function (groupItem) {\r\n var seriesModels = groupItem.seriesModels;\r\n if (!seriesModels.length) {\r\n return;\r\n }\r\n calculateBase(groupItem);\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\r\n });\r\n });\r\n }\r\n function groupSeriesByAxis(ecModel) {\r\n var result = [];\r\n var axisList = [];\r\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var idx = indexOf(axisList, baseAxis);\r\n if (idx < 0) {\r\n idx = axisList.length;\r\n axisList[idx] = baseAxis;\r\n result[idx] = {\r\n axis: baseAxis,\r\n seriesModels: []\r\n };\r\n }\r\n result[idx].seriesModels.push(seriesModel);\r\n });\r\n return result;\r\n }\r\n function calculateBase(groupItem) {\r\n var extent;\r\n var baseAxis = groupItem.axis;\r\n var seriesModels = groupItem.seriesModels;\r\n var seriesCount = seriesModels.length;\r\n var boxWidthList = groupItem.boxWidthList = [];\r\n var boxOffsetList = groupItem.boxOffsetList = [];\r\n var boundList = [];\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else {\r\n var maxDataCount_1 = 0;\r\n each$7(seriesModels, function (seriesModel) {\r\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\r\n });\r\n extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / maxDataCount_1;\r\n }\r\n each$7(seriesModels, function (seriesModel) {\r\n var boxWidthBound = seriesModel.get('boxWidth');\r\n if (!isArray(boxWidthBound)) {\r\n boxWidthBound = [boxWidthBound, boxWidthBound];\r\n }\r\n boundList.push([\r\n parsePercent$2(boxWidthBound[0], bandWidth) || 0,\r\n parsePercent$2(boxWidthBound[1], bandWidth) || 0\r\n ]);\r\n });\r\n var availableWidth = bandWidth * 0.8 - 2;\r\n var boxGap = availableWidth / seriesCount * 0.3;\r\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\r\n var base = boxWidth / 2 - availableWidth / 2;\r\n each$7(seriesModels, function (seriesModel, idx) {\r\n boxOffsetList.push(base);\r\n base += boxGap + boxWidth;\r\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\r\n });\r\n }\r\n function layoutSingleSeries(seriesModel, offset, boxWidth) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var halfWidth = boxWidth / 2;\r\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\r\n var vDimIdx = 1 - cDimIdx;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n if (cDim == null || vDims.length < 5) {\r\n return;\r\n }\r\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\r\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\r\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\r\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\r\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\r\n var ends = [];\r\n addBodyEnd(ends, end2, false);\r\n addBodyEnd(ends, end4, true);\r\n ends.push(end1, end2, end5, end4);\r\n layEndLine(ends, end1);\r\n layEndLine(ends, end5);\r\n layEndLine(ends, median);\r\n data.setItemLayout(dataIndex, {\r\n initBaseline: median[vDimIdx],\r\n ends: ends\r\n });\r\n }\r\n function getPoint(axisDimVal, dim, dataIndex) {\r\n var val = data.get(dim, dataIndex);\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n var point;\r\n if (isNaN(axisDimVal) || isNaN(val)) {\r\n point = [NaN, NaN];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(p);\r\n point[cDimIdx] += offset;\r\n }\r\n return point;\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] += halfWidth;\r\n point2[cDimIdx] -= halfWidth;\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function layEndLine(ends, endCenter) {\r\n var from = endCenter.slice();\r\n var to = endCenter.slice();\r\n from[cDimIdx] -= halfWidth;\r\n to[cDimIdx] += halfWidth;\r\n ends.push(from, to);\r\n }\r\n }\n\n function prepareBoxplotData(rawData, opt) {\r\n opt = opt || {};\r\n var boxData = [];\r\n var outliers = [];\r\n var boundIQR = opt.boundIQR;\r\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\r\n for (var i = 0; i < rawData.length; i++) {\r\n var ascList = asc(rawData[i].slice());\r\n var Q1 = quantile(ascList, 0.25);\r\n var Q2 = quantile(ascList, 0.5);\r\n var Q3 = quantile(ascList, 0.75);\r\n var min = ascList[0];\r\n var max = ascList[ascList.length - 1];\r\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\r\n var low = useExtreme\r\n ? min\r\n : Math.max(min, Q1 - bound);\r\n var high = useExtreme\r\n ? max\r\n : Math.min(max, Q3 + bound);\r\n var itemNameFormatter = opt.itemNameFormatter;\r\n var itemName = isFunction(itemNameFormatter)\r\n ? itemNameFormatter({ value: i })\r\n : isString(itemNameFormatter)\r\n ? itemNameFormatter.replace('{value}', i + '')\r\n : i + '';\r\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\r\n for (var j = 0; j < ascList.length; j++) {\r\n var dataItem = ascList[j];\r\n if (dataItem < low || dataItem > high) {\r\n var outlier = [itemName, dataItem];\r\n outliers.push(outlier);\r\n }\r\n }\r\n }\r\n return {\r\n boxData: boxData,\r\n outliers: outliers\r\n };\r\n }\n\n var boxplotTransform = {\r\n type: 'echarts:boxplot',\r\n transform: function transform(params) {\r\n var upstream = params.upstream;\r\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\r\n }\r\n throwError(errMsg);\r\n }\r\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\r\n return [{\r\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\r\n data: result.boxData\r\n }, {\r\n data: result.outliers\r\n }];\r\n }\r\n };\n\n registerVisual(boxplotVisual);\r\n registerLayout(boxplotLayout);\r\n registerTransform(boxplotTransform);\n\n var CandlestickSeriesModel = (function (_super) {\r\n __extends(CandlestickSeriesModel, _super);\r\n function CandlestickSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickSeriesModel.type;\r\n _this.defaultValueDimensions = [\r\n { name: 'open', defaultTooltip: true },\r\n { name: 'close', defaultTooltip: true },\r\n { name: 'lowest', defaultTooltip: true },\r\n { name: 'highest', defaultTooltip: true }\r\n ];\r\n return _this;\r\n }\r\n CandlestickSeriesModel.prototype.getShadowDim = function () {\r\n return 'open';\r\n };\r\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n return itemLayout && selectors.rect(itemLayout.brushRect);\r\n };\r\n CandlestickSeriesModel.type = 'series.candlestick';\r\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\r\n CandlestickSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n layout: null,\r\n clip: true,\r\n itemStyle: {\r\n color: '#c23531',\r\n color0: '#314656',\r\n borderWidth: 1,\r\n borderColor: '#c23531',\r\n borderColor0: '#314656'\r\n },\r\n emphasis: {\r\n scale: true,\r\n itemStyle: {\r\n borderWidth: 2\r\n }\r\n },\r\n barMaxWidth: null,\r\n barMinWidth: null,\r\n barWidth: null,\r\n large: true,\r\n largeThreshold: 600,\r\n progressive: 3e3,\r\n progressiveThreshold: 1e4,\r\n progressiveChunkMode: 'mod',\r\n animationEasing: 'linear',\r\n animationDuration: 300\r\n };\r\n return CandlestickSeriesModel;\r\n }(SeriesModel));\r\n mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\r\n SeriesModel.registerClass(CandlestickSeriesModel);\n\n var SKIP_PROPS = ['color', 'borderColor'];\r\n var CandlestickView = (function (_super) {\r\n __extends(CandlestickView, _super);\r\n function CandlestickView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CandlestickView.type;\r\n return _this;\r\n }\r\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\r\n this.group.removeClipPath();\r\n this._updateDrawMode(seriesModel);\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel)\r\n : this._renderNormal(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n };\r\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n this._isLargeDraw\r\n ? this._incrementalRenderLarge(params, seriesModel)\r\n : this._incrementalRenderNormal(params, seriesModel);\r\n };\r\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n CandlestickView.prototype._renderNormal = function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var needsClip = seriesModel.get('clip', true);\r\n var coord = seriesModel.coordinateSystem;\r\n var clipArea = coord.getArea && coord.getArea();\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n return;\r\n }\r\n var el = createNormalBox$1(itemLayout, newIdx, true);\r\n initProps(el, { shape: { points: itemLayout.ends } }, seriesModel, newIdx);\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(el);\r\n return;\r\n }\r\n var itemLayout = data.getItemLayout(newIdx);\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n if (!el) {\r\n el = createNormalBox$1(itemLayout);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: {\r\n points: itemLayout.ends\r\n }\r\n }, seriesModel, newIdx);\r\n }\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n this._data = data;\r\n };\r\n CandlestickView.prototype._renderLarge = function (seriesModel) {\r\n this._clear();\r\n createLarge$1(seriesModel, this.group);\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\r\n var data = seriesModel.getData();\r\n var isSimpleBox = data.getLayout('isSimpleBox');\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemLayout = data.getItemLayout(dataIndex);\r\n var el = createNormalBox$1(itemLayout);\r\n setBoxCommon(el, data, dataIndex, isSimpleBox);\r\n el.incremental = true;\r\n this.group.add(el);\r\n }\r\n };\r\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n createLarge$1(seriesModel, this.group, true);\r\n };\r\n CandlestickView.prototype.remove = function (ecModel) {\r\n this._clear();\r\n };\r\n CandlestickView.prototype._clear = function () {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CandlestickView.type = 'candlestick';\r\n return CandlestickView;\r\n }(ChartView));\r\n ChartView.registerClass(CandlestickView);\r\n var NormalBoxPathShape = (function () {\r\n function NormalBoxPathShape() {\r\n }\r\n return NormalBoxPathShape;\r\n }());\r\n var NormalBoxPath = (function (_super) {\r\n __extends(NormalBoxPath, _super);\r\n function NormalBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'normalCandlestickBox';\r\n return _this;\r\n }\r\n NormalBoxPath.prototype.getDefaultShape = function () {\r\n return new NormalBoxPathShape();\r\n };\r\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var ends = shape.points;\r\n if (this.__simpleBox) {\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[6][0], ends[6][1]);\r\n }\r\n else {\r\n ctx.moveTo(ends[0][0], ends[0][1]);\r\n ctx.lineTo(ends[1][0], ends[1][1]);\r\n ctx.lineTo(ends[2][0], ends[2][1]);\r\n ctx.lineTo(ends[3][0], ends[3][1]);\r\n ctx.closePath();\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[5][0], ends[5][1]);\r\n ctx.moveTo(ends[6][0], ends[6][1]);\r\n ctx.lineTo(ends[7][0], ends[7][1]);\r\n }\r\n };\r\n return NormalBoxPath;\r\n }(Path));\r\n function createNormalBox$1(itemLayout, dataIndex, isInit) {\r\n var ends = itemLayout.ends;\r\n return new NormalBoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit$1(ends, itemLayout)\r\n : ends\r\n },\r\n z2: 100\r\n });\r\n }\r\n function isNormalBoxClipped(clipArea, itemLayout) {\r\n var clipped = true;\r\n for (var i = 0; i < itemLayout.ends.length; i++) {\r\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\r\n clipped = false;\r\n break;\r\n }\r\n }\r\n return clipped;\r\n }\r\n function setBoxCommon(el, data, dataIndex, isSimpleBox) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n el.__simpleBox = isSimpleBox;\r\n setStatesStylesFromModel(el, itemModel);\r\n }\r\n function transInit$1(points, itemLayout) {\r\n return map(points, function (point) {\r\n point = point.slice();\r\n point[1] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n }\r\n var LargeBoxPathShape = (function () {\r\n function LargeBoxPathShape() {\r\n }\r\n return LargeBoxPathShape;\r\n }());\r\n var LargeBoxPath = (function (_super) {\r\n __extends(LargeBoxPath, _super);\r\n function LargeBoxPath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeCandlestickBox';\r\n return _this;\r\n }\r\n LargeBoxPath.prototype.getDefaultShape = function () {\r\n return new LargeBoxPathShape();\r\n };\r\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n for (var i = 0; i < points.length;) {\r\n if (this.__sign === points[i++]) {\r\n var x = points[i++];\r\n ctx.moveTo(x, points[i++]);\r\n ctx.lineTo(x, points[i++]);\r\n }\r\n else {\r\n i += 3;\r\n }\r\n }\r\n };\r\n return LargeBoxPath;\r\n }(Path));\r\n function createLarge$1(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var largePoints = data.getLayout('largePoints');\r\n var elP = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: 1\r\n });\r\n group.add(elP);\r\n var elN = new LargeBoxPath({\r\n shape: { points: largePoints },\r\n __sign: -1\r\n });\r\n group.add(elN);\r\n setLargeStyle$1(1, elP, seriesModel);\r\n setLargeStyle$1(-1, elN, seriesModel);\r\n if (incremental) {\r\n elP.incremental = true;\r\n elN.incremental = true;\r\n }\r\n }\r\n function setLargeStyle$1(sign, el, seriesModel, data) {\r\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0'])\r\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\r\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n }\n\n function candlestickPreprocessor(option) {\r\n if (!option || !isArray(option.series)) {\r\n return;\r\n }\r\n each(option.series, function (seriesItem) {\r\n if (isObject(seriesItem) && seriesItem.type === 'k') {\r\n seriesItem.type = 'candlestick';\r\n }\r\n });\r\n }\n\n var positiveBorderColorQuery = ['itemStyle', 'borderColor'];\r\n var negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\r\n var positiveColorQuery = ['itemStyle', 'color'];\r\n var negativeColorQuery = ['itemStyle', 'color0'];\r\n var candlestickVisual = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n function getColor(sign, model) {\r\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\r\n }\r\n function getBorderColor(sign, model) {\r\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\r\n }\r\n var data = seriesModel.getData();\r\n data.setVisual('legendSymbol', 'roundRect');\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var isLargeRender = seriesModel.pipelineContext.large;\r\n return !isLargeRender && {\r\n progress: function (params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var sign = data.getItemLayout(dataIndex).sign;\r\n var style = itemModel.getItemStyle();\r\n style.fill = getColor(sign, itemModel);\r\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\r\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n extend(existsStyle, style);\r\n }\r\n }\r\n };\r\n }\r\n };\n\n var LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n var candlestickLayout = {\r\n seriesType: 'candlestick',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var data = seriesModel.getData();\r\n var candleWidth = calculateCandleWidth(seriesModel, data);\r\n var cDimIdx = 0;\r\n var vDimIdx = 1;\r\n var coordDims = ['x', 'y'];\r\n var cDim = data.mapDimension(coordDims[cDimIdx]);\r\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n var openDim = vDims[0];\r\n var closeDim = vDims[1];\r\n var lowestDim = vDims[2];\r\n var highestDim = vDims[3];\r\n data.setLayout({\r\n candleWidth: candleWidth,\r\n isSimpleBox: candleWidth <= 1.3\r\n });\r\n if (cDim == null || vDims.length < 4) {\r\n return;\r\n }\r\n return {\r\n progress: seriesModel.pipelineContext.large\r\n ? largeProgress : normalProgress\r\n };\r\n function normalProgress(params, data) {\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n var ocLow = Math.min(openVal, closeVal);\r\n var ocHigh = Math.max(openVal, closeVal);\r\n var ocLowPoint = getPoint(ocLow, axisDimVal);\r\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\r\n var lowestPoint = getPoint(lowestVal, axisDimVal);\r\n var highestPoint = getPoint(highestVal, axisDimVal);\r\n var ends = [];\r\n addBodyEnd(ends, ocHighPoint, 0);\r\n addBodyEnd(ends, ocLowPoint, 1);\r\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\r\n data.setItemLayout(dataIndex, {\r\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\r\n initBaseline: openVal > closeVal\r\n ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\r\n ends: ends,\r\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\r\n });\r\n }\r\n function getPoint(val, axisDimVal) {\r\n var p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n return (isNaN(axisDimVal) || isNaN(val))\r\n ? [NaN, NaN]\r\n : coordSys.dataToPoint(p);\r\n }\r\n function addBodyEnd(ends, point, start) {\r\n var point1 = point.slice();\r\n var point2 = point.slice();\r\n point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false);\r\n point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true);\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\r\n var pmin = getPoint(lowestVal, axisDimVal);\r\n var pmax = getPoint(highestVal, axisDimVal);\r\n pmin[cDimIdx] -= candleWidth / 2;\r\n pmax[cDimIdx] -= candleWidth / 2;\r\n return {\r\n x: pmin[0],\r\n y: pmin[1],\r\n width: candleWidth ,\r\n height: pmax[1] - pmin[1] \r\n };\r\n }\r\n function subPixelOptimizePoint(point) {\r\n point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1);\r\n return point;\r\n }\r\n }\r\n function largeProgress(params, data) {\r\n var points = new LargeArr$1(params.count * 4);\r\n var offset = 0;\r\n var point;\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var axisDimVal = data.get(cDim, dataIndex);\r\n var openVal = data.get(openDim, dataIndex);\r\n var closeVal = data.get(closeDim, dataIndex);\r\n var lowestVal = data.get(lowestDim, dataIndex);\r\n var highestVal = data.get(highestDim, dataIndex);\r\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\r\n points[offset++] = NaN;\r\n offset += 3;\r\n continue;\r\n }\r\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\r\n tmpIn[cDimIdx] = axisDimVal;\r\n tmpIn[vDimIdx] = lowestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[0] : NaN;\r\n points[offset++] = point ? point[1] : NaN;\r\n tmpIn[vDimIdx] = highestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[1] : NaN;\r\n }\r\n data.setLayout('largePoints', points);\r\n }\r\n }\r\n };\r\n function getSign(data, dataIndex, openVal, closeVal, closeDim) {\r\n var sign;\r\n if (openVal > closeVal) {\r\n sign = -1;\r\n }\r\n else if (openVal < closeVal) {\r\n sign = 1;\r\n }\r\n else {\r\n sign = dataIndex > 0\r\n ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1)\r\n : 1;\r\n }\r\n return sign;\r\n }\r\n function calculateCandleWidth(seriesModel, data) {\r\n var baseAxis = seriesModel.getBaseAxis();\r\n var extent;\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / data.count());\r\n var barMaxWidth = parsePercent$2(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\r\n var barMinWidth = parsePercent$2(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\r\n var barWidth = seriesModel.get('barWidth');\r\n return barWidth != null\r\n ? parsePercent$2(barWidth, bandWidth)\r\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\r\n }\n\n registerPreprocessor(candlestickPreprocessor);\r\n registerVisual(candlestickVisual);\r\n registerLayout(candlestickLayout);\n\n var EffectScatterSeriesModel = (function (_super) {\r\n __extends(EffectScatterSeriesModel, _super);\r\n function EffectScatterSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n return _this;\r\n }\r\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n };\r\n EffectScatterSeriesModel.type = 'series.effectScatter';\r\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\r\n EffectScatterSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n effectType: 'ripple',\r\n progressive: 0,\r\n showEffectOn: 'render',\r\n rippleEffect: {\r\n period: 4,\r\n scale: 2.5,\r\n brushType: 'fill'\r\n },\r\n symbolSize: 10\r\n };\r\n return EffectScatterSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(EffectScatterSeriesModel);\n\n var EFFECT_RIPPLE_NUMBER = 3;\r\n function normalizeSymbolSize$1(symbolSize) {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return symbolSize;\r\n }\r\n function updateRipplePath(rippleGroup, effectCfg) {\r\n var color = effectCfg.rippleEffectColor || effectCfg.color;\r\n rippleGroup.eachChild(function (ripplePath) {\r\n ripplePath.attr({\r\n z: effectCfg.z,\r\n zlevel: effectCfg.zlevel,\r\n style: {\r\n stroke: effectCfg.brushType === 'stroke' ? color : null,\r\n fill: effectCfg.brushType === 'fill' ? color : null\r\n }\r\n });\r\n });\r\n }\r\n var EffectSymbol = (function (_super) {\r\n __extends(EffectSymbol, _super);\r\n function EffectSymbol(data, idx) {\r\n var _this = _super.call(this) || this;\r\n var symbol = new Symbol(data, idx);\r\n var rippleGroup = new Group();\r\n _this.add(symbol);\r\n _this.add(rippleGroup);\r\n _this.updateData(data, idx);\r\n return _this;\r\n }\r\n EffectSymbol.prototype.stopEffectAnimation = function () {\r\n this.childAt(1).removeAll();\r\n };\r\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\r\n var symbolType = effectCfg.symbolType;\r\n var color = effectCfg.color;\r\n var rippleGroup = this.childAt(1);\r\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\r\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n ripplePath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 99,\r\n silent: true,\r\n scaleX: 0.5,\r\n scaleY: 0.5\r\n });\r\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset;\r\n ripplePath.animate('', true)\r\n .when(effectCfg.period, {\r\n scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2]\r\n })\r\n .delay(delay)\r\n .start();\r\n ripplePath.animateStyle(true)\r\n .when(effectCfg.period, {\r\n opacity: 0\r\n })\r\n .delay(delay)\r\n .start();\r\n rippleGroup.add(ripplePath);\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\r\n var oldEffectCfg = this._effectCfg;\r\n var rippleGroup = this.childAt(1);\r\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\r\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\r\n var propName = DIFFICULT_PROPS[i];\r\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\r\n this.stopEffectAnimation();\r\n this.startEffectAnimation(effectCfg);\r\n return;\r\n }\r\n }\r\n updateRipplePath(rippleGroup, effectCfg);\r\n };\r\n EffectSymbol.prototype.highlight = function () {\r\n enterEmphasis(this);\r\n };\r\n EffectSymbol.prototype.downplay = function () {\r\n leaveEmphasis(this);\r\n };\r\n EffectSymbol.prototype.updateData = function (data, idx) {\r\n var _this = this;\r\n var seriesModel = data.hostModel;\r\n this.childAt(0).updateData(data, idx);\r\n var rippleGroup = this.childAt(1);\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = data.getItemVisual(idx, 'symbol');\r\n var symbolSize = normalizeSymbolSize$1(data.getItemVisual(idx, 'symbolSize'));\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var color = symbolStyle && symbolStyle.fill;\r\n rippleGroup.setScale(symbolSize);\r\n rippleGroup.traverse(function (ripplePath) {\r\n ripplePath.setStyle('fill', color);\r\n });\r\n var symbolOffset = itemModel.getShallow('symbolOffset');\r\n if (symbolOffset) {\r\n rippleGroup.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n rippleGroup.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var effectCfg = {};\r\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\r\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\r\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\r\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\r\n effectCfg.effectOffset = idx / data.count();\r\n effectCfg.z = seriesModel.getShallow('z') || 0;\r\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\r\n effectCfg.symbolType = symbolType;\r\n effectCfg.color = color;\r\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\r\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\r\n if (effectCfg.showEffectOn === 'render') {\r\n this._effectCfg\r\n ? this.updateEffectAnimation(effectCfg)\r\n : this.startEffectAnimation(effectCfg);\r\n this._effectCfg = effectCfg;\r\n }\r\n else {\r\n this._effectCfg = null;\r\n this.stopEffectAnimation();\r\n this.onHoverStateChange = function (toState) {\r\n if (toState === 'emphasis') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.startEffectAnimation(effectCfg);\r\n }\r\n }\r\n else if (toState === 'normal') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n _this.stopEffectAnimation();\r\n }\r\n }\r\n };\r\n }\r\n this._effectCfg = effectCfg;\r\n enableHoverEmphasis(this);\r\n };\r\n EffectSymbol.prototype.fadeOut = function (cb) {\r\n this.off('mouseover').off('mouseout');\r\n cb && cb();\r\n };\r\n return EffectSymbol;\r\n }(Group));\r\n inherits(EffectSymbol, Group);\n\n var EffectScatterView = (function (_super) {\r\n __extends(EffectScatterView, _super);\r\n function EffectScatterView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = EffectScatterView.type;\r\n return _this;\r\n }\r\n EffectScatterView.prototype.init = function () {\r\n this._symbolDraw = new SymbolDraw(EffectSymbol);\r\n };\r\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var effectSymbolDraw = this._symbolDraw;\r\n effectSymbolDraw.updateData(data);\r\n this.group.add(effectSymbolDraw.group);\r\n };\r\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n this.group.dirty();\r\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._symbolDraw.updateLayout();\r\n };\r\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.getRoamTransform) {\r\n this.group.transform = clone$2(coordSys.getRoamTransform());\r\n this.group.decomposeTransform();\r\n }\r\n };\r\n EffectScatterView.prototype.remove = function (ecModel, api) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n };\r\n EffectScatterView.type = 'effectScatter';\r\n return EffectScatterView;\r\n }(ChartView));\r\n ChartView.registerClass(EffectScatterView);\n\n registerLayout(pointsLayout('effectScatter'));\n\n var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\r\n var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\r\n function compatEc2(seriesOpt) {\r\n var data = seriesOpt.data;\r\n if (data && data[0] && data[0][0] && data[0][0].coord) {\r\n if (__DEV__) {\r\n console.warn('Lines data configuration has been changed to'\r\n + ' { coords:[[1,2],[2,3]] }');\r\n }\r\n seriesOpt.data = map(data, function (itemOpt) {\r\n var coords = [\r\n itemOpt[0].coord, itemOpt[1].coord\r\n ];\r\n var target = {\r\n coords: coords\r\n };\r\n if (itemOpt[0].name) {\r\n target.fromName = itemOpt[0].name;\r\n }\r\n if (itemOpt[1].name) {\r\n target.toName = itemOpt[1].name;\r\n }\r\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\r\n });\r\n }\r\n }\r\n var LinesSeriesModel = (function (_super) {\r\n __extends(LinesSeriesModel, _super);\r\n function LinesSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesSeriesModel.type;\r\n _this.visualStyleAccessPath = 'lineStyle';\r\n _this.visualDrawType = 'stroke';\r\n return _this;\r\n }\r\n LinesSeriesModel.prototype.init = function (option) {\r\n option.data = option.data || [];\r\n compatEc2(option);\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n _super.prototype.init.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.mergeOption = function (option) {\r\n compatEc2(option);\r\n if (option.data) {\r\n var result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n }\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n LinesSeriesModel.prototype.appendData = function (params) {\r\n var result = this._processFlatCoordsArray(params.data);\r\n if (result.flatCoords) {\r\n if (!this._flatCoords) {\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n }\r\n else {\r\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\r\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\r\n }\r\n params.data = new Float32Array(result.count);\r\n }\r\n this.getRawData().appendData(params.data);\r\n };\r\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\r\n var itemModel = this.getData().getItemModel(idx);\r\n var coords = (itemModel.option instanceof Array)\r\n ? itemModel.option : itemModel.getShallow('coords');\r\n if (__DEV__) {\r\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\r\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\r\n }\r\n }\r\n return coords;\r\n };\r\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\r\n if (this._flatCoordsOffset) {\r\n return this._flatCoordsOffset[idx * 2 + 1];\r\n }\r\n else {\r\n return this._getCoordsFromItemModel(idx).length;\r\n }\r\n };\r\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\r\n if (this._flatCoordsOffset) {\r\n var offset = this._flatCoordsOffset[idx * 2];\r\n var len = this._flatCoordsOffset[idx * 2 + 1];\r\n for (var i = 0; i < len; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = this._flatCoords[offset + i * 2];\r\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\r\n }\r\n return len;\r\n }\r\n else {\r\n var coords = this._getCoordsFromItemModel(idx);\r\n for (var i = 0; i < coords.length; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = coords[i][0];\r\n out[i][1] = coords[i][1];\r\n }\r\n return coords.length;\r\n }\r\n };\r\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\r\n var startOffset = 0;\r\n if (this._flatCoords) {\r\n startOffset = this._flatCoords.length;\r\n }\r\n if (typeof data[0] === 'number') {\r\n var len = data.length;\r\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\r\n var coordsStorage = new Float64Arr(len);\r\n var coordsCursor = 0;\r\n var offsetCursor = 0;\r\n var dataCount = 0;\r\n for (var i = 0; i < len;) {\r\n dataCount++;\r\n var count = data[i++];\r\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\r\n coordsOffsetAndLenStorage[offsetCursor++] = count;\r\n for (var k = 0; k < count; k++) {\r\n var x = data[i++];\r\n var y = data[i++];\r\n coordsStorage[coordsCursor++] = x;\r\n coordsStorage[coordsCursor++] = y;\r\n if (i > len) {\r\n if (__DEV__) {\r\n throw new Error('Invalid data format.');\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\r\n flatCoords: coordsStorage,\r\n count: dataCount\r\n };\r\n }\r\n return {\r\n flatCoordsOffset: null,\r\n flatCoords: null,\r\n count: data.length\r\n };\r\n };\r\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n if (__DEV__) {\r\n var CoordSys = CoordinateSystemManager.get(option.coordinateSystem);\r\n if (!CoordSys) {\r\n throw new Error('Unkown coordinate system ' + option.coordinateSystem);\r\n }\r\n }\r\n var lineData = new List(['value'], this);\r\n lineData.hasItemOption = false;\r\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\r\n if (dataItem instanceof Array) {\r\n return NaN;\r\n }\r\n else {\r\n lineData.hasItemOption = true;\r\n var value = dataItem.value;\r\n if (value != null) {\r\n return value instanceof Array ? value[dimIndex] : value;\r\n }\r\n }\r\n });\r\n return lineData;\r\n };\r\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var itemModel = data.getItemModel(dataIndex);\r\n var name = itemModel.get('name');\r\n if (name) {\r\n return name;\r\n }\r\n var fromName = itemModel.get('fromName');\r\n var toName = itemModel.get('toName');\r\n var nameArr = [];\r\n fromName != null && nameArr.push(fromName);\r\n toName != null && nameArr.push(toName);\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > ')\r\n });\r\n };\r\n LinesSeriesModel.prototype.preventIncremental = function () {\r\n return !!this.get(['effect', 'show']);\r\n };\r\n LinesSeriesModel.prototype.getProgressive = function () {\r\n var progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 1e4 : this.get('progressive');\r\n }\r\n return progressive;\r\n };\r\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n };\r\n LinesSeriesModel.type = 'series.lines';\r\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\r\n LinesSeriesModel.defaultOption = {\r\n coordinateSystem: 'geo',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n xAxisIndex: 0,\r\n yAxisIndex: 0,\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 10],\r\n geoIndex: 0,\r\n effect: {\r\n show: false,\r\n period: 4,\r\n constantSpeed: 0,\r\n symbol: 'circle',\r\n symbolSize: 3,\r\n loop: true,\r\n trailLength: 0.2\r\n },\r\n large: false,\r\n largeThreshold: 2000,\r\n polyline: false,\r\n clip: true,\r\n label: {\r\n show: false,\r\n position: 'end'\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n };\r\n return LinesSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LinesSeriesModel);\n\n var EffectLine = (function (_super) {\r\n __extends(EffectLine, _super);\r\n function EffectLine(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this.add(_this.createLine(lineData, idx, seriesScope));\r\n _this._updateEffectSymbol(lineData, idx);\r\n return _this;\r\n }\r\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Line$1(lineData, idx, seriesScope);\r\n };\r\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\r\n var itemModel = lineData.getItemModel(idx);\r\n var effectModel = itemModel.getModel('effect');\r\n var size = effectModel.get('symbolSize');\r\n var symbolType = effectModel.get('symbol');\r\n if (!isArray(size)) {\r\n size = [size, size];\r\n }\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var color = effectModel.get('color') || (lineStyle && lineStyle.stroke);\r\n var symbol = this.childAt(1);\r\n if (this._symbolType !== symbolType) {\r\n this.remove(symbol);\r\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n this.add(symbol);\r\n }\r\n if (!symbol) {\r\n return;\r\n }\r\n symbol.setStyle('shadowColor', color);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n symbol.setColor(color);\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\r\n var symbol = this.childAt(1);\r\n if (!symbol) {\r\n return;\r\n }\r\n var self = this;\r\n var points = lineData.getItemLayout(idx);\r\n var period = effectModel.get('period') * 1000;\r\n var loop = effectModel.get('loop');\r\n var constantSpeed = effectModel.get('constantSpeed');\r\n var delayExpr = retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n });\r\n symbol.ignore = true;\r\n this._updateAnimationPoints(symbol, points);\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n if (period !== this._period || loop !== this._loop) {\r\n symbol.stopAnimation();\r\n if (period > 0) {\r\n var delayNum = void 0;\r\n if (typeof delayExpr === 'function') {\r\n delayNum = delayExpr(idx);\r\n }\r\n else {\r\n delayNum = delayExpr;\r\n }\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n symbol.__t = 0;\r\n var animator = symbol.animate('', loop)\r\n .when(period, {\r\n __t: 1\r\n })\r\n .delay(delayNum)\r\n .during(function () {\r\n self._updateSymbolPosition(symbol);\r\n });\r\n if (!loop) {\r\n animator.done(function () {\r\n self.remove(symbol);\r\n });\r\n }\r\n animator.start();\r\n }\r\n }\r\n this._period = period;\r\n this._loop = loop;\r\n };\r\n EffectLine.prototype._getLineLength = function (symbol) {\r\n return (dist(symbol.__p1, symbol.__cp1)\r\n + dist(symbol.__cp1, symbol.__p2));\r\n };\r\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [\r\n (points[0][0] + points[1][0]) / 2,\r\n (points[0][1] + points[1][1]) / 2\r\n ];\r\n };\r\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\r\n this.childAt(0).updateData(lineData, idx, seriesScope);\r\n this._updateEffectSymbol(lineData, idx);\r\n };\r\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\r\n var p1 = symbol.__p1;\r\n var p2 = symbol.__p2;\r\n var cp1 = symbol.__cp1;\r\n var t = symbol.__t;\r\n var pos = [symbol.x, symbol.y];\r\n var lastPos = pos.slice();\r\n var quadraticAt$1 = quadraticAt;\r\n var quadraticDerivativeAt$1 = quadraticDerivativeAt;\r\n pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t);\r\n var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t);\r\n var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t);\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = dist(lastPos, pos) * 1.05;\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n }\r\n else if (symbol.__lastT === 1) {\r\n symbol.scaleY = 2 * dist(p1, pos);\r\n }\r\n else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n };\r\n EffectLine.prototype.updateLayout = function (lineData, idx) {\r\n this.childAt(0).updateLayout(lineData, idx);\r\n var effectModel = lineData.getItemModel(idx).getModel('effect');\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n return EffectLine;\r\n }(Group));\n\n var Polyline$1 = (function (_super) {\r\n __extends(Polyline$1, _super);\r\n function Polyline$1(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n _this._createPolyline(lineData, idx, seriesScope);\r\n return _this;\r\n }\r\n Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) {\r\n var points = lineData.getItemLayout(idx);\r\n var line = new Polyline({\r\n shape: {\r\n points: points\r\n }\r\n });\r\n this.add(line);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) {\r\n var seriesModel = lineData.hostModel;\r\n var line = this.childAt(0);\r\n var target = {\r\n shape: {\r\n points: lineData.getItemLayout(idx)\r\n }\r\n };\r\n updateProps(line, target, seriesModel, idx);\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\r\n var line = this.childAt(0);\r\n var itemModel = lineData.getItemModel(idx);\r\n var hoverLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n if (!seriesScope || lineData.hasItemOption) {\r\n hoverLineStyle = itemModel.getModel(['emphasis', 'lineStyle']).getLineStyle();\r\n }\r\n line.useStyle(lineData.getItemVisual(idx, 'style'));\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n var lineEmphasisState = line.ensureState('emphasis');\r\n lineEmphasisState.style = hoverLineStyle;\r\n enableHoverEmphasis(this);\r\n };\r\n Polyline$1.prototype.updateLayout = function (lineData, idx) {\r\n var polyline = this.childAt(0);\r\n polyline.setShape('points', lineData.getItemLayout(idx));\r\n };\r\n return Polyline$1;\r\n }(Group));\n\n var EffectPolyline = (function (_super) {\r\n __extends(EffectPolyline, _super);\r\n function EffectPolyline() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._lastFrame = 0;\r\n _this._lastFramePercent = 0;\r\n return _this;\r\n }\r\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Polyline$1(lineData, idx, seriesScope);\r\n };\r\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\r\n this._points = points;\r\n var accLenArr = [0];\r\n var len = 0;\r\n for (var i = 1; i < points.length; i++) {\r\n var p1 = points[i - 1];\r\n var p2 = points[i];\r\n len += dist(p1, p2);\r\n accLenArr.push(len);\r\n }\r\n if (len === 0) {\r\n this._length = 0;\r\n return;\r\n }\r\n for (var i = 0; i < accLenArr.length; i++) {\r\n accLenArr[i] /= len;\r\n }\r\n this._offsets = accLenArr;\r\n this._length = len;\r\n };\r\n EffectPolyline.prototype._getLineLength = function () {\r\n return this._length;\r\n };\r\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\r\n var t = symbol.__t;\r\n var points = this._points;\r\n var offsets = this._offsets;\r\n var len = points.length;\r\n if (!offsets) {\r\n return;\r\n }\r\n var lastFrame = this._lastFrame;\r\n var frame;\r\n if (t < this._lastFramePercent) {\r\n var start = Math.min(lastFrame + 1, len - 1);\r\n for (frame = start; frame >= 0; frame--) {\r\n if (offsets[frame] <= t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame, len - 2);\r\n }\r\n else {\r\n for (frame = lastFrame; frame < len; frame++) {\r\n if (offsets[frame] > t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame - 1, len - 2);\r\n }\r\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\r\n var p0 = points[frame];\r\n var p1 = points[frame + 1];\r\n symbol.x = p0[0] * (1 - p) + p * p1[0];\r\n symbol.y = p0[1] * (1 - p) + p * p1[1];\r\n var tx = p1[0] - p0[0];\r\n var ty = p1[1] - p0[1];\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n this._lastFrame = frame;\r\n this._lastFramePercent = t;\r\n symbol.ignore = false;\r\n };\r\n return EffectPolyline;\r\n }(EffectLine));\n\n var LargeLinesPathShape = (function () {\r\n function LargeLinesPathShape() {\r\n this.polyline = false;\r\n this.curveness = 0;\r\n this.segs = [];\r\n }\r\n return LargeLinesPathShape;\r\n }());\r\n var LargeLinesPath = (function (_super) {\r\n __extends(LargeLinesPath, _super);\r\n function LargeLinesPath(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n LargeLinesPath.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n LargeLinesPath.prototype.getDefaultShape = function () {\r\n return new LargeLinesPathShape();\r\n };\r\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n if (shape.polyline) {\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n ctx.moveTo(segs[i++], segs[i++]);\r\n for (var k = 1; k < count; k++) {\r\n ctx.lineTo(segs[i++], segs[i++]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n ctx.moveTo(x0, y0);\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n ctx.quadraticCurveTo(x2, y2, x1, y1);\r\n }\r\n else {\r\n ctx.lineTo(x1, y1);\r\n }\r\n }\r\n }\r\n };\r\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\r\n var shape = this.shape;\r\n var segs = shape.segs;\r\n var curveness = shape.curveness;\r\n var lineWidth = this.style.lineWidth;\r\n if (shape.polyline) {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var count = segs[i++];\r\n if (count > 0) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n for (var k = 1; k < count; k++) {\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n else {\r\n var dataIndex = 0;\r\n for (var i = 0; i < segs.length;) {\r\n var x0 = segs[i++];\r\n var y0 = segs[i++];\r\n var x1 = segs[i++];\r\n var y1 = segs[i++];\r\n if (curveness > 0) {\r\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n else {\r\n if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n dataIndex++;\r\n }\r\n }\r\n return -1;\r\n };\r\n return LargeLinesPath;\r\n }(Path));\r\n var LargeLineDraw = (function () {\r\n function LargeLineDraw() {\r\n this.group = new Group();\r\n }\r\n LargeLineDraw.prototype.isPersistent = function () {\r\n return !this._incremental;\r\n };\r\n LargeLineDraw.prototype.updateData = function (data) {\r\n this.group.removeAll();\r\n var lineEl = new LargeLinesPath({\r\n rectHover: true,\r\n cursor: 'default'\r\n });\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data);\r\n this.group.add(lineEl);\r\n this._incremental = null;\r\n };\r\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this.group.removeAll();\r\n this._clearIncremental();\r\n if (data.count() > 5e5) {\r\n if (!this._incremental) {\r\n this._incremental = new IncrementalDisplayble({\r\n silent: true\r\n });\r\n }\r\n this.group.add(this._incremental);\r\n }\r\n else {\r\n this._incremental = null;\r\n }\r\n };\r\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\r\n var lineEl = new LargeLinesPath();\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n this._setCommon(lineEl, data, !!this._incremental);\r\n if (!this._incremental) {\r\n lineEl.rectHover = true;\r\n lineEl.cursor = 'default';\r\n lineEl.__startIndex = taskParams.start;\r\n this.group.add(lineEl);\r\n }\r\n else {\r\n this._incremental.addDisplayable(lineEl, true);\r\n }\r\n };\r\n LargeLineDraw.prototype.remove = function () {\r\n this._clearIncremental();\r\n this._incremental = null;\r\n this.group.removeAll();\r\n };\r\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\r\n var hostModel = data.hostModel;\r\n lineEl.setShape({\r\n polyline: hostModel.get('polyline'),\r\n curveness: hostModel.get(['lineStyle', 'curveness'])\r\n });\r\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\r\n lineEl.style.strokeNoScale = true;\r\n var style = data.getVisual('style');\r\n if (style && style.stroke) {\r\n lineEl.setStyle('stroke', style.stroke);\r\n }\r\n lineEl.setStyle('fill', null);\r\n if (!isIncremental) {\r\n var ecData_1 = getECData(lineEl);\r\n ecData_1.seriesIndex = hostModel.seriesIndex;\r\n lineEl.on('mousemove', function (e) {\r\n ecData_1.dataIndex = null;\r\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\r\n if (dataIndex > 0) {\r\n ecData_1.dataIndex = dataIndex + lineEl.__startIndex;\r\n }\r\n });\r\n }\r\n };\r\n LargeLineDraw.prototype._clearIncremental = function () {\r\n var incremental = this._incremental;\r\n if (incremental) {\r\n incremental.clearDisplaybles();\r\n }\r\n };\r\n return LargeLineDraw;\r\n }());\n\n var linesLayout = {\r\n seriesType: 'lines',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var isPolyline = seriesModel.get('polyline');\r\n var isLarge = seriesModel.pipelineContext.large;\r\n return {\r\n progress: function (params, lineData) {\r\n var lineCoords = [];\r\n if (isLarge) {\r\n var points = void 0;\r\n var segCount = params.end - params.start;\r\n if (isPolyline) {\r\n var totalCoordsCount = 0;\r\n for (var i = params.start; i < params.end; i++) {\r\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\r\n }\r\n points = new Float32Array(segCount + totalCoordsCount * 2);\r\n }\r\n else {\r\n points = new Float32Array(segCount * 4);\r\n }\r\n var offset = 0;\r\n var pt = [];\r\n for (var i = params.start; i < params.end; i++) {\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n if (isPolyline) {\r\n points[offset++] = len;\r\n }\r\n for (var k = 0; k < len; k++) {\r\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\r\n points[offset++] = pt[0];\r\n points[offset++] = pt[1];\r\n }\r\n }\r\n lineData.setLayout('linesPoints', points);\r\n }\r\n else {\r\n for (var i = params.start; i < params.end; i++) {\r\n var itemModel = lineData.getItemModel(i);\r\n var len = seriesModel.getLineCoords(i, lineCoords);\r\n var pts = [];\r\n if (isPolyline) {\r\n for (var j = 0; j < len; j++) {\r\n pts.push(coordSys.dataToPoint(lineCoords[j]));\r\n }\r\n }\r\n else {\r\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\r\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\r\n var curveness = itemModel.get(['lineStyle', 'curveness']);\r\n if (+curveness) {\r\n pts[2] = [\r\n (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness,\r\n (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness\r\n ];\r\n }\r\n }\r\n lineData.setItemLayout(i, pts);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n };\n\n var LinesView = (function (_super) {\r\n __extends(LinesView, _super);\r\n function LinesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LinesView.type;\r\n return _this;\r\n }\r\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n var zlevel = seriesModel.get('zlevel');\r\n var trailLength = seriesModel.get(['effect', 'trailLength']);\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg) {\r\n zr.painter.getLayer(zlevel).clear(true);\r\n }\r\n if (this._lastZlevel != null && !isSvg) {\r\n zr.configLayer(this._lastZlevel, {\r\n motionBlur: false\r\n });\r\n }\r\n if (this._showEffect(seriesModel) && trailLength) {\r\n if (__DEV__) {\r\n var notInIndividual_1 = false;\r\n ecModel.eachSeries(function (otherSeriesModel) {\r\n if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {\r\n notInIndividual_1 = true;\r\n }\r\n });\r\n notInIndividual_1 && console.warn('Lines with trail effect should have an individual zlevel');\r\n }\r\n if (!isSvg) {\r\n zr.configLayer(zlevel, {\r\n motionBlur: true,\r\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\r\n });\r\n }\r\n }\r\n lineDraw.updateData(data);\r\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n this._lastZlevel = zlevel;\r\n this._finished = true;\r\n };\r\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var lineDraw = this._updateLineDraw(data, seriesModel);\r\n lineDraw.incrementalPrepareUpdate(data);\r\n this._clearLayer(api);\r\n this._finished = false;\r\n };\r\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\r\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n };\r\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n var res = linesLayout.reset(seriesModel, ecModel, api);\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n this._lineDraw.updateLayout();\r\n this._clearLayer(api);\r\n }\r\n };\r\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\r\n var lineDraw = this._lineDraw;\r\n var hasEffect = this._showEffect(seriesModel);\r\n var isPolyline = !!seriesModel.get('polyline');\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var isLargeDraw = pipelineContext.large;\r\n if (__DEV__) {\r\n if (hasEffect && isLargeDraw) {\r\n console.warn('Large lines not support effect');\r\n }\r\n }\r\n if (!lineDraw\r\n || hasEffect !== this._hasEffet\r\n || isPolyline !== this._isPolyline\r\n || isLargeDraw !== this._isLargeDraw) {\r\n if (lineDraw) {\r\n lineDraw.remove();\r\n }\r\n lineDraw = this._lineDraw = isLargeDraw\r\n ? new LargeLineDraw()\r\n : new LineDraw(isPolyline\r\n ? (hasEffect ? EffectPolyline : Polyline$1)\r\n : (hasEffect ? EffectLine : Line$1));\r\n this._hasEffet = hasEffect;\r\n this._isPolyline = isPolyline;\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n this.group.add(lineDraw.group);\r\n return lineDraw;\r\n };\r\n LinesView.prototype._showEffect = function (seriesModel) {\r\n return !!seriesModel.get(['effect', 'show']);\r\n };\r\n LinesView.prototype._clearLayer = function (api) {\r\n var zr = api.getZr();\r\n var isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg && this._lastZlevel != null) {\r\n zr.painter.getLayer(this._lastZlevel).clear(true);\r\n }\r\n };\r\n LinesView.prototype.remove = function (ecModel, api) {\r\n this._lineDraw && this._lineDraw.remove();\r\n this._lineDraw = null;\r\n this._clearLayer(api);\r\n };\r\n LinesView.type = 'lines';\r\n return LinesView;\r\n }(ChartView));\r\n ChartView.registerClass(LinesView);\n\n function normalize$3(a) {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n }\r\n var linesVisual = {\r\n seriesType: 'lines',\r\n reset: function (seriesModel) {\r\n var symbolType = normalize$3(seriesModel.get('symbol'));\r\n var symbolSize = normalize$3(seriesModel.get('symbolSize'));\r\n var data = seriesModel.getData();\r\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n data.setVisual('toSymbol', symbolType && symbolType[1]);\r\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var symbolType = normalize$3(itemModel.getShallow('symbol', true));\r\n var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true));\r\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\r\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\r\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\r\n }\r\n return {\r\n dataEach: data.hasItemOption ? dataEach : null\r\n };\r\n }\r\n };\n\n registerLayout(linesLayout);\r\n registerVisual(linesVisual);\n\n var HeatmapSeriesModel = (function (_super) {\r\n __extends(HeatmapSeriesModel, _super);\r\n function HeatmapSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapSeriesModel.type;\r\n return _this;\r\n }\r\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, {\r\n generateCoord: 'value'\r\n });\r\n };\r\n HeatmapSeriesModel.prototype.preventIncremental = function () {\r\n var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem'));\r\n if (coordSysCreator && coordSysCreator.dimensions) {\r\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\r\n }\r\n };\r\n HeatmapSeriesModel.type = 'series.heatmap';\r\n HeatmapSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n geoIndex: 0,\r\n blurSize: 30,\r\n pointSize: 20,\r\n maxOpacity: 1,\r\n minOpacity: 0,\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n return HeatmapSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(HeatmapSeriesModel);\n\n var GRADIENT_LEVELS = 256;\r\n var HeatmapLayer = (function () {\r\n function HeatmapLayer() {\r\n this.blurSize = 30;\r\n this.pointSize = 20;\r\n this.maxOpacity = 1;\r\n this.minOpacity = 0;\r\n this._gradientPixels = {\r\n inRange: null,\r\n outOfRange: null\r\n };\r\n var canvas = createCanvas();\r\n this.canvas = canvas;\r\n }\r\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\r\n var brush = this._getBrush();\r\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\r\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\r\n var r = this.pointSize + this.blurSize;\r\n var canvas = this.canvas;\r\n var ctx = canvas.getContext('2d');\r\n var len = data.length;\r\n canvas.width = width;\r\n canvas.height = height;\r\n for (var i = 0; i < len; ++i) {\r\n var p = data[i];\r\n var x = p[0];\r\n var y = p[1];\r\n var value = p[2];\r\n var alpha = normalize(value);\r\n ctx.globalAlpha = alpha;\r\n ctx.drawImage(brush, x - r, y - r);\r\n }\r\n if (!canvas.width || !canvas.height) {\r\n return canvas;\r\n }\r\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n var pixels = imageData.data;\r\n var offset = 0;\r\n var pixelLen = pixels.length;\r\n var minOpacity = this.minOpacity;\r\n var maxOpacity = this.maxOpacity;\r\n var diffOpacity = maxOpacity - minOpacity;\r\n while (offset < pixelLen) {\r\n var alpha = pixels[offset + 3] / 256;\r\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\r\n if (alpha > 0) {\r\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\r\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\r\n pixels[offset++] = gradient[gradientOffset];\r\n pixels[offset++] = gradient[gradientOffset + 1];\r\n pixels[offset++] = gradient[gradientOffset + 2];\r\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\r\n }\r\n else {\r\n offset += 4;\r\n }\r\n }\r\n ctx.putImageData(imageData, 0, 0);\r\n return canvas;\r\n };\r\n HeatmapLayer.prototype._getBrush = function () {\r\n var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas());\r\n var r = this.pointSize + this.blurSize;\r\n var d = r * 2;\r\n brushCanvas.width = d;\r\n brushCanvas.height = d;\r\n var ctx = brushCanvas.getContext('2d');\r\n ctx.clearRect(0, 0, d, d);\r\n ctx.shadowOffsetX = d;\r\n ctx.shadowBlur = this.blurSize;\r\n ctx.shadowColor = '#000';\r\n ctx.beginPath();\r\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n return brushCanvas;\r\n };\r\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\r\n var gradientPixels = this._gradientPixels;\r\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\r\n var color = [0, 0, 0, 0];\r\n var off = 0;\r\n for (var i = 0; i < 256; i++) {\r\n colorFunc[state](i / 255, true, color);\r\n pixelsSingleState[off++] = color[0];\r\n pixelsSingleState[off++] = color[1];\r\n pixelsSingleState[off++] = color[2];\r\n pixelsSingleState[off++] = color[3];\r\n }\r\n return pixelsSingleState;\r\n };\r\n return HeatmapLayer;\r\n }());\n\n function getIsInPiecewiseRange(dataExtent, pieceList, selected) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n pieceList = map(pieceList, function (piece) {\r\n return {\r\n interval: [\r\n (piece.interval[0] - dataExtent[0]) / dataSpan,\r\n (piece.interval[1] - dataExtent[0]) / dataSpan\r\n ]\r\n };\r\n });\r\n var len = pieceList.length;\r\n var lastIndex = 0;\r\n return function (val) {\r\n var i;\r\n for (i = lastIndex; i < len; i++) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n if (i === len) {\r\n for (i = lastIndex - 1; i >= 0; i--) {\r\n var interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return i >= 0 && i < len && selected[i];\r\n };\r\n }\r\n function getIsInContinuousRange(dataExtent, range) {\r\n var dataSpan = dataExtent[1] - dataExtent[0];\r\n range = [\r\n (range[0] - dataExtent[0]) / dataSpan,\r\n (range[1] - dataExtent[0]) / dataSpan\r\n ];\r\n return function (val) {\r\n return val >= range[0] && val <= range[1];\r\n };\r\n }\r\n function isGeoCoordSys(coordSys) {\r\n var dimensions = coordSys.dimensions;\r\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\r\n }\r\n var HeatmapView = (function (_super) {\r\n __extends(HeatmapView, _super);\r\n function HeatmapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = HeatmapView.type;\r\n return _this;\r\n }\r\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\r\n var visualMapOfThisSeries;\r\n ecModel.eachComponent('visualMap', function (visualMap) {\r\n visualMap.eachTargetSeries(function (targetSeries) {\r\n if (targetSeries === seriesModel) {\r\n visualMapOfThisSeries = visualMap;\r\n }\r\n });\r\n });\r\n if (__DEV__) {\r\n if (!visualMapOfThisSeries) {\r\n throw new Error('Heatmap must use with visualMap');\r\n }\r\n }\r\n this.group.removeAll();\r\n this._incrementalDisplayable = null;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\r\n }\r\n else if (isGeoCoordSys(coordSys)) {\r\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\r\n }\r\n };\r\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var width;\r\n var height;\r\n var xAxisExtent;\r\n var yAxisExtent;\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n if (__DEV__) {\r\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\r\n throw new Error('Heatmap on cartesian must have two category axes');\r\n }\r\n if (!(xAxis.onBand && yAxis.onBand)) {\r\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\r\n }\r\n }\r\n width = xAxis.getBandWidth();\r\n height = yAxis.getBandWidth();\r\n xAxisExtent = xAxis.scale.getExtent();\r\n yAxisExtent = yAxis.scale.getExtent();\r\n }\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\r\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var labelStatesModels = getLabelStatesModels(seriesModel);\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n var dataDims = isCoordinateSystemType(coordSys, 'cartesian2d')\r\n ? [\r\n data.mapDimension('x'),\r\n data.mapDimension('y'),\r\n data.mapDimension('value')\r\n ]\r\n : [\r\n data.mapDimension('time'),\r\n data.mapDimension('value')\r\n ];\r\n for (var idx = start; idx < end; idx++) {\r\n var rect = void 0;\r\n var style = data.getItemVisual(idx, 'style');\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var dataDimX = data.get(dataDims[0], idx);\r\n var dataDimY = data.get(dataDims[1], idx);\r\n if (isNaN(data.get(dataDims[2], idx))\r\n || dataDimX < xAxisExtent[0]\r\n || dataDimX > xAxisExtent[1]\r\n || dataDimY < yAxisExtent[0]\r\n || dataDimY > yAxisExtent[1]) {\r\n continue;\r\n }\r\n var point = coordSys.dataToPoint([\r\n dataDimX,\r\n dataDimY\r\n ]);\r\n rect = new Rect({\r\n shape: {\r\n x: Math.floor(Math.round(point[0]) - width / 2),\r\n y: Math.floor(Math.round(point[1]) - height / 2),\r\n width: Math.ceil(width),\r\n height: Math.ceil(height)\r\n },\r\n style: style\r\n });\r\n }\r\n else {\r\n if (isNaN(data.get(dataDims[1], idx))) {\r\n continue;\r\n }\r\n rect = new Rect({\r\n z2: 1,\r\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\r\n style: style\r\n });\r\n }\r\n var itemModel = data.getItemModel(idx);\r\n if (data.hasItemOption) {\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var defaultText = '-';\r\n if (rawValue && rawValue[2] != null) {\r\n defaultText = rawValue[2] + '';\r\n }\r\n setLabelStyle(rect, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: defaultText\r\n });\r\n rect.ensureState('emphasis').style = emphasisStyle;\r\n rect.ensureState('blur').style = blurStyle;\r\n rect.ensureState('select').style = selectStyle;\r\n enableHoverEmphasis(rect, focus, blurScope);\r\n rect.incremental = incremental;\r\n if (incremental) {\r\n rect.states.emphasis.hoverLayer = true;\r\n }\r\n group.add(rect);\r\n data.setItemGraphicEl(idx, rect);\r\n }\r\n };\r\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\r\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\r\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\r\n var data = seriesModel.getData();\r\n var hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());\r\n hmLayer.blurSize = seriesModel.get('blurSize');\r\n hmLayer.pointSize = seriesModel.get('pointSize');\r\n hmLayer.minOpacity = seriesModel.get('minOpacity');\r\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\r\n var rect = geo.getViewRect().clone();\r\n var roamTransform = geo.getRoamTransform();\r\n rect.applyTransform(roamTransform);\r\n var x = Math.max(rect.x, 0);\r\n var y = Math.max(rect.y, 0);\r\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\r\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\r\n var width = x2 - x;\r\n var height = y2 - y;\r\n var dims = [\r\n data.mapDimension('lng'),\r\n data.mapDimension('lat'),\r\n data.mapDimension('value')\r\n ];\r\n var points = data.mapArray(dims, function (lng, lat, value) {\r\n var pt = geo.dataToPoint([lng, lat]);\r\n pt[0] -= x;\r\n pt[1] -= y;\r\n pt.push(value);\r\n return pt;\r\n });\r\n var dataExtent = visualMapModel.getExtent();\r\n var isInRange = visualMapModel.type === 'visualMap.continuous'\r\n ? getIsInContinuousRange(dataExtent, visualMapModel.option.range)\r\n : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\r\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\r\n inRange: inRangeVisuals.color.getColorMapper(),\r\n outOfRange: outOfRangeVisuals.color.getColorMapper()\r\n }, isInRange);\r\n var img = new ZRImage({\r\n style: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y,\r\n image: hmLayer.canvas\r\n },\r\n silent: true\r\n });\r\n this.group.add(img);\r\n };\r\n HeatmapView.type = 'heatmap';\r\n return HeatmapView;\r\n }(ChartView));\r\n ChartView.registerClass(HeatmapView);\n\n var PictorialBarSeriesModel = (function (_super) {\r\n __extends(PictorialBarSeriesModel, _super);\r\n function PictorialBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.defaultSymbol = 'roundRect';\r\n return _this;\r\n }\r\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\r\n option.stack = null;\r\n return _super.prototype.getInitialData.apply(this, arguments);\r\n };\r\n PictorialBarSeriesModel.type = 'series.pictorialBar';\r\n PictorialBarSeriesModel.dependencies = ['grid'];\r\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n symbol: 'circle',\r\n symbolSize: null,\r\n symbolRotate: null,\r\n symbolPosition: null,\r\n symbolOffset: null,\r\n symbolMargin: null,\r\n symbolRepeat: false,\r\n symbolRepeatDirection: 'end',\r\n symbolClip: false,\r\n symbolBoundingData: null,\r\n symbolPatternSize: 400,\r\n barGap: '-100%',\r\n progressive: 0,\r\n emphasis: {\r\n scale: false\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n });\r\n return PictorialBarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(PictorialBarSeriesModel);\n\n var BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth'];\r\n var LAYOUT_ATTRS = [\r\n { xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right'] },\r\n { xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom'] }\r\n ];\r\n var pathForLineWidth = new Circle();\r\n var PictorialBarView = (function (_super) {\r\n __extends(PictorialBarView, _super);\r\n function PictorialBarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PictorialBarView.type;\r\n return _this;\r\n }\r\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var coordSysRect = cartesian.master.getRect();\r\n var opt = {\r\n ecSize: { width: api.getWidth(), height: api.getHeight() },\r\n seriesModel: seriesModel,\r\n coordSys: cartesian,\r\n coordSysExtent: [\r\n [coordSysRect.x, coordSysRect.x + coordSysRect.width],\r\n [coordSysRect.y, coordSysRect.y + coordSysRect.height]\r\n ],\r\n isHorizontal: isHorizontal,\r\n valueDim: LAYOUT_ATTRS[+isHorizontal],\r\n categoryDim: LAYOUT_ATTRS[1 - (+isHorizontal)]\r\n };\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var itemModel = getItemModel(data, dataIndex);\r\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\r\n var bar = createBar(data, opt, symbolMeta);\r\n data.setItemGraphicEl(dataIndex, bar);\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var bar = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(bar);\r\n return;\r\n }\r\n var itemModel = getItemModel(data, newIndex);\r\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\r\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\r\n group.remove(bar);\r\n data.setItemGraphicEl(newIndex, null);\r\n bar = null;\r\n }\r\n if (bar) {\r\n updateBar(bar, opt, symbolMeta);\r\n }\r\n else {\r\n bar = createBar(data, opt, symbolMeta, true);\r\n }\r\n data.setItemGraphicEl(newIndex, bar);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n group.add(bar);\r\n updateCommon$1(bar, opt, symbolMeta);\r\n })\r\n .remove(function (dataIndex) {\r\n var bar = oldData.getItemGraphicEl(dataIndex);\r\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\r\n })\r\n .execute();\r\n this._data = data;\r\n return this.group;\r\n };\r\n PictorialBarView.prototype.remove = function (ecModel, api) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (ecModel.get('animation')) {\r\n if (data) {\r\n data.eachItemGraphicEl(function (bar) {\r\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\r\n });\r\n }\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n PictorialBarView.type = 'pictorialBar';\r\n return PictorialBarView;\r\n }(ChartView));\r\n function getSymbolMeta(data, dataIndex, itemModel, opt) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var symbolRepeat = itemModel.get('symbolRepeat');\r\n var symbolClip = itemModel.get('symbolClip');\r\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\r\n var symbolRotate = itemModel.get('symbolRotate');\r\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\r\n var isAnimationEnabled = itemModel.isAnimationEnabled();\r\n var symbolMeta = {\r\n dataIndex: dataIndex,\r\n layout: layout,\r\n itemModel: itemModel,\r\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\r\n style: data.getItemVisual(dataIndex, 'style'),\r\n symbolClip: symbolClip,\r\n symbolRepeat: symbolRepeat,\r\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\r\n symbolPatternSize: symbolPatternSize,\r\n rotation: rotation,\r\n animationModel: isAnimationEnabled ? itemModel : null,\r\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\r\n z2: itemModel.getShallow('z', true) || 0\r\n };\r\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\r\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\r\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\r\n var symbolSize = symbolMeta.symbolSize;\r\n var symbolOffset = itemModel.get('symbolOffset');\r\n if (isArray(symbolOffset)) {\r\n symbolOffset = [\r\n parsePercent$2(symbolOffset[0], symbolSize[0]),\r\n parsePercent$2(symbolOffset[1], symbolSize[1])\r\n ];\r\n }\r\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\r\n return symbolMeta;\r\n }\r\n function prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var symbolBoundingData = itemModel.get('symbolBoundingData');\r\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\r\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\r\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\r\n var boundingLength;\r\n if (isArray(symbolBoundingData)) {\r\n var symbolBoundingExtent = [\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\r\n ];\r\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\r\n boundingLength = symbolBoundingExtent[pxSignIdx];\r\n }\r\n else if (symbolBoundingData != null) {\r\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\r\n }\r\n else if (symbolRepeat) {\r\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\r\n }\r\n else {\r\n boundingLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.boundingLength = boundingLength;\r\n if (symbolRepeat) {\r\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\r\n }\r\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\r\n }\r\n function convertToCoordOnAxis(axis, value) {\r\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\r\n }\r\n function prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\r\n var valueDim = opt.valueDim;\r\n var categoryDim = opt.categoryDim;\r\n var categorySize = Math.abs(layout[categoryDim.wh]);\r\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\r\n var parsedSymbolSize;\r\n if (isArray(symbolSize)) {\r\n parsedSymbolSize = symbolSize.slice();\r\n }\r\n else {\r\n if (symbolSize == null) {\r\n parsedSymbolSize = ['100%', '100%'];\r\n }\r\n else {\r\n parsedSymbolSize = [symbolSize, symbolSize];\r\n }\r\n }\r\n parsedSymbolSize[categoryDim.index] = parsePercent$2(parsedSymbolSize[categoryDim.index], categorySize);\r\n parsedSymbolSize[valueDim.index] = parsePercent$2(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\r\n outputSymbolMeta.symbolSize = parsedSymbolSize;\r\n var symbolScale = outputSymbolMeta.symbolScale = [\r\n parsedSymbolSize[0] / symbolPatternSize,\r\n parsedSymbolSize[1] / symbolPatternSize\r\n ];\r\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\r\n }\r\n function prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\r\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0;\r\n if (valueLineWidth) {\r\n pathForLineWidth.attr({\r\n scaleX: symbolScale[0],\r\n scaleY: symbolScale[1],\r\n rotation: rotation\r\n });\r\n pathForLineWidth.updateTransform();\r\n valueLineWidth /= pathForLineWidth.getLineScale();\r\n valueLineWidth *= symbolScale[opt.valueDim.index];\r\n }\r\n outputSymbolMeta.valueLineWidth = valueLineWidth;\r\n }\r\n function prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\r\n var categoryDim = opt.categoryDim;\r\n var valueDim = opt.valueDim;\r\n var pxSign = outputSymbolMeta.pxSign;\r\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\r\n var pathLen = unitLength;\r\n if (symbolRepeat) {\r\n var absBoundingLength = Math.abs(boundingLength);\r\n var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + '';\r\n var hasEndGap = false;\r\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\r\n hasEndGap = true;\r\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\r\n }\r\n var symbolMarginNumeric = parsePercent$2(symbolMargin, symbolSize[valueDim.index]);\r\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\r\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n var repeatSpecified = isNumeric(symbolRepeat);\r\n var repeatTimes = repeatSpecified\r\n ? symbolRepeat\r\n : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\r\n var mDiff = absBoundingLength - repeatTimes * unitLength;\r\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\r\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\r\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\r\n repeatTimes = repeatCutLength\r\n ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin)\r\n : 0;\r\n }\r\n pathLen = repeatTimes * uLenWithMargin - endFix;\r\n outputSymbolMeta.repeatTimes = repeatTimes;\r\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\r\n }\r\n var sizeFix = pxSign * (pathLen / 2);\r\n var pathPosition = outputSymbolMeta.pathPosition = [];\r\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\r\n pathPosition[valueDim.index] = symbolPosition === 'start'\r\n ? sizeFix\r\n : symbolPosition === 'end'\r\n ? boundingLength - sizeFix\r\n : boundingLength / 2;\r\n if (symbolOffset) {\r\n pathPosition[0] += symbolOffset[0];\r\n pathPosition[1] += symbolOffset[1];\r\n }\r\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\r\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\r\n bundlePosition[valueDim.index] = layout[valueDim.xy];\r\n var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout);\r\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\r\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\r\n var clipShape = outputSymbolMeta.clipShape = {};\r\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\r\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\r\n clipShape[valueDim.xy] = 0;\r\n clipShape[valueDim.wh] = layout[valueDim.wh];\r\n }\r\n function createPath(symbolMeta) {\r\n var symbolPatternSize = symbolMeta.symbolPatternSize;\r\n var path = createSymbol(symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\r\n path.attr({\r\n culling: true\r\n });\r\n path.type !== 'image' && path.setStyle({\r\n strokeNoScale: true\r\n });\r\n return path;\r\n }\r\n function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var symbolSize = symbolMeta.symbolSize;\r\n var valueLineWidth = symbolMeta.valueLineWidth;\r\n var pathPosition = symbolMeta.pathPosition;\r\n var valueDim = opt.valueDim;\r\n var repeatTimes = symbolMeta.repeatTimes || 0;\r\n var index = 0;\r\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\r\n eachPath(bar, function (path) {\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n if (index < repeatTimes) {\r\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(path, null, { scaleX: 0, scaleY: 0 }, symbolMeta, isUpdate, function () {\r\n bundle.remove(path);\r\n });\r\n }\r\n index++;\r\n });\r\n for (; index < repeatTimes; index++) {\r\n var path = createPath(symbolMeta);\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n bundle.add(path);\r\n var target = makeTarget(index);\r\n updateAttr(path, {\r\n x: target.x,\r\n y: target.y,\r\n scaleX: 0,\r\n scaleY: 0\r\n }, {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n rotation: target.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n function makeTarget(index) {\r\n var position = pathPosition.slice();\r\n var pxSign = symbolMeta.pxSign;\r\n var i = index;\r\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\r\n i = repeatTimes - 1 - index;\r\n }\r\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n };\r\n }\r\n }\r\n function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\r\n var bundle = bar.__pictorialBundle;\r\n var mainPath = bar.__pictorialMainPath;\r\n if (!mainPath) {\r\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\r\n bundle.add(mainPath);\r\n updateAttr(mainPath, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: 0,\r\n scaleY: 0,\r\n rotation: symbolMeta.rotation\r\n }, {\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1]\r\n }, symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(mainPath, null, {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n }, symbolMeta, isUpdate);\r\n }\r\n }\r\n function createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\r\n var rectShape = extend({}, symbolMeta.barRectShape);\r\n var barRect = bar.__pictorialBarRect;\r\n if (!barRect) {\r\n barRect = bar.__pictorialBarRect = new Rect({\r\n z2: 2,\r\n shape: rectShape,\r\n silent: true,\r\n style: {\r\n stroke: 'transparent',\r\n fill: 'transparent',\r\n lineWidth: 0\r\n }\r\n });\r\n bar.add(barRect);\r\n }\r\n else {\r\n updateAttr(barRect, null, { shape: rectShape }, symbolMeta, isUpdate);\r\n }\r\n }\r\n function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\r\n if (symbolMeta.symbolClip) {\r\n var clipPath = bar.__pictorialClipPath;\r\n var clipShape = extend({}, symbolMeta.clipShape);\r\n var valueDim = opt.valueDim;\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n if (clipPath) {\r\n updateProps(clipPath, { shape: clipShape }, animationModel, dataIndex);\r\n }\r\n else {\r\n clipShape[valueDim.wh] = 0;\r\n clipPath = new Rect({ shape: clipShape });\r\n bar.__pictorialBundle.setClipPath(clipPath);\r\n bar.__pictorialClipPath = clipPath;\r\n var target = {};\r\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\r\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { shape: target }, animationModel, dataIndex);\r\n }\r\n }\r\n }\r\n function getItemModel(data, dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\r\n itemModel.isAnimationEnabled = isAnimationEnabled;\r\n return itemModel;\r\n }\r\n function getAnimationDelayParams(path) {\r\n return {\r\n index: path.__pictorialAnimationIndex,\r\n count: path.__pictorialRepeatTimes\r\n };\r\n }\r\n function isAnimationEnabled() {\r\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\r\n }\r\n function createBar(data, opt, symbolMeta, isUpdate) {\r\n var bar = new Group();\r\n var bundle = new Group();\r\n bar.add(bundle);\r\n bar.__pictorialBundle = bundle;\r\n bundle.x = symbolMeta.bundlePosition[0];\r\n bundle.y = symbolMeta.bundlePosition[1];\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\r\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\r\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n return bar;\r\n }\r\n function updateBar(bar, opt, symbolMeta) {\r\n var animationModel = symbolMeta.animationModel;\r\n var dataIndex = symbolMeta.dataIndex;\r\n var bundle = bar.__pictorialBundle;\r\n updateProps(bundle, {\r\n x: symbolMeta.bundlePosition[0],\r\n y: symbolMeta.bundlePosition[1]\r\n }, animationModel, dataIndex);\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\r\n }\r\n createOrUpdateBarRect(bar, symbolMeta, true);\r\n createOrUpdateClip(bar, opt, symbolMeta, true);\r\n }\r\n function removeBar(data, dataIndex, animationModel, bar) {\r\n var labelRect = bar.__pictorialBarRect;\r\n labelRect && (labelRect.removeTextContent());\r\n var pathes = [];\r\n eachPath(bar, function (path) {\r\n pathes.push(path);\r\n });\r\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath);\r\n bar.__pictorialClipPath && (animationModel = null);\r\n each(pathes, function (path) {\r\n removeElement(path, { scaleX: 0, scaleY: 0 }, animationModel, dataIndex, function () {\r\n bar.parent && bar.parent.remove(bar);\r\n });\r\n });\r\n data.setItemGraphicEl(dataIndex, null);\r\n }\r\n function getShapeStr(data, symbolMeta) {\r\n return [\r\n data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none',\r\n !!symbolMeta.symbolRepeat,\r\n !!symbolMeta.symbolClip\r\n ].join(':');\r\n }\r\n function eachPath(bar, cb, context) {\r\n each(bar.__pictorialBundle.children(), function (el) {\r\n el !== bar.__pictorialBarRect && cb.call(context, el);\r\n });\r\n }\r\n function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\r\n immediateAttrs && el.attr(immediateAttrs);\r\n if (symbolMeta.symbolClip && !isUpdate) {\r\n animationAttrs && el.attr(animationAttrs);\r\n }\r\n else {\r\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\r\n }\r\n }\r\n function updateCommon$1(bar, opt, symbolMeta) {\r\n var dataIndex = symbolMeta.dataIndex;\r\n var itemModel = symbolMeta.itemModel;\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n var focus = emphasisModel.get('focus');\r\n var blurScope = emphasisModel.get('blurScope');\r\n var hoverScale = emphasisModel.get('scale');\r\n eachPath(bar, function (path) {\r\n if (path instanceof ZRImage) {\r\n var pathStyle = path.style;\r\n path.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolMeta.style));\r\n }\r\n else {\r\n path.useStyle(symbolMeta.style);\r\n }\r\n var emphasisState = path.ensureState('emphasis');\r\n emphasisState.style = emphasisStyle;\r\n if (hoverScale) {\r\n emphasisState.scaleX = path.scaleX * 1.1;\r\n emphasisState.scaleY = path.scaleY * 1.1;\r\n }\r\n path.ensureState('blur').style = blurStyle;\r\n path.ensureState('select').style = selectStyle;\r\n cursorStyle && (path.cursor = cursorStyle);\r\n path.z2 = symbolMeta.z2;\r\n });\r\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\r\n var barRect = bar.__pictorialBarRect;\r\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\r\n labelFetcher: opt.seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\r\n inheritColor: symbolMeta.style.fill,\r\n defaultOpacity: symbolMeta.style.opacity,\r\n defaultOutsidePosition: barPositionOutside\r\n });\r\n enableHoverEmphasis(bar, focus, blurScope);\r\n }\r\n function toIntTimes(times) {\r\n var roundedTimes = Math.round(times);\r\n return Math.abs(times - roundedTimes) < 1e-4\r\n ? roundedTimes\r\n : Math.ceil(times);\r\n }\r\n ChartView.registerClass(PictorialBarView);\n\n registerLayout(curry(layout, 'pictorialBar'));\n\n var SingleAxis = (function (_super) {\r\n __extends(SingleAxis, _super);\r\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n SingleAxis.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n SingleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.coordinateSystem.pointToData(point)[0];\r\n };\r\n return SingleAxis;\r\n }(Axis));\n\n var Single = (function () {\r\n function Single(axisModel, ecModel, api) {\r\n this.type = 'single';\r\n this.dimension = 'single';\r\n this.dimensions = ['single'];\r\n this.axisPointerEnabled = true;\r\n this.model = axisModel;\r\n this._init(axisModel, ecModel, api);\r\n }\r\n Single.prototype._init = function (axisModel, ecModel, api) {\r\n var dim = this.dimension;\r\n var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axis.orient = axisModel.get('orient');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = this;\r\n this._axis = axis;\r\n };\r\n Single.prototype.update = function (ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === this) {\r\n var data_1 = seriesModel.getData();\r\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\r\n this._axis.scale.unionExtentFromData(data_1, dim);\r\n }, this);\r\n niceScaleExtent(this._axis.scale, this._axis.model);\r\n }\r\n }, this);\r\n };\r\n Single.prototype.resize = function (axisModel, api) {\r\n this._rect = getLayoutRect({\r\n left: axisModel.get('left'),\r\n top: axisModel.get('top'),\r\n right: axisModel.get('right'),\r\n bottom: axisModel.get('bottom'),\r\n width: axisModel.get('width'),\r\n height: axisModel.get('height')\r\n }, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._adjustAxis();\r\n };\r\n Single.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Single.prototype._adjustAxis = function () {\r\n var rect = this._rect;\r\n var axis = this._axis;\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\r\n var idx = axis.reverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\r\n };\r\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var extentSum = axisExtent[0] + axisExtent[1];\r\n var isHorizontal = axis.isHorizontal();\r\n axis.toGlobalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n };\r\n Single.prototype.getAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getBaseAxis = function () {\r\n return this._axis;\r\n };\r\n Single.prototype.getAxes = function () {\r\n return [this._axis];\r\n };\r\n Single.prototype.getTooltipAxes = function () {\r\n return {\r\n baseAxes: [this.getAxis()],\r\n otherAxes: []\r\n };\r\n };\r\n Single.prototype.containPoint = function (point) {\r\n var rect = this.getRect();\r\n var axis = this.getAxis();\r\n var orient = axis.orient;\r\n if (orient === 'horizontal') {\r\n return axis.contain(axis.toLocalCoord(point[0]))\r\n && (point[1] >= rect.y && point[1] <= (rect.y + rect.height));\r\n }\r\n else {\r\n return axis.contain(axis.toLocalCoord(point[1]))\r\n && (point[0] >= rect.y && point[0] <= (rect.y + rect.height));\r\n }\r\n };\r\n Single.prototype.pointToData = function (point) {\r\n var axis = this.getAxis();\r\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\r\n };\r\n Single.prototype.dataToPoint = function (val) {\r\n var axis = this.getAxis();\r\n var rect = this.getRect();\r\n var pt = [];\r\n var idx = axis.orient === 'horizontal' ? 0 : 1;\r\n if (val instanceof Array) {\r\n val = val[0];\r\n }\r\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\r\n pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2);\r\n return pt;\r\n };\r\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$2(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Single;\r\n }());\r\n function getCoordSys$2(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var singleModel = finder.singleAxisModel;\r\n return singleModel && singleModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n }\n\n function create$3(ecModel, api) {\r\n var singles = [];\r\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\r\n var single = new Single(axisModel, ecModel, api);\r\n single.name = 'single_' + idx;\r\n single.resize(axisModel, api);\r\n axisModel.coordinateSystem = single;\r\n singles.push(single);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\r\n }\r\n });\r\n return singles;\r\n }\r\n CoordinateSystemManager.register('single', {\r\n create: create$3,\r\n dimensions: Single.prototype.dimensions\r\n });\n\n function layout$2(axisModel, opt) {\r\n opt = opt || {};\r\n var single = axisModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var axisPosition = axis.position;\r\n var orient = axis.orient;\r\n var rect = single.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var positionMap = {\r\n horizontal: { top: rectBound[2], bottom: rectBound[3] },\r\n vertical: { left: rectBound[0], right: rectBound[1] }\r\n };\r\n layout.position = [\r\n orient === 'vertical'\r\n ? positionMap.vertical[axisPosition]\r\n : rectBound[0],\r\n orient === 'horizontal'\r\n ? positionMap.horizontal[axisPosition]\r\n : rectBound[3]\r\n ];\r\n var r = { horizontal: 0, vertical: 1 };\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n var directionMap = { top: -1, bottom: 1, right: 1, left: -1 };\r\n layout.labelDirection = layout.tickDirection =\r\n layout.nameDirection = directionMap[axisPosition];\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n layout.z2 = 1;\r\n return layout;\r\n }\n\n var axisBuilderAttrs$2 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs$1 = ['splitArea', 'splitLine'];\r\n var SingleAxisView = (function (_super) {\r\n __extends(SingleAxisView, _super);\r\n function SingleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisView.type;\r\n _this.axisPointerClass = 'SingleAxisPointer';\r\n return _this;\r\n }\r\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n var layout = layout$2(axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, layout);\r\n each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder);\r\n group.add(this._axisGroup);\r\n group.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs$1, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders$1[name](this, this.group, this._axisGroup, axisModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n SingleAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n SingleAxisView.type = 'singleAxis';\r\n return SingleAxisView;\r\n }(AxisView));\r\n var axisElementBuilders$1 = {\r\n splitLine: function (axisView, group, axisGroup, axisModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var gridRect = axisModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var splitLines = [];\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n for (var i = 0; i < ticksCoords.length; ++i) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n silent: true\r\n }));\r\n }\r\n var lineStyle = lineStyleModel.getLineStyle(['color']);\r\n for (var i = 0; i < splitLines.length; ++i) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n splitArea: function (axisView, group, axisGroup, axisModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\r\n }\r\n };\r\n ComponentView.registerClass(SingleAxisView);\n\n var SingleAxisModel = (function (_super) {\r\n __extends(SingleAxisModel, _super);\r\n function SingleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SingleAxisModel.type;\r\n return _this;\r\n }\r\n SingleAxisModel.prototype.getCoordSysModel = function () {\r\n return this;\r\n };\r\n SingleAxisModel.type = 'singleAxis';\r\n SingleAxisModel.layoutMode = 'box';\r\n SingleAxisModel.defaultOption = {\r\n left: '5%',\r\n top: '5%',\r\n right: '5%',\r\n bottom: '5%',\r\n type: 'value',\r\n position: 'bottom',\r\n orient: 'horizontal',\r\n axisLine: {\r\n show: true,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n tooltip: {\r\n show: true\r\n },\r\n axisTick: {\r\n show: true,\r\n length: 6,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n interval: 'auto'\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n type: 'dashed',\r\n opacity: 0.2\r\n }\r\n }\r\n };\r\n return SingleAxisModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(SingleAxisModel);\r\n mixin(SingleAxisModel, AxisModelCommonMixin.prototype);\r\n axisModelCreator('single', SingleAxisModel, SingleAxisModel.defaultOption);\n\n function findPointFromSeries(finder, ecModel) {\r\n var point = [];\r\n var seriesIndex = finder.seriesIndex;\r\n var seriesModel;\r\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\r\n return {\r\n point: []\r\n };\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, finder);\r\n if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {\r\n return { point: [] };\r\n }\r\n var el = data.getItemGraphicEl(dataIndex);\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueAxisDim = valueAxis.dim;\r\n var baseAxisDim = baseAxis.dim;\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex)) || [];\r\n }\r\n }\r\n else if (el) {\r\n var rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n return { point: point, el: el };\r\n }\n\n var inner$b = makeInner();\r\n function axisTrigger(payload, ecModel, api) {\r\n var currTrigger = payload.currTrigger;\r\n var point = [payload.x, payload.y];\r\n var finder = payload;\r\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer')\r\n .coordSysAxesInfo;\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n if (illegalPoint(point)) {\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n var isIllegalPoint = illegalPoint(point);\r\n var inputAxesInfo = finder.axesInfo;\r\n var axesInfo = coordSysAxesInfo.axesInfo;\r\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n var outputPayload = {};\r\n var showValueMap = {};\r\n var dataByCoordSys = {\r\n list: [],\r\n map: {}\r\n };\r\n var updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n var axis = axisInfo.axis;\r\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n var val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n var linkTriggers = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n var linkGroup = tarAxisInfo.linkGroup;\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n var srcValItem = showValueMap[srcKey];\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n var val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n return outputPayload;\r\n }\r\n function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\r\n var axis = axisInfo.axis;\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var snapToValue = payloadInfo.snapToValue;\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n }\r\n function buildPayloadsBySeries(value, axisInfo) {\r\n var axis = axisInfo.axis;\r\n var dim = axis.dim;\r\n var snapToValue = value;\r\n var payloadBatch = [];\r\n var minDist = Number.MAX_VALUE;\r\n var minDiff = -1;\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n var dataDim = series.getData().mapDimensionsAll(dim);\r\n var seriesNestestValue;\r\n var dataIndices;\r\n if (series.getAxisTooltipData) {\r\n var result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === 'category' ? 0.5 : null);\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n var diff = value - seriesNestestValue;\r\n var dist = Math.abs(diff);\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n }\r\n function showPointer(showValueMap, axisInfo, value, payloadBatch) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n }\r\n function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\r\n var payloadBatch = payloadInfo.payloadBatch;\r\n var axis = axisInfo.axis;\r\n var axisModel = axis.model;\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n var coordSysModel = axisInfo.coordSys.model;\r\n var coordSysKey = makeKey(coordSysModel);\r\n var coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value,\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n }\r\n function updateModelActually(showValueMap, axesInfo, outputPayload) {\r\n var outputAxesInfo = outputPayload.axesInfo = [];\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n var valItem = showValueMap[key];\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n else {\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n }\r\n function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({ type: 'hideTip' });\r\n return;\r\n }\r\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n }\r\n function dispatchHighDownActually(axesInfo, dispatchAction, api) {\r\n var zr = api.getZr();\r\n var highDownKey = 'axisPointerLastHighlights';\r\n var lastHighlights = inner$b(zr)[highDownKey] || {};\r\n var newHighlights = inner$b(zr)[highDownKey] = {};\r\n each(axesInfo, function (axisInfo, key) {\r\n var option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\r\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n var toHighlight = [];\r\n var toDownplay = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toDownplay\r\n });\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n notBlur: true,\r\n batch: toHighlight\r\n });\r\n }\r\n function findInputAxisInfo(inputAxesInfo, axisInfo) {\r\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\r\n var inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n }\r\n function makeMapperParam(axisInfo) {\r\n var axisModel = axisInfo.axis.model;\r\n var item = {};\r\n var dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n }\r\n function illegalPoint(point) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n }\n\n var inner$c = makeInner();\r\n var each$8 = each;\r\n function register(key, api, handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n inner$c(zr).records || (inner$c(zr).records = {});\r\n initGlobalListeners(zr, api);\r\n var record = inner$c(zr).records[key] || (inner$c(zr).records[key] = {});\r\n record.handler = handler;\r\n }\r\n function initGlobalListeners(zr, api) {\r\n if (inner$c(zr).initialized) {\r\n return;\r\n }\r\n inner$c(zr).initialized = true;\r\n useHandler('click', curry(doEnter, 'click'));\r\n useHandler('mousemove', curry(doEnter, 'mousemove'));\r\n useHandler('globalout', onLeave);\r\n function useHandler(eventType, cb) {\r\n zr.on(eventType, function (e) {\r\n var dis = makeDispatchAction(api);\r\n each$8(inner$c(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n }\r\n function dispatchTooltipFinally(pendings, api) {\r\n var showLen = pendings.showTip.length;\r\n var hideLen = pendings.hideTip.length;\r\n var actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n }\r\n function onLeave(record, e, dispatchAction) {\r\n record.handler('leave', null, dispatchAction);\r\n }\r\n function doEnter(currTrigger, record, e, dispatchAction) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n }\r\n function makeDispatchAction(api) {\r\n var pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n var dispatchAction = function (payload) {\r\n var pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n pendingList.push(payload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n }\r\n function unregister(key, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n var record = (inner$c(zr).records || {})[key];\r\n if (record) {\r\n inner$c(zr).records[key] = null;\r\n }\r\n }\n\n var AxisPointerView = (function (_super) {\r\n __extends(AxisPointerView, _super);\r\n function AxisPointerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerView.type;\r\n return _this;\r\n }\r\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\r\n var globalTooltipModel = ecModel.getComponent('tooltip');\r\n var triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n register('axisPointer', api, function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n });\r\n };\r\n AxisPointerView.prototype.remove = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.prototype.dispose = function (ecModel, api) {\r\n unregister('axisPointer', api);\r\n };\r\n AxisPointerView.type = 'axisPointer';\r\n return AxisPointerView;\r\n }(ComponentView));\r\n ComponentView.registerClass(AxisPointerView);\n\n var inner$d = makeInner();\r\n var clone$3 = clone;\r\n var bind$1 = bind;\r\n var BaseAxisPointer = (function () {\r\n function BaseAxisPointer() {\r\n this._dragging = false;\r\n this.animationThreshold = 15;\r\n }\r\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\r\n var value = axisPointerModel.get('value');\r\n var status = axisPointerModel.get('status');\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (!status || status === 'hide') {\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n var elOption = {};\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n var graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n var moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n if (!group) {\r\n group = this._group = new Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n this._renderHandle(value);\r\n };\r\n BaseAxisPointer.prototype.remove = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.dispose = function (api) {\r\n this.clear(api);\r\n };\r\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\r\n var animation = axisPointerModel.get('animation');\r\n var axis = axisModel.axis;\r\n var isCategoryAxis = axis.type === 'category';\r\n var useSnap = axisPointerModel.get('snap');\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n if (animation === 'auto' || animation == null) {\r\n var animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n if (useSnap) {\r\n var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;\r\n var axisExtent = axis.getExtent();\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n return false;\r\n }\r\n return animation === true;\r\n };\r\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n };\r\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\r\n var pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n var pointerEl = inner$d(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer));\r\n group.add(pointerEl);\r\n }\r\n };\r\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\r\n if (elOption.label) {\r\n var labelEl = inner$d(group).labelEl = new ZRText(clone$3(elOption.label));\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\r\n var pointerEl = inner$d(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, { shape: elOption.pointer.shape });\r\n }\r\n };\r\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\r\n var labelEl = inner$d(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n };\r\n BaseAxisPointer.prototype._renderHandle = function (value) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n var axisPointerModel = this._axisPointerModel;\r\n var zr = this._api.getZr();\r\n var handle = this._handle;\r\n var handleModel = axisPointerModel.getModel('handle');\r\n var status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n var isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = createIcon(handleModel.get('icon'), {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),\r\n drift: bind$1(this._onHandleDragMove, this),\r\n ondragend: bind$1(this._onHandleDragEnd, this)\r\n });\r\n zr.add(handle);\r\n }\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n handle.setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n var handleSize = handleModel.get('size');\r\n if (!isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\r\n this._moveHandleToValue(value, isInit);\r\n };\r\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\r\n updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\r\n };\r\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n this._dragging = true;\r\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\r\n this._payloadInfo = trans;\r\n handle.stopAnimation();\r\n handle.attr(getHandleTransProps(trans));\r\n inner$d(handle).lastProp = null;\r\n this._doDispatchAxisPointer();\r\n };\r\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var payloadInfo = this._payloadInfo;\r\n var axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n };\r\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\r\n this._dragging = false;\r\n var handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n var value = this._axisPointerModel.get('value');\r\n this._moveHandleToValue(value);\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n };\r\n BaseAxisPointer.prototype.clear = function (api) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n var zr = api.getZr();\r\n var group = this._group;\r\n var handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n };\r\n BaseAxisPointer.prototype.doClear = function () {\r\n };\r\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n };\r\n return BaseAxisPointer;\r\n }());\r\n function updateProps$1(animationModel, moveAnimation, el, props) {\r\n if (!propsEqual(inner$d(el).lastProp, props)) {\r\n inner$d(el).lastProp = props;\r\n moveAnimation\r\n ? updateProps(el, props, animationModel)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n }\r\n function propsEqual(lastProps, newProps) {\r\n if (isObject(lastProps) && isObject(newProps)) {\r\n var equals_1 = true;\r\n each(newProps, function (item, key) {\r\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals_1;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n }\r\n function updateLabelShowHide(labelEl, axisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n }\r\n function getHandleTransProps(trans) {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n }\r\n function updateMandatoryProps(group, axisPointerModel, silent) {\r\n var z = axisPointerModel.get('z');\r\n var zlevel = axisPointerModel.get('zlevel');\r\n group && group.traverse(function (el) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n }\n\n function buildElStyle(axisPointerModel) {\r\n var axisPointerType = axisPointerModel.get('type');\r\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\r\n var style;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n }\r\n function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\r\n var value = axisPointerModel.get('value');\r\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n });\r\n var labelModel = axisPointerModel.getModel('label');\r\n var paddings = normalizeCssArray$1(labelModel.get('padding') || 0);\r\n var font = labelModel.getFont();\r\n var textRect = getBoundingRect(text, font);\r\n var position = labelPos.position;\r\n var width = textRect.width + paddings[1] + paddings[3];\r\n var height = textRect.height + paddings[0] + paddings[2];\r\n var align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n var verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n confineInContainer(position, width, height, api);\r\n var bgColor = labelModel.get('backgroundColor');\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n elOption.label = {\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor\r\n }),\r\n z2: 10\r\n };\r\n }\r\n function confineInContainer(position, width, height, api) {\r\n var viewWidth = api.getWidth();\r\n var viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n }\r\n function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\r\n value = axis.scale.parse(value);\r\n var text = axis.scale.getLabel({\r\n value: value\r\n }, {\r\n precision: opt.precision\r\n });\r\n var formatter = opt.formatter;\r\n if (formatter) {\r\n var params_1 = {\r\n value: getAxisRawValue(axis, { value: value }),\r\n axisDimension: axis.dim,\r\n axisIndex: axis.index,\r\n seriesData: []\r\n };\r\n each(seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params_1.seriesData.push(dataParams);\r\n });\r\n if (isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (isFunction(formatter)) {\r\n text = formatter(params_1);\r\n }\r\n }\r\n return text;\r\n }\r\n function getTransformedPosition(axis, value, layoutInfo) {\r\n var transform = create$1();\r\n rotate(transform, transform, layoutInfo.rotation);\r\n translate(transform, transform, layoutInfo.position);\r\n return applyTransform$1([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n }\r\n function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\r\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n }\r\n function makeLineShape(p1, p2, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n }\r\n function makeRectShape(xy, wh, xDimIndex) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n }\r\n function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: true\r\n };\r\n }\n\n var CartesianAxisPointer = (function (_super) {\r\n __extends(CartesianAxisPointer, _super);\r\n function CartesianAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisPointerType = axisPointerModel.get('type');\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$1(grid.model, axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var grid = axis.grid;\r\n var axisExtent = axis.getGlobalExtent(true);\r\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n var dimIndex = axis.dim === 'x' ? 0 : 1;\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n var tooltipOptions = [\r\n { verticalAlign: 'middle' },\r\n { align: 'center' }\r\n ];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n };\r\n return CartesianAxisPointer;\r\n }(BaseAxisPointer));\r\n function getCartesian(grid, axis) {\r\n var opt = {};\r\n opt[axis.dim + 'AxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n }\r\n var pointerShapeBuilder = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getAxisDimIndex(axis) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n }\r\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n\n var AxisPointerModel = (function (_super) {\r\n __extends(AxisPointerModel, _super);\r\n function AxisPointerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisPointerModel.type;\r\n return _this;\r\n }\r\n AxisPointerModel.type = 'axisPointer';\r\n AxisPointerModel.defaultOption = {\r\n show: 'auto',\r\n zlevel: 0,\r\n z: 50,\r\n type: 'line',\r\n snap: false,\r\n triggerTooltip: true,\r\n value: null,\r\n status: null,\r\n link: [],\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n label: {\r\n show: true,\r\n formatter: null,\r\n precision: 'auto',\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n handle: {\r\n show: false,\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\r\n size: 45,\r\n margin: 50,\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n throttle: 40\r\n }\r\n };\r\n return AxisPointerModel;\r\n }(ComponentModel));\n\n ComponentModel.registerClass(AxisPointerModel);\r\n registerPreprocessor(function (option) {\r\n if (option) {\r\n (!option.axisPointer || option.axisPointer.length === 0)\r\n && (option.axisPointer = {});\r\n var link = option.axisPointer.link;\r\n if (link && !isArray(link)) {\r\n option.axisPointer.link = [link];\r\n }\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n ecModel.getComponent('axisPointer').coordSysAxesInfo =\r\n collect(ecModel, api);\r\n });\r\n registerAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n }, axisTrigger);\n\n var XY = ['x', 'y'];\r\n var WH = ['width', 'height'];\r\n var SingleAxisPointer = (function (_super) {\r\n __extends(SingleAxisPointer, _super);\r\n function SingleAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\r\n var pixelValue = coordSys.dataToPoint(value)[0];\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, pixelValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var layoutInfo = layout$2(axisModel);\r\n buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\r\n };\r\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\r\n var layoutInfo = layout$2(axisModel, { labelInside: false });\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n var position = getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n };\r\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\r\n var axis = axisModel.axis;\r\n var coordSys = axis.coordinateSystem;\r\n var dimIndex = getPointDimIndex(axis);\r\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\r\n var currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\r\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: {\r\n verticalAlign: 'middle'\r\n }\r\n };\r\n };\r\n return SingleAxisPointer;\r\n }(BaseAxisPointer));\r\n var pointerShapeBuilder$1 = {\r\n line: function (axis, pixelValue, otherExtent) {\r\n var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n shadow: function (axis, pixelValue, otherExtent) {\r\n var bandWidth = axis.getBandWidth();\r\n var span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\r\n };\r\n }\r\n };\r\n function getPointDimIndex(axis) {\r\n return axis.isHorizontal() ? 0 : 1;\r\n }\r\n function getGlobalExtent(coordSys, dimIndex) {\r\n var rect = coordSys.getRect();\r\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\r\n }\r\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n\n extendComponentView({\r\n type: 'single'\r\n });\n\n var DATA_NAME_INDEX = 2;\r\n var ThemeRiverSeriesModel = (function (_super) {\r\n __extends(ThemeRiverSeriesModel, _super);\r\n function ThemeRiverSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverSeriesModel.type;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n ThemeRiverSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n };\r\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\r\n var rawDataLength = data.length;\r\n var timeValueKeys = {};\r\n var groupResult = groupData(data, function (item) {\r\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\r\n timeValueKeys[item[0] + ''] = -1;\r\n }\r\n return item[2];\r\n });\r\n var layerData = [];\r\n groupResult.buckets.each(function (items, key) {\r\n layerData.push({\r\n name: key, dataList: items\r\n });\r\n });\r\n var layerNum = layerData.length;\r\n for (var k = 0; k < layerNum; ++k) {\r\n var name_1 = layerData[k].name;\r\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\r\n var timeValue = layerData[k].dataList[j][0] + '';\r\n timeValueKeys[timeValue] = k;\r\n }\r\n for (var timeValue in timeValueKeys) {\r\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\r\n timeValueKeys[timeValue] = k;\r\n data[rawDataLength] = [timeValue, 0, name_1];\r\n rawDataLength++;\r\n }\r\n }\r\n }\r\n return data;\r\n };\r\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n var axisType = singleAxisModel.get('type');\r\n var filterData = filter(option.data, function (dataItem) {\r\n return dataItem[2] !== undefined;\r\n });\r\n var data = this.fixData(filterData || []);\r\n var nameList = [];\r\n var nameMap = this.nameMap = createHashMap();\r\n var count = 0;\r\n for (var i = 0; i < data.length; ++i) {\r\n nameList.push(data[i][DATA_NAME_INDEX]);\r\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\r\n nameMap.set(data[i][DATA_NAME_INDEX], count);\r\n count++;\r\n }\r\n }\r\n var dimensionsInfo = createDimensions(data, {\r\n coordDimensions: ['single'],\r\n dimensionsDefine: [\r\n {\r\n name: 'time',\r\n type: getDimensionTypeByAxis(axisType)\r\n },\r\n {\r\n name: 'value',\r\n type: 'float'\r\n },\r\n {\r\n name: 'name',\r\n type: 'ordinal'\r\n }\r\n ],\r\n encodeDefine: {\r\n single: 0,\r\n value: 1,\r\n itemName: 2\r\n }\r\n });\r\n var list = new List(dimensionsInfo, this);\r\n list.initData(data);\r\n return list;\r\n };\r\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\r\n var data = this.getData();\r\n var lenCount = data.count();\r\n var indexArr = [];\r\n for (var i = 0; i < lenCount; ++i) {\r\n indexArr[i] = i;\r\n }\r\n var timeDim = data.mapDimension('single');\r\n var groupResult = groupData(indexArr, function (index) {\r\n return data.get('name', index);\r\n });\r\n var layerSeries = [];\r\n groupResult.buckets.each(function (items, key) {\r\n items.sort(function (index1, index2) {\r\n return data.get(timeDim, index1) - data.get(timeDim, index2);\r\n });\r\n layerSeries.push({\r\n name: key,\r\n indices: items\r\n });\r\n });\r\n return layerSeries;\r\n };\r\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\r\n if (!isArray(dim)) {\r\n dim = dim ? [dim] : [];\r\n }\r\n var data = this.getData();\r\n var layerSeries = this.getLayerSeries();\r\n var indices = [];\r\n var layerNum = layerSeries.length;\r\n var nestestValue;\r\n for (var i = 0; i < layerNum; ++i) {\r\n var minDist = Number.MAX_VALUE;\r\n var nearestIdx = -1;\r\n var pointNum = layerSeries[i].indices.length;\r\n for (var j = 0; j < pointNum; ++j) {\r\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\r\n var dist = Math.abs(theValue - value);\r\n if (dist <= minDist) {\r\n nestestValue = theValue;\r\n minDist = dist;\r\n nearestIdx = layerSeries[i].indices[j];\r\n }\r\n }\r\n indices.push(nearestIdx);\r\n }\r\n return { dataIndices: indices, nestestValue: nestestValue };\r\n };\r\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var name = data.getName(dataIndex);\r\n var value = data.get(data.mapDimension('value'), dataIndex);\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n };\r\n ThemeRiverSeriesModel.type = 'series.themeRiver';\r\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\r\n ThemeRiverSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'singleAxis',\r\n boundaryGap: ['10%', '10%'],\r\n singleAxisIndex: 0,\r\n animationEasing: 'linear',\r\n label: {\r\n margin: 4,\r\n show: true,\r\n position: 'left',\r\n fontSize: 11\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return ThemeRiverSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(ThemeRiverSeriesModel);\n\n var ThemeRiverView = (function (_super) {\r\n __extends(ThemeRiverView, _super);\r\n function ThemeRiverView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ThemeRiverView.type;\r\n _this._layers = [];\r\n return _this;\r\n }\r\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var self = this;\r\n var group = this.group;\r\n var layersSeries = seriesModel.getLayerSeries();\r\n var layoutInfo = data.getLayout('layoutInfo');\r\n var rect = layoutInfo.rect;\r\n var boundaryGap = layoutInfo.boundaryGap;\r\n group.x = 0;\r\n group.y = rect.y + boundaryGap[0];\r\n function keyGetter(item) {\r\n return item.name;\r\n }\r\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\r\n var newLayersGroups = [];\r\n dataDiffer\r\n .add(bind(process, this, 'add'))\r\n .update(bind(process, this, 'update'))\r\n .remove(bind(process, this, 'remove'))\r\n .execute();\r\n function process(status, idx, oldIdx) {\r\n var oldLayersGroups = self._layers;\r\n if (status === 'remove') {\r\n group.remove(oldLayersGroups[idx]);\r\n return;\r\n }\r\n var points0 = [];\r\n var points1 = [];\r\n var style;\r\n var indices = layersSeries[idx].indices;\r\n var j = 0;\r\n for (; j < indices.length; j++) {\r\n var layout = data.getItemLayout(indices[j]);\r\n var x = layout.x;\r\n var y0 = layout.y0;\r\n var y = layout.y;\r\n points0.push(x, y0);\r\n points1.push(x, y0 + y);\r\n style = data.getItemVisual(indices[j], 'style');\r\n }\r\n var polygon;\r\n var textLayout = data.getItemLayout(indices[0]);\r\n var labelModel = seriesModel.getModel('label');\r\n var margin = labelModel.get('margin');\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n if (status === 'add') {\r\n var layerGroup = newLayersGroups[idx] = new Group();\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1,\r\n smooth: 0.4,\r\n stackedOnSmooth: 0.4,\r\n smoothConstraint: false\r\n },\r\n z2: 0\r\n });\r\n layerGroup.add(polygon);\r\n group.add(layerGroup);\r\n if (seriesModel.isAnimationEnabled()) {\r\n polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () {\r\n polygon.removeClipPath();\r\n }));\r\n }\r\n }\r\n else {\r\n var layerGroup = oldLayersGroups[oldIdx];\r\n polygon = layerGroup.childAt(0);\r\n group.add(layerGroup);\r\n newLayersGroups[idx] = layerGroup;\r\n updateProps(polygon, {\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1\r\n }\r\n }, seriesModel);\r\n }\r\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\r\n labelDataIndex: indices[j - 1],\r\n defaultText: data.getName(indices[j - 1]),\r\n inheritColor: style.fill\r\n }, {\r\n normal: {\r\n verticalAlign: 'middle'\r\n }\r\n });\r\n polygon.setTextConfig({\r\n position: null,\r\n local: true\r\n });\r\n var labelEl = polygon.getTextContent();\r\n if (labelEl) {\r\n labelEl.x = textLayout.x - margin;\r\n labelEl.y = textLayout.y0 + textLayout.y / 2;\r\n }\r\n polygon.useStyle(style);\r\n data.setItemGraphicEl(idx, polygon);\r\n setStatesStylesFromModel(polygon, seriesModel);\r\n enableHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n }\r\n this._layersSeries = layersSeries;\r\n this._layers = newLayersGroups;\r\n };\r\n ThemeRiverView.type = 'themeRiver';\r\n return ThemeRiverView;\r\n }(ChartView));\r\n function createGridClipShape$2(rect, seriesModel, cb) {\r\n var rectEl = new Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n initProps(rectEl, {\r\n shape: {\r\n x: rect.x - 50,\r\n width: rect.width + 100,\r\n height: rect.height + 20\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n }\r\n ChartView.registerClass(ThemeRiverView);\n\n function themeRiverLayout(ecModel, api) {\r\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var single = seriesModel.coordinateSystem;\r\n var layoutInfo = {};\r\n var rect = single.getRect();\r\n layoutInfo.rect = rect;\r\n var boundaryGap = seriesModel.get('boundaryGap');\r\n var axis = single.getAxis();\r\n layoutInfo.boundaryGap = boundaryGap;\r\n if (axis.orient === 'horizontal') {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.height);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.height);\r\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, height);\r\n }\r\n else {\r\n boundaryGap[0] = parsePercent$2(boundaryGap[0], rect.width);\r\n boundaryGap[1] = parsePercent$2(boundaryGap[1], rect.width);\r\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, width);\r\n }\r\n data.setLayout('layoutInfo', layoutInfo);\r\n });\r\n }\r\n function doThemeRiverLayout(data, seriesModel, height) {\r\n if (!data.count()) {\r\n return;\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n var layerSeries = seriesModel.getLayerSeries();\r\n var timeDim = data.mapDimension('single');\r\n var valueDim = data.mapDimension('value');\r\n var layerPoints = map(layerSeries, function (singleLayer) {\r\n return map(singleLayer.indices, function (idx) {\r\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\r\n pt[1] = data.get(valueDim, idx);\r\n return pt;\r\n });\r\n });\r\n var base = computeBaseline(layerPoints);\r\n var baseLine = base.y0;\r\n var ky = height / base.max;\r\n var n = layerSeries.length;\r\n var m = layerSeries[0].indices.length;\r\n var baseY0;\r\n for (var j = 0; j < m; ++j) {\r\n baseY0 = baseLine[j] * ky;\r\n data.setItemLayout(layerSeries[0].indices[j], {\r\n layerIndex: 0,\r\n x: layerPoints[0][j][0],\r\n y0: baseY0,\r\n y: layerPoints[0][j][1] * ky\r\n });\r\n for (var i = 1; i < n; ++i) {\r\n baseY0 += layerPoints[i - 1][j][1] * ky;\r\n data.setItemLayout(layerSeries[i].indices[j], {\r\n layerIndex: i,\r\n x: layerPoints[i][j][0],\r\n y0: baseY0,\r\n y: layerPoints[i][j][1] * ky\r\n });\r\n }\r\n }\r\n }\r\n function computeBaseline(data) {\r\n var layerNum = data.length;\r\n var pointNum = data[0].length;\r\n var sums = [];\r\n var y0 = [];\r\n var max = 0;\r\n for (var i = 0; i < pointNum; ++i) {\r\n var temp = 0;\r\n for (var j = 0; j < layerNum; ++j) {\r\n temp += data[j][i][1];\r\n }\r\n if (temp > max) {\r\n max = temp;\r\n }\r\n sums.push(temp);\r\n }\r\n for (var k = 0; k < pointNum; ++k) {\r\n y0[k] = (max - sums[k]) / 2;\r\n }\r\n max = 0;\r\n for (var l = 0; l < pointNum; ++l) {\r\n var sum = sums[l] + y0[l];\r\n if (sum > max) {\r\n max = sum;\r\n }\r\n }\r\n return {\r\n y0: y0,\r\n max: max\r\n };\r\n }\n\n registerLayout(themeRiverLayout);\r\n registerProcessor(dataFilter('themeRiver'));\n\n var SunburstSeriesModel = (function (_super) {\r\n __extends(SunburstSeriesModel, _super);\r\n function SunburstSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstSeriesModel.type;\r\n _this.ignoreStyleOnData = true;\r\n return _this;\r\n }\r\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n var root = { name: option.name, children: option.data };\r\n completeTreeValue$1(root);\r\n var levelModels = map(option.levels || [], function (levelDefine) {\r\n return new Model(levelDefine, this, ecModel);\r\n }, this);\r\n var tree = Tree.createTree(root, this, beforeLink);\r\n function beforeLink(nodeData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n var node = tree.getNodeByDataIndex(idx);\r\n var levelModel = levelModels[node.depth];\r\n levelModel && (model.parentModel = levelModel);\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n };\r\n SunburstSeriesModel.prototype.optionUpdated = function () {\r\n this.resetViewRoot();\r\n };\r\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var params = _super.prototype.getDataParams.apply(this, arguments);\r\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n return params;\r\n };\r\n SunburstSeriesModel.prototype.getViewRoot = function () {\r\n return this._viewRoot;\r\n };\r\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n var root = this.getRawData().tree.root;\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))) {\r\n this._viewRoot = root;\r\n }\r\n };\r\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\r\n enableAriaDecalForTree(this);\r\n };\r\n SunburstSeriesModel.type = 'series.sunburst';\r\n SunburstSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n stillShowZeroSum: true,\r\n nodeClick: 'rootToNode',\r\n renderLabelForZeroData: false,\r\n label: {\r\n rotate: 'radial',\r\n show: true,\r\n opacity: 1,\r\n align: 'center',\r\n position: 'inside',\r\n distance: 5,\r\n silent: true\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderColor: 'white',\r\n borderType: 'solid',\r\n shadowBlur: 0,\r\n shadowColor: 'rgba(0, 0, 0, 0.2)',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n emphasis: {\r\n focus: 'descendant'\r\n },\r\n blur: {\r\n itemStyle: {\r\n opacity: 0.2\r\n },\r\n label: {\r\n opacity: 0.1\r\n }\r\n },\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n data: [],\r\n levels: [],\r\n sort: 'desc'\r\n };\r\n return SunburstSeriesModel;\r\n }(SeriesModel));\r\n function completeTreeValue$1(dataNode) {\r\n var sum = 0;\r\n each(dataNode.children, function (child) {\r\n completeTreeValue$1(child);\r\n var childValue = child.value;\r\n isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue;\r\n });\r\n var thisValue = dataNode.value;\r\n if (isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n }\r\n SeriesModel.registerClass(SunburstSeriesModel);\n\n var DEFAULT_SECTOR_Z = 2;\r\n var DEFAULT_TEXT_Z = 4;\r\n var SunburstPiece = (function (_super) {\r\n __extends(SunburstPiece, _super);\r\n function SunburstPiece(node, seriesModel, ecModel, api) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = DEFAULT_SECTOR_Z;\r\n _this.textConfig = {\r\n inside: true\r\n };\r\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\r\n var text = new ZRText({\r\n z2: DEFAULT_TEXT_Z,\r\n silent: node.getModel().get(['label', 'silent'])\r\n });\r\n _this.setTextContent(text);\r\n _this.updateData(true, node, seriesModel, ecModel, api);\r\n return _this;\r\n }\r\n SunburstPiece.prototype.updateData = function (firstCreate, node, seriesModel, ecModel, api) {\r\n this.node = node;\r\n node.piece = this;\r\n seriesModel = seriesModel || this._seriesModel;\r\n ecModel = ecModel || this._ecModel;\r\n var sector = this;\r\n getECData(sector).dataIndex = node.dataIndex;\r\n var itemModel = node.getModel();\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = node.getLayout();\r\n var sectorShape = extend({}, layout);\r\n sectorShape.label = null;\r\n var normalStyle = node.getVisual('style');\r\n normalStyle.lineJoin = 'bevel';\r\n var decal = node.getVisual('decal');\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape);\r\n extend(sectorShape, cornerRadius);\r\n each(SPECIAL_STATES, function (stateName) {\r\n var state = sector.ensureState(stateName);\r\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\r\n state.style = itemStyleModel.getItemStyle();\r\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\r\n if (cornerRadius) {\r\n state.shape = cornerRadius;\r\n }\r\n });\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n sector.shape.r = layout.r0;\r\n updateProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, node.dataIndex);\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel);\r\n }\r\n sector.useStyle(normalStyle);\r\n this._updateLabel(seriesModel);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._seriesModel = seriesModel || this._seriesModel;\r\n this._ecModel = ecModel || this._ecModel;\r\n var focus = emphasisModel.get('focus');\r\n var focusDataIndices = focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n enableHoverEmphasis(this, focusDataIndices || focus, emphasisModel.get('blurScope'));\r\n };\r\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\r\n var _this = this;\r\n var itemModel = this.node.getModel();\r\n var normalLabelModel = itemModel.getModel('label');\r\n var layout = this.node.getLayout();\r\n var angle = layout.endAngle - layout.startAngle;\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var dx = Math.cos(midAngle);\r\n var dy = Math.sin(midAngle);\r\n var sector = this;\r\n var label = sector.getTextContent();\r\n var dataIndex = this.node.dataIndex;\r\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\r\n var isNormalShown = normalLabelModel.get('show')\r\n && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\r\n label.ignore = !isNormalShown;\r\n each(DISPLAY_STATES, function (stateName) {\r\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label')\r\n : itemModel.getModel([stateName, 'label']);\r\n var isNormal = stateName === 'normal';\r\n var state = isNormal ? label : label.ensureState(stateName);\r\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\r\n if (isNormal) {\r\n text = text || _this.node.name;\r\n }\r\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\r\n if (text) {\r\n state.style.text = text;\r\n }\r\n var isShown = labelStateModel.get('show');\r\n if (isShown != null && !isNormal) {\r\n state.ignore = !isShown;\r\n }\r\n var labelPosition = getLabelAttr(labelStateModel, 'position');\r\n var sectorState = isNormal ? sector : sector.states[stateName];\r\n var labelColor = sectorState.style.fill;\r\n sectorState.textConfig = {\r\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\r\n inside: labelPosition !== 'outside'\r\n };\r\n var r;\r\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\r\n var textAlign = getLabelAttr(labelStateModel, 'align');\r\n if (labelPosition === 'outside') {\r\n r = layout.r + labelPadding;\r\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\r\n }\r\n else {\r\n if (!textAlign || textAlign === 'center') {\r\n r = (layout.r + layout.r0) / 2;\r\n textAlign = 'center';\r\n }\r\n else if (textAlign === 'left') {\r\n r = layout.r0 + labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (textAlign === 'right') {\r\n r = layout.r - labelPadding;\r\n if (midAngle > Math.PI / 2) {\r\n textAlign = 'left';\r\n }\r\n }\r\n }\r\n state.style.align = textAlign;\r\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\r\n state.x = r * dx + layout.cx;\r\n state.y = r * dy + layout.cy;\r\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\r\n var rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = -midAngle;\r\n if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = Math.PI / 2 - midAngle;\r\n if (rotate > Math.PI / 2) {\r\n rotate -= Math.PI;\r\n }\r\n else if (rotate < -Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (typeof rotateType === 'number') {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n state.rotation = rotate;\r\n });\r\n function getLabelAttr(model, name) {\r\n var stateAttr = model.get(name);\r\n if (stateAttr == null) {\r\n return normalLabelModel.get(name);\r\n }\r\n return stateAttr;\r\n }\r\n label.dirtyStyle();\r\n };\r\n return SunburstPiece;\r\n }(Sector));\n\n var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\r\n registerAction({ type: ROOT_TO_NODE_ACTION, update: 'updateView' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleRootToNode);\r\n function handleRootToNode(model, index) {\r\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\r\n if (targetInfo) {\r\n var originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n });\r\n var HIGHLIGHT_ACTION = 'sunburstHighlight';\r\n registerAction({ type: HIGHLIGHT_ACTION, update: 'none' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n ecModel.eachComponent({ mainType: 'series', subType: 'sunburst', query: payload }, handleHighlight);\r\n function handleHighlight(model) {\r\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\r\n if (targetInfo) {\r\n payload.dataIndex = targetInfo.node.dataIndex;\r\n }\r\n }\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlight', 'sunburstHighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'highlight'\r\n }));\r\n });\r\n var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\r\n registerAction({ type: UNHIGHLIGHT_ACTION, update: 'updateView' }, function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'sunburstUnhighlight');\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: 'downplay'\r\n }));\r\n });\n\n var SunburstView = (function (_super) {\r\n __extends(SunburstView, _super);\r\n function SunburstView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SunburstView.type;\r\n return _this;\r\n }\r\n SunburstView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var self = this;\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n var data = seriesModel.getData();\r\n var virtualRoot = data.tree.root;\r\n var newRoot = seriesModel.getViewRoot();\r\n var group = this.group;\r\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\r\n var newChildren = [];\r\n newRoot.eachNode(function (node) {\r\n newChildren.push(node);\r\n });\r\n var oldChildren = this._oldChildren || [];\r\n dualTravel(newChildren, oldChildren);\r\n renderRollUp(virtualRoot, newRoot);\r\n this._initEvents();\r\n this._oldChildren = newChildren;\r\n function dualTravel(newChildren, oldChildren) {\r\n if (newChildren.length === 0 && oldChildren.length === 0) {\r\n return;\r\n }\r\n new DataDiffer(oldChildren, newChildren, getKey, getKey)\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n function getKey(node) {\r\n return node.getId();\r\n }\r\n function processNode(newIdx, oldIdx) {\r\n var newNode = newIdx == null ? null : newChildren[newIdx];\r\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\r\n doRenderNode(newNode, oldNode);\r\n }\r\n }\r\n function doRenderNode(newNode, oldNode) {\r\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\r\n newNode = null;\r\n }\r\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\r\n if (oldNode && oldNode.piece) {\r\n if (newNode) {\r\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\r\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\r\n }\r\n else {\r\n removeNode(oldNode);\r\n }\r\n }\r\n else if (newNode) {\r\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\r\n group.add(piece);\r\n data.setItemGraphicEl(newNode.dataIndex, piece);\r\n }\r\n }\r\n }\r\n function removeNode(node) {\r\n if (!node) {\r\n return;\r\n }\r\n if (node.piece) {\r\n group.remove(node.piece);\r\n node.piece = null;\r\n }\r\n }\r\n function renderRollUp(virtualRoot, viewRoot) {\r\n if (viewRoot.depth > 0) {\r\n if (self.virtualPiece) {\r\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\r\n }\r\n else {\r\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\r\n group.add(self.virtualPiece);\r\n }\r\n viewRoot.piece.off('click');\r\n self.virtualPiece.on('click', function (e) {\r\n self._rootToNode(viewRoot.parentNode);\r\n });\r\n }\r\n else if (self.virtualPiece) {\r\n group.remove(self.virtualPiece);\r\n self.virtualPiece = null;\r\n }\r\n }\r\n };\r\n SunburstView.prototype._initEvents = function () {\r\n var _this = this;\r\n this.group.off('click');\r\n this.group.on('click', function (e) {\r\n var targetFound = false;\r\n var viewRoot = _this.seriesModel.getViewRoot();\r\n viewRoot.eachNode(function (node) {\r\n if (!targetFound\r\n && node.piece && node.piece === e.target) {\r\n var nodeClick = node.getModel().get('nodeClick');\r\n if (nodeClick === 'rootToNode') {\r\n _this._rootToNode(node);\r\n }\r\n else if (nodeClick === 'link') {\r\n var itemModel = node.getModel();\r\n var link = itemModel.get('link');\r\n if (link) {\r\n var linkTarget = itemModel.get('target', true)\r\n || '_blank';\r\n windowOpen(link, linkTarget);\r\n }\r\n }\r\n targetFound = true;\r\n }\r\n });\r\n });\r\n };\r\n SunburstView.prototype._rootToNode = function (node) {\r\n if (node !== this.seriesModel.getViewRoot()) {\r\n this.api.dispatchAction({\r\n type: ROOT_TO_NODE_ACTION,\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: node\r\n });\r\n }\r\n };\r\n SunburstView.prototype.containPoint = function (point, seriesModel) {\r\n var treeRoot = seriesModel.getData();\r\n var itemLayout = treeRoot.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n SunburstView.type = 'sunburst';\r\n return SunburstView;\r\n }(ChartView));\r\n ChartView.registerClass(SunburstView);\n\n var RADIAN$2 = Math.PI / 180;\r\n function sunburstLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width);\r\n var cy = parsePercent$2(center[1], height);\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$2;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$2;\r\n var virtualRoot = seriesModel.getData().tree.root;\r\n var treeRoot = seriesModel.getViewRoot();\r\n var rootDepth = treeRoot.depth;\r\n var sort = seriesModel.get('sort');\r\n if (sort != null) {\r\n initChildren$1(treeRoot, sort);\r\n }\r\n var validDataCount = 0;\r\n each(treeRoot.children, function (child) {\r\n !isNaN(child.getValue()) && validDataCount++;\r\n });\r\n var sum = treeRoot.getValue();\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var renderRollupNode = treeRoot.depth > 0;\r\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\r\n var rPerLevel = (r - r0) / (levels || 1);\r\n var clockwise = seriesModel.get('clockwise');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var dir = clockwise ? 1 : -1;\r\n var renderNode = function (node, startAngle) {\r\n if (!node) {\r\n return;\r\n }\r\n var endAngle = startAngle;\r\n if (node !== virtualRoot) {\r\n var value = node.getValue();\r\n var angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n }\r\n endAngle = startAngle + dir * angle;\r\n var depth = node.depth - rootDepth\r\n - (renderRollupNode ? -1 : 1);\r\n var rStart = r0 + rPerLevel * depth;\r\n var rEnd = r0 + rPerLevel * (depth + 1);\r\n var itemModel = node.getModel();\r\n if (itemModel.get('r0') != null) {\r\n rStart = parsePercent$2(itemModel.get('r0'), size / 2);\r\n }\r\n if (itemModel.get('r') != null) {\r\n rEnd = parsePercent$2(itemModel.get('r'), size / 2);\r\n }\r\n node.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n if (node.children && node.children.length) {\r\n var siblingAngle_1 = 0;\r\n each(node.children, function (node) {\r\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\r\n });\r\n }\r\n return endAngle - startAngle;\r\n };\r\n if (renderRollupNode) {\r\n var rStart = r0;\r\n var rEnd = r0 + rPerLevel;\r\n var angle = Math.PI * 2;\r\n virtualRoot.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: startAngle + angle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n renderNode(treeRoot, startAngle);\r\n });\r\n }\r\n function initChildren$1(node, sortOrder) {\r\n var children = node.children || [];\r\n node.children = sort$2(children, sortOrder);\r\n if (children.length) {\r\n each(node.children, function (child) {\r\n initChildren$1(child, sortOrder);\r\n });\r\n }\r\n }\r\n function sort$2(children, sortOrder) {\r\n if (typeof sortOrder === 'function') {\r\n var sortTargets = map(children, function (child, idx) {\r\n var value = child.getValue();\r\n return {\r\n params: {\r\n depth: child.depth,\r\n height: child.height,\r\n dataIndex: child.dataIndex,\r\n getValue: function () { return value; }\r\n },\r\n index: idx\r\n };\r\n });\r\n sortTargets.sort(function (a, b) {\r\n return sortOrder(a.params, b.params);\r\n });\r\n return map(sortTargets, function (target) {\r\n return children[target.index];\r\n });\r\n }\r\n else {\r\n var isAsc_1 = sortOrder === 'asc';\r\n return children.sort(function (a, b) {\r\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\r\n return diff === 0\r\n ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1)\r\n : diff;\r\n });\r\n }\r\n }\n\n function sunburstVisual(ecModel) {\r\n var paletteScope = {};\r\n function pickColor(node, seriesModel, treeHeight) {\r\n var current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n var color = seriesModel.getColorFromPalette((current.name || current.dataIndex + ''), paletteScope);\r\n if (node.depth > 1 && typeof color === 'string') {\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n return color;\r\n }\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var tree = data.tree;\r\n tree.eachNode(function (node) {\r\n var model = node.getModel();\r\n var style = model.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n }\n\n registerLayout(curry(sunburstLayout, 'sunburst'));\r\n registerProcessor(curry(dataFilter, 'sunburst'));\r\n registerVisual(sunburstVisual);\n\n function dataToCoordSize(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['x', 'y'], function (dim, dimIdx) {\r\n var axis = this.getAxis(dim);\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }, this);\r\n }\r\n function cartesianPrepareCustom(coordSys) {\r\n var rect = coordSys.master.getRect();\r\n return {\r\n coordSys: {\r\n type: 'cartesian2d',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$1(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map([0, 1], function (dimIdx) {\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var p1 = [];\r\n var p2 = [];\r\n p1[dimIdx] = val - halfSize;\r\n p2[dimIdx] = val + halfSize;\r\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\r\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\r\n }, this);\r\n }\r\n function geoPrepareCustom(coordSys) {\r\n var rect = coordSys.getBoundingRect();\r\n return {\r\n coordSys: {\r\n type: 'geo',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n zoom: coordSys.getZoom()\r\n },\r\n api: {\r\n coord: function (data) {\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: bind(dataToCoordSize$1, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$2(dataSize, dataItem) {\r\n var axis = this.getAxis();\r\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\r\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }\r\n function singlePrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n return {\r\n coordSys: {\r\n type: 'singleAxis',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (val) {\r\n return coordSys.dataToPoint(val);\r\n },\r\n size: bind(dataToCoordSize$2, coordSys)\r\n }\r\n };\r\n }\n\n function dataToCoordSize$3(dataSize, dataItem) {\r\n dataItem = dataItem || [0, 0];\r\n return map(['Radius', 'Angle'], function (dim, dimIdx) {\r\n var getterName = 'get' + dim + 'Axis';\r\n var axis = this[getterName]();\r\n var val = dataItem[dimIdx];\r\n var halfSize = dataSize[dimIdx] / 2;\r\n var result = axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n if (dim === 'Angle') {\r\n result = result * Math.PI / 180;\r\n }\r\n return result;\r\n }, this);\r\n }\r\n function polarPrepareCustom(coordSys) {\r\n var radiusAxis = coordSys.getRadiusAxis();\r\n var angleAxis = coordSys.getAngleAxis();\r\n var radius = radiusAxis.getExtent();\r\n radius[0] > radius[1] && radius.reverse();\r\n return {\r\n coordSys: {\r\n type: 'polar',\r\n cx: coordSys.cx,\r\n cy: coordSys.cy,\r\n r: radius[1],\r\n r0: radius[0]\r\n },\r\n api: {\r\n coord: function (data) {\r\n var radius = radiusAxis.dataToRadius(data[0]);\r\n var angle = angleAxis.dataToAngle(data[1]);\r\n var coord = coordSys.coordToPoint([radius, angle]);\r\n coord.push(radius, angle * Math.PI / 180);\r\n return coord;\r\n },\r\n size: bind(dataToCoordSize$3, coordSys)\r\n }\r\n };\r\n }\n\n function calendarPrepareCustom(coordSys) {\r\n var rect = coordSys.getRect();\r\n var rangeInfo = coordSys.getRangeInfo();\r\n return {\r\n coordSys: {\r\n type: 'calendar',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n cellWidth: coordSys.getCellWidth(),\r\n cellHeight: coordSys.getCellHeight(),\r\n rangeInfo: {\r\n start: rangeInfo.start,\r\n end: rangeInfo.end,\r\n weeks: rangeInfo.weeks,\r\n dayCount: rangeInfo.allDay\r\n }\r\n },\r\n api: {\r\n coord: function (data, clamp) {\r\n return coordSys.dataToPoint(data, clamp);\r\n }\r\n }\r\n };\r\n }\n\n var deprecatedLogs = {};\r\n function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\r\n return style && (style.legacy\r\n || (style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n && (elType === 'text' || hasOwn(style, 'text'))));\r\n }\r\n function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\r\n var srcStyle = hostStyle;\r\n var textConfig;\r\n var textContent;\r\n var textContentStyle;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n silent: true\r\n };\r\n textConfig = {};\r\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem, richItem);\r\n });\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n }\r\n function convertEC4CompatibleRichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n }\r\n function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\r\n var out = itemStl;\r\n out.textPosition = out.textPosition || txCfg.position || 'inside';\r\n txCfg.offset != null && (out.textOffset = txCfg.offset);\r\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\r\n txCfg.distance != null && (out.textDistance = txCfg.distance);\r\n var isInside = out.textPosition.indexOf('inside') >= 0;\r\n var hostFill = itemStl.fill || '#000';\r\n convertToEC4RichItem(out, txStl);\r\n var textFillNotSet = out.textFill == null;\r\n if (isInside) {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.insideFill || '#fff';\r\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\r\n !out.textStroke && (out.textStroke = hostFill);\r\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\r\n }\r\n }\r\n else {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.outsideFill || hostFill;\r\n }\r\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\r\n }\r\n out.text = txStl.text;\r\n out.rich = txStl.rich;\r\n each(txStl.rich, function (richItem) {\r\n convertToEC4RichItem(richItem, richItem);\r\n });\r\n return out;\r\n }\r\n function convertToEC4RichItem(out, richItem) {\r\n if (!richItem) {\r\n return;\r\n }\r\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\r\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\r\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\r\n hasOwn(richItem, 'font') && (out.font = richItem.font);\r\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\r\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\r\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\r\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\r\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\r\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\r\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\r\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\r\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\r\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\r\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\r\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\r\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\r\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\r\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\r\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\r\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\r\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\r\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\r\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\r\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\r\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\r\n }\r\n function warnDeprecated(deprecated, insteadApproach) {\r\n if (__DEV__) {\r\n var key = deprecated + '^_^' + insteadApproach;\r\n if (!deprecatedLogs[key]) {\r\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\r\n deprecatedLogs[key] = true;\r\n }\r\n }\r\n }\n\n var inner$e = makeInner();\r\n var TRANSFORM_PROPS = {\r\n x: 1,\r\n y: 1,\r\n scaleX: 1,\r\n scaleY: 1,\r\n originX: 1,\r\n originY: 1,\r\n rotation: 1\r\n };\r\n var transformPropNamesStr = keys(TRANSFORM_PROPS).join(', ');\r\n var STYLE_VISUAL_TYPE = {\r\n color: 'fill',\r\n borderColor: 'stroke'\r\n };\r\n var NON_STYLE_VISUAL_PROPS = {\r\n symbol: 1,\r\n symbolSize: 1,\r\n symbolKeepAspect: 1,\r\n legendSymbol: 1,\r\n visualMeta: 1,\r\n liftZ: 1,\r\n decal: 1\r\n };\r\n var EMPHASIS = 'emphasis';\r\n var NORMAL = 'normal';\r\n var BLUR = 'blur';\r\n var SELECT = 'select';\r\n var STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\r\n var PATH_ITEM_STYLE = {\r\n normal: ['itemStyle'],\r\n emphasis: [EMPHASIS, 'itemStyle'],\r\n blur: [BLUR, 'itemStyle'],\r\n select: [SELECT, 'itemStyle']\r\n };\r\n var PATH_LABEL = {\r\n normal: ['label'],\r\n emphasis: [EMPHASIS, 'label'],\r\n blur: [BLUR, 'label'],\r\n select: [SELECT, 'label']\r\n };\r\n var GROUP_DIFF_PREFIX = 'e\\0\\0';\r\n var attachedTxInfoTmp = {\r\n normal: {},\r\n emphasis: {},\r\n blur: {},\r\n select: {}\r\n };\r\n var LEGACY_TRANSFORM_PROPS = {\r\n position: ['x', 'y'],\r\n scale: ['scaleX', 'scaleY'],\r\n origin: ['originX', 'originY']\r\n };\r\n var tmpTransformable = new Transformable();\r\n var prepareCustoms = {\r\n cartesian2d: cartesianPrepareCustom,\r\n geo: geoPrepareCustom,\r\n singleAxis: singlePrepareCustom,\r\n polar: polarPrepareCustom,\r\n calendar: calendarPrepareCustom\r\n };\r\n var CustomSeriesModel = (function (_super) {\r\n __extends(CustomSeriesModel, _super);\r\n function CustomSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesModel.type;\r\n return _this;\r\n }\r\n CustomSeriesModel.prototype.optionUpdated = function () {\r\n this.currentZLevel = this.get('zlevel', true);\r\n this.currentZ = this.get('z', true);\r\n };\r\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this);\r\n };\r\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\r\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\r\n el && (params.info = inner$e(el).info);\r\n return params;\r\n };\r\n CustomSeriesModel.type = 'series.custom';\r\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n CustomSeriesModel.defaultOption = {\r\n coordinateSystem: 'cartesian2d',\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n clip: false\r\n };\r\n return CustomSeriesModel;\r\n }(SeriesModel));\r\n ComponentModel.registerClass(CustomSeriesModel);\r\n var CustomSeriesView = (function (_super) {\r\n __extends(CustomSeriesView, _super);\r\n function CustomSeriesView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CustomSeriesView.type;\r\n return _this;\r\n }\r\n CustomSeriesView.prototype.render = function (customSeries, ecModel, api, payload) {\r\n var oldData = this._data;\r\n var data = customSeries.getData();\r\n var group = this.group;\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n var transOpt = customSeries.__transientTransitionOpt;\r\n if (transOpt && (transOpt.from == null || transOpt.to == null)) {\r\n oldData && oldData.each(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n });\r\n data.each(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n });\r\n }\r\n else {\r\n var morphPreparation_1 = new MorphPreparation(customSeries, transOpt);\r\n var diffMode = transOpt ? 'multiple' : 'oneToOne';\r\n (new DataDiffer(oldData ? oldData.getIndices() : [], data.getIndices(), createGetKey(oldData, diffMode, transOpt && transOpt.from), createGetKey(data, diffMode, transOpt && transOpt.to), null, diffMode))\r\n .add(function (newIdx) {\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, null);\r\n })\r\n .remove(function (oldIdx) {\r\n doRemoveEl(oldData.getItemGraphicEl(oldIdx), customSeries, group);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n morphPreparation_1.reset('oneToOne');\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n if (morphPreparation_1.hasFrom()) {\r\n removeElementDirectly(oldEl, group);\r\n oldEl = null;\r\n }\r\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateManyToOne(function (newIdx, oldIndices) {\r\n morphPreparation_1.reset('manyToOne');\r\n for (var i = 0; i < oldIndices.length; i++) {\r\n var oldEl = oldData.getItemGraphicEl(oldIndices[i]);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n }\r\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data, morphPreparation_1);\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .updateOneToMany(function (newIndices, oldIdx) {\r\n morphPreparation_1.reset('oneToMany');\r\n var newLen = newIndices.length;\r\n var oldEl = oldData.getItemGraphicEl(oldIdx);\r\n morphPreparation_1.findAndAddFrom(oldEl);\r\n removeElementDirectly(oldEl, group);\r\n for (var i = 0; i < newLen; i++) {\r\n createOrUpdateItem(api, null, newIndices[i], renderItem(newIndices[i], payload), customSeries, group, data, morphPreparation_1);\r\n }\r\n morphPreparation_1.applyMorphing();\r\n })\r\n .execute();\r\n }\r\n var clipPath = customSeries.get('clip', true)\r\n ? createClipPath(customSeries.coordinateSystem, false, customSeries)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n this._data = data;\r\n };\r\n CustomSeriesView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\r\n this.group.removeAll();\r\n this._data = null;\r\n };\r\n CustomSeriesView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\r\n var data = customSeries.getData();\r\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n function setIncrementalAndHoverLayer(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = params.start; idx < params.end; idx++) {\r\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data, null);\r\n el.traverse(setIncrementalAndHoverLayer);\r\n }\r\n };\r\n CustomSeriesView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\r\n var elementName = query.element;\r\n if (elementName == null || targetEl.name === elementName) {\r\n return true;\r\n }\r\n while ((targetEl = (targetEl.__hostTarget || targetEl.parent)) && targetEl !== this.group) {\r\n if (targetEl.name === elementName) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n CustomSeriesView.type = 'custom';\r\n return CustomSeriesView;\r\n }(ChartView));\r\n ChartView.registerClass(CustomSeriesView);\r\n function createGetKey(data, diffMode, dimension) {\r\n if (!data) {\r\n return;\r\n }\r\n if (diffMode === 'oneToOne') {\r\n return function (rawIdx, dataIndex) {\r\n return data.getId(dataIndex);\r\n };\r\n }\r\n var diffByDimName = data.getDimension(dimension);\r\n var dimInfo = data.getDimensionInfo(diffByDimName);\r\n if (!dimInfo) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = dimension + \" is not a valid dimension.\";\r\n }\r\n throwError(errMsg);\r\n }\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n return function (rawIdx, dataIndex) {\r\n var key = data.get(diffByDimName, dataIndex);\r\n if (ordinalMeta) {\r\n key = ordinalMeta.categories[key];\r\n }\r\n return (key == null || eqNaN(key))\r\n ? rawIdx + ''\r\n : '_ec_' + key;\r\n };\r\n }\r\n function createEl(elOption) {\r\n var graphicType = elOption.type;\r\n var el;\r\n if (graphicType === 'path') {\r\n var shape = elOption.shape;\r\n var pathRect = (shape.width != null && shape.height != null)\r\n ? {\r\n x: shape.x || 0,\r\n y: shape.y || 0,\r\n width: shape.width,\r\n height: shape.height\r\n }\r\n : null;\r\n var pathData = getPathData(shape);\r\n el = makePath(pathData, null, pathRect, shape.layout || 'center');\r\n inner$e(el).customPathData = pathData;\r\n }\r\n else if (graphicType === 'image') {\r\n el = new ZRImage({});\r\n inner$e(el).customImagePath = elOption.style.image;\r\n }\r\n else if (graphicType === 'text') {\r\n el = new ZRText({});\r\n }\r\n else if (graphicType === 'group') {\r\n el = new Group();\r\n }\r\n else if (graphicType === 'compoundPath') {\r\n throw new Error('\"compoundPath\" is not supported yet.');\r\n }\r\n else {\r\n var Clz = getShapeClass(graphicType);\r\n if (!Clz) {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\r\n }\r\n throwError(errMsg);\r\n }\r\n el = new Clz();\r\n }\r\n inner$e(el).customGraphicType = graphicType;\r\n el.name = elOption.name;\r\n el.z2EmphasisLift = 1;\r\n el.z2SelectLift = 1;\r\n return el;\r\n }\r\n function updateElNormal(api, el, isMorphTo, dataIndex, elOption, styleOpt, attachedTxInfo, seriesModel, isInit, isTextContent) {\r\n var transFromProps = {};\r\n var allPropsFinal = {};\r\n var elDisplayable = el.isGroup ? null : el;\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('shape', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('shape', elOption, allPropsFinal);\r\n !isMorphTo && prepareShapeOrExtraTransitionFrom('extra', el, null, elOption, transFromProps, isInit);\r\n prepareShapeOrExtraAllPropsFinal('extra', elOption, allPropsFinal);\r\n !isMorphTo && prepareTransformTransitionFrom(el, null, elOption, transFromProps, isInit);\r\n prepareTransformAllPropsFinal(elOption, allPropsFinal);\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\r\n if (txCfgOpt) {\r\n el.setTextConfig(txCfgOpt);\r\n }\r\n if (el.type === 'text' && styleOpt) {\r\n var textOptionStyle = styleOpt;\r\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\r\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\r\n }\r\n if (styleOpt) {\r\n var decalPattern = void 0;\r\n var decalObj = isPath$1(el) ? styleOpt.decal : null;\r\n if (api && decalObj) {\r\n decalObj.dirty = true;\r\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\r\n }\r\n styleOpt.__decalPattern = decalPattern;\r\n }\r\n !isMorphTo && prepareStyleTransitionFrom(el, null, elOption, styleOpt, transFromProps, isInit);\r\n if (elDisplayable) {\r\n hasOwn(elOption, 'invisible') && (elDisplayable.invisible = elOption.invisible);\r\n }\r\n if (!isMorphTo) {\r\n applyPropsFinal(el, allPropsFinal, styleOpt);\r\n applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit);\r\n }\r\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\r\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\r\n if (!isTextContent) {\r\n hasOwn(elOption, 'info') && (inner$e(el).info = elOption.info);\r\n }\r\n styleOpt ? el.dirty() : el.markRedraw();\r\n return isMorphTo ? allPropsFinal : null;\r\n }\r\n function applyPropsFinal(el, allPropsFinal, styleOpt) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n if (elDisplayable && styleOpt) {\r\n var decalPattern = styleOpt.__decalPattern;\r\n var originalDecalObj = void 0;\r\n if (decalPattern) {\r\n originalDecalObj = styleOpt.decal;\r\n styleOpt.decal = decalPattern;\r\n }\r\n elDisplayable.useStyle(styleOpt);\r\n if (decalPattern) {\r\n styleOpt.decal = originalDecalObj;\r\n }\r\n var animators = elDisplayable.animators;\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (animator.targetName === 'style') {\r\n animator.changeTarget(elDisplayable.style);\r\n }\r\n }\r\n }\r\n allPropsFinal && el.attr(allPropsFinal);\r\n }\r\n function applyTransitionFrom(el, dataIndex, elOption, seriesModel, transFromProps, isInit) {\r\n if (transFromProps) {\r\n var userDuring = elOption.during;\r\n inner$e(el).userDuring = userDuring;\r\n var cfgDuringCall = userDuring ? bind(duringCall, { el: el, userDuring: userDuring }) : null;\r\n var cfg = {\r\n dataIndex: dataIndex,\r\n isFrom: true,\r\n during: cfgDuringCall\r\n };\r\n isInit\r\n ? initProps(el, transFromProps, seriesModel, cfg)\r\n : updateProps(el, transFromProps, seriesModel, cfg);\r\n }\r\n }\r\n function prepareShapeOrExtraTransitionFrom(mainAttr, el, morphFromEl, elOption, transFromProps, isInit) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var elPropsInAttr = el[mainAttr];\r\n var transFromPropsInAttr;\r\n var enterFrom = attrOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromPropsInAttr[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit\r\n && elPropsInAttr\r\n && !(morphFromEl != null && mainAttr === 'shape')) {\r\n if (attrOpt.transition) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var transitionKeys = normalizeToArray(attrOpt.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer(key, attrOpt[key], elVal);\r\n }\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n else if (indexOf(elOption.transition, mainAttr) >= 0) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n var elPropsInAttrKeys = keys(elPropsInAttr);\r\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\r\n var key = elPropsInAttrKeys[i];\r\n var elVal = elPropsInAttr[key];\r\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = attrOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToPropsInAttr = leaveToProps[mainAttr] || (leaveToProps[mainAttr] = {});\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToPropsInAttr[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\r\n var attrOpt = elOption[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n var allPropsInAttr = allProps[mainAttr] = {};\r\n var keysInAttr = keys(attrOpt);\r\n for (var i = 0; i < keysInAttr.length; i++) {\r\n var key = keysInAttr[i];\r\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\r\n }\r\n }\r\n function prepareTransformTransitionFrom(el, morphFromEl, elOption, transFromProps, isInit) {\r\n var enterFrom = elOption.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.enterFrom');\r\n }\r\n transFromProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit) {\r\n if (morphFromEl) {\r\n var fromTransformable = calcOldElLocalTransformBasedOnNewElParent(morphFromEl, el);\r\n setTransformPropToTransitionFrom(transFromProps, 'x', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'scaleY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originX', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'originY', fromTransformable);\r\n setTransformPropToTransitionFrom(transFromProps, 'rotation', fromTransformable);\r\n }\r\n else if (elOption.transition) {\r\n var transitionKeys = normalizeToArray(elOption.transition);\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n if (key === 'style' || key === 'shape' || key === 'extra') {\r\n continue;\r\n }\r\n var elVal = el[key];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.transition');\r\n checkNonStyleTansitionRefer(key, elOption[key], elVal);\r\n }\r\n transFromProps[key] = elVal;\r\n }\r\n }\r\n else {\r\n setTransformPropToTransitionFrom(transFromProps, 'x', el);\r\n setTransformPropToTransitionFrom(transFromProps, 'y', el);\r\n }\r\n }\r\n var leaveTo = elOption.leaveTo;\r\n if (leaveTo) {\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToKeys = keys(leaveTo);\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.leaveTo');\r\n }\r\n leaveToProps[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function prepareTransformAllPropsFinal(elOption, allProps) {\r\n setLagecyTransformProp(elOption, allProps, 'position');\r\n setLagecyTransformProp(elOption, allProps, 'scale');\r\n setLagecyTransformProp(elOption, allProps, 'origin');\r\n setTransformProp(elOption, allProps, 'x');\r\n setTransformProp(elOption, allProps, 'y');\r\n setTransformProp(elOption, allProps, 'scaleX');\r\n setTransformProp(elOption, allProps, 'scaleY');\r\n setTransformProp(elOption, allProps, 'originX');\r\n setTransformProp(elOption, allProps, 'originY');\r\n setTransformProp(elOption, allProps, 'rotation');\r\n }\r\n function prepareStyleTransitionFrom(el, morphFromEl, elOption, styleOpt, transFromProps, isInit) {\r\n if (!styleOpt) {\r\n return;\r\n }\r\n var fromEl = morphFromEl || el;\r\n var fromElStyle = fromEl.style;\r\n var transFromStyleProps;\r\n var enterFrom = styleOpt.enterFrom;\r\n if (isInit && enterFrom) {\r\n var enterFromKeys = keys(enterFrom);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < enterFromKeys.length; i++) {\r\n var key = enterFromKeys[i];\r\n transFromStyleProps[key] = enterFrom[key];\r\n }\r\n }\r\n if (!isInit && fromElStyle) {\r\n if (styleOpt.transition) {\r\n var transitionKeys = normalizeToArray(styleOpt.transition);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (var i = 0; i < transitionKeys.length; i++) {\r\n var key = transitionKeys[i];\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n else if (el.getAnimationStyleProps\r\n && indexOf(elOption.transition, 'style') >= 0) {\r\n var animationProps = el.getAnimationStyleProps();\r\n var animationStyleProps = animationProps ? animationProps.style : null;\r\n if (animationStyleProps) {\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n var styleKeys = keys(styleOpt);\r\n for (var i = 0; i < styleKeys.length; i++) {\r\n var key = styleKeys[i];\r\n if (animationStyleProps[key]) {\r\n var elVal = fromElStyle[key];\r\n transFromStyleProps[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n var leaveTo = styleOpt.leaveTo;\r\n if (leaveTo) {\r\n var leaveToKeys = keys(leaveTo);\r\n var leaveToProps = getOrCreateLeaveToPropsFromEl(el);\r\n var leaveToStyleProps = leaveToProps.style || (leaveToProps.style = {});\r\n for (var i = 0; i < leaveToKeys.length; i++) {\r\n var key = leaveToKeys[i];\r\n leaveToStyleProps[key] = leaveTo[key];\r\n }\r\n }\r\n }\r\n function calcOldElLocalTransformBasedOnNewElParent(oldEl, newEl) {\r\n if (!oldEl || oldEl === newEl || oldEl.parent === newEl.parent) {\r\n return oldEl;\r\n }\r\n var tmpM = tmpTransformable.transform\r\n || (tmpTransformable.transform = identity([]));\r\n var oldGlobalTransform = oldEl.getComputedTransform();\r\n oldGlobalTransform\r\n ? copy$1(tmpM, oldGlobalTransform)\r\n : identity(tmpM);\r\n var newParent = newEl.parent;\r\n if (newParent) {\r\n newParent.getComputedTransform();\r\n }\r\n tmpTransformable.originX = oldEl.originX;\r\n tmpTransformable.originY = oldEl.originY;\r\n tmpTransformable.parent = newParent;\r\n tmpTransformable.decomposeTransform();\r\n return tmpTransformable;\r\n }\r\n var checkNonStyleTansitionRefer;\r\n if (__DEV__) {\r\n checkNonStyleTansitionRefer = function (propName, optVal, elVal) {\r\n if (!isArrayLike(optVal)) {\r\n assert(optVal != null && isFinite(optVal), 'Prop `' + propName + '` must refer to a finite number or ArrayLike for transition.');\r\n }\r\n else {\r\n assert(optVal !== elVal, 'Prop `' + propName + '` must use different Array object each time for transition.');\r\n }\r\n };\r\n }\r\n function isNonStyleTransitionEnabled(optVal, elVal) {\r\n return !isArrayLike(optVal)\r\n ? (optVal != null && isFinite(optVal))\r\n : optVal !== elVal;\r\n }\r\n var checkTransformPropRefer;\r\n if (__DEV__) {\r\n checkTransformPropRefer = function (key, usedIn) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Prop `' + key + '` is not a permitted in `' + usedIn + '`. '\r\n + 'Only `' + keys(TRANSFORM_PROPS).join('`, `') + '` are permitted.');\r\n };\r\n }\r\n function getOrCreateLeaveToPropsFromEl(el) {\r\n var innerEl = inner$e(el);\r\n return innerEl.leaveToProps || (innerEl.leaveToProps = {});\r\n }\r\n var tmpDuringScope = {};\r\n var customDuringAPI = {\r\n setTransform: function (key, val) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\r\n }\r\n tmpDuringScope.el[key] = val;\r\n return this;\r\n },\r\n getTransform: function (key) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\r\n }\r\n return tmpDuringScope.el[key];\r\n },\r\n setShape: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape\r\n || (tmpDuringScope.el.shape = {});\r\n shape[key] = val;\r\n tmpDuringScope.isShapeDirty = true;\r\n return this;\r\n },\r\n getShape: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var shape = tmpDuringScope.el.shape;\r\n if (shape) {\r\n return shape[key];\r\n }\r\n },\r\n setStyle: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n if (__DEV__) {\r\n if (eqNaN(val)) {\r\n warn('style.' + key + ' must not be assigned with NaN.');\r\n }\r\n }\r\n style[key] = val;\r\n tmpDuringScope.isStyleDirty = true;\r\n }\r\n return this;\r\n },\r\n getStyle: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var style = tmpDuringScope.el.style;\r\n if (style) {\r\n return style[key];\r\n }\r\n },\r\n setExtra: function (key, val) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra\r\n || (tmpDuringScope.el.extra = {});\r\n extra[key] = val;\r\n return this;\r\n },\r\n getExtra: function (key) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n var extra = tmpDuringScope.el.extra;\r\n if (extra) {\r\n return extra[key];\r\n }\r\n }\r\n };\r\n function assertNotReserved(key) {\r\n if (__DEV__) {\r\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\r\n throw new Error('key must not be \"' + key + '\"');\r\n }\r\n }\r\n }\r\n function duringCall() {\r\n var scope = this;\r\n var el = scope.el;\r\n if (!el) {\r\n return;\r\n }\r\n var newstUserDuring = inner$e(el).userDuring;\r\n var scopeUserDuring = scope.userDuring;\r\n if (newstUserDuring !== scopeUserDuring) {\r\n scope.el = scope.userDuring = null;\r\n return;\r\n }\r\n tmpDuringScope.el = el;\r\n tmpDuringScope.isShapeDirty = false;\r\n tmpDuringScope.isStyleDirty = false;\r\n scopeUserDuring(customDuringAPI);\r\n if (tmpDuringScope.isShapeDirty && el.dirtyShape) {\r\n el.dirtyShape();\r\n }\r\n if (tmpDuringScope.isStyleDirty && el.dirtyStyle) {\r\n el.dirtyStyle();\r\n }\r\n }\r\n function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo, isRoot, isTextContent) {\r\n var elDisplayable = el.isGroup ? null : el;\r\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\r\n if (elDisplayable) {\r\n var stateObj = elDisplayable.ensureState(state);\r\n if (styleOpt === false) {\r\n var existingEmphasisState = elDisplayable.getState(state);\r\n if (existingEmphasisState) {\r\n existingEmphasisState.style = null;\r\n }\r\n }\r\n else {\r\n stateObj.style = styleOpt || null;\r\n }\r\n if (txCfgOpt) {\r\n stateObj.textConfig = txCfgOpt;\r\n }\r\n setDefaultStateProxy(elDisplayable);\r\n }\r\n }\r\n function updateZ$1(el, elOption, seriesModel, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n var elDisplayable = el;\r\n var currentZ = seriesModel.currentZ;\r\n var currentZLevel = seriesModel.currentZLevel;\r\n elDisplayable.z = currentZ;\r\n elDisplayable.zlevel = currentZLevel;\r\n var optZ2 = elOption.z2;\r\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\r\n for (var i = 0; i < STATES.length; i++) {\r\n updateZForEachState(elDisplayable, elOption, STATES[i]);\r\n }\r\n }\r\n function updateZForEachState(elDisplayable, elOption, state) {\r\n var isNormal = state === NORMAL;\r\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\r\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\r\n var stateObj;\r\n if (optZ2 != null) {\r\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\r\n stateObj.z2 = optZ2 || 0;\r\n }\r\n }\r\n function setLagecyTransformProp(elOption, targetProps, legacyName, fromTransformable) {\r\n var legacyArr = elOption[legacyName];\r\n var xyName = LEGACY_TRANSFORM_PROPS[legacyName];\r\n if (legacyArr) {\r\n if (fromTransformable) {\r\n targetProps[xyName[0]] = fromTransformable[xyName[0]];\r\n targetProps[xyName[1]] = fromTransformable[xyName[1]];\r\n }\r\n else {\r\n targetProps[xyName[0]] = legacyArr[0];\r\n targetProps[xyName[1]] = legacyArr[1];\r\n }\r\n }\r\n }\r\n function setTransformProp(elOption, allProps, name, fromTransformable) {\r\n if (elOption[name] != null) {\r\n allProps[name] = fromTransformable ? fromTransformable[name] : elOption[name];\r\n }\r\n }\r\n function setTransformPropToTransitionFrom(transitionFrom, name, fromTransformable) {\r\n if (fromTransformable) {\r\n transitionFrom[name] = fromTransformable[name];\r\n }\r\n }\r\n function makeRenderItem(customSeries, data, ecModel, api) {\r\n var renderItem = customSeries.get('renderItem');\r\n var coordSys = customSeries.coordinateSystem;\r\n var prepareResult = {};\r\n if (coordSys) {\r\n if (__DEV__) {\r\n assert(renderItem, 'series.render is required.');\r\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\r\n }\r\n prepareResult = coordSys.prepareCustoms\r\n ? coordSys.prepareCustoms(coordSys)\r\n : prepareCustoms[coordSys.type](coordSys);\r\n }\r\n var userAPI = defaults({\r\n getWidth: api.getWidth,\r\n getHeight: api.getHeight,\r\n getZr: api.getZr,\r\n getDevicePixelRatio: api.getDevicePixelRatio,\r\n value: value,\r\n style: style,\r\n ordinalRawValue: ordinalRawValue,\r\n styleEmphasis: styleEmphasis,\r\n visual: visual,\r\n barLayout: barLayout,\r\n currentSeriesIndices: currentSeriesIndices,\r\n font: font\r\n }, prepareResult.api || {});\r\n var userParams = {\r\n context: {},\r\n seriesId: customSeries.id,\r\n seriesName: customSeries.name,\r\n seriesIndex: customSeries.seriesIndex,\r\n coordSys: prepareResult.coordSys,\r\n dataInsideLength: data.count(),\r\n encode: wrapEncodeDef(customSeries.getData())\r\n };\r\n var currDataIndexInside;\r\n var currItemModel;\r\n var currItemStyleModels = {};\r\n var currLabelModels = {};\r\n var seriesItemStyleModels = {};\r\n var seriesLabelModels = {};\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n seriesItemStyleModels[stateName] = customSeries\r\n .getModel(PATH_ITEM_STYLE[stateName]);\r\n seriesLabelModels[stateName] = customSeries\r\n .getModel(PATH_LABEL[stateName]);\r\n }\r\n function getItemModel(dataIndexInside) {\r\n return dataIndexInside === currDataIndexInside\r\n ? (currItemModel || (currItemModel = data.getItemModel(dataIndexInside)))\r\n : data.getItemModel(dataIndexInside);\r\n }\r\n function getItemStyleModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesItemStyleModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\r\n }\r\n function getLabelModel(dataIndexInside, state) {\r\n return !data.hasItemOption\r\n ? seriesLabelModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])))\r\n : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\r\n }\r\n return function (dataIndexInside, payload) {\r\n currDataIndexInside = dataIndexInside;\r\n currItemModel = null;\r\n currItemStyleModels = {};\r\n currLabelModels = {};\r\n return renderItem && renderItem(defaults({\r\n dataIndexInside: dataIndexInside,\r\n dataIndex: data.getRawIndex(dataIndexInside),\r\n actionType: payload ? payload.type : null\r\n }, userParams), userAPI);\r\n };\r\n function value(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n return data.get(data.getDimension(dim || 0), dataIndexInside);\r\n }\r\n function ordinalRawValue(dim, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var dimInfo = data.getDimensionInfo(dim || 0);\r\n if (!dimInfo) {\r\n return;\r\n }\r\n var val = data.get(dimInfo.name, dataIndexInside);\r\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.categories[val]\r\n : val;\r\n }\r\n function style(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.style', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var style = data.getItemVisual(dataIndexInside, 'style');\r\n var visualColor = style && style.fill;\r\n var opacity = style && style.opacity;\r\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\r\n visualColor != null && (itemStyle.fill = visualColor);\r\n opacity != null && (itemStyle.opacity = opacity);\r\n var opt = { inheritColor: isString(visualColor) ? visualColor : '#000' };\r\n var labelModel = getLabelModel(dataIndexInside, NORMAL);\r\n var textStyle = createTextStyle(labelModel, null, opt, false, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, opt, false);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function styleEmphasis(userProps, dataIndexInside) {\r\n if (__DEV__) {\r\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\r\n }\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\r\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\r\n var textStyle = createTextStyle(labelModel, null, null, true, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside))\r\n : null;\r\n var textConfig = createTextConfig(labelModel, null, true);\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n itemStyle.legacy = true;\r\n return itemStyle;\r\n }\r\n function applyUserPropsAfter(itemStyle, extra) {\r\n for (var key in extra) {\r\n if (hasOwn(extra, key)) {\r\n itemStyle[key] = extra[key];\r\n }\r\n }\r\n }\r\n function preFetchFromExtra(extra, itemStyle) {\r\n if (extra) {\r\n extra.textFill && (itemStyle.textFill = extra.textFill);\r\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\r\n }\r\n }\r\n function visual(visualType, dataIndexInside) {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\r\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\r\n return style_1\r\n ? style_1[STYLE_VISUAL_TYPE[visualType]]\r\n : null;\r\n }\r\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\r\n return data.getItemVisual(dataIndexInside, visualType);\r\n }\r\n }\r\n function barLayout(opt) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var baseAxis = coordSys.getBaseAxis();\r\n return getLayoutOnAxis(defaults({ axis: baseAxis }, opt));\r\n }\r\n }\r\n function currentSeriesIndices() {\r\n return ecModel.getCurrentSeriesIndices();\r\n }\r\n function font(opt) {\r\n return getFont(opt, ecModel);\r\n }\r\n }\r\n function wrapEncodeDef(data) {\r\n var encodeDef = {};\r\n each(data.dimensions, function (dimName, dataDimIndex) {\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isExtraCoord) {\r\n var coordDim = dimInfo.coordDim;\r\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\r\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\r\n }\r\n });\r\n return encodeDef;\r\n }\r\n function createOrUpdateItem(api, el, dataIndex, elOption, seriesModel, group, data, morphPreparation) {\r\n if (!elOption) {\r\n removeElementDirectly(el, group);\r\n return;\r\n }\r\n el = doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, true, morphPreparation);\r\n el && data.setItemGraphicEl(dataIndex, el);\r\n enableHoverEmphasis(el, elOption.focus, elOption.blurScope);\r\n return el;\r\n }\r\n function doCreateOrUpdateEl(api, el, dataIndex, elOption, seriesModel, group, isRoot, morphPreparation) {\r\n if (__DEV__) {\r\n assert(elOption, 'should not have an null/undefined element setting');\r\n }\r\n var toBeReplacedIdx = -1;\r\n if (el && (doesElNeedRecreate(el, elOption))) {\r\n toBeReplacedIdx = group.childrenRef().indexOf(el);\r\n el = null;\r\n }\r\n var elIsNewCreated = !el;\r\n if (!el) {\r\n el = createEl(elOption);\r\n }\r\n else {\r\n el.clearStates();\r\n }\r\n var canMorph = inner$e(el).canMorph = elOption.morph && isPath$1(el);\r\n var thisElIsMorphTo = canMorph && morphPreparation && morphPreparation.hasFrom();\r\n var isInit = elIsNewCreated && !thisElIsMorphTo;\r\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt =\r\n attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt =\r\n attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt =\r\n attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\r\n attachedTxInfoTmp.isLegacy = false;\r\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\r\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\r\n var pendingAllPropsFinal = updateElNormal(api, el, thisElIsMorphTo, dataIndex, elOption, elOption.style, attachedTxInfoTmp, seriesModel, isInit, false);\r\n if (thisElIsMorphTo) {\r\n morphPreparation.addTo(el, elOption, dataIndex, pendingAllPropsFinal);\r\n }\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var otherStateOpt = retrieveStateOption(elOption, stateName);\r\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\r\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\r\n }\r\n }\r\n updateZ$1(el, elOption, seriesModel);\r\n if (elOption.type === 'group') {\r\n mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation);\r\n }\r\n if (toBeReplacedIdx >= 0) {\r\n group.replaceAt(el, toBeReplacedIdx);\r\n }\r\n else {\r\n group.add(el);\r\n }\r\n return el;\r\n }\r\n function doesElNeedRecreate(el, elOption) {\r\n var elInner = inner$e(el);\r\n var elOptionType = elOption.type;\r\n var elOptionShape = elOption.shape;\r\n var elOptionStyle = elOption.style;\r\n return ((elOptionType != null\r\n && elOptionType !== elInner.customGraphicType)\r\n || (elOptionType === 'path'\r\n && hasOwnPathData(elOptionShape)\r\n && getPathData(elOptionShape) !== elInner.customPathData)\r\n || (elOptionType === 'image'\r\n && hasOwn(elOptionStyle, 'image')\r\n && elOptionStyle.image !== elInner.customImagePath));\r\n }\r\n function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\r\n var clipPathOpt = elOption.clipPath;\r\n if (clipPathOpt === false) {\r\n if (el && el.getClipPath()) {\r\n el.removeClipPath();\r\n }\r\n }\r\n else if (clipPathOpt) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt)) {\r\n clipPath = null;\r\n }\r\n if (!clipPath) {\r\n clipPath = createEl(clipPathOpt);\r\n if (__DEV__) {\r\n assert(clipPath instanceof Path, 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\r\n }\r\n el.setClipPath(clipPath);\r\n }\r\n updateElNormal(null, clipPath, null, dataIndex, clipPathOpt, null, null, seriesModel, isInit, false);\r\n }\r\n }\r\n function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\r\n if (el.isGroup) {\r\n return;\r\n }\r\n processTxInfo(elOption, null, attachedTxInfo);\r\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\r\n var txConOptNormal = attachedTxInfo.normal.conOpt;\r\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\r\n var txConOptBlur = attachedTxInfo.blur.conOpt;\r\n var txConOptSelect = attachedTxInfo.select.conOpt;\r\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\r\n var textContent = el.getTextContent();\r\n if (txConOptNormal === false) {\r\n textContent && el.removeTextContent();\r\n }\r\n else {\r\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { type: 'text' };\r\n if (!textContent) {\r\n textContent = createEl(txConOptNormal);\r\n el.setTextContent(textContent);\r\n }\r\n else {\r\n textContent.clearStates();\r\n }\r\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\r\n updateElNormal(null, textContent, null, dataIndex, txConOptNormal, txConStlOptNormal, null, seriesModel, isInit, true);\r\n for (var i = 0; i < STATES.length; i++) {\r\n var stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\r\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\r\n }\r\n }\r\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\r\n }\r\n }\r\n }\r\n function processTxInfo(elOption, state, attachedTxInfo) {\r\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\r\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\r\n var elType = elOption.type;\r\n var txCfg = stateOpt ? stateOpt.textConfig : null;\r\n var txConOptNormal = elOption.textContent;\r\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\r\n if (styleOpt && (attachedTxInfo.isLegacy\r\n || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\r\n attachedTxInfo.isLegacy = true;\r\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\r\n if (!txCfg && convertResult.textConfig) {\r\n txCfg = convertResult.textConfig;\r\n }\r\n if (!txConOpt && convertResult.textContent) {\r\n txConOpt = convertResult.textContent;\r\n }\r\n }\r\n if (!state && txConOpt) {\r\n var txConOptNormal_1 = txConOpt;\r\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\r\n if (__DEV__) {\r\n txConOptNormal_1.type !== 'text' && assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\r\n }\r\n }\r\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\r\n info.cfg = txCfg;\r\n info.conOpt = txConOpt;\r\n }\r\n function retrieveStateOption(elOption, state) {\r\n return !state ? elOption : elOption ? elOption[state] : null;\r\n }\r\n function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\r\n var style = stateOption && stateOption.style;\r\n if (style == null && state === EMPHASIS && stateOptionNormal) {\r\n style = stateOptionNormal.styleEmphasis;\r\n }\r\n return style;\r\n }\r\n function mergeChildren(api, el, dataIndex, elOption, seriesModel, morphPreparation) {\r\n var newChildren = elOption.children;\r\n var newLen = newChildren ? newChildren.length : 0;\r\n var mergeChildren = elOption.$mergeChildren;\r\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\r\n var notMerge = mergeChildren === false;\r\n if (!newLen && !byName && !notMerge) {\r\n return;\r\n }\r\n if (byName) {\r\n diffGroupChildren({\r\n api: api,\r\n oldChildren: el.children() || [],\r\n newChildren: newChildren || [],\r\n dataIndex: dataIndex,\r\n seriesModel: seriesModel,\r\n group: el,\r\n morphPreparation: morphPreparation\r\n });\r\n return;\r\n }\r\n notMerge && el.removeAll();\r\n var index = 0;\r\n for (; index < newLen; index++) {\r\n newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el, false, morphPreparation);\r\n }\r\n for (var i = el.childCount() - 1; i >= index; i--) {\r\n doRemoveEl(el.childAt(i), seriesModel, el);\r\n }\r\n }\r\n function diffGroupChildren(context) {\r\n (new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context))\r\n .add(processAddUpdate)\r\n .update(processAddUpdate)\r\n .remove(processRemove)\r\n .execute();\r\n }\r\n function getKey(item, idx) {\r\n var name = item && item.name;\r\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\r\n }\r\n function processAddUpdate(newIndex, oldIndex) {\r\n var context = this.context;\r\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\r\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\r\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group, false, context.morphPreparation);\r\n }\r\n function processRemove(oldIndex) {\r\n var context = this.context;\r\n var child = context.oldChildren[oldIndex];\r\n doRemoveEl(child, context.seriesModel, context.group);\r\n }\r\n function doRemoveEl(el, seriesModel, group) {\r\n if (el) {\r\n var leaveToProps = inner$e(el).leaveToProps;\r\n leaveToProps\r\n ? updateProps(el, leaveToProps, seriesModel, {\r\n cb: function () {\r\n group.remove(el);\r\n }\r\n })\r\n : group.remove(el);\r\n }\r\n }\r\n function getPathData(shape) {\r\n return shape && (shape.pathData || shape.d);\r\n }\r\n function hasOwnPathData(shape) {\r\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\r\n }\r\n function isPath$1(el) {\r\n return el && el instanceof Path;\r\n }\r\n function removeElementDirectly(el, group) {\r\n el && group.remove(el);\r\n }\r\n var MorphPreparation = (function () {\r\n function MorphPreparation(seriesModel, transOpt) {\r\n this._fromList = [];\r\n this._toList = [];\r\n this._toElOptionList = [];\r\n this._allPropsFinalList = [];\r\n this._toDataIndices = [];\r\n this._morphConfigList = [];\r\n this._seriesModel = seriesModel;\r\n this._transOpt = transOpt;\r\n }\r\n MorphPreparation.prototype.hasFrom = function () {\r\n return !!this._fromList.length;\r\n };\r\n MorphPreparation.prototype.findAndAddFrom = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n if (inner$e(el).canMorph) {\r\n this._fromList.push(el);\r\n }\r\n if (el.isGroup) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n this.findAndAddFrom(children[i]);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype.addTo = function (path, elOption, dataIndex, allPropsFinal) {\r\n if (path) {\r\n this._toList.push(path);\r\n this._toElOptionList.push(elOption);\r\n this._toDataIndices.push(dataIndex);\r\n this._allPropsFinalList.push(allPropsFinal);\r\n }\r\n };\r\n MorphPreparation.prototype.applyMorphing = function () {\r\n var type = this._type;\r\n var fromList = this._fromList;\r\n var toList = this._toList;\r\n var toListLen = toList.length;\r\n var fromListLen = fromList.length;\r\n if (!fromListLen || !toListLen) {\r\n return;\r\n }\r\n if (type === 'oneToOne') {\r\n for (var toIdx = 0; toIdx < toListLen; toIdx++) {\r\n this._oneToOneForSingleTo(toIdx, toIdx);\r\n }\r\n }\r\n else if (type === 'manyToOne') {\r\n var fromSingleSegLen = Math.max(1, Math.floor(fromListLen / toListLen));\r\n for (var toIdx = 0, fromIdxStart = 0; toIdx < toListLen; toIdx++, fromIdxStart += fromSingleSegLen) {\r\n var fromCount = toIdx + 1 >= toListLen\r\n ? fromListLen - fromIdxStart\r\n : fromSingleSegLen;\r\n this._manyToOneForSingleTo(toIdx, fromIdxStart >= fromListLen ? null : fromIdxStart, fromCount);\r\n }\r\n }\r\n else if (type === 'oneToMany') {\r\n var toSingleSegLen = Math.max(1, Math.floor(toListLen / fromListLen));\r\n for (var toIdxStart = 0, fromIdx = 0; toIdxStart < toListLen; toIdxStart += toSingleSegLen, fromIdx++) {\r\n var toCount = toIdxStart + toSingleSegLen >= toListLen\r\n ? toListLen - toIdxStart\r\n : toSingleSegLen;\r\n this._oneToManyForSingleFrom(toIdxStart, toCount, fromIdx >= fromListLen ? null : fromIdx);\r\n }\r\n }\r\n };\r\n MorphPreparation.prototype._oneToOneForSingleTo = function (toIdx, fromIdx) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var toDataIndex = this._toDataIndices[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n var from = this._fromList[fromIdx];\r\n var elAnimationConfig = this._getOrCreateMorphConfig(toDataIndex);\r\n var morphDuration = elAnimationConfig.duration;\r\n if (from && isCombiningPath(from)) {\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphDuration) {\r\n var combineResult = combine([from], to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n }\r\n else {\r\n var morphFrom = (morphDuration\r\n && from\r\n && (from !== to || isInAnyMorphing(from))) ? from : null;\r\n var transFromProps = {};\r\n prepareShapeOrExtraTransitionFrom('shape', to, morphFrom, toElOption, transFromProps, false);\r\n prepareShapeOrExtraTransitionFrom('extra', to, morphFrom, toElOption, transFromProps, false);\r\n prepareTransformTransitionFrom(to, morphFrom, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(to, morphFrom, toElOption, toElOption.style, transFromProps, false);\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n if (morphFrom) {\r\n morphPath(morphFrom, to, elAnimationConfig);\r\n }\r\n applyTransitionFrom(to, toDataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._manyToOneForSingleTo = function (toIdx, fromIdxStart, fromCount) {\r\n var to = this._toList[toIdx];\r\n var toElOption = this._toElOptionList[toIdx];\r\n var allPropsFinal = this._allPropsFinalList[toIdx];\r\n applyPropsFinal(to, allPropsFinal, toElOption.style);\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdx]);\r\n if (elAnimationConfig.duration && fromIdxStart != null) {\r\n var combineFromList = [];\r\n for (var fromIdx = fromIdxStart; fromIdx < fromCount; fromIdx++) {\r\n combineFromList.push(this._fromList[fromIdx]);\r\n }\r\n var combineResult = combine(combineFromList, to, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(combineResult, toIdx, null);\r\n }\r\n };\r\n MorphPreparation.prototype._oneToManyForSingleFrom = function (toIdxStart, toCount, fromIdx) {\r\n var from = fromIdx == null ? null : this._fromList[fromIdx];\r\n var toList = this._toList;\r\n var separateToList = [];\r\n for (var toIdx = toIdxStart; toIdx < toCount; toIdx++) {\r\n var to = toList[toIdx];\r\n applyPropsFinal(to, this._allPropsFinalList[toIdx], this._toElOptionList[toIdx].style);\r\n separateToList.push(to);\r\n }\r\n var elAnimationConfig = this._getOrCreateMorphConfig(this._toDataIndices[toIdxStart]);\r\n if (elAnimationConfig.duration && from) {\r\n var separateResult = separate(from, separateToList, elAnimationConfig, copyPropsWhenDivided);\r\n this._processResultIndividuals(separateResult, toIdxStart, toCount);\r\n }\r\n };\r\n MorphPreparation.prototype._processResultIndividuals = function (combineSeparateResult, toIdxStart, toCount) {\r\n var isSeparate = toCount != null;\r\n for (var i = 0; i < combineSeparateResult.count; i++) {\r\n var fromIndividual = combineSeparateResult.fromIndividuals[i];\r\n var toIndividual = combineSeparateResult.toIndividuals[i];\r\n var toIdx = toIdxStart + (isSeparate ? i : 0);\r\n var toElOption = this._toElOptionList[toIdx];\r\n var dataIndex = this._toDataIndices[toIdx];\r\n var transFromProps = {};\r\n prepareTransformTransitionFrom(toIndividual, fromIndividual, toElOption, transFromProps, false);\r\n prepareStyleTransitionFrom(toIndividual, fromIndividual, toElOption, toElOption.style, transFromProps, false);\r\n applyTransitionFrom(toIndividual, dataIndex, toElOption, this._seriesModel, transFromProps, false);\r\n }\r\n };\r\n MorphPreparation.prototype._getOrCreateMorphConfig = function (dataIndex) {\r\n var morphConfigList = this._morphConfigList;\r\n var config = morphConfigList[dataIndex];\r\n if (config) {\r\n return config;\r\n }\r\n var duration;\r\n var easing;\r\n var delay;\r\n var seriesModel = this._seriesModel;\r\n var transOpt = this._transOpt;\r\n if (seriesModel.isAnimationEnabled()) {\r\n var animationPayload = void 0;\r\n if (seriesModel && seriesModel.ecModel) {\r\n var updatePayload = seriesModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n easing = animationPayload.easing || 'cubicOut';\r\n delay = animationPayload.delay || 0;\r\n }\r\n else {\r\n easing = seriesModel.get('animationEasingUpdate');\r\n var delayOption = seriesModel.get('animationDelayUpdate');\r\n delay = isFunction(delayOption) ? delayOption(dataIndex) : delayOption;\r\n var durationOption = seriesModel.get('animationDurationUpdate');\r\n duration = isFunction(durationOption) ? durationOption(dataIndex) : durationOption;\r\n }\r\n }\r\n config = {\r\n duration: duration || 0,\r\n delay: delay,\r\n easing: easing,\r\n dividingMethod: transOpt ? transOpt.dividingMethod : null\r\n };\r\n morphConfigList[dataIndex] = config;\r\n return config;\r\n };\r\n MorphPreparation.prototype.reset = function (type) {\r\n this._type = type;\r\n this._fromList.length =\r\n this._toList.length =\r\n this._toElOptionList.length =\r\n this._allPropsFinalList.length =\r\n this._toDataIndices.length = 0;\r\n };\r\n return MorphPreparation;\r\n }());\r\n function copyPropsWhenDivided(srcPath, tarPath, willClone) {\r\n tarPath.style = willClone\r\n ? clone(srcPath.style)\r\n : srcPath.style;\r\n tarPath.zlevel = srcPath.zlevel;\r\n tarPath.z = srcPath.z;\r\n tarPath.z2 = srcPath.z2;\r\n }\n\n function getSeriesStackId$1(seriesModel) {\r\n return seriesModel.get('stack')\r\n || '__ec_stack_' + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey$1(polar, axis) {\r\n return axis.dim + polar.model.componentIndex;\r\n }\r\n function barLayoutPolar(seriesType, ecModel, api) {\r\n var lastStackCoords = {};\r\n var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\r\n return !ecModel.isSeriesFiltered(seriesModel)\r\n && seriesModel.coordinateSystem\r\n && seriesModel.coordinateSystem.type === 'polar';\r\n }));\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (seriesModel.coordinateSystem.type !== 'polar') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = polar.getOtherAxis(baseAxis);\r\n var cx = seriesModel.coordinateSystem.cx;\r\n var cy = seriesModel.coordinateSystem.cy;\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var clampLayout = baseAxis.dim !== 'radius'\r\n || !seriesModel.get('roundCap', true);\r\n var valueAxisStart = valueAxis.dataToCoord(0);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var r0 = void 0;\r\n var r = void 0;\r\n var startAngle = void 0;\r\n var endAngle = void 0;\r\n if (valueAxis.dim === 'radius') {\r\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\r\n var angle = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(radiusSpan) < barMinHeight) {\r\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n r0 = baseCoord;\r\n r = baseCoord + radiusSpan;\r\n startAngle = angle - columnOffset;\r\n endAngle = startAngle - columnWidth;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\r\n }\r\n else {\r\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\r\n var radius = baseAxis.dataToCoord(baseValue);\r\n if (Math.abs(angleSpan) < barMinAngle) {\r\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\r\n }\r\n r0 = radius + columnOffset;\r\n r = r0 + columnWidth;\r\n startAngle = baseCoord;\r\n endAngle = baseCoord + angleSpan;\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\r\n }\r\n data.setItemLayout(idx, {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: -startAngle * Math.PI / 180,\r\n endAngle: -endAngle * Math.PI / 180\r\n });\r\n }\r\n });\r\n }\r\n function calRadialBar(barSeries) {\r\n var columnsMap = {};\r\n each(barSeries, function (seriesModel, idx) {\r\n var data = seriesModel.getData();\r\n var polar = seriesModel.coordinateSystem;\r\n var baseAxis = polar.getBaseAxis();\r\n var axisKey = getAxisKey$1(polar, baseAxis);\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: '20%',\r\n gap: '30%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = getSeriesStackId$1(seriesModel);\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n if (barWidth && !stacks[stackId].width) {\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n stacks[stackId].width = barWidth;\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGap = parsePercent$2(columnsOnAxis.categoryGap, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column, stack) {\r\n var maxWidth = column.maxWidth;\r\n if (maxWidth && maxWidth < autoWidth) {\r\n maxWidth = Math.min(maxWidth, remainedWidth);\r\n if (column.width) {\r\n maxWidth = Math.min(maxWidth, column.width);\r\n }\r\n remainedWidth -= maxWidth;\r\n column.width = maxWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\n\n var PolarModel = (function (_super) {\r\n __extends(PolarModel, _super);\r\n function PolarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PolarModel.type;\r\n return _this;\r\n }\r\n PolarModel.prototype.findAxisModel = function (axisType) {\r\n var foundAxisModel;\r\n var ecModel = this.ecModel;\r\n ecModel.eachComponent(axisType, function (axisModel) {\r\n if (axisModel.getCoordSysModel() === this) {\r\n foundAxisModel = axisModel;\r\n }\r\n }, this);\r\n return foundAxisModel;\r\n };\r\n PolarModel.type = 'polar';\r\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\r\n PolarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n center: ['50%', '50%'],\r\n radius: '80%'\r\n };\r\n return PolarModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(PolarModel);\n\n var PolarAxisModel = (function (_super) {\r\n __extends(PolarAxisModel, _super);\r\n function PolarAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n };\r\n PolarAxisModel.type = 'polarAxis';\r\n return PolarAxisModel;\r\n }(ComponentModel));\r\n mixin(PolarAxisModel, AxisModelCommonMixin);\r\n var AngleAxisModel = (function (_super) {\r\n __extends(AngleAxisModel, _super);\r\n function AngleAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisModel.type;\r\n return _this;\r\n }\r\n AngleAxisModel.type = 'angleAxis';\r\n return AngleAxisModel;\r\n }(PolarAxisModel));\r\n var RadiusAxisModel = (function (_super) {\r\n __extends(RadiusAxisModel, _super);\r\n function RadiusAxisModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisModel.type;\r\n return _this;\r\n }\r\n RadiusAxisModel.type = 'radiusAxis';\r\n return RadiusAxisModel;\r\n }(PolarAxisModel));\r\n var angleAxisExtraOption = {\r\n startAngle: 90,\r\n clockwise: true,\r\n splitNumber: 12,\r\n axisLabel: {\r\n rotate: 0\r\n }\r\n };\r\n var radiusAxisExtraOption = {\r\n splitNumber: 5\r\n };\r\n axisModelCreator('angle', AngleAxisModel, angleAxisExtraOption);\r\n axisModelCreator('radius', RadiusAxisModel, radiusAxisExtraOption);\n\n var RadiusAxis = (function (_super) {\r\n __extends(RadiusAxis, _super);\r\n function RadiusAxis(scale, radiusExtent) {\r\n return _super.call(this, 'radius', scale, radiusExtent) || this;\r\n }\r\n RadiusAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n return RadiusAxis;\r\n }(Axis));\r\n RadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\r\n RadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\n\n var inner$f = makeInner();\r\n var AngleAxis = (function (_super) {\r\n __extends(AngleAxis, _super);\r\n function AngleAxis(scale, angleExtent) {\r\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\r\n }\r\n AngleAxis.prototype.pointToData = function (point, clamp) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n };\r\n AngleAxis.prototype.calculateCategoryInterval = function () {\r\n var axis = this;\r\n var labelModel = axis.getLabelModel();\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitH = Math.abs(unitSpan);\r\n var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\r\n var maxH = Math.max(rect.height, 7);\r\n var dh = maxH / unitH;\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(dh));\r\n var cache = inner$f(axis.model);\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n }\r\n return interval;\r\n };\r\n return AngleAxis;\r\n }(Axis));\r\n AngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\r\n AngleAxis.prototype.angleToData = Axis.prototype.coordToData;\n\n var Polar = (function () {\r\n function Polar(name) {\r\n this.dimensions = ['radius', 'angle'];\r\n this.type = 'polar';\r\n this.cx = 0;\r\n this.cy = 0;\r\n this._radiusAxis = new RadiusAxis();\r\n this._angleAxis = new AngleAxis();\r\n this.axisPointerEnabled = true;\r\n this.name = name || '';\r\n this._radiusAxis.polar = this._angleAxis.polar = this;\r\n }\r\n Polar.prototype.containPoint = function (point) {\r\n var coord = this.pointToCoord(point);\r\n return this._radiusAxis.contain(coord[0])\r\n && this._angleAxis.contain(coord[1]);\r\n };\r\n Polar.prototype.containData = function (data) {\r\n return this._radiusAxis.containData(data[0])\r\n && this._angleAxis.containData(data[1]);\r\n };\r\n Polar.prototype.getAxis = function (dim) {\r\n var key = ('_' + dim + 'Axis');\r\n return this[key];\r\n };\r\n Polar.prototype.getAxes = function () {\r\n return [this._radiusAxis, this._angleAxis];\r\n };\r\n Polar.prototype.getAxesByScale = function (scaleType) {\r\n var axes = [];\r\n var angleAxis = this._angleAxis;\r\n var radiusAxis = this._radiusAxis;\r\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\r\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\r\n return axes;\r\n };\r\n Polar.prototype.getAngleAxis = function () {\r\n return this._angleAxis;\r\n };\r\n Polar.prototype.getRadiusAxis = function () {\r\n return this._radiusAxis;\r\n };\r\n Polar.prototype.getOtherAxis = function (axis) {\r\n var angleAxis = this._angleAxis;\r\n return axis === angleAxis ? this._radiusAxis : angleAxis;\r\n };\r\n Polar.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAngleAxis();\r\n };\r\n Polar.prototype.getTooltipAxes = function (dim) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? this.getAxis(dim) : this.getBaseAxis();\r\n return {\r\n baseAxes: [baseAxis],\r\n otherAxes: [this.getOtherAxis(baseAxis)]\r\n };\r\n };\r\n Polar.prototype.dataToPoint = function (data, clamp) {\r\n return this.coordToPoint([\r\n this._radiusAxis.dataToRadius(data[0], clamp),\r\n this._angleAxis.dataToAngle(data[1], clamp)\r\n ]);\r\n };\r\n Polar.prototype.pointToData = function (point, clamp) {\r\n var coord = this.pointToCoord(point);\r\n return [\r\n this._radiusAxis.radiusToData(coord[0], clamp),\r\n this._angleAxis.angleToData(coord[1], clamp)\r\n ];\r\n };\r\n Polar.prototype.pointToCoord = function (point) {\r\n var dx = point[0] - this.cx;\r\n var dy = point[1] - this.cy;\r\n var angleAxis = this.getAngleAxis();\r\n var extent = angleAxis.getExtent();\r\n var minAngle = Math.min(extent[0], extent[1]);\r\n var maxAngle = Math.max(extent[0], extent[1]);\r\n angleAxis.inverse\r\n ? (minAngle = maxAngle - 360)\r\n : (maxAngle = minAngle + 360);\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n var radian = Math.atan2(-dy, dx) / Math.PI * 180;\r\n var dir = radian < minAngle ? 1 : -1;\r\n while (radian < minAngle || radian > maxAngle) {\r\n radian += dir * 360;\r\n }\r\n return [radius, radian];\r\n };\r\n Polar.prototype.coordToPoint = function (coord) {\r\n var radius = coord[0];\r\n var radian = coord[1] / 180 * Math.PI;\r\n var x = Math.cos(radian) * radius + this.cx;\r\n var y = -Math.sin(radian) * radius + this.cy;\r\n return [x, y];\r\n };\r\n Polar.prototype.getArea = function () {\r\n var angleAxis = this.getAngleAxis();\r\n var radiusAxis = this.getRadiusAxis();\r\n var radiusExtent = radiusAxis.getExtent().slice();\r\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\r\n var angleExtent = angleAxis.getExtent();\r\n var RADIAN = Math.PI / 180;\r\n return {\r\n cx: this.cx,\r\n cy: this.cy,\r\n r0: radiusExtent[0],\r\n r: radiusExtent[1],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse,\r\n contain: function (x, y) {\r\n var dx = x - this.cx;\r\n var dy = y - this.cy;\r\n var d2 = dx * dx + dy * dy;\r\n var r = this.r;\r\n var r0 = this.r0;\r\n return d2 <= r * r && d2 >= r0 * r0;\r\n }\r\n };\r\n };\r\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n };\r\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$3(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n };\r\n return Polar;\r\n }());\r\n function getCoordSys$3(finder) {\r\n var seriesModel = finder.seriesModel;\r\n var polarModel = finder.polarModel;\r\n return polarModel && polarModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem;\r\n }\n\n function resizePolar(polar, polarModel, api) {\r\n var center = polarModel.get('center');\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n polar.cx = parsePercent$2(center[0], width);\r\n polar.cy = parsePercent$2(center[1], height);\r\n var radiusAxis = polar.getRadiusAxis();\r\n var size = Math.min(width, height) / 2;\r\n var radius = polarModel.get('radius');\r\n if (radius == null) {\r\n radius = [0, '100%'];\r\n }\r\n else if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n var parsedRadius = [\r\n parsePercent$2(radius[0], size),\r\n parsePercent$2(radius[1], size)\r\n ];\r\n radiusAxis.inverse\r\n ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0])\r\n : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\r\n }\r\n function updatePolarScale(ecModel, api) {\r\n var polar = this;\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxis = polar.getRadiusAxis();\r\n angleAxis.scale.setExtent(Infinity, -Infinity);\r\n radiusAxis.scale.setExtent(Infinity, -Infinity);\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === polar) {\r\n var data_1 = seriesModel.getData();\r\n each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\r\n radiusAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\r\n angleAxis.scale.unionExtentFromData(data_1, dim);\r\n });\r\n }\r\n });\r\n niceScaleExtent(angleAxis.scale, angleAxis.model);\r\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\r\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\r\n var extent = angleAxis.getExtent();\r\n var diff = 360 / angleAxis.scale.count();\r\n angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);\r\n angleAxis.setExtent(extent[0], extent[1]);\r\n }\r\n }\r\n function isAngleAxisModel(axisModel) {\r\n return axisModel.mainType === 'angleAxis';\r\n }\r\n function setAxis(axis, axisModel) {\r\n axis.type = axisModel.get('type');\r\n axis.scale = createScaleByModel(axisModel);\r\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\r\n axis.inverse = axisModel.get('inverse');\r\n if (isAngleAxisModel(axisModel)) {\r\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\r\n var startAngle = axisModel.get('startAngle');\r\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\r\n }\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n }\r\n var polarCreator = {\r\n dimensions: Polar.prototype.dimensions,\r\n create: function (ecModel, api) {\r\n var polarList = [];\r\n ecModel.eachComponent('polar', function (polarModel, idx) {\r\n var polar = new Polar(idx + '');\r\n polar.update = updatePolarScale;\r\n var radiusAxis = polar.getRadiusAxis();\r\n var angleAxis = polar.getAngleAxis();\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n setAxis(radiusAxis, radiusAxisModel);\r\n setAxis(angleAxis, angleAxisModel);\r\n resizePolar(polar, polarModel, api);\r\n polarList.push(polar);\r\n polarModel.coordinateSystem = polar;\r\n polar.model = polarModel;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'polar') {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!polarModel) {\r\n throw new Error('Polar \"' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\r\n }\r\n }\r\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\r\n }\r\n });\r\n return polarList;\r\n }\r\n };\r\n CoordinateSystemManager.register('polar', polarCreator);\n\n var elementList$1 = [\r\n 'axisLine',\r\n 'axisLabel',\r\n 'axisTick',\r\n 'minorTick',\r\n 'splitLine',\r\n 'minorSplitLine',\r\n 'splitArea'\r\n ];\r\n function getAxisLineShape(polar, rExtent, angle) {\r\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\r\n var start = polar.coordToPoint([rExtent[0], angle]);\r\n var end = polar.coordToPoint([rExtent[1], angle]);\r\n return {\r\n x1: start[0],\r\n y1: start[1],\r\n x2: end[0],\r\n y2: end[1]\r\n };\r\n }\r\n function getRadiusIdx(polar) {\r\n var radiusAxis = polar.getRadiusAxis();\r\n return radiusAxis.inverse ? 0 : 1;\r\n }\r\n function fixAngleOverlap(list) {\r\n var firstItem = list[0];\r\n var lastItem = list[list.length - 1];\r\n if (firstItem\r\n && lastItem\r\n && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\r\n list.pop();\r\n }\r\n }\r\n var AngleAxisView = (function (_super) {\r\n __extends(AngleAxisView, _super);\r\n function AngleAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AngleAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!angleAxisModel.get('show')) {\r\n return;\r\n }\r\n var angleAxis = angleAxisModel.axis;\r\n var polar = angleAxis.polar;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var ticksAngles = angleAxis.getTicksCoords();\r\n var minorTickAngles = angleAxis.getMinorTicksCoords();\r\n var labels = map(angleAxis.getViewLabels(), function (labelItem) {\r\n labelItem = clone(labelItem);\r\n labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);\r\n return labelItem;\r\n });\r\n fixAngleOverlap(labels);\r\n fixAngleOverlap(ticksAngles);\r\n each(elementList$1, function (name) {\r\n if (angleAxisModel.get([name, 'show'])\r\n && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\r\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\r\n }\r\n }, this);\r\n };\r\n AngleAxisView.type = 'angleAxis';\r\n return AngleAxisView;\r\n }(AxisView));\r\n var angelAxisElementsBuilders = {\r\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\r\n var rId = getRadiusIdx(polar);\r\n var r0Id = rId ? 0 : 1;\r\n var shape;\r\n if (radiusExtent[r0Id] === 0) {\r\n shape = new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n else {\r\n shape = new Ring({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n r0: radiusExtent[r0Id]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n shape.style.fill = null;\r\n group.add(shape);\r\n },\r\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = map(ticksAngles, function (tickAngleItem) {\r\n return new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\r\n });\r\n });\r\n group.add(mergePath$1(lines, {\r\n style: defaults(tickModel.getModel('lineStyle').getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n })\r\n }));\r\n },\r\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var tickModel = angleAxisModel.getModel('axisTick');\r\n var minorTickModel = angleAxisModel.getModel('minorTick');\r\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\r\n var radius = radiusExtent[getRadiusIdx(polar)];\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }))\r\n }));\r\n },\r\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\r\n var rawCategoryData = angleAxisModel.getCategories(true);\r\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\r\n var labelMargin = commonLabelModel.get('margin');\r\n var triggerEvent = angleAxisModel.get('triggerEvent');\r\n each(labels, function (labelItem, idx) {\r\n var labelModel = commonLabelModel;\r\n var tickValue = labelItem.tickValue;\r\n var r = radiusExtent[getRadiusIdx(polar)];\r\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3\r\n ? 'center' : (p[0] > cx ? 'left' : 'right');\r\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3\r\n ? 'middle' : (p[1] > cy ? 'top' : 'bottom');\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\r\n }\r\n }\r\n var textEl = new ZRText({\r\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\r\n style: createTextStyle(labelModel, {\r\n x: p[0],\r\n y: p[1],\r\n fill: labelModel.getTextColor()\r\n || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\r\n text: labelItem.formattedLabel,\r\n align: labelTextAlign,\r\n verticalAlign: labelTextVerticalAlign\r\n })\r\n });\r\n group.add(textEl);\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = labelItem.rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n }, this);\r\n },\r\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n var splitLineModel = angleAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksAngles.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTickAngles.length; i++) {\r\n for (var k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new Line({\r\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: lineStyleModel.getLineStyle(),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n },\r\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!ticksAngles.length) {\r\n return;\r\n }\r\n var splitAreaModel = angleAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var RADIAN = Math.PI / 180;\r\n var prevAngle = -ticksAngles[0].coord * RADIAN;\r\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\r\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\r\n var clockwise = angleAxisModel.get('clockwise');\r\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\r\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: r0,\r\n r: r1,\r\n startAngle: prevAngle,\r\n endAngle: -coord * RADIAN,\r\n clockwise: clockwise\r\n },\r\n silent: true\r\n }));\r\n prevAngle = -coord * RADIAN;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n };\r\n ComponentView.registerClass(AngleAxisView);\n\n var axisBuilderAttrs$3 = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs$2 = [\r\n 'splitLine', 'splitArea', 'minorSplitLine'\r\n ];\r\n var RadiusAxisView = (function (_super) {\r\n __extends(RadiusAxisView, _super);\r\n function RadiusAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = RadiusAxisView.type;\r\n _this.axisPointerClass = 'PolarAxisPointer';\r\n return _this;\r\n }\r\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\r\n this.group.removeAll();\r\n if (!radiusAxisModel.get('show')) {\r\n return;\r\n }\r\n var oldAxisGroup = this._axisGroup;\r\n var newAxisGroup = this._axisGroup = new Group();\r\n this.group.add(newAxisGroup);\r\n var radiusAxis = radiusAxisModel.axis;\r\n var polar = radiusAxis.polar;\r\n var angleAxis = polar.getAngleAxis();\r\n var ticksCoords = radiusAxis.getTicksCoords();\r\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\r\n var axisAngle = angleAxis.getExtent()[0];\r\n var radiusExtent = radiusAxis.getExtent();\r\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\r\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\r\n each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder);\r\n newAxisGroup.add(axisBuilder.getGroup());\r\n groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\r\n each(selfBuilderAttrs$2, function (name) {\r\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\r\n axisElementBuilders$2[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\r\n }\r\n }, this);\r\n };\r\n RadiusAxisView.type = 'radiusAxis';\r\n return RadiusAxisView;\r\n }(AxisView));\r\n var axisElementBuilders$2 = {\r\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n var splitLineModel = radiusAxisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n var lineCount = 0;\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n var splitLines = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: ticksCoords[i].coord\r\n }\r\n }));\r\n }\r\n for (var i = 0; i < splitLines.length; i++) {\r\n group.add(mergePath$1(splitLines[i], {\r\n style: defaults({\r\n stroke: lineColors[i % lineColors.length],\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var lines = [];\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n lines.push(new Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: minorTicksCoords[i][k].coord\r\n }\r\n }));\r\n }\r\n }\r\n group.add(mergePath$1(lines, {\r\n style: defaults({\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n },\r\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var lineCount = 0;\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n var splitAreas = [];\r\n var prevRadius = ticksCoords[0].coord;\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: prevRadius,\r\n r: ticksCoords[i].coord,\r\n startAngle: 0,\r\n endAngle: Math.PI * 2\r\n },\r\n silent: true\r\n }));\r\n prevRadius = ticksCoords[i].coord;\r\n }\r\n for (var i = 0; i < splitAreas.length; i++) {\r\n group.add(mergePath$1(splitAreas[i], {\r\n style: defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n };\r\n function layoutAxis(polar, radiusAxisModel, axisAngle) {\r\n return {\r\n position: [polar.cx, polar.cy],\r\n rotation: axisAngle / 180 * Math.PI,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1,\r\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\r\n z2: 1\r\n };\r\n }\r\n AxisView.registerClass(RadiusAxisView);\n\n var PolarAxisPointer = (function (_super) {\r\n __extends(PolarAxisPointer, _super);\r\n function PolarAxisPointer() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\r\n var axis = axisModel.axis;\r\n if (axis.dim === 'angle') {\r\n this.animationThreshold = Math.PI / 18;\r\n }\r\n var polar = axis.polar;\r\n var otherAxis = polar.getOtherAxis(axis);\r\n var otherExtent = otherAxis.getExtent();\r\n var coordValue = axis.dataToCoord(value);\r\n var axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n var elStyle = buildElStyle(axisPointerModel);\r\n var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, polar, coordValue, otherExtent);\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n var labelMargin = axisPointerModel.get(['label', 'margin']);\r\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\r\n };\r\n return PolarAxisPointer;\r\n }(BaseAxisPointer));\r\n function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\r\n var axis = axisModel.axis;\r\n var coord = axis.dataToCoord(value);\r\n var axisAngle = polar.getAngleAxis().getExtent()[0];\r\n axisAngle = axisAngle / 180 * Math.PI;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var position;\r\n var align;\r\n var verticalAlign;\r\n if (axis.dim === 'radius') {\r\n var transform = create$1();\r\n rotate(transform, transform, axisAngle);\r\n translate(transform, transform, [polar.cx, polar.cy]);\r\n position = applyTransform$1([coord, -labelMargin], transform);\r\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\r\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\r\n align = labelLayout.textAlign;\r\n verticalAlign = labelLayout.textVerticalAlign;\r\n }\r\n else {\r\n var r = radiusExtent[1];\r\n position = polar.coordToPoint([r + labelMargin, coord]);\r\n var cx = polar.cx;\r\n var cy = polar.cy;\r\n align = Math.abs(position[0] - cx) / r < 0.3\r\n ? 'center' : (position[0] > cx ? 'left' : 'right');\r\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3\r\n ? 'middle' : (position[1] > cy ? 'top' : 'bottom');\r\n }\r\n return {\r\n position: position,\r\n align: align,\r\n verticalAlign: verticalAlign\r\n };\r\n }\r\n var pointerShapeBuilder$2 = {\r\n line: function (axis, polar, coordValue, otherExtent) {\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Line',\r\n shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\r\n }\r\n : {\r\n type: 'Circle',\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: coordValue\r\n }\r\n };\r\n },\r\n shadow: function (axis, polar, coordValue, otherExtent) {\r\n var bandWidth = Math.max(1, axis.getBandWidth());\r\n var radian = Math.PI / 180;\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\r\n }\r\n : {\r\n type: 'Sector',\r\n shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\r\n };\r\n }\r\n };\r\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n\n registerLayout(curry(barLayoutPolar, 'bar'));\r\n extendComponentView({\r\n type: 'polar'\r\n });\n\n var GeoView = (function (_super) {\r\n __extends(GeoView, _super);\r\n function GeoView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoView.type;\r\n return _this;\r\n }\r\n GeoView.prototype.init = function (ecModel, api) {\r\n var mapDraw = new MapDraw(api);\r\n this._mapDraw = mapDraw;\r\n this.group.add(mapDraw.group);\r\n this._api = api;\r\n };\r\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\r\n var mapDraw = this._mapDraw;\r\n if (geoModel.get('show')) {\r\n mapDraw.draw(geoModel, ecModel, api, this, payload);\r\n }\r\n else {\r\n this._mapDraw.group.removeAll();\r\n }\r\n mapDraw.group.on('click', this._handleRegionClick, this);\r\n mapDraw.group.silent = geoModel.get('silent');\r\n this._model = geoModel;\r\n this.updateSelectStatus(geoModel, ecModel, api);\r\n };\r\n GeoView.prototype._handleRegionClick = function (e) {\r\n var current = e.target;\r\n var eventData;\r\n while (current && (eventData = getECData(current).eventData) == null) {\r\n current = current.__hostTarget || current.parent;\r\n }\r\n if (eventData) {\r\n this._api.dispatchAction({\r\n type: 'geoToggleSelect',\r\n geoId: this._model.id,\r\n name: eventData.name\r\n });\r\n }\r\n };\r\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\r\n var _this = this;\r\n this._mapDraw.group.traverse(function (node) {\r\n var eventData = getECData(node).eventData;\r\n if (eventData) {\r\n _this._model.isSelected(eventData.name)\r\n ? api.enterSelect(node) : api.leaveSelect(node);\r\n return true;\r\n }\r\n });\r\n };\r\n GeoView.prototype.dispose = function () {\r\n this._mapDraw && this._mapDraw.remove();\r\n };\r\n GeoView.type = 'geo';\r\n return GeoView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GeoView);\n\n var GeoModel = (function (_super) {\r\n __extends(GeoModel, _super);\r\n function GeoModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GeoModel.type;\r\n return _this;\r\n }\r\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n defaultEmphasis(option, 'label', ['show']);\r\n };\r\n GeoModel.prototype.optionUpdated = function () {\r\n var option = this.option;\r\n var self = this;\r\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap);\r\n var selectedMap = {};\r\n this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) {\r\n var regionName = regionOpt.name;\r\n if (regionName) {\r\n optionModelMap.set(regionName, new Model(regionOpt, self));\r\n if (regionOpt.selected) {\r\n selectedMap[regionName] = true;\r\n }\r\n }\r\n return optionModelMap;\r\n }, createHashMap());\r\n if (!option.selectedMap) {\r\n option.selectedMap = selectedMap;\r\n }\r\n };\r\n GeoModel.prototype.getRegionModel = function (name) {\r\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\r\n };\r\n GeoModel.prototype.getFormattedLabel = function (name, status) {\r\n var regionModel = this.getRegionModel(name);\r\n var formatter = status === 'normal'\r\n ? regionModel.get(['label', 'formatter'])\r\n : regionModel.get(['emphasis', 'label', 'formatter']);\r\n var params = {\r\n name: name\r\n };\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n return formatter.replace('{a}', name != null ? name : '');\r\n }\r\n };\r\n GeoModel.prototype.setZoom = function (zoom) {\r\n this.option.zoom = zoom;\r\n };\r\n GeoModel.prototype.setCenter = function (center) {\r\n this.option.center = center;\r\n };\r\n GeoModel.prototype.select = function (name) {\r\n var option = this.option;\r\n var selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n if (selectedMode !== 'multiple') {\r\n option.selectedMap = null;\r\n }\r\n var selectedMap = option.selectedMap || (option.selectedMap = {});\r\n selectedMap[name] = true;\r\n };\r\n GeoModel.prototype.unSelect = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n if (selectedMap) {\r\n selectedMap[name] = false;\r\n }\r\n };\r\n GeoModel.prototype.toggleSelected = function (name) {\r\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\r\n };\r\n GeoModel.prototype.isSelected = function (name) {\r\n var selectedMap = this.option.selectedMap;\r\n return !!(selectedMap && selectedMap[name]);\r\n };\r\n GeoModel.prototype._initSelectedMapFromData = function () {\r\n };\r\n GeoModel.type = 'geo';\r\n GeoModel.layoutMode = 'box';\r\n GeoModel.defaultOption = {\r\n zlevel: 0,\r\n z: 0,\r\n show: true,\r\n left: 'center',\r\n top: 'center',\r\n aspectScale: null,\r\n silent: false,\r\n map: '',\r\n boundingCoords: null,\r\n center: null,\r\n zoom: 1,\r\n scaleLimit: null,\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n color: '#eee'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n regions: []\r\n };\r\n return GeoModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GeoModel);\n\n function makeAction(method, actionInfo) {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registerAction(actionInfo, function (payload, ecModel) {\r\n var selected = {};\r\n ecModel.eachComponent({ mainType: 'geo', query: payload }, function (geoModel) {\r\n geoModel[method](payload.name);\r\n var geo = geoModel.coordinateSystem;\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n });\r\n });\r\n return {\r\n selected: selected,\r\n name: payload.name\r\n };\r\n });\r\n }\r\n makeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n });\r\n makeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n });\r\n makeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n });\n\n var PROXIMATE_ONE_DAY = 86400000;\r\n var Calendar = (function () {\r\n function Calendar(calendarModel, ecModel, api) {\r\n this.type = 'calendar';\r\n this.dimensions = Calendar.dimensions;\r\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\r\n this._model = calendarModel;\r\n }\r\n Calendar.getDimensionsInfo = function () {\r\n return [{\r\n name: 'time', type: 'time'\r\n }, 'value'];\r\n };\r\n Calendar.prototype.getRangeInfo = function () {\r\n return this._rangeInfo;\r\n };\r\n Calendar.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n Calendar.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Calendar.prototype.getCellWidth = function () {\r\n return this._sw;\r\n };\r\n Calendar.prototype.getCellHeight = function () {\r\n return this._sh;\r\n };\r\n Calendar.prototype.getOrient = function () {\r\n return this._orient;\r\n };\r\n Calendar.prototype.getFirstDayOfWeek = function () {\r\n return this._firstDayOfWeek;\r\n };\r\n Calendar.prototype.getDateInfo = function (date) {\r\n date = parseDate(date);\r\n var y = date.getFullYear();\r\n var m = date.getMonth() + 1;\r\n var mStr = m < 10 ? '0' + m : '' + m;\r\n var d = date.getDate();\r\n var dStr = d < 10 ? '0' + d : '' + d;\r\n var day = date.getDay();\r\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\r\n return {\r\n y: y + '',\r\n m: mStr,\r\n d: dStr,\r\n day: day,\r\n time: date.getTime(),\r\n formatedDate: y + '-' + mStr + '-' + dStr,\r\n date: date\r\n };\r\n };\r\n Calendar.prototype.getNextNDay = function (date, n) {\r\n n = n || 0;\r\n if (n === 0) {\r\n return this.getDateInfo(date);\r\n }\r\n date = new Date(this.getDateInfo(date).time);\r\n date.setDate(date.getDate() + n);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.prototype.update = function (ecModel, api) {\r\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\r\n this._orient = this._model.get('orient');\r\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\r\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\r\n var weeks = this._rangeInfo.weeks || 1;\r\n var whNames = ['width', 'height'];\r\n var cellSize = this._model.getCellSize().slice();\r\n var layoutParams = this._model.getBoxLayoutParams();\r\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\r\n each([0, 1], function (idx) {\r\n if (cellSizeSpecified(cellSize, idx)) {\r\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\r\n }\r\n });\r\n var whGlobal = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);\r\n each([0, 1], function (idx) {\r\n if (!cellSizeSpecified(cellSize, idx)) {\r\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\r\n }\r\n });\r\n function cellSizeSpecified(cellSize, idx) {\r\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\r\n }\r\n this._sw = cellSize[0];\r\n this._sh = cellSize[1];\r\n };\r\n Calendar.prototype.dataToPoint = function (data, clamp) {\r\n isArray(data) && (data = data[0]);\r\n clamp == null && (clamp = true);\r\n var dayInfo = this.getDateInfo(data);\r\n var range = this._rangeInfo;\r\n var date = dayInfo.formatedDate;\r\n if (clamp && !(dayInfo.time >= range.start.time\r\n && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\r\n return [NaN, NaN];\r\n }\r\n var week = dayInfo.day;\r\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\r\n if (this._orient === 'vertical') {\r\n return [\r\n this._rect.x + week * this._sw + this._sw / 2,\r\n this._rect.y + nthWeek * this._sh + this._sh / 2\r\n ];\r\n }\r\n return [\r\n this._rect.x + nthWeek * this._sw + this._sw / 2,\r\n this._rect.y + week * this._sh + this._sh / 2\r\n ];\r\n };\r\n Calendar.prototype.pointToData = function (point) {\r\n var date = this.pointToDate(point);\r\n return date && date.time;\r\n };\r\n Calendar.prototype.dataToRect = function (data, clamp) {\r\n var point = this.dataToPoint(data, clamp);\r\n return {\r\n contentShape: {\r\n x: point[0] - (this._sw - this._lineWidth) / 2,\r\n y: point[1] - (this._sh - this._lineWidth) / 2,\r\n width: this._sw - this._lineWidth,\r\n height: this._sh - this._lineWidth\r\n },\r\n center: point,\r\n tl: [\r\n point[0] - this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n tr: [\r\n point[0] + this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n br: [\r\n point[0] + this._sw / 2,\r\n point[1] + this._sh / 2\r\n ],\r\n bl: [\r\n point[0] - this._sw / 2,\r\n point[1] + this._sh / 2\r\n ]\r\n };\r\n };\r\n Calendar.prototype.pointToDate = function (point) {\r\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\r\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\r\n var range = this._rangeInfo.range;\r\n if (this._orient === 'vertical') {\r\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\r\n }\r\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\r\n };\r\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys$4(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n Calendar.prototype.containPoint = function (point) {\r\n console.warn('Not implemented.');\r\n return false;\r\n };\r\n Calendar.prototype._initRangeOption = function () {\r\n var range = this._model.get('range');\r\n var normalizedRange;\r\n if (isArray(range) && range.length === 1) {\r\n range = range[0];\r\n }\r\n if (!isArray(range)) {\r\n var rangeStr = range.toString();\r\n if (/^\\d{4}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n var start = this.getDateInfo(rangeStr);\r\n var firstDay = start.date;\r\n firstDay.setMonth(firstDay.getMonth() + 1);\r\n var end = this.getNextNDay(firstDay, -1);\r\n normalizedRange = [start.formatedDate, end.formatedDate];\r\n }\r\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr, rangeStr];\r\n }\r\n }\r\n else {\r\n normalizedRange = range;\r\n }\r\n if (!normalizedRange) {\r\n if (__DEV__) {\r\n logError('Invalid date range.');\r\n }\r\n return range;\r\n }\r\n var tmp = this._getRangeInfo(normalizedRange);\r\n if (tmp.start.time > tmp.end.time) {\r\n normalizedRange.reverse();\r\n }\r\n return normalizedRange;\r\n };\r\n Calendar.prototype._getRangeInfo = function (range) {\r\n var parsedRange = [\r\n this.getDateInfo(range[0]),\r\n this.getDateInfo(range[1])\r\n ];\r\n var reversed;\r\n if (parsedRange[0].time > parsedRange[1].time) {\r\n reversed = true;\r\n parsedRange.reverse();\r\n }\r\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY)\r\n - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\r\n var date = new Date(parsedRange[0].time);\r\n var startDateNum = date.getDate();\r\n var endDateNum = parsedRange[1].date.getDate();\r\n date.setDate(startDateNum + allDay - 1);\r\n var dateNum = date.getDate();\r\n if (dateNum !== endDateNum) {\r\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\r\n while ((dateNum = date.getDate()) !== endDateNum\r\n && (date.getTime() - parsedRange[1].time) * sign > 0) {\r\n allDay -= sign;\r\n date.setDate(dateNum - sign);\r\n }\r\n }\r\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\r\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\r\n reversed && parsedRange.reverse();\r\n return {\r\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\r\n start: parsedRange[0],\r\n end: parsedRange[1],\r\n allDay: allDay,\r\n weeks: weeks,\r\n nthWeek: nthWeek,\r\n fweek: parsedRange[0].day,\r\n lweek: parsedRange[1].day\r\n };\r\n };\r\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\r\n var rangeInfo = this._getRangeInfo(range);\r\n if (nthWeek > rangeInfo.weeks\r\n || (nthWeek === 0 && day < rangeInfo.fweek)\r\n || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)) {\r\n return null;\r\n }\r\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\r\n var date = new Date(rangeInfo.start.time);\r\n date.setDate(+rangeInfo.start.d + nthDay);\r\n return this.getDateInfo(date);\r\n };\r\n Calendar.create = function (ecModel, api) {\r\n var calendarList = [];\r\n ecModel.eachComponent('calendar', function (calendarModel) {\r\n var calendar = new Calendar(calendarModel, ecModel, api);\r\n calendarList.push(calendar);\r\n calendarModel.coordinateSystem = calendar;\r\n });\r\n ecModel.eachSeries(function (calendarSeries) {\r\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\r\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\r\n }\r\n });\r\n return calendarList;\r\n };\r\n Calendar.dimensions = ['time', 'value'];\r\n return Calendar;\r\n }());\r\n function getCoordSys$4(finder) {\r\n var calendarModel = finder.calendarModel;\r\n var seriesModel = finder.seriesModel;\r\n var coordSys = calendarModel\r\n ? calendarModel.coordinateSystem\r\n : seriesModel\r\n ? seriesModel.coordinateSystem\r\n : null;\r\n return coordSys;\r\n }\r\n CoordinateSystemManager.register('calendar', Calendar);\n\n var CalendarModel = (function (_super) {\r\n __extends(CalendarModel, _super);\r\n function CalendarModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarModel.type;\r\n return _this;\r\n }\r\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\r\n };\r\n CalendarModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n mergeAndNormalizeLayoutParams(this.option, option);\r\n };\r\n CalendarModel.prototype.getCellSize = function () {\r\n return this.option.cellSize;\r\n };\r\n CalendarModel.type = 'calendar';\r\n CalendarModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n left: 80,\r\n top: 60,\r\n cellSize: 20,\r\n orient: 'horizontal',\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: '#000',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n },\r\n dayLabel: {\r\n show: true,\r\n firstDay: 0,\r\n position: 'start',\r\n margin: '50%',\r\n nameMap: 'en',\r\n color: '#000'\r\n },\r\n monthLabel: {\r\n show: true,\r\n position: 'start',\r\n margin: 5,\r\n align: 'center',\r\n nameMap: 'en',\r\n formatter: null,\r\n color: '#000'\r\n },\r\n yearLabel: {\r\n show: true,\r\n position: null,\r\n margin: 30,\r\n formatter: null,\r\n color: '#ccc',\r\n fontFamily: 'sans-serif',\r\n fontWeight: 'bolder',\r\n fontSize: 20\r\n }\r\n };\r\n return CalendarModel;\r\n }(ComponentModel));\r\n function mergeAndNormalizeLayoutParams(target, raw) {\r\n var cellSize = target.cellSize;\r\n var cellSizeArr;\r\n if (!isArray(cellSize)) {\r\n cellSizeArr = target.cellSize = [cellSize, cellSize];\r\n }\r\n else {\r\n cellSizeArr = cellSize;\r\n }\r\n if (cellSizeArr.length === 1) {\r\n cellSizeArr[1] = cellSizeArr[0];\r\n }\r\n var ignoreSize = map([0, 1], function (hvIdx) {\r\n if (sizeCalculable(raw, hvIdx)) {\r\n cellSizeArr[hvIdx] = 'auto';\r\n }\r\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\r\n });\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(CalendarModel);\n\n var MONTH_TEXT = {\r\n EN: [\r\n 'Jan', 'Feb', 'Mar',\r\n 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep',\r\n 'Oct', 'Nov', 'Dec'\r\n ],\r\n CN: [\r\n '一月', '二月', '三月',\r\n '四月', '五月', '六月',\r\n '七月', '八月', '九月',\r\n '十月', '十一月', '十二月'\r\n ]\r\n };\r\n var WEEK_TEXT = {\r\n EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n CN: ['日', '一', '二', '三', '四', '五', '六']\r\n };\r\n var CalendarView = (function (_super) {\r\n __extends(CalendarView, _super);\r\n function CalendarView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CalendarView.type;\r\n return _this;\r\n }\r\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\r\n var group = this.group;\r\n group.removeAll();\r\n var coordSys = calendarModel.coordinateSystem;\r\n var rangeData = coordSys.getRangeInfo();\r\n var orient = coordSys.getOrient();\r\n this._renderDayRect(calendarModel, rangeData, group);\r\n this._renderLines(calendarModel, rangeData, orient, group);\r\n this._renderYearText(calendarModel, rangeData, orient, group);\r\n this._renderMonthText(calendarModel, orient, group);\r\n this._renderWeekText(calendarModel, rangeData, orient, group);\r\n };\r\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\r\n var sw = coordSys.getCellWidth();\r\n var sh = coordSys.getCellHeight();\r\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\r\n var point = coordSys.dataToRect([i], false).tl;\r\n var rect = new Rect({\r\n shape: {\r\n x: point[0],\r\n y: point[1],\r\n width: sw,\r\n height: sh\r\n },\r\n cursor: 'default',\r\n style: itemRectStyleModel\r\n });\r\n group.add(rect);\r\n }\r\n };\r\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\r\n var self = this;\r\n var coordSys = calendarModel.coordinateSystem;\r\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\r\n var show = calendarModel.get(['splitLine', 'show']);\r\n var lineWidth = lineStyleModel.lineWidth;\r\n this._tlpoints = [];\r\n this._blpoints = [];\r\n this._firstDayOfMonth = [];\r\n this._firstDayPoints = [];\r\n var firstDay = rangeData.start;\r\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\r\n addPoints(firstDay.formatedDate);\r\n if (i === 0) {\r\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\r\n }\r\n var date = firstDay.date;\r\n date.setMonth(date.getMonth() + 1);\r\n firstDay = coordSys.getDateInfo(date);\r\n }\r\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\r\n function addPoints(date) {\r\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\r\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\r\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\r\n self._tlpoints.push(points[0]);\r\n self._blpoints.push(points[points.length - 1]);\r\n show && self._drawSplitline(points, lineStyleModel, group);\r\n }\r\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\r\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\r\n };\r\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\r\n var rs = [points[0].slice(), points[points.length - 1].slice()];\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\r\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\r\n return rs;\r\n };\r\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\r\n var poyline = new Polyline({\r\n z2: 20,\r\n shape: {\r\n points: points\r\n },\r\n style: lineStyle\r\n });\r\n group.add(poyline);\r\n };\r\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\r\n var coordSys = calendarModel.coordinateSystem;\r\n var parsedDate = coordSys.getDateInfo(date);\r\n var points = [];\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\r\n var point = coordSys.dataToRect([tmpD.time], false);\r\n points[2 * tmpD.day] = point.tl;\r\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\r\n }\r\n return points;\r\n };\r\n CalendarView.prototype._formatterLabel = function (formatter, params) {\r\n if (typeof formatter === 'string' && formatter) {\r\n return formatTplSimple(formatter, params);\r\n }\r\n if (typeof formatter === 'function') {\r\n return formatter(params);\r\n }\r\n return params.nameMap;\r\n };\r\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\r\n var x = point[0];\r\n var y = point[1];\r\n var aligns = ['center', 'bottom'];\r\n if (position === 'bottom') {\r\n y += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else if (position === 'left') {\r\n x -= margin;\r\n }\r\n else if (position === 'right') {\r\n x += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else {\r\n y -= margin;\r\n }\r\n var rotate = 0;\r\n if (position === 'left' || position === 'right') {\r\n rotate = Math.PI / 2;\r\n }\r\n return {\r\n rotation: rotate,\r\n x: x,\r\n y: y,\r\n style: {\r\n align: aligns[0],\r\n verticalAlign: aligns[1]\r\n }\r\n };\r\n };\r\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\r\n var yearLabel = calendarModel.getModel('yearLabel');\r\n if (!yearLabel.get('show')) {\r\n return;\r\n }\r\n var margin = yearLabel.get('margin');\r\n var pos = yearLabel.get('position');\r\n if (!pos) {\r\n pos = orient !== 'horizontal' ? 'top' : 'left';\r\n }\r\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\r\n var xc = (points[0][0] + points[1][0]) / 2;\r\n var yc = (points[0][1] + points[1][1]) / 2;\r\n var idx = orient === 'horizontal' ? 0 : 1;\r\n var posPoints = {\r\n top: [xc, points[idx][1]],\r\n bottom: [xc, points[1 - idx][1]],\r\n left: [points[1 - idx][0], yc],\r\n right: [points[idx][0], yc]\r\n };\r\n var name = rangeData.start.y;\r\n if (+rangeData.end.y > +rangeData.start.y) {\r\n name = name + '-' + rangeData.end.y;\r\n }\r\n var formatter = yearLabel.get('formatter');\r\n var params = {\r\n start: rangeData.start.y,\r\n end: rangeData.end.y,\r\n nameMap: name\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var yearText = new ZRText({\r\n z2: 30,\r\n style: createTextStyle(yearLabel, {\r\n text: content\r\n })\r\n });\r\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\r\n group.add(yearText);\r\n };\r\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\r\n var align = 'left';\r\n var vAlign = 'top';\r\n var x = point[0];\r\n var y = point[1];\r\n if (orient === 'horizontal') {\r\n y = y + margin;\r\n if (isCenter) {\r\n align = 'center';\r\n }\r\n if (position === 'start') {\r\n vAlign = 'bottom';\r\n }\r\n }\r\n else {\r\n x = x + margin;\r\n if (isCenter) {\r\n vAlign = 'middle';\r\n }\r\n if (position === 'start') {\r\n align = 'right';\r\n }\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderMonthText = function (calendarModel, orient, group) {\r\n var monthLabel = calendarModel.getModel('monthLabel');\r\n if (!monthLabel.get('show')) {\r\n return;\r\n }\r\n var nameMap = monthLabel.get('nameMap');\r\n var margin = monthLabel.get('margin');\r\n var pos = monthLabel.get('position');\r\n var align = monthLabel.get('align');\r\n var termPoints = [this._tlpoints, this._blpoints];\r\n if (isString(nameMap)) {\r\n nameMap = MONTH_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var idx = pos === 'start' ? 0 : 1;\r\n var axis = orient === 'horizontal' ? 0 : 1;\r\n margin = pos === 'start' ? -margin : margin;\r\n var isCenter = (align === 'center');\r\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\r\n var tmp = termPoints[idx][i].slice();\r\n var firstDay = this._firstDayOfMonth[i];\r\n if (isCenter) {\r\n var firstDayPoints = this._firstDayPoints[i];\r\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\r\n }\r\n var formatter = monthLabel.get('formatter');\r\n var name_1 = nameMap[+firstDay.m - 1];\r\n var params = {\r\n yyyy: firstDay.y,\r\n yy: (firstDay.y + '').slice(2),\r\n MM: firstDay.m,\r\n M: +firstDay.m,\r\n nameMap: name_1\r\n };\r\n var content = this._formatterLabel(formatter, params);\r\n var monthText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(monthLabel, { text: content }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\r\n });\r\n group.add(monthText);\r\n }\r\n };\r\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\r\n var align = 'center';\r\n var vAlign = 'middle';\r\n var x = point[0];\r\n var y = point[1];\r\n var isStart = position === 'start';\r\n if (orient === 'horizontal') {\r\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\r\n align = isStart ? 'right' : 'left';\r\n }\r\n else {\r\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\r\n vAlign = isStart ? 'bottom' : 'top';\r\n }\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n };\r\n CalendarView.prototype._renderWeekText = function (calendarModel, rangeData, orient, group) {\r\n var dayLabel = calendarModel.getModel('dayLabel');\r\n if (!dayLabel.get('show')) {\r\n return;\r\n }\r\n var coordSys = calendarModel.coordinateSystem;\r\n var pos = dayLabel.get('position');\r\n var nameMap = dayLabel.get('nameMap');\r\n var margin = dayLabel.get('margin');\r\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\r\n if (isString(nameMap)) {\r\n nameMap = WEEK_TEXT[nameMap.toUpperCase()] || [];\r\n }\r\n var start = coordSys.getNextNDay(rangeData.end.time, (7 - rangeData.lweek)).time;\r\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\r\n margin = parsePercent$2(margin, cellSize[orient === 'horizontal' ? 0 : 1]);\r\n if (pos === 'start') {\r\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\r\n margin = -margin;\r\n }\r\n for (var i = 0; i < 7; i++) {\r\n var tmpD = coordSys.getNextNDay(start, i);\r\n var point = coordSys.dataToRect([tmpD.time], false).center;\r\n var day = i;\r\n day = Math.abs((i + firstDayOfWeek) % 7);\r\n var weekText = new ZRText({\r\n z2: 30,\r\n style: extend(createTextStyle(dayLabel, { text: nameMap[day] }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\r\n });\r\n group.add(weekText);\r\n }\r\n };\r\n CalendarView.type = 'calendar';\r\n return CalendarView;\r\n }(ComponentView));\r\n ComponentView.registerClass(CalendarView);\n\n var inner$g = makeInner();\r\n var _nonShapeGraphicElements = {\r\n path: null,\r\n compoundPath: null,\r\n group: Group,\r\n image: ZRImage,\r\n text: ZRText\r\n };\r\n registerPreprocessor(function (option) {\r\n var graphicOption = option.graphic;\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n option.graphic = [option.graphic[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n });\r\n var GraphicComponentModel = (function (_super) {\r\n __extends(GraphicComponentModel, _super);\r\n function GraphicComponentModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentModel.type;\r\n return _this;\r\n }\r\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n var elements = this.option.elements;\r\n this.option.elements = null;\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this.option.elements = elements;\r\n };\r\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var newList = (isInit ? thisOption : newOption).elements;\r\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n var flattenedList = [];\r\n this._flatten(newList, flattenedList, null);\r\n var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge');\r\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\r\n each(mappingResult, function (resultItem, index) {\r\n var newElOption = resultItem.newOption;\r\n if (__DEV__) {\r\n assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\r\n }\r\n if (!newElOption) {\r\n return;\r\n }\r\n elOptionsToUpdate.push(newElOption);\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n }, this);\r\n for (var i = existList.length - 1; i >= 0; i--) {\r\n if (existList[i] == null) {\r\n existList.splice(i, 1);\r\n }\r\n else {\r\n delete existList[i].$action;\r\n }\r\n }\r\n };\r\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\r\n each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n result.push(option);\r\n var children = option.children;\r\n if (option.type === 'group' && children) {\r\n this._flatten(children, result, option);\r\n }\r\n delete option.children;\r\n }, this);\r\n };\r\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\r\n var els = this._elOptionsToUpdate;\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n };\r\n GraphicComponentModel.type = 'graphic';\r\n GraphicComponentModel.defaultOption = {\r\n elements: []\r\n };\r\n return GraphicComponentModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(GraphicComponentModel);\r\n var GraphicComponentView = (function (_super) {\r\n __extends(GraphicComponentView, _super);\r\n function GraphicComponentView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = GraphicComponentView.type;\r\n return _this;\r\n }\r\n GraphicComponentView.prototype.init = function () {\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n };\r\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\r\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n var elMap = this._elMap;\r\n var rootGroup = this.group;\r\n each(elOptionsToUpdate, function (elOption) {\r\n var id = convertOptionIdName(elOption.id, null);\r\n var elExisting = id != null ? elMap.get(id) : null;\r\n var parentId = convertOptionIdName(elOption.parentId, null);\r\n var targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup);\r\n var elType = elOption.type;\r\n var elOptionStyle = elOption.style;\r\n if (elType === 'text' && elOptionStyle) {\r\n if (elOption.hv && elOption.hv[1]) {\r\n elOptionStyle.textVerticalAlign =\r\n elOptionStyle.textBaseline =\r\n elOptionStyle.verticalAlign =\r\n elOptionStyle.align = null;\r\n }\r\n }\r\n var textContentOption = elOption.textContent;\r\n var textConfig = elOption.textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = elOption.textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n var elOptionCleaned = getCleanedElOption(elOption);\r\n if (__DEV__) {\r\n elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\r\n }\r\n var $action = elOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n elExisting\r\n ? elExisting.attr(elOptionCleaned)\r\n : createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'replace') {\r\n removeEl(elExisting, elMap);\r\n createEl$1(id, targetElParent, elOptionCleaned, elMap);\r\n }\r\n else if ($action === 'remove') {\r\n removeEl(elExisting, elMap);\r\n }\r\n var el = elMap.get(id);\r\n if (el && textContentOption) {\r\n if ($action === 'merge') {\r\n var textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new ZRText(textContentOption));\r\n }\r\n else if ($action === 'replace') {\r\n el.setTextContent(new ZRText(textContentOption));\r\n }\r\n }\r\n if (el) {\r\n var elInner = inner$g(el);\r\n elInner.__ecGraphicWidthOption = elOption.width;\r\n elInner.__ecGraphicHeightOption = elOption.height;\r\n setEventData(el, graphicModel, elOption);\r\n }\r\n });\r\n };\r\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\r\n var elOptions = graphicModel.option.elements;\r\n var rootGroup = this.group;\r\n var elMap = this._elMap;\r\n var apiWidth = api.getWidth();\r\n var apiHeight = api.getHeight();\r\n for (var i = 0; i < elOptions.length; i++) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var isParentRoot = parentEl === rootGroup;\r\n var elInner = inner$g(el);\r\n var parentElInner = inner$g(parentEl);\r\n elInner.__ecGraphicWidth = parsePercent$2(elInner.__ecGraphicWidthOption, isParentRoot ? apiWidth : parentElInner.__ecGraphicWidth) || 0;\r\n elInner.__ecGraphicHeight = parsePercent$2(elInner.__ecGraphicHeightOption, isParentRoot ? apiHeight : parentElInner.__ecGraphicHeight) || 0;\r\n }\r\n for (var i = elOptions.length - 1; i >= 0; i--) {\r\n var elOption = elOptions[i];\r\n var id = convertOptionIdName(elOption.id, null);\r\n var el = id != null ? elMap.get(id) : null;\r\n if (!el) {\r\n continue;\r\n }\r\n var parentEl = el.parent;\r\n var parentElInner = inner$g(parentEl);\r\n var containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.__ecGraphicWidth,\r\n height: parentElInner.__ecGraphicHeight\r\n };\r\n positionElement(el, elOption, containerInfo, null, { hv: elOption.hv, boundingMode: elOption.bounding });\r\n }\r\n };\r\n GraphicComponentView.prototype._clear = function () {\r\n var elMap = this._elMap;\r\n elMap.each(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n this._elMap = createHashMap();\r\n };\r\n GraphicComponentView.prototype.dispose = function () {\r\n this._clear();\r\n };\r\n GraphicComponentView.type = 'graphic';\r\n return GraphicComponentView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GraphicComponentView);\r\n function createEl$1(id, targetElParent, elOption, elMap) {\r\n var graphicType = elOption.type;\r\n if (__DEV__) {\r\n assert(graphicType, 'graphic type MUST be set');\r\n }\r\n var Clz = (hasOwn(_nonShapeGraphicElements, graphicType)\r\n ? _nonShapeGraphicElements[graphicType]\r\n : getShapeClass(graphicType));\r\n if (__DEV__) {\r\n assert(Clz, 'graphic type can not be found');\r\n }\r\n var el = new Clz(elOption);\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner$g(el).__ecGraphicId = id;\r\n }\r\n function removeEl(elExisting, elMap) {\r\n var existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elMap);\r\n });\r\n elMap.removeKey(inner$g(elExisting).__ecGraphicId);\r\n existElParent.remove(elExisting);\r\n }\r\n }\r\n function getCleanedElOption(elOption) {\r\n elOption = extend({}, elOption);\r\n each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent'].concat(LOCATION_PARAMS), function (name) {\r\n delete elOption[name];\r\n });\r\n return elOption;\r\n }\r\n function isSetLoc(obj, props) {\r\n var isSet;\r\n each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n }\r\n function setKeyInfoToNewElOption(resultItem, newElOption) {\r\n var existElOption = resultItem.existing;\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n if (newElOption.parentId == null) {\r\n var newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n newElOption.parentOption = null;\r\n }\r\n function mergeNewElOptionToExist(existList, index, newElOption) {\r\n var newElOptCopy = extend({}, newElOption);\r\n var existElOption = existList[index];\r\n var $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n var newType = newElOption.type;\r\n assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\r\n }\r\n merge(existElOption, newElOptCopy, true);\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n copyLayoutParams(newElOption, existElOption);\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n existElOption && (existList[index] = null);\r\n }\r\n }\r\n function setLayoutInfoToExist(existItem, newElOption) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n isSetLoc(newElOption, ['left', 'right']),\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n if (existItem.type === 'group') {\r\n var existingGroupOpt = existItem;\r\n var newGroupOpt = newElOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n }\r\n function setEventData(el, graphicModel, elOption) {\r\n var eventData = getECData(el).eventData;\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n }\n\n var ToolboxFeature = (function () {\r\n function ToolboxFeature() {\r\n }\r\n return ToolboxFeature;\r\n }());\r\n var features = {};\r\n function registerFeature(name, ctor) {\r\n features[name] = ctor;\r\n }\r\n function getFeature(name) {\r\n return features[name];\r\n }\n\n var ToolboxModel = (function (_super) {\r\n __extends(ToolboxModel, _super);\r\n function ToolboxModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ToolboxModel.type;\r\n return _this;\r\n }\r\n ToolboxModel.prototype.optionUpdated = function () {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n var ecModel = this.ecModel;\r\n each(this.option.feature, function (featureOpt, featureName) {\r\n var Feature = getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n };\r\n ToolboxModel.type = 'toolbox';\r\n ToolboxModel.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n ToolboxModel.defaultOption = {\r\n show: true,\r\n z: 6,\r\n zlevel: 0,\r\n orient: 'horizontal',\r\n left: 'right',\r\n top: 'top',\r\n backgroundColor: 'transparent',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemSize: 15,\r\n itemGap: 8,\r\n showTitle: true,\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return ToolboxModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(ToolboxModel);\n\n function layout$3(group, componentModel, api) {\r\n var boxLayoutParams = componentModel.getBoxLayoutParams();\r\n var padding = componentModel.get('padding');\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\r\n box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\r\n positionElement(group, boxLayoutParams, viewportSize, padding);\r\n }\r\n function makeBackground(rect, componentModel) {\r\n var padding = normalizeCssArray$1(componentModel.get('padding'));\r\n var style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n return rect;\r\n }\n\n var ToolboxView = (function (_super) {\r\n __extends(ToolboxView, _super);\r\n function ToolboxView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\r\n var group = this.group;\r\n group.removeAll();\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n var itemSize = +toolboxModel.get('itemSize');\r\n var featureOpts = toolboxModel.get('feature') || {};\r\n var features = this._features || (this._features = {});\r\n var featureNames = [];\r\n each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(curry(processFeature, null))\r\n .execute();\r\n this._featureNames = featureNames;\r\n function processFeature(newIndex, oldIndex) {\r\n var featureName = featureNames[newIndex];\r\n var oldName = featureNames[oldIndex];\r\n var featureOpt = featureOpts[featureName];\r\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\r\n var feature;\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n if (featureName && !oldName) {\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n };\r\n }\r\n else {\r\n var Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n if (feature instanceof ToolboxFeature) {\r\n if (!featureName && oldName) {\r\n feature.dispose && feature.dispose(ecModel, api);\r\n return;\r\n }\r\n if (!featureModel.get('show') || feature.unusable) {\r\n feature.remove && feature.remove(ecModel, api);\r\n return;\r\n }\r\n }\r\n createIconPaths(featureModel, feature, featureName);\r\n featureModel.setIconStatus = function (iconName, status) {\r\n var option = this.option;\r\n var iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n function createIconPaths(featureModel, feature, featureName) {\r\n var iconStyleModel = featureModel.getModel('iconStyle');\r\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n var icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n var titles = featureModel.get('title') || {};\r\n var iconsMap;\r\n var titlesMap;\r\n if (typeof icons === 'string') {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (typeof titles === 'string') {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n var iconPaths = featureModel.iconPaths = {};\r\n each(iconsMap, function (iconStr, iconName) {\r\n var path = createIcon(iconStr, {}, {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n });\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n var pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n var textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n var tooltipModel = toolboxModel.getModel('tooltip');\r\n if (tooltipModel && tooltipModel.get('show')) {\r\n path.tooltip = extend({\r\n content: titlesMap[iconName],\r\n formatter: tooltipModel.get('formatter', true)\r\n || function () {\r\n return titlesMap[iconName];\r\n },\r\n formatterParams: {\r\n componentType: 'toolbox',\r\n name: iconName,\r\n title: titlesMap[iconName],\r\n $vars: ['name', 'title']\r\n },\r\n position: tooltipModel.get('position', true) || 'bottom'\r\n }, tooltipModel.option);\r\n }\r\n path.__title = titlesMap[iconName];\r\n path.on('mouseover', function () {\r\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n var defaultTextPosition = toolboxModel.get('orient') === 'vertical'\r\n ? (toolboxModel.get('right') == null ? 'right' : 'left')\r\n : (toolboxModel.get('bottom') == null ? 'bottom' : 'top');\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000'),\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n group.add(path);\r\n path.on('click', bind(feature.onclick, feature, ecModel, api, iconName));\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n layout$3(group, toolboxModel, api);\r\n group.add(makeBackground(group.getBoundingRect(), toolboxModel));\r\n group.eachChild(function (icon) {\r\n var titleText = icon.__title;\r\n var emphasisState = icon.ensureState('emphasis');\r\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n var textContent = icon.getTextContent();\r\n var emphasisTextState = textContent && textContent.states.emphasis;\r\n if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {\r\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\r\n var offsetX = icon.x + group.x;\r\n var offsetY = icon.y + group.y + itemSize;\r\n var needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n };\r\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n };\r\n ToolboxView.prototype.remove = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n };\r\n ToolboxView.prototype.dispose = function (ecModel, api) {\r\n each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n };\r\n ToolboxView.type = 'toolbox';\r\n return ToolboxView;\r\n }(ComponentView));\r\n ComponentView.registerClass(ToolboxView);\r\n function isUserFeatureName(featureName) {\r\n return featureName.indexOf('my') === 0;\r\n }\n\n var SaveAsImage = (function (_super) {\r\n __extends(SaveAsImage, _super);\r\n function SaveAsImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SaveAsImage.prototype.onclick = function (ecModel, api) {\r\n var model = this.model;\r\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n var isSvg = api.getZr().painter.getType() === 'svg';\r\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n var url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n if (typeof MouseEvent === 'function' && !env.browser.ie && !env.browser.edge) {\r\n var $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n var evt = new MouseEvent('click', {\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n else {\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n var bstr = atob(url.split(',')[1]);\r\n var n = bstr.length;\r\n var u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n var blob = new Blob([u8arr]);\r\n window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);\r\n }\r\n else {\r\n var lang = model.get('lang');\r\n var html = ''\r\n + ''\r\n + ''\r\n + '';\r\n var tab = window.open();\r\n tab.document.write(html);\r\n }\r\n }\r\n };\r\n SaveAsImage.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocale(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n pixelRatio: 1,\r\n lang: ecModel.getLocale(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n return defaultOption;\r\n };\r\n return SaveAsImage;\r\n }(ToolboxFeature));\r\n SaveAsImage.prototype.unusable = !env.canvasSupported;\r\n registerFeature('saveAsImage', SaveAsImage);\n\n var INNER_STACK_KEYWORD = '__ec_magicType_stack__';\r\n var radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n ];\r\n var MagicType = (function (_super) {\r\n __extends(MagicType, _super);\r\n function MagicType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MagicType.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon');\r\n var icons = {};\r\n each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n MagicType.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: [],\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n return defaultOption;\r\n };\r\n MagicType.prototype.onclick = function (ecModel, api, type) {\r\n var model = this.model;\r\n var seriesIndex = model.get(['seriesIndex', type]);\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n var newOption = {\r\n series: []\r\n };\r\n var generateNewSeriesTypes = function (seriesModel) {\r\n var seriesType = seriesModel.subType;\r\n var seriesId = seriesModel.id;\r\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\r\n if (newSeriesOpt) {\r\n defaults(newSeriesOpt, seriesModel.option);\r\n newOption.series.push(newSeriesOpt);\r\n }\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n var axisDim = categoryAxis.dim;\r\n var axisType = axisDim + 'Axis';\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n var axisIndex = axisModel.componentIndex;\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (var i = 0; i <= axisIndex; i++) {\r\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\r\n }\r\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n each(radioTypes, function (radio) {\r\n if (indexOf(radio, type) >= 0) {\r\n each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n model.setIconStatus(type, 'emphasis');\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes);\r\n var newTitle;\r\n if (type === 'stack') {\r\n newTitle = merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n }\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: type,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n };\r\n return MagicType;\r\n }(ToolboxFeature));\r\n var seriesOptGenreator = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return merge({\r\n id: seriesId,\r\n type: 'line',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return merge({\r\n id: seriesId,\r\n type: 'bar',\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n };\r\n registerAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n });\r\n registerFeature('magicType', MagicType);\n\n var BLOCK_SPLITER = new Array(60).join('-');\r\n var ITEM_SPLITER = '\\t';\r\n function groupSeries(ecModel) {\r\n var seriesGroupByCategoryAxis = {};\r\n var otherSeries = [];\r\n var meta = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n }\r\n function assembleSeriesWithCategoryAxis(groups) {\r\n var tables = [];\r\n each(groups, function (group, key) {\r\n var categoryAxis = group.categoryAxis;\r\n var valueAxis = group.valueAxis;\r\n var valueAxisDim = valueAxis.dim;\r\n var headers = [' '].concat(map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n var columns = [categoryAxis.model.getCategories()];\r\n each(group.series, function (series) {\r\n var rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n var lines = [headers.join(ITEM_SPLITER)];\r\n for (var i = 0; i < columns[0].length; i++) {\r\n var items = [];\r\n for (var j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function assembleOtherSeries(series) {\r\n return map(series, function (series) {\r\n var data = series.getRawData();\r\n var lines = [series.name];\r\n var vals = [];\r\n data.each(data.dimensions, function () {\r\n var argLen = arguments.length;\r\n var dataIndex = arguments[argLen - 1];\r\n var name = data.getName(dataIndex);\r\n for (var i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n }\r\n function getContentFromModel(ecModel) {\r\n var result = groupSeries(ecModel);\r\n return {\r\n value: filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n meta: result.meta\r\n };\r\n }\r\n function trim$1(str) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n }\r\n function isTSVFormat(block) {\r\n var firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n }\r\n var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\n function parseTSVContents(tsv) {\r\n var tsvLines = tsv.split(/\\n+/g);\r\n var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);\r\n var categories = [];\r\n var series = map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (var i = 0; i < tsvLines.length; i++) {\r\n var items = trim$1(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (var j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n }\r\n function parseListContents(str) {\r\n var lines = str.split(/\\n+/g);\r\n var seriesName = trim$1(lines.shift());\r\n var data = [];\r\n for (var i = 0; i < lines.length; i++) {\r\n var line = trim$1(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n var items = line.split(itemSplitRegex);\r\n var name_1 = '';\r\n var value = void 0;\r\n var hasName = false;\r\n if (isNaN(items[0])) {\r\n hasName = true;\r\n name_1 = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name_1,\r\n value: []\r\n };\r\n value = data[i].value;\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (var j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? (data[i].value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n }\r\n function parseContents(str, blockMetaList) {\r\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n var newOption = {\r\n series: []\r\n };\r\n each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n var result = parseTSVContents(block);\r\n var blockMeta = blockMetaList[idx];\r\n var axisKey = blockMeta.axisDim + 'Axis';\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n newOption[axisKey][blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = newOption.series.concat(result.series);\r\n }\r\n }\r\n else {\r\n var result = parseListContents(block);\r\n newOption.series.push(result);\r\n }\r\n });\r\n return newOption;\r\n }\r\n var DataView = (function (_super) {\r\n __extends(DataView, _super);\r\n function DataView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataView.prototype.onclick = function (ecModel, api) {\r\n var container = api.getDom();\r\n var model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n var root = document.createElement('div');\r\n root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n var header = document.createElement('h4');\r\n var lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin: 10px 20px;';\r\n header.style.color = model.get('textColor');\r\n var viewMain = document.createElement('div');\r\n var textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'display:block;width:100%;overflow:auto;';\r\n var optionToContent = model.get('optionToContent');\r\n var contentToOption = model.get('contentToOption');\r\n var result = getContentFromModel(ecModel);\r\n if (typeof optionToContent === 'function') {\r\n var htmlOrDom = optionToContent(api.getOption());\r\n if (typeof htmlOrDom === 'string') {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n viewMain.appendChild(textarea);\r\n textarea.readOnly = model.get('readOnly');\r\n textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';\r\n textarea.style.color = model.get('textColor');\r\n textarea.style.borderColor = model.get('textareaBorderColor');\r\n textarea.style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n }\r\n var blockMetaList = result.meta;\r\n var buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';\r\n var buttonStyle = 'float:right;margin-right:20px;border:none;'\r\n + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n var closeButton = document.createElement('div');\r\n var refreshButton = document.createElement('div');\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n var self = this;\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\r\n }\r\n close();\r\n return;\r\n }\r\n var newOption;\r\n try {\r\n if (typeof contentToOption === 'function') {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n close();\r\n });\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText = buttonStyle;\r\n closeButton.style.cssText = buttonStyle;\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n container.appendChild(root);\r\n this._dom = root;\r\n };\r\n DataView.prototype.remove = function (ecModel, api) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n };\r\n DataView.prototype.dispose = function (ecModel, api) {\r\n this.remove(ecModel, api);\r\n };\r\n DataView.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocale(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocale(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n return defaultOption;\r\n };\r\n return DataView;\r\n }(ToolboxFeature));\r\n function tryMergeDataOption(newData, originalData) {\r\n return map(newData, function (newVal, idx) {\r\n var original = originalData && originalData[idx];\r\n if (isObject(original) && !isArray(original)) {\r\n var newValIsObject = isObject(newVal) && !isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n };\r\n }\r\n var shouldDeleteName = original.name != null && newVal.name == null;\r\n newVal = defaults(newVal, original);\r\n shouldDeleteName && (delete newVal.name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n }\r\n registerFeature('dataView', DataView);\r\n registerAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n }, function (payload, ecModel) {\r\n var newSeriesOptList = [];\r\n each(payload.newOption.series, function (seriesOpt) {\r\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n newSeriesOptList.push(extend({\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n var originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data, originalData)\r\n });\r\n }\r\n });\r\n ecModel.mergeOption(defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n });\n\n var COORD_CONVERTS = ['dataToPoint', 'pointToData'];\r\n var INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n ];\r\n var BrushTargetManager = (function () {\r\n function BrushTargetManager(finder, ecModel, opt) {\r\n var _this = this;\r\n this._targetInfoList = [];\r\n var foundCpts = parseFinder$1(ecModel, finder);\r\n each(targetInfoBuilders, function (builder, type) {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, _this._targetInfoList);\r\n }\r\n });\r\n }\r\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\r\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n };\r\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (targetInfo && targetInfo !== true) {\r\n each(targetInfo.coordSyses, function (coordSys) {\r\n var result = coordConvert[area.brushType](1, coordSys, area.range);\r\n cb(area, result.values, coordSys, ecModel);\r\n });\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\r\n each(areas, function (area) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n if (__DEV__) {\r\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\r\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\r\n }\r\n area.range = area.range || [];\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n var rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax))\r\n : result.values;\r\n }\r\n }, this);\r\n };\r\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n var rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: makeRectPanelClipPath(rect),\r\n isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\r\n getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n };\r\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\r\n var targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0);\r\n };\r\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\r\n var targetInfoList = this._targetInfoList;\r\n var foundCpts = parseFinder$1(ecModel, area);\r\n for (var i = 0; i < targetInfoList.length; i++) {\r\n var targetInfo = targetInfoList[i];\r\n var areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return BrushTargetManager;\r\n }());\r\n function formatMinMax(minMax) {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n }\r\n function parseFinder$1(ecModel, finder) {\r\n return parseFinder(ecModel, finder, { includeMainTypes: INCLUDE_FINDER_MAIN_TYPES });\r\n }\r\n var targetInfoBuilders = {\r\n grid: function (foundCpts, targetInfoList) {\r\n var xAxisModels = foundCpts.xAxisModels;\r\n var yAxisModels = foundCpts.yAxisModels;\r\n var gridModels = foundCpts.gridModels;\r\n var gridModelMap = createHashMap();\r\n var xAxesHas = {};\r\n var yAxesHas = {};\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n each(xAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n var gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n gridModelMap.each(function (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n var cartesians = [];\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n });\r\n });\r\n },\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel) {\r\n var coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n });\r\n });\r\n }\r\n };\r\n var targetInfoMatchers = [\r\n function (foundCpts, targetInfo) {\r\n var xAxisModel = foundCpts.xAxisModel;\r\n var yAxisModel = foundCpts.yAxisModel;\r\n var gridModel = foundCpts.gridModel;\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n return gridModel && gridModel === targetInfo.gridModel;\r\n },\r\n function (foundCpts, targetInfo) {\r\n var geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === targetInfo.geoModel;\r\n }\r\n ];\r\n var panelRectBuilders = {\r\n grid: function () {\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n geo: function () {\r\n var coordSys = this.coordSys;\r\n var rect = coordSys.getBoundingRect().clone();\r\n rect.applyTransform(getTransform(coordSys));\r\n return rect;\r\n }\r\n };\r\n var coordConvert = {\r\n lineX: curry(axisConvert, 0),\r\n lineY: curry(axisConvert, 1),\r\n rect: function (to, coordSys, rangeOrCoordRange) {\r\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\r\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\r\n var values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return { values: values, xyMinMax: values };\r\n },\r\n polygon: function (to, coordSys, rangeOrCoordRange) {\r\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var values = map(rangeOrCoordRange, function (item) {\r\n var p = coordSys[COORD_CONVERTS[to]](item);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n };\r\n function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\r\n if (__DEV__) {\r\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\r\n }\r\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n var values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]))\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n var xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n return { values: values, xyMinMax: xyMinMax };\r\n }\r\n var diffProcessor = {\r\n lineX: curry(axisDiffProcessor, 0),\r\n lineY: curry(axisDiffProcessor, 1),\r\n rect: function (values, refer, scales) {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n polygon: function (values, refer, scales) {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n };\r\n function axisDiffProcessor(axisNameIndex, values, refer, scales) {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n }\r\n function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\r\n var sizeCurr = getSize(xyMinMaxCurr);\r\n var sizeOrigin = getSize(xyMinMaxOrigin);\r\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n }\r\n function getSize(xyMinMax) {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n }\n\n var each$9 = each;\r\n var inner$h = makeInner();\r\n function push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n each$9(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId })[0];\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n }\r\n function pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n var snapshot = {};\r\n each$9(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n }\r\n function clear$1(ecModel) {\r\n inner$h(ecModel).snapshots = null;\r\n }\r\n function count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n }\r\n function getStoreSnapshots(ecModel) {\r\n var store = inner$h(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n }\n\n ComponentModel.registerSubTypeDefaulter('dataZoom', function () {\r\n return 'slider';\r\n });\n\n var DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n ];\r\n var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\r\n function isCoordSupported(seriesModel) {\r\n var coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n }\r\n function getAxisMainType(axisDim) {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis';\r\n }\r\n function findEffectedDataZooms(ecModel, payload) {\r\n var axisRecords = createHashMap();\r\n var effectedModels = [];\r\n var effectedModelMap = createHashMap();\r\n ecModel.eachComponent({ mainType: 'dataZoom', query: payload }, function (dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n });\r\n var foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n } while (foundNewLink);\r\n function processSingle(dataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n function addToEffected(dataZoom) {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n function isLinked(dataZoomModel) {\r\n var isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n function markAxisControlled(dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\r\n });\r\n }\r\n return effectedModels;\r\n }\r\n function collectReferCoordSysModelInfo(dataZoomModel) {\r\n var ecModel = dataZoomModel.ecModel;\r\n var coordSysInfoWrap = {\r\n infoList: [],\r\n infoMap: createHashMap()\r\n };\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n if (!axisModel) {\r\n return;\r\n }\r\n var coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n var coordSysUid = coordSysModel.uid;\r\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n return coordSysInfoWrap;\r\n }\n\n var DataZoomAxisInfo = (function () {\r\n function DataZoomAxisInfo() {\r\n this.indexList = [];\r\n this.indexMap = [];\r\n }\r\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n };\r\n return DataZoomAxisInfo;\r\n }());\r\n var DataZoomModel = (function (_super) {\r\n __extends(DataZoomModel, _super);\r\n function DataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomModel.type;\r\n _this._autoThrottle = true;\r\n _this._noTarget = true;\r\n _this._rangePropMode = ['percent', 'percent'];\r\n return _this;\r\n }\r\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputRawOption = retrieveRawOption(option);\r\n this.settledOption = inputRawOption;\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype.mergeOption = function (newOption) {\r\n var inputRawOption = retrieveRawOption(newOption);\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n this._doInit(inputRawOption);\r\n };\r\n DataZoomModel.prototype._doInit = function (inputRawOption) {\r\n var thisOption = this.option;\r\n this._setDefaultThrottle(inputRawOption);\r\n this._updateRangeUse(inputRawOption);\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n }, this);\r\n this._resetTarget();\r\n };\r\n DataZoomModel.prototype._resetTarget = function () {\r\n var optionOrient = this.get('orient', true);\r\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n };\r\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\r\n var hasAxisSpecified = false;\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n var axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n return hasAxisSpecified;\r\n };\r\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\r\n var ecModel = this.ecModel;\r\n var needAuto = true;\r\n if (needAuto) {\r\n var axisDim = orient === 'vertical' ? 'y' : 'x';\r\n var axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n if (needAuto) {\r\n var axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: function (axisModel) { return axisModel.get('orient', true) === orient; }\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n function setParallelAxis(axisModels, axisDim) {\r\n var axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel_1 && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n if (needAuto) {\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n var axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: function (axisModel) { return axisModel.get('type', true) === 'category'; }\r\n });\r\n if (axisModels[0]) {\r\n var axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n };\r\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\r\n var dim;\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n };\r\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n var globalOption = this.ecModel.option;\r\n this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20;\r\n }\r\n };\r\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\r\n var rangePropMode = this._rangePropMode;\r\n var rangeModeInOption = this.get('rangeMode');\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\r\n var percentSpecified = inputRawOption[names[0]] != null;\r\n var valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n });\r\n };\r\n DataZoomModel.prototype.noTarget = function () {\r\n return this._noTarget;\r\n };\r\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\r\n var firstAxisModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n }, this);\r\n return firstAxisModel;\r\n };\r\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n };\r\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\r\n var axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n };\r\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n }\r\n };\r\n DataZoomModel.prototype.setRawRange = function (opt) {\r\n var thisOption = this.option;\r\n var settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n this._updateRangeUse(opt);\r\n };\r\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\r\n var option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\r\n option[name] = opt[name];\r\n });\r\n };\r\n DataZoomModel.prototype.getPercentRange = function () {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\r\n if (axisDim == null && axisIndex == null) {\r\n var axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n };\r\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\r\n if (axisModel) {\r\n return axisModel.__dzAxisProxy;\r\n }\r\n var firstProxy;\r\n var axisDimList = this._targetAxisInfoMap.keys();\r\n for (var i = 0; i < axisDimList.length; i++) {\r\n var axisDim = axisDimList[i];\r\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (var j = 0; j < axisInfo.indexList.length; j++) {\r\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n return firstProxy;\r\n };\r\n DataZoomModel.prototype.getRangePropMode = function () {\r\n return this._rangePropMode.slice();\r\n };\r\n DataZoomModel.prototype.getOrient = function () {\r\n if (__DEV__) {\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n };\r\n DataZoomModel.type = 'dataZoom';\r\n DataZoomModel.dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n DataZoomModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n filterMode: 'filter',\r\n start: 0,\r\n end: 100\r\n };\r\n return DataZoomModel;\r\n }(ComponentModel));\r\n function retrieveRawOption(option) {\r\n var ret = {};\r\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\r\n option.hasOwnProperty(name) && (ret[name] = option[name]);\r\n });\r\n return ret;\r\n }\n\n var DataZoomView = (function (_super) {\r\n __extends(DataZoomView, _super);\r\n function DataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = DataZoomView.type;\r\n return _this;\r\n }\r\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n DataZoomView.type = 'dataZoom';\r\n return DataZoomView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DataZoomView);\n\n var SelectDataZoomModel = (function (_super) {\r\n __extends(SelectDataZoomModel, _super);\r\n function SelectDataZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomModel.type;\r\n return _this;\r\n }\r\n SelectDataZoomModel.type = 'dataZoom.select';\r\n return SelectDataZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SelectDataZoomModel);\n\n var SelectDataZoomView = (function (_super) {\r\n __extends(SelectDataZoomView, _super);\r\n function SelectDataZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SelectDataZoomView.type;\r\n return _this;\r\n }\r\n SelectDataZoomView.type = 'dataZoom.select';\r\n return SelectDataZoomView;\r\n }(DataZoomView));\r\n ComponentView.registerClass(SelectDataZoomView);\n\n var each$a = each;\r\n var asc$1 = asc;\r\n var AxisProxy = (function () {\r\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\r\n this._dimName = dimName;\r\n this._axisIndex = axisIndex;\r\n this.ecModel = ecModel;\r\n this._dataZoomModel = dataZoomModel;\r\n }\r\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\r\n return this._dataZoomModel === dataZoomModel;\r\n };\r\n AxisProxy.prototype.getDataValueWindow = function () {\r\n return this._valueWindow.slice();\r\n };\r\n AxisProxy.prototype.getDataPercentWindow = function () {\r\n return this._percentWindow.slice();\r\n };\r\n AxisProxy.prototype.getTargetSeriesModels = function () {\r\n var seriesModels = [];\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n var axisMainType = getAxisMainType(this._dimName);\r\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n return seriesModels;\r\n };\r\n AxisProxy.prototype.getAxisModel = function () {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\r\n };\r\n AxisProxy.prototype.getMinMaxSpan = function () {\r\n return clone(this._minMaxSpan);\r\n };\r\n AxisProxy.prototype.calculateDataWindow = function (opt) {\r\n var dataExtent = this._dataExtent;\r\n var axisModel = this.getAxisModel();\r\n var scale = axisModel.axis.scale;\r\n var rangePropMode = this._dataZoomModel.getRangePropMode();\r\n var percentExtent = [0, 100];\r\n var percentWindow = [];\r\n var valueWindow = [];\r\n var hasPropModeValue;\r\n each$a(['start', 'end'], function (prop, idx) {\r\n var boundPercent = opt[prop];\r\n var boundValue = opt[prop + 'Value'];\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n boundPercent = linearMap(boundValue, dataExtent, percentExtent);\r\n }\r\n valueWindow[idx] = boundValue;\r\n percentWindow[idx] = boundPercent;\r\n });\r\n asc$1(valueWindow);\r\n asc$1(percentWindow);\r\n var spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\r\n var suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\r\n for (var i = 0; i < 2; i++) {\r\n toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n };\r\n AxisProxy.prototype.reset = function (dataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var targetSeries = this.getTargetSeriesModels();\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n this._updateMinMaxSpan();\r\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n this._setAxisModel();\r\n };\r\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n var axisDim = this._dimName;\r\n var seriesModels = this.getTargetSeriesModels();\r\n var filterMode = dataZoomModel.get('filterMode');\r\n var valueWindow = this._valueWindow;\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n each$a(seriesModels, function (seriesModel) {\r\n var seriesData = seriesModel.getData();\r\n var dataDims = seriesData.mapDimensionsAll(axisDim);\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n if (filterMode === 'weakFilter') {\r\n seriesData.filterSelf(function (dataIndex) {\r\n var leftOut;\r\n var rightOut;\r\n var hasValue;\r\n for (var i = 0; i < dataDims.length; i++) {\r\n var value = seriesData.get(dataDims[i], dataIndex);\r\n var thisHasValue = !isNaN(value);\r\n var thisLeftOut = value < valueWindow[0];\r\n var thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each$a(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\r\n return !isInWindow(value) ? NaN : value;\r\n }));\r\n }\r\n else {\r\n var range = {};\r\n range[dim] = valueWindow;\r\n seriesData.selectRange(range);\r\n }\r\n });\r\n }\r\n each$a(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n function isInWindow(value) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n };\r\n AxisProxy.prototype._updateMinMaxSpan = function () {\r\n var minMaxSpan = this._minMaxSpan = {};\r\n var dataZoomModel = this._dataZoomModel;\r\n var dataExtent = this._dataExtent;\r\n each$a(['min', 'max'], function (minMax) {\r\n var percentSpan = dataZoomModel.get(minMax + 'Span');\r\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n if (valueSpan != null) {\r\n percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\r\n }\r\n minMaxSpan[minMax + 'Span'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\r\n }, this);\r\n };\r\n AxisProxy.prototype._setAxisModel = function () {\r\n var axisModel = this.getAxisModel();\r\n var percentWindow = this._percentWindow;\r\n var valueWindow = this._valueWindow;\r\n if (!percentWindow) {\r\n return;\r\n }\r\n var precision = getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n };\r\n return AxisProxy;\r\n }());\r\n function calculateDataExtent(axisProxy, axisDim, seriesModels) {\r\n var dataExtent = [Infinity, -Infinity];\r\n each$a(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n var axisModel = axisProxy.getAxisModel();\r\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n return [rawExtentResult.min, rawExtentResult.max];\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER, {\r\n getTargetSeries: function (ecModel) {\r\n function eachAxisModel(cb) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n var proxyList = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n if (!axisModel.__dzAxisProxy) {\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n var seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var percentRange = axisProxy.getDataPercentWindow();\r\n var valueRange = axisProxy.getDataValueWindow();\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n });\n\n registerAction('dataZoom', function (payload, ecModel) {\r\n var effectedModels = findEffectedDataZooms(ecModel, payload);\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n });\n\n var each$b = each;\r\n var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\n var DataZoomFeature = (function (_super) {\r\n __extends(DataZoomFeature, _super);\r\n function DataZoomFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\r\n if (!this.brushController) {\r\n this.brushController = new BrushController(api.getZr());\r\n this.brushController.on('brush', bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n };\r\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\r\n handlers$1[type].call(this);\r\n };\r\n DataZoomFeature.prototype.remove = function (ecModel, api) {\r\n this.brushController.unmount();\r\n };\r\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\r\n this.brushController.dispose();\r\n };\r\n DataZoomFeature.prototype._onBrush = function (eventParam) {\r\n var areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n var snapshot = {};\r\n var ecModel = this.ecModel;\r\n this.brushController.updateCovers([]);\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { include: ['grid'] });\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n var brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, coordRange[0]);\r\n setBatch('y', coordSys, coordRange[1]);\r\n }\r\n else {\r\n setBatch({ lineX: 'x', lineY: 'y' }[brushType], coordSys, coordRange);\r\n }\r\n });\r\n push(ecModel, snapshot);\r\n this._dispatchZoomAction(snapshot);\r\n function setBatch(dimName, coordSys, minMax) {\r\n var axis = coordSys.getAxis(dimName);\r\n var axisModel = axis.model;\r\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\r\n }\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n function findDataZoom(dimName, axisModel, ecModel) {\r\n var found;\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'select' }, function (dzModel) {\r\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\r\n var batch = [];\r\n each$b(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(clone(batchItem));\r\n });\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n };\r\n DataZoomFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n return defaultOption;\r\n };\r\n return DataZoomFeature;\r\n }(ToolboxFeature));\r\n var handlers$1 = {\r\n zoom: function () {\r\n var nextActive = !this.isZoomActive;\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n back: function () {\r\n this._dispatchZoomAction(pop(this.ecModel));\r\n }\r\n };\r\n function makeAxisFinder(dzFeatureModel) {\r\n var setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n };\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n return setting;\r\n }\r\n function updateBackBtnStatus(featureModel, ecModel) {\r\n featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal');\r\n }\r\n function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\r\n var zoomActive = view.isZoomActive;\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n view.isZoomActive = zoomActive;\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { include: ['grid'] });\r\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n view.brushController\r\n .setPanels(panels)\r\n .enableBrush((zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false);\r\n }\r\n registerFeature('dataZoom', DataZoomFeature);\r\n registerInternalOptionCreator('dataZoom', function (ecModel) {\r\n var toolboxModel = ecModel.getComponent('toolbox', 0);\r\n if (!toolboxModel) {\r\n return;\r\n }\r\n var dzFeatureModel = toolboxModel.getModel(['feature', 'dataZoom']);\r\n var dzOptions = [];\r\n var finder = makeAxisFinder(dzFeatureModel);\r\n var finderResult = parseFinder(ecModel, finder);\r\n each$b(finderResult.xAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); });\r\n each$b(finderResult.yAxisModels, function (axisModel) { return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); });\r\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\r\n var axisIndex = axisModel.componentIndex;\r\n var newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n };\r\n newOpt[axisIndexPropName] = axisIndex;\r\n dzOptions.push(newOpt);\r\n }\r\n return dzOptions;\r\n });\n\n var RestoreOption = (function (_super) {\r\n __extends(RestoreOption, _super);\r\n function RestoreOption() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RestoreOption.prototype.onclick = function (ecModel, api) {\r\n clear$1(ecModel);\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n };\r\n RestoreOption.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocale(['toolbox', 'restore', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return RestoreOption;\r\n }(ToolboxFeature));\r\n registerFeature('restore', RestoreOption);\r\n registerAction({ type: 'restore', event: 'restore', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n });\n\n var TooltipModel = (function (_super) {\r\n __extends(TooltipModel, _super);\r\n function TooltipModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipModel.type;\r\n return _this;\r\n }\r\n TooltipModel.type = 'tooltip';\r\n TooltipModel.dependencies = ['axisPointer'];\r\n TooltipModel.defaultOption = {\r\n zlevel: 0,\r\n z: 60,\r\n show: true,\r\n showContent: true,\r\n trigger: 'item',\r\n triggerOn: 'mousemove|click',\r\n alwaysShowContent: false,\r\n displayMode: 'single',\r\n renderMode: 'auto',\r\n confine: null,\r\n showDelay: 0,\r\n hideDelay: 100,\r\n transitionDuration: 0.4,\r\n enterable: false,\r\n backgroundColor: '#fff',\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n borderColor: '#333',\r\n borderRadius: 4,\r\n borderWidth: 1,\r\n padding: null,\r\n extraCssText: '',\r\n axisPointer: {\r\n type: 'line',\r\n axis: 'auto',\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n textStyle: {}\r\n }\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n return TooltipModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TooltipModel);\n\n function shouldTooltipConfine(tooltipModel) {\r\n var confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n : tooltipModel.get('renderMode') === 'richText';\r\n }\n\n var vendors = ['-ms-', '-moz-', '-o-', '-webkit-', ''];\r\n var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';\r\n function mirrorPos(pos) {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n }\r\n function assembleArrow(backgroundColor, borderColor, arrowPosition) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n borderColor = convertToColorString(borderColor);\r\n var arrowPos = mirrorPos(arrowPosition);\r\n var positionStyle = '';\r\n var transformStyle = '';\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle = arrowPos + \":-6px;top:50%;\";\r\n transformStyle = \"translateY(-50%) rotate(\" + (arrowPos === 'left' ? -225 : -45) + \"deg)\";\r\n }\r\n else {\r\n positionStyle = arrowPos + \":-6px;left:50%;\";\r\n transformStyle = \"translateX(-50%) rotate(\" + (arrowPos === 'top' ? 225 : 45) + \"deg)\";\r\n }\r\n transformStyle = map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transform:' + transformStyle;\r\n }).join(';');\r\n var styleCss = [\r\n 'position:absolute;width:10px;height:10px;',\r\n \"\" + positionStyle + transformStyle + \";\",\r\n \"border-bottom: \" + borderColor + \" solid 1px;\",\r\n \"border-right: \" + borderColor + \" solid 1px;\",\r\n \"background-color: \" + backgroundColor + \";\",\r\n 'box-shadow: 8px 8px 16px -3px #000;'\r\n ];\r\n return \"
\";\r\n }\r\n function assembleTransition(duration, onlyFade) {\r\n var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';\r\n var transitionText = 'opacity ' + (duration / 2) + 's ' + transitionCurve + ','\r\n + 'visibility ' + (duration / 2) + 's ' + transitionCurve;\r\n if (!onlyFade) {\r\n transitionText += ',left ' + duration + 's ' + transitionCurve\r\n + ',top ' + duration + 's ' + transitionCurve;\r\n }\r\n return map(vendors, function (vendorPrefix) {\r\n return vendorPrefix + 'transition:' + transitionText;\r\n }).join(';');\r\n }\r\n function assembleFont(textStyleModel) {\r\n var cssText = [];\r\n var fontSize = textStyleModel.get('fontSize');\r\n var color = textStyleModel.getTextColor();\r\n color && cssText.push('color:' + color);\r\n cssText.push('font:' + textStyleModel.getFont());\r\n fontSize\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n var shadowColor = textStyleModel.get('textShadowColor');\r\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n each(['decoration', 'align'], function (name) {\r\n var val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n return cssText.join(';');\r\n }\r\n function assembleCssText(tooltipModel, enableTransition, onlyFade) {\r\n var cssText = [];\r\n var transitionDuration = tooltipModel.get('transitionDuration');\r\n var backgroundColor = tooltipModel.get('backgroundColor');\r\n var shadowBlur = tooltipModel.get('shadowBlur');\r\n var shadowColor = tooltipModel.get('shadowColor');\r\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\r\n cssText.push('box-shadow:' + boxShadow);\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n if (backgroundColor) {\r\n if (env.canvasSupported) {\r\n cssText.push('background-Color:' + backgroundColor);\r\n }\r\n else {\r\n cssText.push('background-Color:#' + toHex(backgroundColor));\r\n cssText.push('filter:alpha(opacity=70)');\r\n }\r\n }\r\n each(['width', 'color', 'radius'], function (name) {\r\n var borderName = 'border-' + name;\r\n var camelCase = toCamelCase(borderName);\r\n var val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n cssText.push(assembleFont(textStyleModel));\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px');\r\n }\r\n return cssText.join(';') + ';';\r\n }\r\n function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\r\n var zrPainter = zr && zr.painter;\r\n if (appendToBody) {\r\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\r\n var TooltipHTMLContent = (function () {\r\n function TooltipHTMLContent(container, api, opt) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._firstShow = true;\r\n this._longHide = true;\r\n if (env.wxa) {\r\n return null;\r\n }\r\n var el = document.createElement('div');\r\n el.domBelongToZr = true;\r\n this.el = el;\r\n var zr = this._zr = api.getZr();\r\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\r\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\r\n if (appendToBody) {\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n container.appendChild(el);\r\n }\r\n this._container = container;\r\n var self = this;\r\n el.onmouseenter = function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || window.event;\r\n if (!self._enterable) {\r\n var handler = zr.handler;\r\n var zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n self._inContent = false;\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\r\n var container = this._container;\r\n var stl = container.currentStyle\r\n || document.defaultView.getComputedStyle(container);\r\n var domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n this.el.className = tooltipModel.get('className') || '';\r\n };\r\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n var el = this.el;\r\n var styleCoord = this._styleCoord;\r\n var offset = el.offsetHeight / 2;\r\n nearPointColor = convertToColorString(nearPointColor);\r\n el.style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n + ';left:' + styleCoord[0] + 'px;top:' + (styleCoord[1] - offset) + 'px;'\r\n + (\"border-color: \" + nearPointColor + \";\")\r\n + (tooltipModel.get('extraCssText') || '');\r\n el.style.display = el.innerHTML ? 'block' : 'none';\r\n el.style.pointerEvents = this._enterable ? 'auto' : 'none';\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n };\r\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\r\n if (content == null) {\r\n return;\r\n }\r\n var el = this.el;\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content;\r\n }\r\n else if (content) {\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (var i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipHTMLContent.prototype.getSize = function () {\r\n var el = this.el;\r\n return [el.clientWidth, el.clientHeight];\r\n };\r\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n var style = this.el.style;\r\n style.left = styleCoord[0].toFixed(0) + 'px';\r\n style.top = styleCoord[1].toFixed(0) + 'px';\r\n }\r\n };\r\n TooltipHTMLContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipHTMLContent.prototype.hide = function () {\r\n var _this = this;\r\n this.el.style.visibility = 'hidden';\r\n this.el.style.opacity = '0';\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(function () { return _this._longHide = true; }, 500);\r\n };\r\n TooltipHTMLContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipHTMLContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipHTMLContent.prototype.dispose = function () {\r\n this.el.parentNode.removeChild(this.el);\r\n };\r\n TooltipHTMLContent.prototype.getOuterSize = function () {\r\n var width = this.el.clientWidth;\r\n var height = this.el.clientHeight;\r\n if (document.defaultView && document.defaultView.getComputedStyle) {\r\n var stl = document.defaultView.getComputedStyle(this.el);\r\n if (stl) {\r\n width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);\r\n height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);\r\n }\r\n }\r\n return { width: width, height: height };\r\n };\r\n return TooltipHTMLContent;\r\n }());\n\n var TooltipRichContent = (function () {\r\n function TooltipRichContent(api) {\r\n this._show = false;\r\n this._styleCoord = [0, 0, 0, 0];\r\n this._enterable = true;\r\n this._zr = api.getZr();\r\n makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n TooltipRichContent.prototype.update = function (tooltipModel) {\r\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n };\r\n TooltipRichContent.prototype.show = function () {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n this.el.show();\r\n this._show = true;\r\n };\r\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\r\n if (isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n var textStyleModel = tooltipModel.getModel('textStyle');\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content,\r\n lineHeight: 22,\r\n backgroundColor: tooltipModel.get('backgroundColor'),\r\n borderRadius: tooltipModel.get('borderRadius'),\r\n borderWidth: 1,\r\n borderColor: borderColor,\r\n shadowColor: tooltipModel.get('shadowColor'),\r\n shadowBlur: tooltipModel.get('shadowBlur'),\r\n shadowOffsetX: tooltipModel.get('shadowOffsetX'),\r\n shadowOffsetY: tooltipModel.get('shadowOffsetY'),\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n textShadowBlur: textStyleModel.get('textShadowBlur') || 0,\r\n textShadowOffsetX: textStyleModel.get('textShadowOffsetX') || 0,\r\n textShadowOffsetY: textStyleModel.get('textShadowOffsetY') || 0,\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n this._zr.add(this.el);\r\n var self = this;\r\n this.el.on('mouseover', function () {\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n };\r\n TooltipRichContent.prototype.setEnterable = function (enterable) {\r\n this._enterable = enterable;\r\n };\r\n TooltipRichContent.prototype.getSize = function () {\r\n var el = this.el;\r\n var bounding = this.el.getBoundingRect();\r\n var shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n };\r\n TooltipRichContent.prototype.moveTo = function (x, y) {\r\n var el = this.el;\r\n if (el) {\r\n var styleCoord = this._styleCoord;\r\n makeStyleCoord$1(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n var style = el.style;\r\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n var shadowOuterSize = calcShadowOuterSize(style);\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n };\r\n TooltipRichContent.prototype._moveIfResized = function () {\r\n var ratioX = this._styleCoord[2];\r\n var ratioY = this._styleCoord[3];\r\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\r\n };\r\n TooltipRichContent.prototype.hide = function () {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n };\r\n TooltipRichContent.prototype.hideLater = function (time) {\r\n if (this._show && !(this._inContent && this._enterable)) {\r\n if (time) {\r\n this._hideDelay = time;\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n };\r\n TooltipRichContent.prototype.isShow = function () {\r\n return this._show;\r\n };\r\n TooltipRichContent.prototype.getOuterSize = function () {\r\n var size = this.getSize();\r\n return {\r\n width: size[0],\r\n height: size[1]\r\n };\r\n };\r\n TooltipRichContent.prototype.dispose = function () {\r\n this._zr.remove(this.el);\r\n };\r\n return TooltipRichContent;\r\n }());\r\n function mathMaxWith0(val) {\r\n return Math.max(0, val);\r\n }\r\n function calcShadowOuterSize(style) {\r\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n }\r\n function makeStyleCoord$1(out, zr, zrX, zrY) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n }\n\n var bind$2 = bind;\r\n var each$c = each;\r\n var parsePercent$3 = parsePercent$2;\r\n var proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n });\r\n var TooltipView = (function (_super) {\r\n __extends(TooltipView, _super);\r\n function TooltipView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TooltipView.type;\r\n return _this;\r\n }\r\n TooltipView.prototype.init = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n var tooltipModel = ecModel.getComponent('tooltip');\r\n var renderMode = tooltipModel.get('renderMode');\r\n this._renderMode = getTooltipRenderMode(renderMode);\r\n this._tooltipContent = this._renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api.getDom(), api, {\r\n appendToBody: tooltipModel.get('appendToBody', true)\r\n });\r\n };\r\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this.group.removeAll();\r\n this._tooltipModel = tooltipModel;\r\n this._ecModel = ecModel;\r\n this._api = api;\r\n this._alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n var tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n this._initGlobalListener();\r\n this._keepShow();\r\n };\r\n TooltipView.prototype._initGlobalListener = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var triggerOn = tooltipModel.get('triggerOn');\r\n register('itemTooltip', this._api, bind$2(function (currTrigger, e, dispatchAction) {\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this));\r\n };\r\n TooltipView.prototype._keepShow = function () {\r\n var tooltipModel = this._tooltipModel;\r\n var ecModel = this._ecModel;\r\n var api = this._api;\r\n if (this._lastX != null\r\n && this._lastY != null\r\n && tooltipModel.get('triggerOn') !== 'none') {\r\n var self_1 = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self_1._lastX,\r\n y: self_1._lastY,\r\n dataByCoordSys: self_1._lastDataByCoordSys\r\n });\r\n });\r\n }\r\n };\r\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\r\n if (payload.from === this.uid || env.node) {\r\n return;\r\n }\r\n var dispatchAction = makeDispatchAction$1(payload, api);\r\n this._ticket = '';\r\n var dataByCoordSys = payload.dataByCoordSys;\r\n if (payload.tooltip && payload.x != null && payload.y != null) {\r\n var el = proxyRect;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n el.tooltip = payload.tooltip;\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n var pointInfo = findPointFromSeries(payload, ecModel);\r\n var cx = pointInfo.point[0];\r\n var cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n position: payload.position,\r\n target: pointInfo.el\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\r\n var tooltipContent = this._tooltipContent;\r\n if (!this._alwaysShowContent && this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction$1(payload, api));\r\n }\r\n };\r\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\r\n var seriesIndex = payload.seriesIndex;\r\n var dataIndex = payload.dataIndex;\r\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel,\r\n (seriesModel.coordinateSystem || {}).model,\r\n tooltipModel\r\n ]);\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n return true;\r\n };\r\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\r\n var el = e.target;\r\n var tooltipModel = this._tooltipModel;\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n var dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el && findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; })) {\r\n this._lastDataByCoordSys = null;\r\n this._showSeriesItemTooltip(e, el, dispatchAction);\r\n }\r\n else if (el && el.tooltip) {\r\n this._lastDataByCoordSys = null;\r\n this._showComponentItemTooltip(e, el, dispatchAction);\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n };\r\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\r\n var delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay))\r\n : cb();\r\n };\r\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\r\n var ecModel = this._ecModel;\r\n var globalTooltipModel = this._tooltipModel;\r\n var point = [e.offsetX, e.offsetY];\r\n var singleTooltipModel = buildTooltipModel([\r\n e.tooltipOption,\r\n globalTooltipModel\r\n ]);\r\n var renderMode = this._renderMode;\r\n var cbParamsList = [];\r\n var articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n var markupTextArrLegacy = [];\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n each$c(dataByCoordSys, function (itemCoordSys) {\r\n each$c(itemCoordSys.dataByAxis, function (axisItem) {\r\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\r\n var axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\r\n var axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n var dataIndex = idxItem.dataIndexInside;\r\n var cbParams = series.getDataParams(dataIndex);\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = getAxisRawValue(axisModel.axis, { value: axisValue });\r\n cbParams.axisValueLabel = axisValueLabel;\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\r\n if (seriesTooltipResult.markupFragment) {\r\n axisSectionMarkup.blocks.push(seriesTooltipResult.markupFragment);\r\n }\r\n if (seriesTooltipResult.markupText) {\r\n markupTextArrLegacy.push(seriesTooltipResult.markupText);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n var positionExpr = e.position;\r\n var orderMode = singleTooltipModel.get('order');\r\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'));\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n this._showOrMove(singleTooltipModel, function () {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys)) {\r\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\r\n }\r\n else {\r\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\r\n }\r\n });\r\n };\r\n TooltipView.prototype._showSeriesItemTooltip = function (e, el, dispatchAction) {\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; });\r\n var ecModel = this._ecModel;\r\n var ecData = getECData(dispatcher);\r\n var seriesIndex = ecData.seriesIndex;\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n var dataModel = ecData.dataModel || seriesModel;\r\n var dataIndex = ecData.dataIndex;\r\n var dataType = ecData.dataType;\r\n var data = dataModel.getData(dataType);\r\n var renderMode = this._renderMode;\r\n var tooltipModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model,\r\n this._tooltipModel\r\n ]);\r\n var tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n var params = dataModel.getDataParams(dataIndex, dataType);\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\r\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\r\n var orderMode = tooltipModel.get('order');\r\n var markupText = seriesTooltipResult.markupFragment\r\n ? buildTooltipMarkup(seriesTooltipResult.markupFragment, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'))\r\n : seriesTooltipResult.markupText;\r\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n this._showOrMove(tooltipModel, function () {\r\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\r\n var tooltipOpt = el.tooltip;\r\n if (isString(tooltipOpt)) {\r\n var content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n formatter: content\r\n };\r\n }\r\n var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);\r\n var defaultHtml = subTooltipModel.get('content');\r\n var asyncTicket = Math.random() + '';\r\n var markupStyleCreator = new TooltipMarkupStyleCreator();\r\n this._showOrMove(subTooltipModel, function () {\r\n this._showTooltipContent(subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\r\n });\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype._showTooltipContent = function (tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\r\n this._ticket = '';\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n var tooltipContent = this._tooltipContent;\r\n var formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var html = defaultHtml;\r\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'));\r\n if (formatter && isString(formatter)) {\r\n var useUTC = tooltipModel.ecModel.get('useUTC');\r\n var params0 = isArray(params) ? params[0] : params;\r\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = format(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n var callback = bind$2(function (cbTicket, html) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPoint.color, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPoint.color);\r\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\r\n };\r\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger) {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: this._renderMode === 'html' ? '#fff' : 'none'\r\n };\r\n }\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n };\r\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, y, content, params, el) {\r\n var viewWidth = this._api.getWidth();\r\n var viewHeight = this._api.getHeight();\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n var contentSize = content.getSize();\r\n var align = tooltipModel.get('align');\r\n var vAlign = tooltipModel.get('verticalAlign');\r\n var rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n if (isFunction(positionExpr)) {\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice()\r\n });\r\n }\r\n if (isArray(positionExpr)) {\r\n x = parsePercent$3(positionExpr[0], viewWidth);\r\n y = parsePercent$3(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n var boxLayoutPosition = positionExpr;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n var layoutRect = getLayoutRect(boxLayoutPosition, { width: viewWidth, height: viewHeight });\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n vAlign = null;\r\n }\r\n else if (isString(positionExpr) && el) {\r\n var pos = calcTooltipPosition(positionExpr, rect, contentSize);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n content.moveTo(x, y);\r\n };\r\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys) {\r\n var lastCoordSys = this._lastDataByCoordSys;\r\n var contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n contentNotChanged && each$c(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\r\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\r\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\r\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n contentNotChanged && each$c(lastDataByAxis, function (lastItem, indexAxis) {\r\n var thisItem = thisDataByAxis[indexAxis] || {};\r\n var lastIndices = lastItem.seriesDataIndices || [];\r\n var newIndices = thisItem.seriesDataIndices || [];\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n contentNotChanged && each$c(lastIndices, function (lastIdxItem, j) {\r\n var newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n });\r\n });\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n return !!contentNotChanged;\r\n };\r\n TooltipView.prototype._hide = function (dispatchAction) {\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n };\r\n TooltipView.prototype.dispose = function (ecModel, api) {\r\n if (env.node) {\r\n return;\r\n }\r\n this._tooltipContent.dispose();\r\n unregister('itemTooltip', api);\r\n };\r\n TooltipView.type = 'tooltip';\r\n return TooltipView;\r\n }(ComponentView));\r\n function buildTooltipModel(modelCascade) {\r\n var resultModel = modelCascade.pop();\r\n while (modelCascade.length) {\r\n var tooltipOpt = modelCascade.pop();\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = tooltipOpt.get('tooltip', true);\r\n }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\r\n }\r\n }\r\n return resultModel;\r\n }\r\n function makeDispatchAction$1(payload, api) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n }\r\n function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n if (gapH != null) {\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n }\r\n function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\r\n var size = content.getOuterSize();\r\n var width = size.width;\r\n var height = size.height;\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n return [x, y];\r\n }\r\n function calcTooltipPosition(position, rect, contentSize) {\r\n var domWidth = contentSize[0];\r\n var domHeight = contentSize[1];\r\n var gap = 10;\r\n var offset = 5;\r\n var x = 0;\r\n var y = 0;\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - gap;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + gap;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - gap - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + gap + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n }\r\n function isCenterAlign(align) {\r\n return align === 'center' || align === 'middle';\r\n }\r\n ComponentView.registerClass(TooltipView);\n\n registerAction({\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n }, function () { });\r\n registerAction({\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n }, function () { });\n\n var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\r\n function brushPreprocessor(option, isNew) {\r\n var brushComponents = normalizeToArray(option ? option.brush : []);\r\n if (!brushComponents.length) {\r\n return;\r\n }\r\n var brushComponentSpecifiedBtns = [];\r\n each(brushComponents, function (brushOpt) {\r\n var tbs = brushOpt.hasOwnProperty('toolbox')\r\n ? brushOpt.toolbox : [];\r\n if (tbs instanceof Array) {\r\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\r\n }\r\n });\r\n var toolbox = option && option.toolbox;\r\n if (isArray(toolbox)) {\r\n toolbox = toolbox[0];\r\n }\r\n if (!toolbox) {\r\n toolbox = { feature: {} };\r\n option.toolbox = [toolbox];\r\n }\r\n var toolboxFeature = (toolbox.feature || (toolbox.feature = {}));\r\n var toolboxBrush = (toolboxFeature.brush || (toolboxFeature.brush = {}));\r\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\r\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\r\n removeDuplicate(brushTypes);\r\n if (isNew && !brushTypes.length) {\r\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\r\n }\r\n }\r\n function removeDuplicate(arr) {\r\n var map = {};\r\n each(arr, function (val) {\r\n map[val] = 1;\r\n });\r\n arr.length = 0;\r\n each(map, function (flag, val) {\r\n arr.push(val);\r\n });\r\n }\n\n var each$d = each;\r\n function hasKeys(obj) {\r\n if (obj) {\r\n for (var name_1 in obj) {\r\n if (obj.hasOwnProperty(name_1)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n function createVisualMappings(option, stateList, supplementVisualOption) {\r\n var visualMappings = {};\r\n each$d(stateList, function (state) {\r\n var mappings = visualMappings[state] = createMappings();\r\n each$d(option[state], function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var mappingOption = {\r\n type: visualType,\r\n visual: visualData\r\n };\r\n supplementVisualOption && supplementVisualOption(mappingOption, state);\r\n mappings[visualType] = new VisualMapping(mappingOption);\r\n if (visualType === 'opacity') {\r\n mappingOption = clone(mappingOption);\r\n mappingOption.type = 'colorAlpha';\r\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\r\n }\r\n });\r\n });\r\n return visualMappings;\r\n function createMappings() {\r\n var Creater = function () { };\r\n Creater.prototype.__hidden = Creater.prototype;\r\n var obj = new Creater();\r\n return obj;\r\n }\r\n }\r\n function replaceVisualOption(thisOption, newOption, keys) {\r\n var has;\r\n each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n has = true;\r\n }\r\n });\r\n has && each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n thisOption[key] = clone(newOption[key]);\r\n }\r\n else {\r\n delete thisOption[key];\r\n }\r\n });\r\n }\r\n function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n var dataIndex;\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n if (dimension == null) {\r\n data.each(eachItem);\r\n }\r\n else {\r\n data.each([dimension], eachItem);\r\n }\r\n function eachItem(valueOrIndex, index) {\r\n dataIndex = dimension == null\r\n ? valueOrIndex\r\n : index;\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n return;\r\n }\r\n var valueState = getValueState.call(scope, valueOrIndex);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\r\n var visualTypesMap = {};\r\n each(stateList, function (state) {\r\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n return {\r\n progress: function progress(params, data) {\r\n var dimName;\r\n if (dim != null) {\r\n dimName = data.getDimension(dim);\r\n }\r\n function getVisual(key) {\r\n return getItemVisualFromData(data, dataIndex, key);\r\n }\r\n function setVisual(key, value) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n var dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n var rawDataItem = data.getRawDataItem(dataIndex);\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n continue;\r\n }\r\n var value = dim != null\r\n ? data.get(dimName, dataIndex)\r\n : dataIndex;\r\n var valueState = getValueState(value);\r\n var mappings = visualMappings[valueState];\r\n var visualTypes = visualTypesMap[valueState];\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n };\r\n }\n\n function makeBrushCommonSelectorForSeries(area) {\r\n var brushType = area.brushType;\r\n var selectors = {\r\n point: function (itemLayout) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect: function (itemLayout) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n }\r\n var selector = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout\r\n && area.boundingRect.contain(itemLayout[0], itemLayout[1])\r\n && contain$2(area.range, itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n var points = area.range;\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n var x = itemLayout.x;\r\n var y = itemLayout.y;\r\n var width = itemLayout.width;\r\n var height = itemLayout.height;\r\n var p = points[0];\r\n if (contain$2(points, x, y)\r\n || contain$2(points, x + width, y)\r\n || contain$2(points, x, y + height)\r\n || contain$2(points, x + width, y + height)\r\n || BoundingRect.create(itemLayout).contain(p[0], p[1])\r\n || linePolygonIntersect(x, y, x + width, y, points)\r\n || linePolygonIntersect(x, y, x, y + height, points)\r\n || linePolygonIntersect(x + width, y, x + width, y + height, points)\r\n || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\r\n return true;\r\n }\r\n }\r\n }\r\n };\r\n function getLineSelectors(xyIndex) {\r\n var xy = ['x', 'y'];\r\n var wh = ['width', 'height'];\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n var range = area.range;\r\n var layoutRange = [\r\n itemLayout[xy[xyIndex]],\r\n itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]\r\n ];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range)\r\n || inLineRange(layoutRange[1], range)\r\n || inLineRange(range[0], layoutRange)\r\n || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n }\r\n function inLineRange(p, range) {\r\n return range[0] <= p && p <= range[1];\r\n }\n\n var STATE_LIST = ['inBrush', 'outOfBrush'];\r\n var DISPATCH_METHOD = '__ecBrushSelect';\r\n var DISPATCH_FLAG = '__ecInBrushSelectEvent';\r\n var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH;\r\n function layoutCovers(ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\r\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\r\n });\r\n }\r\n registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) {\r\n var brushSelected = [];\r\n var throttleType;\r\n var throttleDelay;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { brushType: false });\r\n });\r\n layoutCovers(ecModel);\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel, brushIndex) {\r\n var thisBrushSelected = {\r\n brushId: brushModel.id,\r\n brushIndex: brushIndex,\r\n brushName: brushModel.name,\r\n areas: clone(brushModel.areas),\r\n selected: []\r\n };\r\n brushSelected.push(thisBrushSelected);\r\n var brushOption = brushModel.option;\r\n var brushLink = brushOption.brushLink;\r\n var linkedSeriesMap = [];\r\n var selectedDataIndexForLink = [];\r\n var rangeInfoBySeries = [];\r\n var hasBrushExists = false;\r\n if (!brushIndex) {\r\n throttleType = brushOption.throttleType;\r\n throttleDelay = brushOption.throttleDelay;\r\n }\r\n var areas = map(brushModel.areas, function (area) {\r\n var builder = boundingRectBuilders[area.brushType];\r\n var selectableArea = defaults({ boundingRect: builder ? builder(area) : void 0 }, area);\r\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\r\n return selectableArea;\r\n });\r\n var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\r\n mappingOption.mappingMethod = 'fixed';\r\n });\r\n isArray(brushLink) && each(brushLink, function (seriesIndex) {\r\n linkedSeriesMap[seriesIndex] = 1;\r\n });\r\n function linkOthers(seriesIndex) {\r\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\r\n }\r\n function brushed(rangeInfoList) {\r\n return !!rangeInfoList.length;\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\r\n seriesModel.subType === 'parallel'\r\n ? stepAParallel(seriesModel, seriesIndex)\r\n : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\r\n });\r\n function stepAParallel(seriesModel, seriesIndex) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\r\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\r\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\r\n });\r\n }\r\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\r\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\r\n return;\r\n }\r\n each(areas, function (area) {\r\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\r\n rangeInfoList.push(area);\r\n }\r\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\r\n });\r\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\r\n var data_1 = seriesModel.getData();\r\n data_1.each(function (dataIndex) {\r\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\r\n selectedDataIndexForLink[dataIndex] = 1;\r\n }\r\n });\r\n }\r\n }\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n var seriesBrushSelected = {\r\n seriesId: seriesModel.id,\r\n seriesIndex: seriesIndex,\r\n seriesName: seriesModel.name,\r\n dataIndex: []\r\n };\r\n thisBrushSelected.selected.push(seriesBrushSelected);\r\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\r\n var data = seriesModel.getData();\r\n var getValueState = linkOthers(seriesIndex)\r\n ? function (dataIndex) {\r\n return selectedDataIndexForLink[dataIndex]\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n }\r\n : function (dataIndex) {\r\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex)\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n };\r\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList))\r\n && applyVisual(STATE_LIST, visualMappings, data, getValueState);\r\n });\r\n });\r\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\r\n });\r\n function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\r\n if (!payload) {\r\n return;\r\n }\r\n var zr = api.getZr();\r\n if (zr[DISPATCH_FLAG]) {\r\n return;\r\n }\r\n if (!zr[DISPATCH_METHOD]) {\r\n zr[DISPATCH_METHOD] = doDispatch;\r\n }\r\n var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\r\n fn(api, brushSelected);\r\n }\r\n function doDispatch(api, brushSelected) {\r\n if (!api.isDisposed()) {\r\n var zr = api.getZr();\r\n zr[DISPATCH_FLAG] = true;\r\n api.dispatchAction({\r\n type: 'brushSelect',\r\n batch: brushSelected\r\n });\r\n zr[DISPATCH_FLAG] = false;\r\n }\r\n }\r\n function checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\r\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\r\n var area = rangeInfoList[i];\r\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\r\n return true;\r\n }\r\n }\r\n }\r\n function brushModelNotControll(brushModel, seriesIndex) {\r\n var seriesIndices = brushModel.option.seriesIndex;\r\n return seriesIndices != null\r\n && seriesIndices !== 'all'\r\n && (isArray(seriesIndices)\r\n ? indexOf(seriesIndices, seriesIndex) < 0\r\n : seriesIndex !== seriesIndices);\r\n }\r\n var boundingRectBuilders = {\r\n rect: function (area) {\r\n return getBoundingRectFromMinMax(area.range);\r\n },\r\n polygon: function (area) {\r\n var minMax;\r\n var range = area.range;\r\n for (var i = 0, len = range.length; i < len; i++) {\r\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n var rg = range[i];\r\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\r\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\r\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\r\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\r\n }\r\n return minMax && getBoundingRectFromMinMax(minMax);\r\n }\r\n };\r\n function getBoundingRectFromMinMax(minMax) {\r\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\r\n }\n\n var DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\r\n var BrushModel = (function (_super) {\r\n __extends(BrushModel, _super);\r\n function BrushModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushModel.type;\r\n _this.areas = [];\r\n _this.brushOption = {};\r\n return _this;\r\n }\r\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\r\n var inBrush = thisOption.inBrush = thisOption.inBrush || {};\r\n thisOption.outOfBrush = thisOption.outOfBrush || { color: DEFAULT_OUT_OF_BRUSH_COLOR };\r\n if (!inBrush.hasOwnProperty('liftZ')) {\r\n inBrush.liftZ = 5;\r\n }\r\n };\r\n BrushModel.prototype.setAreas = function (areas) {\r\n if (__DEV__) {\r\n assert(isArray(areas));\r\n each(areas, function (area) {\r\n assert(area.brushType, 'Illegal areas');\r\n });\r\n }\r\n if (!areas) {\r\n return;\r\n }\r\n this.areas = map(areas, function (area) {\r\n return generateBrushOption(this.option, area);\r\n }, this);\r\n };\r\n BrushModel.prototype.setBrushOption = function (brushOption) {\r\n this.brushOption = generateBrushOption(this.option, brushOption);\r\n this.brushType = this.brushOption.brushType;\r\n };\r\n BrushModel.type = 'brush';\r\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\r\n BrushModel.defaultOption = {\r\n seriesIndex: 'all',\r\n brushType: 'rect',\r\n brushMode: 'single',\r\n transformable: true,\r\n brushStyle: {\r\n borderWidth: 1,\r\n color: 'rgba(210,219,238,0.3)',\r\n borderColor: '#D2DBEE'\r\n },\r\n throttleType: 'fixRate',\r\n throttleDelay: 0,\r\n removeOnClick: true,\r\n z: 10000\r\n };\r\n return BrushModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(BrushModel);\r\n function generateBrushOption(option, brushOption) {\r\n return merge({\r\n brushType: option.brushType,\r\n brushMode: option.brushMode,\r\n transformable: option.transformable,\r\n brushStyle: new Model(option.brushStyle).getItemStyle(),\r\n removeOnClick: option.removeOnClick,\r\n z: option.z\r\n }, brushOption, true);\r\n }\n\n var BrushView = (function (_super) {\r\n __extends(BrushView, _super);\r\n function BrushView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BrushView.type;\r\n return _this;\r\n }\r\n BrushView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n this.model;\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', bind(this._onBrush, this))\r\n .mount();\r\n };\r\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\r\n this.model = brushModel;\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\r\n layoutCovers(ecModel);\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\r\n this.updateTransform(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\r\n this._updateController(brushModel, ecModel, api, payload);\r\n };\r\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\r\n (!payload || payload.$from !== brushModel.id) && this._brushController\r\n .setPanels(brushModel.brushTargetManager.makePanelOpts(api))\r\n .enableBrush(brushModel.brushOption)\r\n .updateCovers(brushModel.areas.slice());\r\n };\r\n BrushView.prototype.dispose = function () {\r\n this._brushController.dispose();\r\n };\r\n BrushView.prototype._onBrush = function (eventParam) {\r\n var modelId = this.model.id;\r\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\r\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\r\n type: 'brush',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n eventParam.isEnd && this.api.dispatchAction({\r\n type: 'brushEnd',\r\n brushId: modelId,\r\n areas: clone(areas),\r\n $from: modelId\r\n });\r\n };\r\n BrushView.type = 'brush';\r\n return BrushView;\r\n }(ComponentView));\r\n ComponentView.registerClass(BrushView);\n\n registerAction({ type: 'brush', event: 'brush', update: 'updateVisual' }, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'brush', query: payload }, function (brushModel) {\r\n brushModel.setAreas(payload.areas);\r\n });\r\n });\r\n registerAction({ type: 'brushSelect', event: 'brushSelected', update: 'none' }, function () { });\r\n registerAction({ type: 'brushEnd', event: 'brushEnd', update: 'none' }, function () { });\n\n var ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\r\n var BrushFeature = (function (_super) {\r\n __extends(BrushFeature, _super);\r\n function BrushFeature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\r\n var brushType;\r\n var brushMode;\r\n var isBrushed;\r\n ecModel.eachComponent({ mainType: 'brush' }, function (brushModel) {\r\n brushType = brushModel.brushType;\r\n brushMode = brushModel.brushOption.brushMode || 'single';\r\n isBrushed = isBrushed || !!brushModel.areas.length;\r\n });\r\n this._brushType = brushType;\r\n this._brushMode = brushMode;\r\n each(featureModel.get('type', true), function (type) {\r\n featureModel.setIconStatus(type, (type === 'keep'\r\n ? brushMode === 'multiple'\r\n : type === 'clear'\r\n ? isBrushed\r\n : type === brushType) ? 'emphasis' : 'normal');\r\n });\r\n };\r\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\r\n this.render(featureModel, ecModel, api);\r\n };\r\n BrushFeature.prototype.getIcons = function () {\r\n var model = this.model;\r\n var availableIcons = model.get('icon', true);\r\n var icons = {};\r\n each(model.get('type', true), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\r\n var brushType = this._brushType;\r\n var brushMode = this._brushMode;\r\n if (type === 'clear') {\r\n api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n intervals: []\r\n });\r\n api.dispatchAction({\r\n type: 'brush',\r\n command: 'clear',\r\n areas: []\r\n });\r\n }\r\n else {\r\n api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'brush',\r\n brushOption: {\r\n brushType: type === 'keep'\r\n ? brushType\r\n : (brushType === type ? false : type),\r\n brushMode: type === 'keep'\r\n ? (brushMode === 'multiple' ? 'single' : 'multiple')\r\n : brushMode\r\n }\r\n });\r\n }\r\n };\r\n BrushFeature.getDefaultOption = function (ecModel) {\r\n var defaultOption = {\r\n show: true,\r\n type: ICON_TYPES.slice(),\r\n icon: {\r\n rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13',\r\n polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2',\r\n lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4',\r\n lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4',\r\n keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z',\r\n clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2'\r\n },\r\n title: ecModel.getLocale(['toolbox', 'brush', 'title'])\r\n };\r\n return defaultOption;\r\n };\r\n return BrushFeature;\r\n }(ToolboxFeature));\r\n registerFeature('brush', BrushFeature);\n\n registerPreprocessor(brushPreprocessor);\n\n var TitleModel = (function (_super) {\r\n __extends(TitleModel, _super);\r\n function TitleModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleModel.type;\r\n _this.layoutMode = { type: 'box', ignoreSize: true };\r\n return _this;\r\n }\r\n TitleModel.type = 'title';\r\n TitleModel.defaultOption = {\r\n zlevel: 0,\r\n z: 6,\r\n show: true,\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n subtarget: 'blank',\r\n left: 0,\r\n top: 0,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n return TitleModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TitleModel);\r\n var TitleView = (function (_super) {\r\n __extends(TitleView, _super);\r\n function TitleView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TitleView.type;\r\n return _this;\r\n }\r\n TitleView.prototype.render = function (titleModel, ecModel, api) {\r\n this.group.removeAll();\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n var group = this.group;\r\n var textStyleModel = titleModel.getModel('textStyle');\r\n var subtextStyleModel = titleModel.getModel('subtextStyle');\r\n var textAlign = titleModel.get('textAlign');\r\n var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\r\n var textEl = new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var textRect = textEl.getBoundingRect();\r\n var subText = titleModel.get('subtext');\r\n var subTextEl = new ZRText({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, { disableBox: true }),\r\n z2: 10\r\n });\r\n var link = titleModel.get('link');\r\n var sublink = titleModel.get('sublink');\r\n var triggerEvent = titleModel.get('triggerEvent', true);\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n var groupRect = group.getBoundingRect();\r\n var layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n var layoutRect = getLayoutRect(layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding'));\r\n if (!textAlign) {\r\n textAlign = (titleModel.get('left') || titleModel.get('right'));\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom'));\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n var alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n groupRect = group.getBoundingRect();\r\n var padding = layoutRect.margin;\r\n var style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n var rect = new Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n group.add(rect);\r\n };\r\n TitleView.type = 'title';\r\n return TitleView;\r\n }(ComponentView));\r\n ComponentView.registerClass(TitleView);\n\n function timelinePreprocessor(option) {\r\n var timelineOpt = option && option.timeline;\r\n if (!isArray(timelineOpt)) {\r\n timelineOpt = timelineOpt ? [timelineOpt] : [];\r\n }\r\n each(timelineOpt, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n compatibleEC2(opt);\r\n });\r\n }\r\n function compatibleEC2(opt) {\r\n var type = opt.type;\r\n var ec2Types = { 'number': 'value', 'time': 'time' };\r\n if (ec2Types[type]) {\r\n opt.axisType = ec2Types[type];\r\n delete opt.type;\r\n }\r\n transferItem(opt);\r\n if (has(opt, 'controlPosition')) {\r\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\r\n if (!has(controlStyle, 'position')) {\r\n controlStyle.position = opt.controlPosition;\r\n }\r\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\r\n controlStyle.show = false;\r\n delete controlStyle.position;\r\n }\r\n delete opt.controlPosition;\r\n }\r\n each(opt.data || [], function (dataItem) {\r\n if (isObject(dataItem) && !isArray(dataItem)) {\r\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\r\n dataItem.value = dataItem.name;\r\n }\r\n transferItem(dataItem);\r\n }\r\n });\r\n }\r\n function transferItem(opt) {\r\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\r\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\r\n var label = opt.label || (opt.label || {});\r\n var labelNormal = label.normal || (label.normal = {});\r\n var excludeLabelAttr = { normal: 1, emphasis: 1 };\r\n each(label, function (value, name) {\r\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\r\n labelNormal[name] = value;\r\n }\r\n });\r\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\r\n label.emphasis = itemStyleEmphasis.label;\r\n delete itemStyleEmphasis.label;\r\n }\r\n }\r\n function has(obj, attr) {\r\n return obj.hasOwnProperty(attr);\r\n }\n\n ComponentModel.registerSubTypeDefaulter('timeline', function () {\r\n return 'slider';\r\n });\n\n registerAction({ type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.currentIndex != null) {\r\n timelineModel.setCurrentIndex(payload.currentIndex);\r\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {\r\n timelineModel.setPlayState(false);\r\n }\r\n }\r\n ecModel.resetOption('timeline', { replaceMerge: timelineModel.get('replaceMerge', true) });\r\n return defaults({\r\n currentIndex: timelineModel.option.currentIndex\r\n }, payload);\r\n });\r\n registerAction({ type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update' }, function (payload, ecModel) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel && payload.playState != null) {\r\n timelineModel.setPlayState(payload.playState);\r\n }\r\n });\n\n var TimelineModel = (function (_super) {\r\n __extends(TimelineModel, _super);\r\n function TimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineModel.type;\r\n _this.layoutMode = 'box';\r\n return _this;\r\n }\r\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.mergeOption = function (option) {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n this._initData();\r\n };\r\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n var count = this._data.count();\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n }\r\n else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n this.option.currentIndex = currentIndex;\r\n };\r\n TimelineModel.prototype.getCurrentIndex = function () {\r\n return this.option.currentIndex;\r\n };\r\n TimelineModel.prototype.isIndexMax = function () {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n };\r\n TimelineModel.prototype.setPlayState = function (state) {\r\n this.option.autoPlay = !!state;\r\n };\r\n TimelineModel.prototype.getPlayState = function () {\r\n return !!this.option.autoPlay;\r\n };\r\n TimelineModel.prototype._initData = function () {\r\n var thisOption = this.option;\r\n var dataArr = thisOption.data || [];\r\n var axisType = thisOption.axisType;\r\n var names = this._names = [];\r\n var processedDataArr;\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n var value = convertOptionIdName(getDataItemValue(item), '');\r\n var newItem;\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n newItem.value = index;\r\n }\r\n else {\r\n newItem = index;\r\n }\r\n processedDataArr.push(newItem);\r\n names.push(value);\r\n });\r\n }\r\n else {\r\n processedDataArr = dataArr;\r\n }\r\n var dimType = ({\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n })[axisType] || 'number';\r\n var data = this._data = new List([{\r\n name: 'value', type: dimType\r\n }], this);\r\n data.initData(processedDataArr, names);\r\n };\r\n TimelineModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n TimelineModel.prototype.getCategories = function () {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n };\r\n TimelineModel.type = 'timeline';\r\n TimelineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n axisType: 'time',\r\n realtime: true,\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n controlPosition: 'left',\r\n autoPlay: false,\r\n rewind: false,\r\n loop: true,\r\n playInterval: 2000,\r\n currentIndex: 0,\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n data: []\r\n };\r\n return TimelineModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(TimelineModel);\n\n var SliderTimelineModel = (function (_super) {\r\n __extends(SliderTimelineModel, _super);\r\n function SliderTimelineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineModel.type;\r\n return _this;\r\n }\r\n SliderTimelineModel.type = 'timeline.slider';\r\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderWidth: 0,\r\n orient: 'horizontal',\r\n inverse: false,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n symbol: 'circle',\r\n symbolSize: 12,\r\n lineStyle: {\r\n show: true,\r\n width: 2,\r\n color: '#DAE1F5'\r\n },\r\n label: {\r\n position: 'auto',\r\n show: true,\r\n interval: 'auto',\r\n rotate: 0,\r\n color: '#A4B1D7'\r\n },\r\n itemStyle: {\r\n color: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n checkpointStyle: {\r\n symbol: 'circle',\r\n symbolSize: 15,\r\n color: '#316bf3',\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0, 0, 0, 0.3)',\r\n animation: true,\r\n animationDuration: 300,\r\n animationEasing: 'quinticInOut'\r\n },\r\n controlStyle: {\r\n show: true,\r\n showPlayBtn: true,\r\n showPrevBtn: true,\r\n showNextBtn: true,\r\n itemSize: 24,\r\n itemGap: 12,\r\n position: 'left',\r\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\r\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\r\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\r\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\r\n prevBtnSize: 18,\r\n nextBtnSize: 18,\r\n color: '#A4B1D7',\r\n borderColor: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: '#6f778d'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n controlStyle: {\r\n color: '#316BF3',\r\n borderColor: '#316BF3',\r\n borderWidth: 2\r\n }\r\n },\r\n progress: {\r\n lineStyle: {\r\n color: '#316BF3'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n label: {\r\n color: '#6f778d'\r\n }\r\n },\r\n data: []\r\n });\r\n return SliderTimelineModel;\r\n }(TimelineModel));\r\n mixin(SliderTimelineModel, DataFormatMixin.prototype);\r\n ComponentModel.registerClass(SliderTimelineModel);\n\n var TimelineView = (function (_super) {\r\n __extends(TimelineView, _super);\r\n function TimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = TimelineView.type;\r\n return _this;\r\n }\r\n TimelineView.type = 'timeline';\r\n return TimelineView;\r\n }(ComponentView));\n\n var TimelineAxis = (function (_super) {\r\n __extends(TimelineAxis, _super);\r\n function TimelineAxis(dim, scale, coordExtent, axisType) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.type = axisType || 'value';\r\n return _this;\r\n }\r\n TimelineAxis.prototype.getLabelModel = function () {\r\n return this.model.getModel('label');\r\n };\r\n TimelineAxis.prototype.isHorizontal = function () {\r\n return this.model.get('orient') === 'horizontal';\r\n };\r\n return TimelineAxis;\r\n }(Axis));\n\n var PI$9 = Math.PI;\r\n var labelDataIndexStore = makeInner();\r\n var SliderTimelineView = (function (_super) {\r\n __extends(SliderTimelineView, _super);\r\n function SliderTimelineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderTimelineView.type;\r\n return _this;\r\n }\r\n SliderTimelineView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n };\r\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\r\n this.model = timelineModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n this.group.removeAll();\r\n if (timelineModel.get('show', true)) {\r\n var layoutInfo_1 = this._layout(timelineModel, api);\r\n var mainGroup_1 = this._createGroup('_mainGroup');\r\n var labelGroup = this._createGroup('_labelGroup');\r\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\r\n timelineModel.formatTooltip = function (dataIndex) {\r\n var name = axis_1.scale.getLabel({ value: dataIndex });\r\n return createTooltipMarkup('nameValue', { noName: true, value: name });\r\n };\r\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\r\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\r\n }, this);\r\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\r\n this._position(layoutInfo_1, timelineModel);\r\n }\r\n this._doPlayStop();\r\n this._updateTicksStatus();\r\n };\r\n SliderTimelineView.prototype.remove = function () {\r\n this._clearTimer();\r\n this.group.removeAll();\r\n };\r\n SliderTimelineView.prototype.dispose = function () {\r\n this._clearTimer();\r\n };\r\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\r\n var labelPosOpt = timelineModel.get(['label', 'position']);\r\n var orient = timelineModel.get('orient');\r\n var viewRect = getViewRect$5(timelineModel, api);\r\n var parsedLabelPos;\r\n if (labelPosOpt == null || labelPosOpt === 'auto') {\r\n parsedLabelPos = orient === 'horizontal'\r\n ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')\r\n : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');\r\n }\r\n else if (isString(labelPosOpt)) {\r\n parsedLabelPos = {\r\n horizontal: { top: '-', bottom: '+' },\r\n vertical: { left: '-', right: '+' }\r\n }[orient][labelPosOpt];\r\n }\r\n else {\r\n parsedLabelPos = labelPosOpt;\r\n }\r\n var labelAlignMap = {\r\n horizontal: 'center',\r\n vertical: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'left' : 'right'\r\n };\r\n var labelBaselineMap = {\r\n horizontal: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'top' : 'bottom',\r\n vertical: 'middle'\r\n };\r\n var rotationMap = {\r\n horizontal: 0,\r\n vertical: PI$9 / 2\r\n };\r\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\r\n var controlModel = timelineModel.getModel('controlStyle');\r\n var showControl = controlModel.get('show', true);\r\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\r\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\r\n var sizePlusGap = controlSize + controlGap;\r\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\r\n labelRotation = labelRotation * PI$9 / 180;\r\n var playPosition;\r\n var prevBtnPosition;\r\n var nextBtnPosition;\r\n var controlPosition = controlModel.get('position', true);\r\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\r\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\r\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\r\n var xLeft = 0;\r\n var xRight = mainLength;\r\n if (controlPosition === 'left' || controlPosition === 'bottom') {\r\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n else {\r\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n var axisExtent = [xLeft, xRight];\r\n if (timelineModel.get('inverse')) {\r\n axisExtent.reverse();\r\n }\r\n return {\r\n viewRect: viewRect,\r\n mainLength: mainLength,\r\n orient: orient,\r\n rotation: rotationMap[orient],\r\n labelRotation: labelRotation,\r\n labelPosOpt: parsedLabelPos,\r\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\r\n labelBaseline: timelineModel.get(['label', 'verticalAlign'])\r\n || timelineModel.get(['label', 'baseline'])\r\n || labelBaselineMap[orient],\r\n playPosition: playPosition,\r\n prevBtnPosition: prevBtnPosition,\r\n nextBtnPosition: nextBtnPosition,\r\n axisExtent: axisExtent,\r\n controlSize: controlSize,\r\n controlGap: controlGap\r\n };\r\n };\r\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\r\n var mainGroup = this._mainGroup;\r\n var labelGroup = this._labelGroup;\r\n var viewRect = layoutInfo.viewRect;\r\n if (layoutInfo.orient === 'vertical') {\r\n var m = create$1();\r\n var rotateOriginX = viewRect.x;\r\n var rotateOriginY = viewRect.y + viewRect.height;\r\n translate(m, m, [-rotateOriginX, -rotateOriginY]);\r\n rotate(m, m, -PI$9 / 2);\r\n translate(m, m, [rotateOriginX, rotateOriginY]);\r\n viewRect = viewRect.clone();\r\n viewRect.applyTransform(m);\r\n }\r\n var viewBound = getBound(viewRect);\r\n var mainBound = getBound(mainGroup.getBoundingRect());\r\n var labelBound = getBound(labelGroup.getBoundingRect());\r\n var mainPosition = [mainGroup.x, mainGroup.y];\r\n var labelsPosition = [labelGroup.x, labelGroup.y];\r\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\r\n var labelPosOpt = layoutInfo.labelPosOpt;\r\n if (labelPosOpt == null || isString(labelPosOpt)) {\r\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\r\n }\r\n else {\r\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\r\n }\r\n mainGroup.setPosition(mainPosition);\r\n labelGroup.setPosition(labelsPosition);\r\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\r\n setOrigin(mainGroup);\r\n setOrigin(labelGroup);\r\n function setOrigin(targetGroup) {\r\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\r\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\r\n }\r\n function getBound(rect) {\r\n return [\r\n [rect.x, rect.x + rect.width],\r\n [rect.y, rect.y + rect.height]\r\n ];\r\n }\r\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\r\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\r\n }\r\n };\r\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\r\n var data = timelineModel.getData();\r\n var axisType = timelineModel.get('axisType');\r\n var scale = createScaleByModel$1(timelineModel, axisType);\r\n scale.getTicks = function () {\r\n return data.mapArray(['value'], function (value) {\r\n return { value: value };\r\n });\r\n };\r\n var dataExtent = data.getDataExtent('value');\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n scale.niceTicks();\r\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\r\n axis.model = timelineModel;\r\n return axis;\r\n };\r\n SliderTimelineView.prototype._createGroup = function (key) {\r\n var newGroup = this[key] = new Group();\r\n this.group.add(newGroup);\r\n return newGroup;\r\n };\r\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\r\n var axisExtent = axis.getExtent();\r\n if (!timelineModel.get(['lineStyle', 'show'])) {\r\n return;\r\n }\r\n var line = new Line({\r\n shape: {\r\n x1: axisExtent[0], y1: 0,\r\n x2: axisExtent[1], y2: 0\r\n },\r\n style: extend({ lineCap: 'round' }, timelineModel.getModel('lineStyle').getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(line);\r\n var progressLine = this._progressLine = new Line({\r\n shape: {\r\n x1: axisExtent[0],\r\n x2: this._currentPointer\r\n ? this._currentPointer.x : axisExtent[0],\r\n y1: 0, y2: 0\r\n },\r\n style: defaults({ lineCap: 'round', lineWidth: line.style.lineWidth }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(progressLine);\r\n };\r\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var data = timelineModel.getData();\r\n var ticks = axis.scale.getTicks();\r\n this._tickSymbols = [];\r\n each(ticks, function (tick) {\r\n var tickCoord = axis.dataToCoord(tick.value);\r\n var itemModel = data.getItemModel(tick.value);\r\n var itemStyleModel = itemModel.getModel('itemStyle');\r\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\r\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\r\n var symbolOpt = {\r\n x: tickCoord,\r\n y: 0,\r\n onclick: bind(_this._changeTimeline, _this, tick.value)\r\n };\r\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\r\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\r\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\r\n enableHoverEmphasis(el);\r\n var ecData = getECData(el);\r\n if (itemModel.get('tooltip')) {\r\n ecData.dataIndex = tick.value;\r\n ecData.dataModel = timelineModel;\r\n }\r\n else {\r\n ecData.dataIndex = ecData.dataModel = null;\r\n }\r\n _this._tickSymbols.push(el);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\r\n var _this = this;\r\n var labelModel = axis.getLabelModel();\r\n if (!labelModel.get('show')) {\r\n return;\r\n }\r\n var data = timelineModel.getData();\r\n var labels = axis.getViewLabels();\r\n this._tickLabels = [];\r\n each(labels, function (labelItem) {\r\n var dataIndex = labelItem.tickValue;\r\n var itemModel = data.getItemModel(dataIndex);\r\n var normalLabelModel = itemModel.getModel('label');\r\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\r\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\r\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: 0,\r\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\r\n onclick: bind(_this._changeTimeline, _this, dataIndex),\r\n silent: false,\r\n style: createTextStyle(normalLabelModel, {\r\n text: labelItem.formattedLabel,\r\n align: layoutInfo.labelAlign,\r\n verticalAlign: layoutInfo.labelBaseline\r\n })\r\n });\r\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\r\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\r\n group.add(textEl);\r\n enableHoverEmphasis(textEl);\r\n labelDataIndexStore(textEl).dataIndex = dataIndex;\r\n _this._tickLabels.push(textEl);\r\n });\r\n };\r\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\r\n var controlSize = layoutInfo.controlSize;\r\n var rotation = layoutInfo.rotation;\r\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\r\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\r\n var playState = timelineModel.getPlayState();\r\n var inverse = timelineModel.get('inverse', true);\r\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\r\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\r\n makeBtn(layoutInfo.playPosition, (playState ? 'stop' : 'play'), bind(this._handlePlayClick, this, !playState), true);\r\n function makeBtn(position, iconName, onclick, willRotate) {\r\n if (!position) {\r\n return;\r\n }\r\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\r\n var rect = [0, -iconSize / 2, iconSize, iconSize];\r\n var opt = {\r\n position: position,\r\n origin: [controlSize / 2, 0],\r\n rotation: willRotate ? -rotation : 0,\r\n rectHover: true,\r\n style: itemStyle,\r\n onclick: onclick\r\n };\r\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, opt);\r\n btn.ensureState('emphasis').style = hoverStyle;\r\n group.add(btn);\r\n enableHoverEmphasis(btn);\r\n }\r\n };\r\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\r\n var data = timelineModel.getData();\r\n var currentIndex = timelineModel.getCurrentIndex();\r\n var pointerModel = data.getItemModel(currentIndex)\r\n .getModel('checkpointStyle');\r\n var me = this;\r\n var callback = {\r\n onCreate: function (pointer) {\r\n pointer.draggable = true;\r\n pointer.drift = bind(me._handlePointerDrag, me);\r\n pointer.ondragend = bind(me._handlePointerDragend, me);\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\r\n },\r\n onUpdate: function (pointer) {\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\r\n }\r\n };\r\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\r\n };\r\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\r\n this._clearTimer();\r\n this.api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: nextState,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\r\n this._clearTimer();\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\r\n };\r\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\r\n };\r\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\r\n var toCoord = this._toAxisCoord(mousePos)[0];\r\n var axis = this._axis;\r\n var axisExtent = asc(axis.getExtent().slice());\r\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\r\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\r\n this._currentPointer.x = toCoord;\r\n this._currentPointer.markRedraw();\r\n this._progressLine.shape.x2 = toCoord;\r\n this._progressLine.dirty();\r\n var targetDataIndex = this._findNearestTick(toCoord);\r\n var timelineModel = this.model;\r\n if (trigger || (targetDataIndex !== timelineModel.getCurrentIndex()\r\n && timelineModel.get('realtime'))) {\r\n this._changeTimeline(targetDataIndex);\r\n }\r\n };\r\n SliderTimelineView.prototype._doPlayStop = function () {\r\n var _this = this;\r\n this._clearTimer();\r\n if (this.model.getPlayState()) {\r\n this._timer = setTimeout(function () {\r\n var timelineModel = _this.model;\r\n _this._changeTimeline(timelineModel.getCurrentIndex()\r\n + (timelineModel.get('rewind', true) ? -1 : 1));\r\n }, this.model.get('playInterval'));\r\n }\r\n };\r\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\r\n var trans = this._mainGroup.getLocalTransform();\r\n return applyTransform$1(vertex, trans, true);\r\n };\r\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\r\n var data = this.model.getData();\r\n var dist = Infinity;\r\n var targetDataIndex;\r\n var axis = this._axis;\r\n data.each(['value'], function (value, dataIndex) {\r\n var coord = axis.dataToCoord(value);\r\n var d = Math.abs(coord - axisCoord);\r\n if (d < dist) {\r\n dist = d;\r\n targetDataIndex = dataIndex;\r\n }\r\n });\r\n return targetDataIndex;\r\n };\r\n SliderTimelineView.prototype._clearTimer = function () {\r\n if (this._timer) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n };\r\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\r\n var currentIndex = this.model.getCurrentIndex();\r\n if (nextIndex === '+') {\r\n nextIndex = currentIndex + 1;\r\n }\r\n else if (nextIndex === '-') {\r\n nextIndex = currentIndex - 1;\r\n }\r\n this.api.dispatchAction({\r\n type: 'timelineChange',\r\n currentIndex: nextIndex,\r\n from: this.uid\r\n });\r\n };\r\n SliderTimelineView.prototype._updateTicksStatus = function () {\r\n var currentIndex = this.model.getCurrentIndex();\r\n var tickSymbols = this._tickSymbols;\r\n var tickLabels = this._tickLabels;\r\n if (tickSymbols) {\r\n for (var i = 0; i < tickSymbols.length; i++) {\r\n tickSymbols && tickSymbols[i]\r\n && tickSymbols[i].toggleState('progress', i < currentIndex);\r\n }\r\n }\r\n if (tickLabels) {\r\n for (var i = 0; i < tickLabels.length; i++) {\r\n tickLabels && tickLabels[i]\r\n && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\r\n }\r\n }\r\n };\r\n SliderTimelineView.type = 'timeline.slider';\r\n return SliderTimelineView;\r\n }(TimelineView));\r\n function createScaleByModel$1(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new IntervalScale();\r\n }\r\n }\r\n }\r\n function getViewRect$5(model, api) {\r\n return getLayoutRect(model.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, model.get('padding'));\r\n }\r\n function makeControlIcon(timelineModel, objPath, rect, opts) {\r\n var style = opts.style;\r\n var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\r\n if (style) {\r\n icon.setStyle(style);\r\n }\r\n return icon;\r\n }\r\n function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\r\n var color = itemStyleModel.get('color');\r\n if (!symbol) {\r\n var symbolType = hostModel.get('symbol');\r\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n symbol.setStyle('strokeNoScale', true);\r\n group.add(symbol);\r\n callback && callback.onCreate(symbol);\r\n }\r\n else {\r\n symbol.setColor(color);\r\n group.add(symbol);\r\n callback && callback.onUpdate(symbol);\r\n }\r\n var itemStyle = itemStyleModel.getItemStyle(['color']);\r\n symbol.setStyle(itemStyle);\r\n opt = merge({\r\n rectHover: true,\r\n z2: 100\r\n }, opt, true);\r\n var symbolSize = hostModel.get('symbolSize');\r\n symbolSize = symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n opt.scaleX = symbolSize[0] / 2;\r\n opt.scaleY = symbolSize[1] / 2;\r\n var symbolOffset = hostModel.get('symbolOffset');\r\n if (symbolOffset) {\r\n opt.x = opt.x || 0;\r\n opt.y = opt.y || 0;\r\n opt.x += parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n opt.y += parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n var symbolRotate = hostModel.get('symbolRotate');\r\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n symbol.attr(opt);\r\n symbol.updateTransform();\r\n return symbol;\r\n }\r\n function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\r\n if (pointer.dragging) {\r\n return;\r\n }\r\n var pointerModel = timelineModel.getModel('checkpointStyle');\r\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\r\n if (noAnimation || !pointerModel.get('animation', true)) {\r\n pointer.attr({\r\n x: toCoord,\r\n y: 0\r\n });\r\n progressLine && progressLine.attr({\r\n shape: { x2: toCoord }\r\n });\r\n }\r\n else {\r\n var animationCfg = {\r\n duration: pointerModel.get('animationDuration', true),\r\n easing: pointerModel.get('animationEasing', true)\r\n };\r\n pointer.stopAnimation(null, true);\r\n pointer.animateTo({\r\n x: toCoord,\r\n y: 0\r\n }, animationCfg);\r\n progressLine && progressLine.animateTo({\r\n shape: { x2: toCoord }\r\n }, animationCfg);\r\n }\r\n }\r\n ComponentView.registerClass(SliderTimelineView);\n\n registerPreprocessor(timelinePreprocessor);\n\n function fillLabel(opt) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n }\r\n var inner$i = makeInner();\r\n var MarkerModel = (function (_super) {\r\n __extends(MarkerModel, _super);\r\n function MarkerModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerModel.type;\r\n _this.createdBySelf = false;\r\n return _this;\r\n }\r\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n };\r\n MarkerModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n };\r\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n };\r\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\r\n var componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerOpt = seriesModel.get(this.mainType, true);\r\n var markerModel = inner$i(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner$i(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n fillLabel(markerOpt);\r\n }\r\n each(markerOpt.data, function (item) {\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\r\n extend(markerModel, {\r\n mainType: this.mainType,\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner$i(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n };\r\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n var data = this.getData();\r\n var value = this.getRawValue(dataIndex);\r\n var itemName = data.getName(dataIndex);\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n };\r\n MarkerModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n MarkerModel.prototype.setData = function (data) {\r\n this._data = data;\r\n };\r\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, componentType) {\r\n return inner$i(seriesModel)[componentType];\r\n };\r\n MarkerModel.type = 'marker';\r\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\r\n return MarkerModel;\r\n }(ComponentModel));\r\n mixin(MarkerModel, DataFormatMixin.prototype);\n\n var MarkPointModel = (function (_super) {\r\n __extends(MarkPointModel, _super);\r\n function MarkPointModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointModel.type;\r\n return _this;\r\n }\r\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkPointModel.type = 'markPoint';\r\n MarkPointModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n return MarkPointModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkPointModel);\n\n function hasXOrY(item) {\r\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\r\n }\r\n function hasXAndY(item) {\r\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\r\n }\r\n function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\r\n var coordArr = [];\r\n var stacked = isDimensionStacked(data, targetDataDim);\r\n var calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n var value = numCalculate(data, calcDataDim, markerType);\r\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n var coordArrValue = data.get(targetDataDim, dataIndex);\r\n var precision = getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\r\n }\r\n return [coordArr, coordArrValue];\r\n }\r\n var markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n };\r\n function dataTransform(seriesModel, item) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {\r\n var dims = coordSys.dimensions;\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n item = clone(item);\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis) {\r\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\r\n item.coord = coordInfo[0];\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n var coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n for (var i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i]]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\r\n }\r\n }\r\n item.coord = coord;\r\n }\r\n }\r\n return item;\r\n }\r\n function getAxisInfo$1(item, data, coordSys, seriesModel) {\r\n var ret = {};\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n return ret;\r\n }\r\n function dataDimToCoordDim(seriesModel, dataDim) {\r\n var data = seriesModel.getData();\r\n var dimensions = data.dimensions;\r\n dataDim = data.getDimension(dataDim);\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimItem = data.getDimensionInfo(dimensions[i]);\r\n if (dimItem.name === dataDim) {\r\n return dimItem.coordDim;\r\n }\r\n }\r\n }\r\n function dataFilter$1(coordSys, item) {\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n }\r\n function dimValueGetter(item, dimName, dataIndex, dimIndex) {\r\n if (dimIndex < 2) {\r\n return item.coord && item.coord[dimIndex];\r\n }\r\n return item.value;\r\n }\r\n function numCalculate(data, valueDataDim, type) {\r\n if (type === 'average') {\r\n var sum_1 = 0;\r\n var count_1 = 0;\r\n data.each(valueDataDim, function (val, idx) {\r\n if (!isNaN(val)) {\r\n sum_1 += val;\r\n count_1++;\r\n }\r\n });\r\n return sum_1 / count_1;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n }\n\n var inner$j = makeInner();\r\n var MarkerView = (function (_super) {\r\n __extends(MarkerView, _super);\r\n function MarkerView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkerView.type;\r\n return _this;\r\n }\r\n MarkerView.prototype.init = function () {\r\n this.markerGroupMap = createHashMap();\r\n };\r\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\r\n var _this = this;\r\n var markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner$j(item).keep = false;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n markerGroupMap.each(function (item) {\r\n !inner$j(item).keep && _this.group.remove(item.group);\r\n });\r\n };\r\n MarkerView.prototype.markKeep = function (drawGroup) {\r\n inner$j(drawGroup).keep = true;\r\n };\r\n MarkerView.prototype.blurSeries = function (seriesModelList) {\r\n var _this = this;\r\n each(seriesModelList, function (seriesModel) {\r\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\r\n if (markerModel) {\r\n var data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n enterBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n };\r\n MarkerView.type = 'marker';\r\n return MarkerView;\r\n }(ComponentView));\n\n function updateMarkerLayout(mpData, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\r\n }\r\n else if (coordSys) {\r\n var x = mpData.get(coordSys.dimensions[0], idx);\r\n var y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n mpData.setItemLayout(idx, point);\r\n });\r\n }\r\n var MarkPointView = (function (_super) {\r\n __extends(MarkPointView, _super);\r\n function MarkPointView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkPointView.type;\r\n return _this;\r\n }\r\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\r\n if (mpModel) {\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var symbolDrawMap = this.markerGroupMap;\r\n var symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n var mpData = createList$1(coordSys, seriesModel, mpModel);\r\n mpModel.setData(mpData);\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n mpData.each(function (idx) {\r\n var itemModel = mpData.getItemModel(idx);\r\n var symbol = itemModel.getShallow('symbol');\r\n var symbolSize = itemModel.getShallow('symbolSize');\r\n var symbolRotate = itemModel.getShallow('symbolRotate');\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {\r\n var rawIdx = mpModel.getRawValue(idx);\r\n var dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n }\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n var color = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n style: style\r\n });\r\n });\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n this.markKeep(symbolDraw);\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkPointView.type = 'markPoint';\r\n return MarkPointView;\r\n }(MarkerView));\r\n function createList$1(coordSys, seriesModel, mpModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var mpData = new List(coordDimsInfos, mpModel);\r\n var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel));\r\n if (coordSys) {\r\n dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys));\r\n }\r\n mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n });\r\n return mpData;\r\n }\r\n ComponentView.registerClass(MarkPointView);\n\n registerPreprocessor(function (opt) {\r\n opt.markPoint = opt.markPoint || {};\r\n });\n\n var MarkLineModel = (function (_super) {\r\n __extends(MarkLineModel, _super);\r\n function MarkLineModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineModel.type;\r\n return _this;\r\n }\r\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkLineModel.type = 'markLine';\r\n MarkLineModel.defaultOption = {\r\n zlevel: 0,\r\n z: 5,\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n return MarkLineModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkLineModel);\n\n var inner$k = makeInner();\r\n var markLineTransform = function (seriesModel, coordSys, mlModel, item) {\r\n var data = seriesModel.getData();\r\n var itemArray;\r\n if (!isArray(item)) {\r\n var mlType = item.type;\r\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n || (item.xAxis != null || item.yAxis != null)) {\r\n var valueAxis = void 0;\r\n var value = void 0;\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = numCalculate(data, valueDataDim, mlType);\r\n }\r\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n var baseIndex = 1 - valueIndex;\r\n var mlFrom = clone(item);\r\n var mlTo = {\r\n coord: []\r\n };\r\n mlFrom.type = null;\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n var precision = mlModel.get('precision');\r\n if (precision >= 0 && typeof value === 'number') {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n itemArray = [mlFrom, mlTo, {\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n value: value\r\n }];\r\n }\r\n else {\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n var normalizedItem = [\r\n dataTransform(seriesModel, itemArray[0]),\r\n dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n return normalizedItem;\r\n };\r\n function isInifinity(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n var dimName = coordSys.dimensions[dimIndex];\r\n return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n }\r\n function markLineFilter(coordSys, item) {\r\n if (coordSys.type === 'cartesian2d') {\r\n var fromCoord = item[0].coord;\r\n var toCoord = item[1].coord;\r\n if (fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, item[0])\r\n && dataFilter$1(coordSys, item[1]);\r\n }\r\n function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get('x'), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\r\n }\r\n else {\r\n var dims = coordSys.dimensions;\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var dims = coordSys.dimensions;\r\n if (isInifinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInifinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n data.setItemLayout(idx, point);\r\n }\r\n var MarkLineView = (function (_super) {\r\n __extends(MarkLineView, _super);\r\n function MarkLineView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkLineView.type;\r\n return _this;\r\n }\r\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\r\n if (mlModel) {\r\n var mlData_1 = mlModel.getData();\r\n var fromData_1 = inner$k(mlModel).from;\r\n var toData_1 = inner$k(mlModel).to;\r\n fromData_1.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\r\n });\r\n mlData_1.each(function (idx) {\r\n mlData_1.setItemLayout(idx, [\r\n fromData_1.getItemLayout(idx),\r\n toData_1.getItemLayout(idx)\r\n ]);\r\n });\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n };\r\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var lineDrawMap = this.markerGroupMap;\r\n var lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n var mlData = createList$2(coordSys, seriesModel, mlModel);\r\n var fromData = mlData.from;\r\n var toData = mlData.to;\r\n var lineData = mlData.line;\r\n inner$k(mlModel).from = fromData;\r\n inner$k(mlModel).to = toData;\r\n mlModel.setData(lineData);\r\n var symbolType = mlModel.get('symbol');\r\n var symbolSize = mlModel.get('symbolSize');\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n lineData.each(function (idx) {\r\n var lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n lineData.setItemVisual(idx, {\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n lineDraw.updateData(lineData);\r\n mlData.line.eachItemGraphicEl(function (el, idx) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n function updateDataVisualAndLayout(data, idx, isFrom) {\r\n var itemModel = data.getItemModel(idx);\r\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\r\n var style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color');\r\n }\r\n data.setItemVisual(idx, {\r\n symbolRotate: itemModel.get('symbolRotate'),\r\n symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],\r\n symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],\r\n style: style\r\n });\r\n }\r\n this.markKeep(lineDraw);\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkLineView.type = 'markLine';\r\n return MarkLineView;\r\n }(MarkerView));\r\n function createList$2(coordSys, seriesModel, mlModel) {\r\n var coordDimsInfos;\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\r\n return defaults({ name: coordDim }, info);\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n var fromData = new List(coordDimsInfos, mlModel);\r\n var toData = new List(coordDimsInfos, mlModel);\r\n var lineData = new List([], mlModel);\r\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markLineFilter, coordSys));\r\n }\r\n var dimValueGetter$1 = coordSys ? dimValueGetter : function (item) {\r\n return item.value;\r\n };\r\n fromData.initData(map(optData, function (item) {\r\n return item[0];\r\n }), null, dimValueGetter$1);\r\n toData.initData(map(optData, function (item) {\r\n return item[1];\r\n }), null, dimValueGetter$1);\r\n lineData.initData(map(optData, function (item) {\r\n return item[2];\r\n }));\r\n lineData.hasItemOption = true;\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n }\r\n ComponentView.registerClass(MarkLineView);\n\n registerPreprocessor(function (opt) {\r\n opt.markLine = opt.markLine || {};\r\n });\n\n var MarkAreaModel = (function (_super) {\r\n __extends(MarkAreaModel, _super);\r\n function MarkAreaModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaModel.type;\r\n return _this;\r\n }\r\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n };\r\n MarkAreaModel.type = 'markArea';\r\n MarkAreaModel.defaultOption = {\r\n zlevel: 0,\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n return MarkAreaModel;\r\n }(MarkerModel));\r\n ComponentModel.registerClass(MarkAreaModel);\n\n var inner$l = makeInner();\r\n var markAreaTransform = function (seriesModel, coordSys, maModel, item) {\r\n var lt = dataTransform(seriesModel, item[0]);\r\n var rb = dataTransform(seriesModel, item[1]);\r\n var ltCoord = lt.coord;\r\n var rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n var result = mergeAll([{}, lt, rb]);\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n };\r\n function isInifinity$1(val) {\r\n return !isNaN(val) && !isFinite(val);\r\n }\r\n function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\r\n var otherDimIndex = 1 - dimIndex;\r\n return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]);\r\n }\r\n function markAreaFilter(coordSys, item) {\r\n var fromCoord = item.coord[0];\r\n var toCoord = item.coord[1];\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n if (fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {\r\n return true;\r\n }\r\n }\r\n return dataFilter$1(coordSys, {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n })\r\n || dataFilter$1(coordSys, {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n });\r\n }\r\n function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var itemModel = data.getItemModel(idx);\r\n var point;\r\n var xPx = parsePercent$2(itemModel.get(dims[0]), api.getWidth());\r\n var yPx = parsePercent$2(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n if (seriesModel.getMarkerPosition) {\r\n point = seriesModel.getMarkerPosition(data.getValues(dims, idx));\r\n }\r\n else {\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n var pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var xAxis = coordSys.getAxis('x');\r\n var yAxis = coordSys.getAxis('y');\r\n var x = data.get(dims[0], idx);\r\n var y = data.get(dims[1], idx);\r\n if (isInifinity$1(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInifinity$1(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n return point;\r\n }\r\n var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\r\n var MarkAreaView = (function (_super) {\r\n __extends(MarkAreaView, _super);\r\n function MarkAreaView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = MarkAreaView.type;\r\n return _this;\r\n }\r\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\r\n if (maModel) {\r\n var areaData_1 = maModel.getData();\r\n areaData_1.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\r\n });\r\n areaData_1.setItemLayout(idx, points);\r\n var el = areaData_1.getItemGraphicEl(idx);\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n };\r\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\r\n var coordSys = seriesModel.coordinateSystem;\r\n var seriesId = seriesModel.id;\r\n var seriesData = seriesModel.getData();\r\n var areaGroupMap = this.markerGroupMap;\r\n var polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, { group: new Group() });\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n var areaData = createList$3(coordSys, seriesModel, maModel);\r\n maModel.setData(areaData);\r\n areaData.each(function (idx) {\r\n var points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n var allClipped = true;\r\n each(dimPermutations, function (dim) {\r\n if (!allClipped) {\r\n return;\r\n }\r\n var xValue = areaData.get(dim[0], idx);\r\n var yValue = areaData.get(dim[1], idx);\r\n if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))\r\n && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))) {\r\n allClipped = false;\r\n }\r\n });\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n var color$1 = getVisualFromData(seriesData, 'color');\r\n if (!style.fill) {\r\n style.fill = color$1;\r\n if (typeof style.fill === 'string') {\r\n style.fill = modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color$1;\r\n }\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n areaData.diff(inner$l(polygonGroup).data)\r\n .add(function (idx) {\r\n var layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n var polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(oldIdx);\r\n var layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n var polygon = inner$l(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n areaData.eachItemGraphicEl(function (polygon, idx) {\r\n var itemModel = areaData.getItemModel(idx);\r\n var style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: typeof style.fill === 'string'\r\n ? modifyAlpha(style.fill, 1) : '#000'\r\n });\r\n setStatesStylesFromModel(polygon, itemModel);\r\n enableHoverEmphasis(polygon);\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n inner$l(polygonGroup).data = areaData;\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n };\r\n MarkAreaView.type = 'markArea';\r\n return MarkAreaView;\r\n }(MarkerView));\r\n function createList$3(coordSys, seriesModel, maModel) {\r\n var coordDimsInfos;\r\n var areaData;\r\n var dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n var data = seriesModel.getData();\r\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\r\n return defaults({\r\n name: coordDim\r\n }, info);\r\n });\r\n areaData = new List(map(dims, function (dim, idx) {\r\n return {\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n };\r\n }), maModel);\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new List(coordDimsInfos, maModel);\r\n }\r\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\r\n if (coordSys) {\r\n optData = filter(optData, curry(markAreaFilter, coordSys));\r\n }\r\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\r\n return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n } : function (item) {\r\n return item.value;\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n }\r\n ComponentView.registerClass(MarkAreaView);\n\n registerPreprocessor(function (opt) {\r\n opt.markArea = opt.markArea || {};\r\n });\n\n var getDefaultSelectorOptions = function (ecModel, type) {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocale(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocale(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n };\r\n var LegendModel = (function (_super) {\r\n __extends(LegendModel, _super);\r\n function LegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendModel.type;\r\n _this.layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n };\r\n return _this;\r\n }\r\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n this._updateSelector(option);\r\n };\r\n LegendModel.prototype._updateSelector = function (option) {\r\n var selector = option.selector;\r\n var ecModel = this.ecModel;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (isArray(selector)) {\r\n each(selector, function (item, index) {\r\n isString(item) && (item = { type: item });\r\n selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));\r\n });\r\n }\r\n };\r\n LegendModel.prototype.optionUpdated = function () {\r\n this._updateData(this.ecModel);\r\n var legendData = this._data;\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n var hasSelected = false;\r\n for (var i = 0; i < legendData.length; i++) {\r\n var name_1 = legendData[i].get('name');\r\n if (this.isSelected(name_1)) {\r\n this.select(name_1);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n };\r\n LegendModel.prototype._updateData = function (ecModel) {\r\n var potentialData = [];\r\n var availableNames = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n var seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n var isPotential;\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n var names = provider.getAllNames();\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n this._availableNames = availableNames;\r\n var rawData = this.get('data') || potentialData;\r\n var legendData = map(rawData, function (dataItem) {\r\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\r\n dataItem = {\r\n name: dataItem\r\n };\r\n }\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n this._data = legendData;\r\n };\r\n LegendModel.prototype.getData = function () {\r\n return this._data;\r\n };\r\n LegendModel.prototype.select = function (name) {\r\n var selected = this.option.selected;\r\n var selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n var data = this._data;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n };\r\n LegendModel.prototype.unSelect = function (name) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n };\r\n LegendModel.prototype.toggleSelected = function (name) {\r\n var selected = this.option.selected;\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n };\r\n LegendModel.prototype.allSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n };\r\n LegendModel.prototype.inverseSelect = function () {\r\n var data = this._data;\r\n var selected = this.option.selected;\r\n each(data, function (dataItem) {\r\n var name = dataItem.get('name', true);\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n };\r\n LegendModel.prototype.isSelected = function (name) {\r\n var selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && indexOf(this._availableNames, name) >= 0;\r\n };\r\n LegendModel.prototype.getOrient = function () {\r\n return this.get('orient') === 'vertical'\r\n ? { index: 1, name: 'vertical' }\r\n : { index: 0, name: 'horizontal' };\r\n };\r\n LegendModel.type = 'legend.plain';\r\n LegendModel.dependencies = ['series'];\r\n LegendModel.defaultOption = {\r\n zlevel: 0,\r\n z: 4,\r\n show: true,\r\n orient: 'horizontal',\r\n left: 'center',\r\n top: 0,\r\n align: 'auto',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n itemStyle: {\r\n borderWidth: 0\r\n },\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n selector: false,\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: ' sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n selectorPosition: 'auto',\r\n selectorItemGap: 7,\r\n selectorButtonGap: 10,\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n return LegendModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(LegendModel);\n\n function legendSelectActionHandler(methodName, payload, ecModel) {\r\n var selectedMap = {};\r\n var isToggleSelect = methodName === 'toggleSelected';\r\n var isSelected;\r\n ecModel.eachComponent('legend', function (legendModel) {\r\n if (isToggleSelect && isSelected != null) {\r\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\r\n }\r\n else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n isSelected = legendModel.isSelected(payload.name);\r\n }\r\n var legendData = legendModel.getData();\r\n each(legendData, function (model) {\r\n var name = model.get('name');\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n var isItemSelected = legendModel.isSelected(name);\r\n if (selectedMap.hasOwnProperty(name)) {\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n });\r\n return (methodName === 'allSelect' || methodName === 'inverseSelect')\r\n ? {\r\n selected: selectedMap\r\n }\r\n : {\r\n name: payload.name,\r\n selected: selectedMap\r\n };\r\n }\r\n registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\r\n registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\r\n registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\r\n registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\r\n registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n\n var curry$1 = curry;\r\n var each$e = each;\r\n var Group$2 = Group;\r\n var LegendView = (function (_super) {\r\n __extends(LegendView, _super);\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group$2());\r\n this.group.add(this._selectorGroup = new Group$2());\r\n this._isFirstRender = true;\r\n };\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (legendModel.get('left') === 'right'\r\n && orient === 'vertical') ? 'right' : 'left';\r\n }\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n var padding = legendModel.get('padding');\r\n var maxSize = getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n var layoutRect = getLayoutRect(defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each$e(legendModel.getData(), function (itemModel, dataIndex) {\r\n var name = itemModel.get('name');\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group$2();\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var style = data.getVisual('style');\r\n var color = style[data.getVisual('drawType')] || style.fill;\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\r\n var symbolType = data.getVisual('symbol');\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var borderColor = style.stroke;\r\n var decal = style.decal;\r\n var color = style.fill;\r\n var colorArr = parse(style.fill);\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n color = stringify(colorArr, 'rgba');\r\n }\r\n var legendSymbolType = 'roundRect';\r\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, decal, selectMode);\r\n itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each$e(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new ZRText({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, { normal: labelModel, emphasis: emphasisLabelModel }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n LegendView.prototype._createItem = function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, decal, selectMode) {\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var inactiveColor = legendModel.get('inactiveColor');\r\n var inactiveBorderColor = legendModel.get('inactiveBorderColor');\r\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\r\n var legendModelItemStyle = legendModel.getModel('itemStyle');\r\n var isSelected = legendModel.isSelected(name);\r\n var itemGroup = new Group$2();\r\n var textStyleModel = itemModel.getModel('textStyle');\r\n var itemIcon = itemModel.get('icon');\r\n var tooltipModel = itemModel.getModel('tooltip');\r\n var legendGlobalTooltipModel = tooltipModel.parentModel;\r\n legendSymbolType = itemIcon || legendSymbolType;\r\n var legendSymbol = createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbol, legendSymbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n if (!itemIcon && symbolType\r\n && ((symbolType !== legendSymbolType) || symbolType === 'none')) {\r\n var size = itemHeight * 0.8;\r\n if (symbolType === 'none') {\r\n symbolType = 'circle';\r\n }\r\n var legendSymbolCenter = createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, symbolKeepAspect == null ? true : symbolKeepAspect);\r\n itemGroup.add(setSymbolStyle(legendSymbolCenter, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected));\r\n }\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n if (typeof formatter === 'string' && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (typeof formatter === 'function') {\r\n content = formatter(name);\r\n }\r\n itemGroup.add(new ZRText({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n }));\r\n var hitRect = new Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n if (tooltipModel.get('show')) {\r\n var formatterParams = {\r\n componentType: 'legend',\r\n legendIndex: legendModel.componentIndex,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n hitRect.tooltip = extend({\r\n content: name,\r\n formatter: legendGlobalTooltipModel.get('formatter', true)\r\n || function (params) {\r\n return params.name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipModel.option);\r\n }\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup);\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup();\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n if (selector) {\r\n box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n }(ComponentView));\r\n function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, inactiveBorderColor, decal, isSelected) {\r\n var itemStyle;\r\n if (symbolType !== 'line' && symbolType.indexOf('empty') < 0) {\r\n itemStyle = legendModelItemStyle.getItemStyle();\r\n symbol.style.stroke = borderColor;\r\n symbol.style.decal = decal;\r\n if (!isSelected) {\r\n itemStyle.stroke = inactiveBorderColor;\r\n }\r\n }\r\n else {\r\n itemStyle = legendModelItemStyle.getItemStyle(['borderWidth', 'borderColor']);\r\n }\r\n symbol.setStyle(itemStyle);\r\n return symbol;\r\n }\r\n function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n }\r\n function isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n }\r\n function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n }\r\n ComponentView.registerClass(LegendView);\n\n function legendFilter(ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series) {\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n }\n\n registerProcessor(PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\n ComponentModel.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n });\n\n var ScrollableLegendModel = (function (_super) {\r\n __extends(ScrollableLegendModel, _super);\r\n function ScrollableLegendModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendModel.type;\r\n return _this;\r\n }\r\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n };\r\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\r\n var inputPositionParams = getLayoutParams(option);\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams);\r\n };\r\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\r\n _super.prototype.mergeOption.call(this, option, ecModel);\r\n mergeAndNormalizeLayoutParams$1(this, this.option, option);\r\n };\r\n ScrollableLegendModel.type = 'legend.scroll';\r\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end',\r\n pageFormatter: '{current}/{total}',\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15,\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n animationDurationUpdate: 800\r\n });\r\n return ScrollableLegendModel;\r\n }(LegendModel));\r\n function mergeAndNormalizeLayoutParams$1(legendModel, target, raw) {\r\n var orient = legendModel.getOrient();\r\n var ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n }\r\n ComponentModel.registerClass(ScrollableLegendModel);\n\n var Group$3 = Group;\r\n var WH$1 = ['width', 'height'];\r\n var XY$1 = ['x', 'y'];\r\n var ScrollableLegendView = (function (_super) {\r\n __extends(ScrollableLegendView, _super);\r\n function ScrollableLegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ScrollableLegendView.type;\r\n _this.newlineDisabled = true;\r\n _this._currentIndex = 0;\r\n return _this;\r\n }\r\n ScrollableLegendView.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n this.group.add(this._containerGroup = new Group$3());\r\n this._containerGroup.add(this.getContentGroup());\r\n this.group.add(this._controllerGroup = new Group$3());\r\n };\r\n ScrollableLegendView.prototype.resetInner = function () {\r\n _super.prototype.resetInner.call(this);\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n };\r\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var self = this;\r\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n var controllerGroup = this._controllerGroup;\r\n var pageIconSize = legendModel.get('pageIconSize', true);\r\n var pageIconSizeArr = isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n createPageButton('pagePrev', 0);\r\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new ZRText({\r\n name: 'pageText',\r\n style: {\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n createPageButton('pageNext', 1);\r\n function createPageButton(name, iconIdx) {\r\n var pageDataIndexName = (name + 'DataIndex');\r\n var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\r\n onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)\r\n }, {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n });\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n };\r\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var hw = WH$1[1 - orientIdx];\r\n var yx = XY$1[1 - orientIdx];\r\n selector && box('horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var processMaxSize = clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n var offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\r\n var contentGroup = this.getContentGroup();\r\n var containerGroup = this._containerGroup;\r\n var controllerGroup = this._controllerGroup;\r\n box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\r\n box('horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\r\n var contentRect = contentGroup.getBoundingRect();\r\n var controllerRect = controllerGroup.getBoundingRect();\r\n var showController = this._showController = contentRect[wh] > maxSize[wh];\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n var containerPos = [0, 0];\r\n var controllerPos = [-controllerRect.x, -controllerRect.y];\r\n var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\r\n if (showController) {\r\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n var mainRect = { x: 0, y: 0 };\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n var clipShape = { x: 0, y: 0 };\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new Rect({ shape: clipShape }));\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n controllerGroup.eachChild(function (child) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n var pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && updateProps(contentGroup, { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] }, showController ? legendModel : null);\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n return mainRect;\r\n };\r\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\r\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n };\r\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\r\n var controllerGroup = this._controllerGroup;\r\n each(['pagePrev', 'pageNext'], function (name) {\r\n var key = (name + 'DataIndex');\r\n var canJump = pageInfo[key] != null;\r\n var icon = controllerGroup.childOfName(name);\r\n if (icon) {\r\n icon.setStyle('fill', canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true));\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n var pageText = controllerGroup.childOfName('pageText');\r\n var pageFormatter = legendModel.get('pageFormatter');\r\n var pageIndex = pageInfo.pageIndex;\r\n var current = pageIndex != null ? pageIndex + 1 : 0;\r\n var total = pageInfo.pageCount;\r\n pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({ current: current, total: total }));\r\n };\r\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\r\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n var contentGroup = this.getContentGroup();\r\n var containerRectSize = this._containerGroup.__rectSize;\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = WH$1[orientIdx];\r\n var xy = XY$1[orientIdx];\r\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n var children = contentGroup.children();\r\n var targetItem = children[targetItemIndex];\r\n var itemCount = children.length;\r\n var pCount = !itemCount ? 0 : 1;\r\n var result = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n if (!targetItem) {\r\n return result;\r\n }\r\n var targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else {\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n && winStartItemInfo.i < winEndItemInfo.i) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n return result;\r\n function getItemInfo(el) {\r\n if (el) {\r\n var itemRect = el.getBoundingRect();\r\n var start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: el.__legendDataIndex\r\n };\r\n }\r\n }\r\n function intersect(itemInfo, winStart) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n };\r\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n var index;\r\n var contentGroup = this.getContentGroup();\r\n var defaultIndex;\r\n contentGroup.eachChild(function (child, idx) {\r\n var legendDataIdx = child.__legendDataIndex;\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n return index != null ? index : defaultIndex;\r\n };\r\n ScrollableLegendView.type = 'legend.scroll';\r\n return ScrollableLegendView;\r\n }(LegendView));\r\n ComponentView.registerClass(ScrollableLegendView);\n\n registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\r\n var scrollDataIndex = payload.scrollDataIndex;\r\n scrollDataIndex != null && ecModel.eachComponent({ mainType: 'legend', subType: 'scroll', query: payload }, function (legendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n });\r\n });\n\n var SliderZoomModel = (function (_super) {\r\n __extends(SliderZoomModel, _super);\r\n function SliderZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomModel.type;\r\n return _this;\r\n }\r\n SliderZoomModel.type = 'dataZoom.slider';\r\n SliderZoomModel.layoutMode = 'box';\r\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n right: 'ph',\r\n top: 'ph',\r\n width: 'ph',\r\n height: 'ph',\r\n left: null,\r\n bottom: null,\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n backgroundColor: 'rgba(47,69,84,0)',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n handleSize: '100%',\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n showDetail: true,\r\n showDataShadow: 'auto',\r\n realtime: true,\r\n zoomLock: false,\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n });\r\n return SliderZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(SliderZoomModel);\n\n var Rect$2 = Rect;\r\n var DEFAULT_LOCATION_EDGE_GAP = 7;\r\n var DEFAULT_FRAME_BORDER_WIDTH = 1;\r\n var DEFAULT_FILLER_SIZE = 30;\r\n var DEFAULT_MOVE_HANDLE_SIZE = 7;\r\n var HORIZONTAL = 'horizontal';\r\n var VERTICAL = 'vertical';\r\n var LABEL_GAP = 5;\r\n var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\n var REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100\r\n };\r\n var SliderZoomView = (function (_super) {\r\n __extends(SliderZoomView, _super);\r\n function SliderZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = SliderZoomView.type;\r\n _this._displayables = {};\r\n return _this;\r\n }\r\n SliderZoomView.prototype.init = function (ecModel, api) {\r\n this.api = api;\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n };\r\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\r\n _super.prototype.render.apply(this, arguments);\r\n createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\r\n this._orient = dataZoomModel.getOrient();\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n this._updateView();\r\n };\r\n SliderZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n SliderZoomView.prototype._clear = function () {\r\n clear(this, '_dispatchZoomAction');\r\n var zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n };\r\n SliderZoomView.prototype._buildView = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n this._resetLocation();\r\n this._resetInterval();\r\n var barGroup = this._displayables.sliderGroup = new Group();\r\n this._renderBackground();\r\n this._renderHandle();\r\n this._renderDataShadow();\r\n thisGroup.add(barGroup);\r\n this._positionGroup();\r\n };\r\n SliderZoomView.prototype._resetLocation = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var showMoveHandle = dataZoomModel.get('brushSelect');\r\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n var coordRect = this._findCoordRect();\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : {\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n var layoutParams = getLayoutParams(dataZoomModel.option);\r\n each(['right', 'top', 'width', 'height'], function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n var layoutRect = getLayoutRect(layoutParams, ecSize);\r\n this._location = { x: layoutRect.x, y: layoutRect.y };\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n };\r\n SliderZoomView.prototype._positionGroup = function () {\r\n var thisGroup = this.group;\r\n var location = this._location;\r\n var orient = this._orient;\r\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n sliderGroup.attr((orient === HORIZONTAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? { scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? { scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2 }\r\n : { scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2 });\r\n var rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n };\r\n SliderZoomView.prototype._getViewExtent = function () {\r\n return [0, this._size[0]];\r\n };\r\n SliderZoomView.prototype._renderBackground = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var size = this._size;\r\n var barGroup = this._displayables.sliderGroup;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n barGroup.add(new Rect$2({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n var clickPanel = new Rect$2({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n var zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n barGroup.add(clickPanel);\r\n };\r\n SliderZoomView.prototype._renderDataShadow = function () {\r\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n this._displayables.dataShadowSegs = [];\r\n if (!info) {\r\n return;\r\n }\r\n var size = this._size;\r\n var seriesModel = info.series;\r\n var data = seriesModel.getRawData();\r\n var otherDim = seriesModel.getShadowDim\r\n ? seriesModel.getShadowDim()\r\n : info.otherDim;\r\n if (otherDim == null) {\r\n return;\r\n }\r\n var otherDataExtent = data.getDataExtent(otherDim);\r\n var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n var otherShadowExtent = [0, size[1]];\r\n var thisShadowExtent = [0, size[0]];\r\n var areaPoints = [[size[0], 0], [0, 0]];\r\n var linePoints = [];\r\n var step = thisShadowExtent[1] / (data.count() - 1);\r\n var thisCoord = 0;\r\n var stride = Math.round(data.count() / size[0]);\r\n var lastIsEmpty;\r\n data.each([otherDim], function (value, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n var isEmpty = value == null || isNaN(value) || value === '';\r\n var otherCoord = isEmpty\r\n ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true);\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n var dataZoomModel = this.dataZoomModel;\r\n function createDataShadowGroup(isSelectedArea) {\r\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n var group = new Group();\r\n var polygon = new Polygon({\r\n shape: { points: areaPoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n var polyline = new Polyline({\r\n shape: { points: linePoints },\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n for (var i = 0; i < 3; i++) {\r\n var group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n };\r\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\r\n var dataZoomModel = this.dataZoomModel;\r\n var showDataShadow = dataZoomModel.get('showDataShadow');\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n var result;\r\n var ecModel = this.ecModel;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n var seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\r\n return;\r\n }\r\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\r\n var otherDim = getOtherDim(axisDim);\r\n var otherAxisInverse;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n }, this);\r\n }, this);\r\n return result;\r\n };\r\n SliderZoomView.prototype._renderHandle = function () {\r\n var thisGroup = this.group;\r\n var displayables = this._displayables;\r\n var handles = displayables.handles = [null, null];\r\n var handleLabels = displayables.handleLabels = [null, null];\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var size = this._size;\r\n var dataZoomModel = this.dataZoomModel;\r\n var api = this.api;\r\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n var brushSelect = dataZoomModel.get('brushSelect');\r\n var filler = displayables.filler = new Rect$2({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n sliderGroup.add(filler);\r\n sliderGroup.add(new Rect$2({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n stroke: dataZoomModel.get('dataBackgroundColor')\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n each([0, 1], function (handleIndex) {\r\n var iconStr = dataZoomModel.get('handleIcon');\r\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0) {\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n var bRect = path.getBoundingRect();\r\n var handleSize = dataZoomModel.get('handleSize');\r\n this._handleHeight = parsePercent$2(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n var handleColor = dataZoomModel.get('handleColor');\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n sliderGroup.add(handles[handleIndex] = path);\r\n var textStyleModel = dataZoomModel.getModel('textStyle');\r\n thisGroup.add(handleLabels[handleIndex] = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n },\r\n z2: 10\r\n }));\r\n }, this);\r\n var actualMoveZone = filler;\r\n if (brushSelect) {\r\n var moveHandleHeight = parsePercent$2(dataZoomModel.get('moveHandleSize'), size[1]);\r\n var moveHandle_1 = displayables.moveHandle = new Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n var iconSize = moveHandleHeight * 0.8;\r\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\r\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n actualMoveZone.on('mouseover', function () {\r\n api.enterEmphasis(moveHandle_1);\r\n })\r\n .on('mouseout', function () {\r\n api.leaveEmphasis(moveHandle_1);\r\n });\r\n sliderGroup.add(moveHandle_1);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n };\r\n SliderZoomView.prototype._resetInterval = function () {\r\n var range = this._range = this.dataZoomModel.getPercentRange();\r\n var viewExtent = this._getViewExtent();\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n };\r\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var handleEnds = this._handleEnds;\r\n var viewExtend = this._getViewExtent();\r\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n var percentExtent = [0, 100];\r\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\r\n var lastRange = this._range;\r\n var range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n };\r\n SliderZoomView.prototype._updateView = function (nonRealtime) {\r\n var displaybles = this._displayables;\r\n var handleEnds = this._handleEnds;\r\n var handleInterval = asc(handleEnds.slice());\r\n var size = this._size;\r\n each([0, 1], function (handleIndex) {\r\n var handle = displaybles.handles[handleIndex];\r\n var handleHeight = this._handleHeight;\r\n handle.attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n var viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n var dataShadowSegs = displaybles.dataShadowSegs;\r\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n for (var i = 0; i < dataShadowSegs.length; i++) {\r\n var segGroup = dataShadowSegs[i];\r\n var clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n this._updateDataInfo(nonRealtime);\r\n };\r\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var displaybles = this._displayables;\r\n var handleLabels = displaybles.handleLabels;\r\n var orient = this._orient;\r\n var labelTexts = ['', ''];\r\n if (dataZoomModel.get('showDetail')) {\r\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n var axis = axisProxy.getAxisModel().axis;\r\n var range = this._range;\r\n var dataInterval = nonRealtime\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n var orderedHandleEnds = asc(this._handleEnds.slice());\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n function setLabel(handleIndex) {\r\n var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);\r\n var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\r\n var offset = this._handleWidth / 2 + LABEL_GAP;\r\n var textPoint = applyTransform$1([\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ], barTransform);\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\r\n align: orient === HORIZONTAL ? direction : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n };\r\n SliderZoomView.prototype._formatLabel = function (value, axis) {\r\n var dataZoomModel = this.dataZoomModel;\r\n var labelFormatter = dataZoomModel.get('labelFormatter');\r\n var labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n var valueStr = (value == null || isNaN(value))\r\n ? ''\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value)\r\n })\r\n : value.toFixed(Math.min(labelPrecision, 20));\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n };\r\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\r\n showOrHide = this._dragging || showOrHide;\r\n var displayables = this._displayables;\r\n var handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n };\r\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\r\n this._dragging = true;\r\n stop(event.event);\r\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n var vertex = applyTransform$1([dx, dy], barTransform, true);\r\n var changed = this._updateInterval(handleIndex, vertex[0]);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n this._updateView(!realtime);\r\n changed && realtime && this._dispatchZoomAction(true);\r\n };\r\n SliderZoomView.prototype._onDragEnd = function () {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n var realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onClickPanel = function (e) {\r\n var size = this._size;\r\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]) {\r\n return;\r\n }\r\n var handleEnds = this._handleEnds;\r\n var center = (handleEnds[0] + handleEnds[1]) / 2;\r\n var changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrushStart = function (e) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n this._brushStart = new Point(x, y);\r\n this._brushing = true;\r\n this._brushStartTime = +new Date();\r\n };\r\n SliderZoomView.prototype._onBrushEnd = function (e) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n var brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n if (!brushRect) {\r\n return;\r\n }\r\n brushRect.attr('ignore', true);\r\n var brushShape = brushRect.shape;\r\n var brushEndTime = +new Date();\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n return;\r\n }\r\n var viewExtend = this._getViewExtent();\r\n var percentExtent = [0, 100];\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n this._updateView();\r\n this._dispatchZoomAction(false);\r\n };\r\n SliderZoomView.prototype._onBrush = function (e) {\r\n if (this._brushing) {\r\n stop(e.event);\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n };\r\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\r\n var displayables = this._displayables;\r\n var dataZoomModel = this.dataZoomModel;\r\n var brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect$2({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n brushRect.attr('ignore', false);\r\n var brushStart = this._brushStart;\r\n var sliderGroup = this._displayables.sliderGroup;\r\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n var size = this._size;\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n };\r\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\r\n var range = this._range;\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n };\r\n SliderZoomView.prototype._findCoordRect = function () {\r\n var rect;\r\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n if (!rect && coordSysInfoList.length) {\r\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n if (!rect) {\r\n var width = this.api.getWidth();\r\n var height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n return rect;\r\n };\r\n SliderZoomView.type = 'dataZoom.slider';\r\n return SliderZoomView;\r\n }(DataZoomView));\r\n function getOtherDim(thisDim) {\r\n var map = { x: 'y', y: 'x', radius: 'angle', angle: 'radius' };\r\n return map[thisDim];\r\n }\r\n function getCursor(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(SliderZoomView);\n\n var InsideZoomModel = (function (_super) {\r\n __extends(InsideZoomModel, _super);\r\n function InsideZoomModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = InsideZoomModel.type;\r\n return _this;\r\n }\r\n InsideZoomModel.type = 'dataZoom.inside';\r\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n return InsideZoomModel;\r\n }(DataZoomModel));\r\n ComponentModel.registerClass(InsideZoomModel);\n\n var inner$m = makeInner();\r\n registerProcessor(PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\r\n var apiInner = inner$m(api);\r\n var coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n ecModel.eachComponent({ mainType: 'dataZoom', subType: 'inside' }, function (dataZoomModel) {\r\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n var coordSysUid = dzCoordSysInfo.model.uid;\r\n var coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n });\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n var controller = coordSysRecord.controller;\r\n var firstDzInfo;\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\r\n });\r\n });\r\n function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\r\n inner$m(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n }\r\n function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\r\n var coordSysRecordMap = inner$m(api).coordSysRecordMap;\r\n var coordSysKeyArr = coordSysRecordMap.keys();\r\n for (var i = 0; i < coordSysKeyArr.length; i++) {\r\n var coordSysKey = coordSysKeyArr[i];\r\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n var dzUid = dataZoomModel.uid;\r\n var dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n var controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n }\r\n function createCoordSysRecord(api, coordSysModel) {\r\n var coordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction$1, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\r\n controller.on(eventName, function (event) {\r\n var batch = [];\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n var method = (dzInfo.getRange || {})[eventName];\r\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n return coordSysRecord;\r\n }\r\n function dispatchAction$1(api, batch) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n }\r\n function containsPoint(coordSysModel, e, x, y) {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n }\r\n function mergeControllerParams(dataZoomInfoMap) {\r\n var controlType;\r\n var prefix = 'type_';\r\n var typePriority = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n var preventDefaultMouseMove = true;\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n var dataZoomModel = dataZoomInfo.model;\r\n var oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move'\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n }\n\n var InsideZoomView = (function (_super) {\r\n __extends(InsideZoomView, _super);\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n this.range = dataZoomModel.getPercentRange();\r\n setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n InsideZoomView.prototype._clear = function () {\r\n disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n }(DataZoomView));\r\n var getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n };\r\n function makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice();\r\n var axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n }\r\n var getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else {\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n return ret;\r\n }\r\n };\r\n ComponentView.registerClass(InsideZoomView);\n\n var each$f = each;\r\n function visualMapPreprocessor(option) {\r\n var visualMap = option && option.visualMap;\r\n if (!isArray(visualMap)) {\r\n visualMap = visualMap ? [visualMap] : [];\r\n }\r\n each$f(visualMap, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) {\r\n opt.pieces = opt.splitList;\r\n delete opt.splitList;\r\n }\r\n var pieces = opt.pieces;\r\n if (pieces && isArray(pieces)) {\r\n each$f(pieces, function (piece) {\r\n if (isObject(piece)) {\r\n if (has$1(piece, 'start') && !has$1(piece, 'min')) {\r\n piece.min = piece.start;\r\n }\r\n if (has$1(piece, 'end') && !has$1(piece, 'max')) {\r\n piece.max = piece.end;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n function has$1(obj, name) {\r\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\r\n }\n\n ComponentModel.registerSubTypeDefaulter('visualMap', function (option) {\r\n return (!option.categories\r\n && (!(option.pieces\r\n ? option.pieces.length > 0\r\n : option.splitNumber > 0)\r\n || option.calculable))\r\n ? 'continuous' : 'piecewise';\r\n });\n\n var VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT;\r\n registerVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var resetDefines = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n var pipelineContext = seriesModel.pipelineContext;\r\n if (!visualMapModel.isTargetSeries(seriesModel)\r\n || (pipelineContext && pipelineContext.large)) {\r\n return;\r\n }\r\n resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\r\n });\r\n return resetDefines;\r\n }\r\n });\r\n registerVisual(VISUAL_PRIORITY, {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var visualMetaList = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel) {\r\n if (visualMapModel.isTargetSeries(seriesModel)) {\r\n var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {\r\n stops: [],\r\n outerColors: []\r\n };\r\n var concreteDim = visualMapModel.getDataDimension(data);\r\n var dimInfo = data.getDimensionInfo(concreteDim);\r\n if (dimInfo != null) {\r\n visualMeta.dimension = dimInfo.index;\r\n visualMetaList.push(visualMeta);\r\n }\r\n }\r\n });\r\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\r\n }\r\n });\r\n function getColorVisual(seriesModel, visualMapModel, value, valueState) {\r\n var mappings = visualMapModel.targetVisuals[valueState];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n var resultVisual = {\r\n color: getVisualFromData(seriesModel.getData(), 'color')\r\n };\r\n for (var i = 0, len = visualTypes.length; i < len; i++) {\r\n var type = visualTypes[i];\r\n var mapping = mappings[(type === 'opacity' ? '__alphaForOpacity' : type)];\r\n mapping && mapping.applyVisual(value, getVisual, setVisual);\r\n }\r\n return resultVisual.color;\r\n function getVisual(key) {\r\n return resultVisual[key];\r\n }\r\n function setVisual(key, value) {\r\n resultVisual[key] = value;\r\n }\r\n }\n\n var visualDefault = {\r\n get: function (visualType, key, isCategory) {\r\n var value = clone((defaultOption$2[visualType] || {})[key]);\r\n return isCategory\r\n ? (isArray(value) ? value[value.length - 1] : value)\r\n : value;\r\n }\r\n };\r\n var defaultOption$2 = {\r\n color: {\r\n active: ['#006edd', '#e0ffff'],\r\n inactive: ['rgba(0,0,0,0)']\r\n },\r\n colorHue: {\r\n active: [0, 360],\r\n inactive: [0, 0]\r\n },\r\n colorSaturation: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n colorLightness: {\r\n active: [0.9, 0.5],\r\n inactive: [0, 0]\r\n },\r\n colorAlpha: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n opacity: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n symbol: {\r\n active: ['circle', 'roundRect', 'diamond'],\r\n inactive: ['none']\r\n },\r\n symbolSize: {\r\n active: [10, 50],\r\n inactive: [0, 0]\r\n }\r\n };\n\n var mapVisual$1 = VisualMapping.mapVisual;\r\n var eachVisual = VisualMapping.eachVisual;\r\n var isArray$1 = isArray;\r\n var each$g = each;\r\n var asc$2 = asc;\r\n var linearMap$1 = linearMap;\r\n var VisualMapModel = (function (_super) {\r\n __extends(VisualMapModel, _super);\r\n function VisualMapModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapModel.type;\r\n _this.stateList = ['inRange', 'outOfRange'];\r\n _this.replacableOptionKeys = [\r\n 'inRange', 'outOfRange', 'target', 'controller', 'color'\r\n ];\r\n _this.layoutMode = {\r\n type: 'box', ignoreSize: true\r\n };\r\n _this.dataBound = [-Infinity, Infinity];\r\n _this.targetVisuals = {};\r\n _this.controllerVisuals = {};\r\n return _this;\r\n }\r\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n if (!env.canvasSupported) {\r\n thisOption.realtime = false;\r\n }\r\n !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\r\n this.textStyleModel = this.getModel('textStyle');\r\n this.resetItemSize();\r\n this.completeVisualOption();\r\n };\r\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\r\n var stateList = this.stateList;\r\n supplementVisualOption = bind(supplementVisualOption, this);\r\n this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);\r\n this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);\r\n };\r\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\r\n var optionSeriesIndex = this.option.seriesIndex;\r\n var seriesIndices = [];\r\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\r\n this.ecModel.eachSeries(function (seriesModel, index) {\r\n seriesIndices.push(index);\r\n });\r\n }\r\n else {\r\n seriesIndices = normalizeToArray(optionSeriesIndex);\r\n }\r\n return seriesIndices;\r\n };\r\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\r\n each(this.getTargetSeriesIndices(), function (seriesIndex) {\r\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\r\n if (seriesModel) {\r\n callback.call(context, seriesModel);\r\n }\r\n }, this);\r\n };\r\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\r\n var is = false;\r\n this.eachTargetSeries(function (model) {\r\n model === seriesModel && (is = true);\r\n });\r\n return is;\r\n };\r\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\r\n var option = this.option;\r\n var precision = option.precision;\r\n var dataBound = this.dataBound;\r\n var formatter = option.formatter;\r\n var isMinMax;\r\n edgeSymbols = edgeSymbols || ['<', '>'];\r\n if (isArray(value)) {\r\n value = value.slice();\r\n isMinMax = true;\r\n }\r\n var textValue = isCategory\r\n ? value\r\n : (isMinMax\r\n ? [toFixed(value[0]), toFixed(value[1])]\r\n : toFixed(value));\r\n if (isString(formatter)) {\r\n return formatter\r\n .replace('{value}', isMinMax ? textValue[0] : textValue)\r\n .replace('{value2}', isMinMax ? textValue[1] : textValue);\r\n }\r\n else if (isFunction(formatter)) {\r\n return isMinMax\r\n ? formatter(value[0], value[1])\r\n : formatter(value);\r\n }\r\n if (isMinMax) {\r\n if (value[0] === dataBound[0]) {\r\n return edgeSymbols[0] + ' ' + textValue[1];\r\n }\r\n else if (value[1] === dataBound[1]) {\r\n return edgeSymbols[1] + ' ' + textValue[0];\r\n }\r\n else {\r\n return textValue[0] + ' - ' + textValue[1];\r\n }\r\n }\r\n else {\r\n return textValue;\r\n }\r\n function toFixed(val) {\r\n return val === dataBound[0]\r\n ? 'min'\r\n : val === dataBound[1]\r\n ? 'max'\r\n : (+val).toFixed(Math.min(precision, 20));\r\n }\r\n };\r\n VisualMapModel.prototype.resetExtent = function () {\r\n var thisOption = this.option;\r\n var extent = asc$2([thisOption.min, thisOption.max]);\r\n this._dataExtent = extent;\r\n };\r\n VisualMapModel.prototype.getDataDimension = function (list) {\r\n var optDim = this.option.dimension;\r\n var listDimensions = list.dimensions;\r\n if (optDim == null && !listDimensions.length) {\r\n return;\r\n }\r\n if (optDim != null) {\r\n return list.getDimension(optDim);\r\n }\r\n var dimNames = list.dimensions;\r\n for (var i = dimNames.length - 1; i >= 0; i--) {\r\n var dimName = dimNames[i];\r\n var dimInfo = list.getDimensionInfo(dimName);\r\n if (!dimInfo.isCalculationCoord) {\r\n return dimName;\r\n }\r\n }\r\n };\r\n VisualMapModel.prototype.getExtent = function () {\r\n return this._dataExtent.slice();\r\n };\r\n VisualMapModel.prototype.completeVisualOption = function () {\r\n var ecModel = this.ecModel;\r\n var thisOption = this.option;\r\n var base = {\r\n inRange: thisOption.inRange,\r\n outOfRange: thisOption.outOfRange\r\n };\r\n var target = thisOption.target || (thisOption.target = {});\r\n var controller = thisOption.controller || (thisOption.controller = {});\r\n merge(target, base);\r\n merge(controller, base);\r\n var isCategory = this.isCategory();\r\n completeSingle.call(this, target);\r\n completeSingle.call(this, controller);\r\n completeInactive.call(this, target, 'inRange', 'outOfRange');\r\n completeController.call(this, controller);\r\n function completeSingle(base) {\r\n if (isArray$1(thisOption.color)\r\n && !base.inRange) {\r\n base.inRange = { color: thisOption.color.slice().reverse() };\r\n }\r\n base.inRange = base.inRange || { color: ecModel.get('gradientColor') };\r\n }\r\n function completeInactive(base, stateExist, stateAbsent) {\r\n var optExist = base[stateExist];\r\n var optAbsent = base[stateAbsent];\r\n if (optExist && !optAbsent) {\r\n optAbsent = base[stateAbsent] = {};\r\n each$g(optExist, function (visualData, visualType) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\r\n if (defa != null) {\r\n optAbsent[visualType] = defa;\r\n if (visualType === 'color'\r\n && !optAbsent.hasOwnProperty('opacity')\r\n && !optAbsent.hasOwnProperty('colorAlpha')) {\r\n optAbsent.opacity = [0, 0];\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function completeController(controller) {\r\n var symbolExists = (controller.inRange || {}).symbol\r\n || (controller.outOfRange || {}).symbol;\r\n var symbolSizeExists = (controller.inRange || {}).symbolSize\r\n || (controller.outOfRange || {}).symbolSize;\r\n var inactiveColor = this.get('inactiveColor');\r\n each$g(this.stateList, function (state) {\r\n var itemSize = this.itemSize;\r\n var visuals = controller[state];\r\n if (!visuals) {\r\n visuals = controller[state] = {\r\n color: isCategory ? inactiveColor : [inactiveColor]\r\n };\r\n }\r\n if (visuals.symbol == null) {\r\n visuals.symbol = symbolExists\r\n && clone(symbolExists)\r\n || (isCategory ? 'roundRect' : ['roundRect']);\r\n }\r\n if (visuals.symbolSize == null) {\r\n visuals.symbolSize = symbolSizeExists\r\n && clone(symbolSizeExists)\r\n || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\r\n }\r\n visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) {\r\n return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol;\r\n });\r\n var symbolSize = visuals.symbolSize;\r\n if (symbolSize != null) {\r\n var max_1 = -Infinity;\r\n eachVisual(symbolSize, function (value) {\r\n value > max_1 && (max_1 = value);\r\n });\r\n visuals.symbolSize = mapVisual$1(symbolSize, function (value) {\r\n return linearMap$1(value, [0, max_1], [0, itemSize[0]], true);\r\n });\r\n }\r\n }, this);\r\n }\r\n };\r\n VisualMapModel.prototype.resetItemSize = function () {\r\n this.itemSize = [\r\n parseFloat(this.get('itemWidth')),\r\n parseFloat(this.get('itemHeight'))\r\n ];\r\n };\r\n VisualMapModel.prototype.isCategory = function () {\r\n return !!this.option.categories;\r\n };\r\n VisualMapModel.prototype.setSelected = function (selected) { };\r\n VisualMapModel.prototype.getSelected = function () {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getValueState = function (value) {\r\n return null;\r\n };\r\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\r\n return null;\r\n };\r\n VisualMapModel.type = 'visualMap';\r\n VisualMapModel.dependencies = ['series'];\r\n VisualMapModel.defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 4,\r\n seriesIndex: 'all',\r\n min: 0,\r\n max: 200,\r\n left: 0,\r\n right: null,\r\n top: null,\r\n bottom: 0,\r\n itemWidth: null,\r\n itemHeight: null,\r\n inverse: false,\r\n orient: 'vertical',\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n contentColor: '#5793f3',\r\n inactiveColor: '#aaa',\r\n borderWidth: 0,\r\n padding: 5,\r\n textGap: 10,\r\n precision: 0,\r\n textStyle: {\r\n color: '#333'\r\n }\r\n };\r\n return VisualMapModel;\r\n }(ComponentModel));\n\n var DEFAULT_BAR_BOUND = [20, 140];\r\n var ContinuousModel = (function (_super) {\r\n __extends(ContinuousModel, _super);\r\n function ContinuousModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousModel.type;\r\n return _this;\r\n }\r\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n this.resetVisual(function (mappingOption) {\r\n mappingOption.mappingMethod = 'linear';\r\n mappingOption.dataExtent = this.getExtent();\r\n });\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.resetItemSize = function () {\r\n _super.prototype.resetItemSize.apply(this, arguments);\r\n var itemSize = this.itemSize;\r\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\r\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\r\n };\r\n ContinuousModel.prototype._resetRange = function () {\r\n var dataExtent = this.getExtent();\r\n var range = this.option.range;\r\n if (!range || range.auto) {\r\n dataExtent.auto = 1;\r\n this.option.range = dataExtent;\r\n }\r\n else if (isArray(range)) {\r\n if (range[0] > range[1]) {\r\n range.reverse();\r\n }\r\n range[0] = Math.max(range[0], dataExtent[0]);\r\n range[1] = Math.min(range[1], dataExtent[1]);\r\n }\r\n };\r\n ContinuousModel.prototype.completeVisualOption = function () {\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n each(this.stateList, function (state) {\r\n var symbolSize = this.option.controller[state].symbolSize;\r\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\r\n symbolSize[0] = symbolSize[1] / 3;\r\n }\r\n }, this);\r\n };\r\n ContinuousModel.prototype.setSelected = function (selected) {\r\n this.option.range = selected.slice();\r\n this._resetRange();\r\n };\r\n ContinuousModel.prototype.getSelected = function () {\r\n var dataExtent = this.getExtent();\r\n var dataInterval = asc((this.get('range') || []).slice());\r\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\r\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\r\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\r\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\r\n return dataInterval;\r\n };\r\n ContinuousModel.prototype.getValueState = function (value) {\r\n var range = this.option.range;\r\n var dataExtent = this.getExtent();\r\n return ((range[0] <= dataExtent[0] || range[0] <= value)\r\n && (range[1] >= dataExtent[1] || value <= range[1])) ? 'inRange' : 'outOfRange';\r\n };\r\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\r\n var result = [];\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndices\r\n });\r\n }, this);\r\n return result;\r\n };\r\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\r\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\r\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\r\n var stops = [];\r\n function setStop(value, valueState) {\r\n stops.push({\r\n value: value,\r\n color: getColorVisual(value, valueState)\r\n });\r\n }\r\n var iIdx = 0;\r\n var oIdx = 0;\r\n var iLen = iVals.length;\r\n var oLen = oVals.length;\r\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\r\n if (oVals[oIdx] < iVals[iIdx]) {\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\r\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\r\n setStop(iVals[iIdx], 'inRange');\r\n }\r\n for (var first = 1; oIdx < oLen; oIdx++) {\r\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\r\n if (first) {\r\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\r\n first = 0;\r\n }\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n var stopsLen = stops.length;\r\n return {\r\n stops: stops,\r\n outerColors: [\r\n stopsLen ? stops[0].color : 'transparent',\r\n stopsLen ? stops[stopsLen - 1].color : 'transparent'\r\n ]\r\n };\r\n };\r\n ContinuousModel.type = 'visualMap.continuous';\r\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n align: 'auto',\r\n calculable: false,\r\n hoverLink: true,\r\n realtime: true,\r\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\r\n handleSize: '120%',\r\n handleStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n indicatorIcon: 'circle',\r\n indicatorSize: '50%',\r\n indicatorStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n });\r\n return ContinuousModel;\r\n }(VisualMapModel));\r\n function getColorStopValues(visualMapModel, valueState, dataExtent) {\r\n if (dataExtent[0] === dataExtent[1]) {\r\n return dataExtent.slice();\r\n }\r\n var count = 200;\r\n var step = (dataExtent[1] - dataExtent[0]) / count;\r\n var value = dataExtent[0];\r\n var stopValues = [];\r\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\r\n stopValues.push(value);\r\n value += step;\r\n }\r\n stopValues.push(dataExtent[1]);\r\n return stopValues;\r\n }\r\n ComponentModel.registerClass(ContinuousModel);\n\n var VisualMapView = (function (_super) {\r\n __extends(VisualMapView, _super);\r\n function VisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = VisualMapView.type;\r\n _this.autoPositionValues = { left: 1, right: 1, top: 1, bottom: 1 };\r\n return _this;\r\n }\r\n VisualMapView.prototype.init = function (ecModel, api) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n };\r\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload) {\r\n this.visualMapModel = visualMapModel;\r\n if (visualMapModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n this.doRender(visualMapModel, ecModel, api, payload);\r\n };\r\n VisualMapView.prototype.renderBackground = function (group) {\r\n var visualMapModel = this.visualMapModel;\r\n var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0);\r\n var rect = group.getBoundingRect();\r\n group.add(new Rect({\r\n z2: -1,\r\n silent: true,\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[3] + padding[1],\r\n height: rect.height + padding[0] + padding[2]\r\n },\r\n style: {\r\n fill: visualMapModel.get('backgroundColor'),\r\n stroke: visualMapModel.get('borderColor'),\r\n lineWidth: visualMapModel.get('borderWidth')\r\n }\r\n }));\r\n };\r\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\r\n opts = opts || {};\r\n var forceState = opts.forceState;\r\n var visualMapModel = this.visualMapModel;\r\n var visualObj = {};\r\n if (visualCluster === 'symbol') {\r\n visualObj.symbol = visualMapModel.get('itemSymbol');\r\n }\r\n if (visualCluster === 'color') {\r\n var defaultColor = visualMapModel.get('contentColor');\r\n visualObj.color = defaultColor;\r\n }\r\n function getter(key) {\r\n return visualObj[key];\r\n }\r\n function setter(key, value) {\r\n visualObj[key] = value;\r\n }\r\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\r\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n each(visualTypes, function (type) {\r\n var visualMapping = mappings[type];\r\n if (opts.convertOpacityToAlpha && type === 'opacity') {\r\n type = 'colorAlpha';\r\n visualMapping = mappings.__alphaForOpacity;\r\n }\r\n if (VisualMapping.dependsOn(type, visualCluster)) {\r\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\r\n }\r\n });\r\n return visualObj[visualCluster];\r\n };\r\n VisualMapView.prototype.positionGroup = function (group) {\r\n var model = this.visualMapModel;\r\n var api = this.api;\r\n positionElement(group, model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() });\r\n };\r\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { };\r\n VisualMapView.type = 'visualMap';\r\n return VisualMapView;\r\n }(ComponentView));\r\n ComponentView.registerClass(VisualMapView);\n\n var paramsSet = [\r\n ['left', 'right', 'width'],\r\n ['top', 'bottom', 'height']\r\n ];\r\n function getItemAlign(visualMapModel, api, itemSize) {\r\n var modelOption = visualMapModel.option;\r\n var itemAlign = modelOption.align;\r\n if (itemAlign != null && itemAlign !== 'auto') {\r\n return itemAlign;\r\n }\r\n var ecSize = { width: api.getWidth(), height: api.getHeight() };\r\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\r\n var reals = paramsSet[realIndex];\r\n var fakeValue = [0, null, 10];\r\n var layoutInput = {};\r\n for (var i = 0; i < 3; i++) {\r\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\r\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\r\n }\r\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\r\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\r\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5\r\n < ecSize[rParam[1]] * 0.5 ? 0 : 1];\r\n }\r\n function makeHighDownBatch(batch, visualMapModel) {\r\n each(batch || [], function (batchItem) {\r\n if (batchItem.dataIndex != null) {\r\n batchItem.dataIndexInside = batchItem.dataIndex;\r\n batchItem.dataIndex = null;\r\n }\r\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\r\n });\r\n return batch;\r\n }\n\n var linearMap$2 = linearMap;\r\n var each$h = each;\r\n var mathMin$a = Math.min;\r\n var mathMax$a = Math.max;\r\n var HOVER_LINK_SIZE = 12;\r\n var HOVER_LINK_OUT = 6;\r\n var ContinuousView = (function (_super) {\r\n __extends(ContinuousView, _super);\r\n function ContinuousView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = ContinuousView.type;\r\n _this._shapes = {};\r\n _this._dataInterval = [];\r\n _this._handleEnds = [];\r\n _this._hoverLinkDataIndices = [];\r\n return _this;\r\n }\r\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\r\n this._api = api;\r\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n };\r\n ContinuousView.prototype._buildView = function () {\r\n this.group.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var thisGroup = this.group;\r\n this._orient = visualMapModel.get('orient');\r\n this._useHandle = visualMapModel.get('calculable');\r\n this._resetInterval();\r\n this._renderBar(thisGroup);\r\n var dataRangeText = visualMapModel.get('text');\r\n this._renderEndsText(thisGroup, dataRangeText, 0);\r\n this._renderEndsText(thisGroup, dataRangeText, 1);\r\n this._updateView(true);\r\n this.renderBackground(thisGroup);\r\n this._updateView();\r\n this._enableHoverLinkToSeries();\r\n this._enableHoverLinkFromSeries();\r\n this.positionGroup(thisGroup);\r\n };\r\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\r\n if (!dataRangeText) {\r\n return;\r\n }\r\n var text = dataRangeText[1 - endsIndex];\r\n text = text != null ? text + '' : '';\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var itemSize = visualMapModel.itemSize;\r\n var barGroup = this._shapes.mainGroup;\r\n var position = this._applyTransform([\r\n itemSize[0] / 2,\r\n endsIndex === 0 ? -textGap : itemSize[1] + textGap\r\n ], barGroup);\r\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\r\n var orient = this._orient;\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n this.group.add(new ZRText({\r\n style: {\r\n x: position[0],\r\n y: position[1],\r\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\r\n align: orient === 'horizontal' ? align : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n };\r\n ContinuousView.prototype._renderBar = function (targetGroup) {\r\n var visualMapModel = this.visualMapModel;\r\n var shapes = this._shapes;\r\n var itemSize = visualMapModel.itemSize;\r\n var orient = this._orient;\r\n var useHandle = this._useHandle;\r\n var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);\r\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\r\n var gradientBarGroup = new Group();\r\n mainGroup.add(gradientBarGroup);\r\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\r\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true)));\r\n gradientBarGroup.setClipPath(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: itemSize[0],\r\n height: itemSize[1],\r\n r: 3\r\n }\r\n }));\r\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\r\n var textSize = mathMax$a(textRect.width, textRect.height);\r\n if (useHandle) {\r\n shapes.handleThumbs = [];\r\n shapes.handleLabels = [];\r\n shapes.handleLabelPoints = [];\r\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\r\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\r\n }\r\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\r\n targetGroup.add(mainGroup);\r\n };\r\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\r\n var onDrift = bind(this._dragHandle, this, handleIndex, false);\r\n var onDragEnd = bind(this._dragHandle, this, handleIndex, true);\r\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\r\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\r\n var cursor = getCursor$1(this._orient);\r\n handleThumb.attr({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n ondragend: onDragEnd,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n }\r\n });\r\n handleThumb.x = itemSize[0] / 2;\r\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\r\n handleThumb.setStyle({\r\n strokeNoScale: true,\r\n strokeFirst: true\r\n });\r\n handleThumb.style.lineWidth *= 2;\r\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n setAsHighDownDispatcher(handleThumb, true);\r\n mainGroup.add(handleThumb);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var handleLabel = new ZRText({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n handleLabel.ensureState('blur').style = {\r\n opacity: 0.1\r\n };\r\n handleLabel.stateTransition = { duration: 200 };\r\n this.group.add(handleLabel);\r\n var handleLabelPoint = [handleSize, 0];\r\n var shapes = this._shapes;\r\n shapes.handleThumbs[handleIndex] = handleThumb;\r\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\r\n shapes.handleLabels[handleIndex] = handleLabel;\r\n };\r\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\r\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\r\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\r\n indicator.attr({\r\n cursor: 'move',\r\n invisible: true,\r\n silent: true,\r\n x: itemSize[0] / 2\r\n });\r\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\r\n if (indicator instanceof ZRImage) {\r\n var pathStyle = indicator.style;\r\n indicator.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, indicatorStyle));\r\n }\r\n else {\r\n indicator.useStyle(indicatorStyle);\r\n }\r\n mainGroup.add(indicator);\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n var indicatorLabel = new ZRText({\r\n silent: true,\r\n invisible: true,\r\n style: {\r\n x: 0, y: 0, text: '',\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n });\r\n this.group.add(indicatorLabel);\r\n var indicatorLabelPoint = [\r\n (orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2,\r\n 0\r\n ];\r\n var shapes = this._shapes;\r\n shapes.indicator = indicator;\r\n shapes.indicatorLabel = indicatorLabel;\r\n shapes.indicatorLabelPoint = indicatorLabelPoint;\r\n this._firstShowIndicator = true;\r\n };\r\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, dx, dy) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n this._dragging = !isEnd;\r\n if (!isEnd) {\r\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\r\n this._updateInterval(handleIndex, vertex[1]);\r\n this._hideIndicator();\r\n this._updateView();\r\n }\r\n if (isEnd === !this.visualMapModel.get('realtime')) {\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: this._dataInterval.slice()\r\n });\r\n }\r\n if (isEnd) {\r\n !this._hovering && this._clearHoverLinkToSeries();\r\n }\r\n else if (useHoverLinkOnHandle(this.visualMapModel)) {\r\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\r\n }\r\n };\r\n ContinuousView.prototype._resetInterval = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\r\n var dataExtent = visualMapModel.getExtent();\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n this._handleEnds = [\r\n linearMap$2(dataInterval[0], dataExtent, sizeExtent, true),\r\n linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\r\n delta = delta || 0;\r\n var visualMapModel = this.visualMapModel;\r\n var handleEnds = this._handleEnds;\r\n var sizeExtent = [0, visualMapModel.itemSize[1]];\r\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, 0);\r\n var dataExtent = visualMapModel.getExtent();\r\n this._dataInterval = [\r\n linearMap$2(handleEnds[0], sizeExtent, dataExtent, true),\r\n linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)\r\n ];\r\n };\r\n ContinuousView.prototype._updateView = function (forSketch) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var shapes = this._shapes;\r\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\r\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\r\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\r\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\r\n shapes.inRange\r\n .setStyle({\r\n fill: visualInRange.barColor\r\n })\r\n .setShape('points', visualInRange.barPoints);\r\n shapes.outOfRange\r\n .setStyle({\r\n fill: visualOutOfRange.barColor\r\n })\r\n .setShape('points', visualOutOfRange.barPoints);\r\n this._updateHandle(inRangeHandleEnds, visualInRange);\r\n };\r\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\r\n var opts = {\r\n forceState: forceState,\r\n convertOpacityToAlpha: true\r\n };\r\n var colorStops = this._makeColorGradient(dataInterval, opts);\r\n var symbolSizes = [\r\n this.getControllerVisual(dataInterval[0], 'symbolSize', opts),\r\n this.getControllerVisual(dataInterval[1], 'symbolSize', opts)\r\n ];\r\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\r\n return {\r\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\r\n barPoints: barPoints,\r\n handlesColor: [\r\n colorStops[0].color,\r\n colorStops[colorStops.length - 1].color\r\n ]\r\n };\r\n };\r\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\r\n var sampleNumber = 100;\r\n var colorStops = [];\r\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\r\n offset: 0\r\n });\r\n for (var i = 1; i < sampleNumber; i++) {\r\n var currValue = dataInterval[0] + step * i;\r\n if (currValue > dataInterval[1]) {\r\n break;\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(currValue, 'color', opts),\r\n offset: i / sampleNumber\r\n });\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\r\n offset: 1\r\n });\r\n return colorStops;\r\n };\r\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\r\n var itemSize = this.visualMapModel.itemSize;\r\n return [\r\n [itemSize[0] - symbolSizes[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[1]],\r\n [itemSize[0] - symbolSizes[1], handleEnds[1]]\r\n ];\r\n };\r\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\r\n var orient = this._orient;\r\n var inverse = this.visualMapModel.get('inverse');\r\n return new Group((orient === 'horizontal' && !inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? 1 : -1, rotation: Math.PI / 2 }\r\n : (orient === 'horizontal' && inverse)\r\n ? { scaleX: itemAlign === 'bottom' ? -1 : 1, rotation: -Math.PI / 2 }\r\n : (orient === 'vertical' && !inverse)\r\n ? { scaleX: itemAlign === 'left' ? 1 : -1, scaleY: -1 }\r\n : { scaleX: itemAlign === 'left' ? 1 : -1 });\r\n };\r\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n var shapes = this._shapes;\r\n var visualMapModel = this.visualMapModel;\r\n var handleThumbs = shapes.handleThumbs;\r\n var handleLabels = shapes.handleLabels;\r\n var itemSize = visualMapModel.itemSize;\r\n var dataExtent = visualMapModel.getExtent();\r\n each$h([0, 1], function (handleIndex) {\r\n var handleThumb = handleThumbs[handleIndex];\r\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\r\n handleThumb.y = handleEnds[handleIndex];\r\n var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\r\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\r\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\r\n handleThumb.x = itemSize[0] - symbolSize / 2;\r\n var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\r\n verticalAlign: 'middle',\r\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\r\n });\r\n }, this);\r\n };\r\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\r\n var visualMapModel = this.visualMapModel;\r\n var dataExtent = visualMapModel.getExtent();\r\n var itemSize = visualMapModel.itemSize;\r\n var sizeExtent = [0, itemSize[1]];\r\n var shapes = this._shapes;\r\n var indicator = shapes.indicator;\r\n if (!indicator) {\r\n return;\r\n }\r\n indicator.attr('invisible', false);\r\n var opts = { convertOpacityToAlpha: true };\r\n var color = this.getControllerVisual(cursorValue, 'color', opts);\r\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\r\n var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true);\r\n var x = itemSize[0] - symbolSize / 2;\r\n var oldIndicatorPos = { x: indicator.x, y: indicator.y };\r\n indicator.y = y;\r\n indicator.x = x;\r\n var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group));\r\n var indicatorLabel = shapes.indicatorLabel;\r\n indicatorLabel.attr('invisible', false);\r\n var align = this._applyTransform('left', shapes.mainGroup);\r\n var orient = this._orient;\r\n var isHorizontal = orient === 'horizontal';\r\n indicatorLabel.setStyle({\r\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\r\n verticalAlign: isHorizontal ? align : 'middle',\r\n align: isHorizontal ? 'center' : align\r\n });\r\n var indicatorNewProps = {\r\n x: x,\r\n y: y,\r\n style: {\r\n fill: color\r\n }\r\n };\r\n var labelNewProps = {\r\n style: {\r\n x: textPoint[0],\r\n y: textPoint[1]\r\n }\r\n };\r\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\r\n var animationCfg = {\r\n duration: 100,\r\n easing: 'cubicInOut',\r\n additive: true\r\n };\r\n indicator.x = oldIndicatorPos.x;\r\n indicator.y = oldIndicatorPos.y;\r\n indicator.animateTo(indicatorNewProps, animationCfg);\r\n indicatorLabel.animateTo(labelNewProps, animationCfg);\r\n }\r\n else {\r\n indicator.attr(indicatorNewProps);\r\n indicatorLabel.attr(labelNewProps);\r\n }\r\n this._firstShowIndicator = false;\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.enterBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\r\n var self = this;\r\n this._shapes.mainGroup\r\n .on('mousemove', function (e) {\r\n self._hovering = true;\r\n if (!self._dragging) {\r\n var itemSize = self.visualMapModel.itemSize;\r\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\r\n pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]);\r\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\r\n }\r\n })\r\n .on('mouseout', function () {\r\n self._hovering = false;\r\n !self._dragging && self._clearHoverLinkToSeries();\r\n });\r\n };\r\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\r\n var zr = this.api.getZr();\r\n if (this.visualMapModel.option.hoverLink) {\r\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\r\n zr.on('mouseout', this._hideIndicator, this);\r\n }\r\n else {\r\n this._clearHoverLinkFromSeries();\r\n }\r\n };\r\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\r\n var visualMapModel = this.visualMapModel;\r\n var itemSize = visualMapModel.itemSize;\r\n if (!visualMapModel.option.hoverLink) {\r\n return;\r\n }\r\n var sizeExtent = [0, itemSize[1]];\r\n var dataExtent = visualMapModel.getExtent();\r\n cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]);\r\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\r\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\r\n var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true);\r\n var valueRange = [\r\n linearMap$2(hoverRange[0], sizeExtent, dataExtent, true),\r\n linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)\r\n ];\r\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\r\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\r\n if (hoverOnBar) {\r\n if (valueRange[0] === -Infinity) {\r\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\r\n }\r\n else if (valueRange[1] === Infinity) {\r\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\r\n }\r\n else {\r\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\r\n }\r\n }\r\n var oldBatch = this._hoverLinkDataIndices;\r\n var newBatch = [];\r\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\r\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\r\n }\r\n var resultBatches = compressBatches(oldBatch, newBatch);\r\n this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel));\r\n this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel));\r\n };\r\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\r\n var el = e.target;\r\n var visualMapModel = this.visualMapModel;\r\n if (!el || getECData(el).dataIndex == null) {\r\n return;\r\n }\r\n var ecData = getECData(el);\r\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n if (!visualMapModel.isTargetSeries(dataModel)) {\r\n return;\r\n }\r\n var data = dataModel.getData(ecData.dataType);\r\n var value = data.get(visualMapModel.getDataDimension(data), ecData.dataIndex);\r\n if (!isNaN(value)) {\r\n this._showIndicator(value, value);\r\n }\r\n };\r\n ContinuousView.prototype._hideIndicator = function () {\r\n var shapes = this._shapes;\r\n shapes.indicator && shapes.indicator.attr('invisible', true);\r\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\r\n var handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (var i = 0; i < handleLabels.length; i++) {\r\n this._api.leaveBlur(handleLabels[i]);\r\n }\r\n }\r\n };\r\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\r\n this._hideIndicator();\r\n var indices = this._hoverLinkDataIndices;\r\n this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel));\r\n indices.length = 0;\r\n };\r\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\r\n this._hideIndicator();\r\n var zr = this.api.getZr();\r\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\r\n zr.off('mouseout', this._hideIndicator);\r\n };\r\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\r\n var transform = getTransform(element, global ? null : this.group);\r\n return isArray(vertex)\r\n ? applyTransform$1(vertex, transform, inverse)\r\n : transformDirection(vertex, transform, inverse);\r\n };\r\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\r\n batch && batch.length && this.api.dispatchAction({\r\n type: type,\r\n batch: batch\r\n });\r\n };\r\n ContinuousView.prototype.dispose = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.prototype.remove = function () {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n };\r\n ContinuousView.type = 'visualMap.continuous';\r\n return ContinuousView;\r\n }(VisualMapView));\r\n function createPolygon(points, cursor, onDrift, onDragEnd) {\r\n return new Polygon({\r\n shape: { points: points },\r\n draggable: !!onDrift,\r\n cursor: cursor,\r\n drift: onDrift,\r\n onmousemove: function (e) {\r\n stop(e.event);\r\n },\r\n ondragend: onDragEnd\r\n });\r\n }\r\n function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\r\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\r\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\r\n if (hoverLinkDataSize) {\r\n halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\r\n }\r\n return halfHoverLinkSize;\r\n }\r\n function useHoverLinkOnHandle(visualMapModel) {\r\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\r\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\r\n }\r\n function getCursor$1(orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n }\r\n ComponentView.registerClass(ContinuousView);\n\n var actionInfo$2 = {\r\n type: 'selectDataRange',\r\n event: 'dataRangeSelected',\r\n update: 'update'\r\n };\r\n registerAction(actionInfo$2, function (payload, ecModel) {\r\n ecModel.eachComponent({ mainType: 'visualMap', query: payload }, function (model) {\r\n model.setSelected(payload.selected);\r\n });\r\n });\n\n registerPreprocessor(visualMapPreprocessor);\n\n var PiecewiseModel = (function (_super) {\r\n __extends(PiecewiseModel, _super);\r\n function PiecewiseModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseModel.type;\r\n _this._pieceList = [];\r\n return _this;\r\n }\r\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\r\n _super.prototype.optionUpdated.apply(this, arguments);\r\n this.resetExtent();\r\n var mode = this._mode = this._determineMode();\r\n this._pieceList = [];\r\n resetMethods[this._mode].call(this, this._pieceList);\r\n this._resetSelected(newOption, isInit);\r\n var categories = this.option.categories;\r\n this.resetVisual(function (mappingOption, state) {\r\n if (mode === 'categories') {\r\n mappingOption.mappingMethod = 'category';\r\n mappingOption.categories = clone(categories);\r\n }\r\n else {\r\n mappingOption.dataExtent = this.getExtent();\r\n mappingOption.mappingMethod = 'piecewise';\r\n mappingOption.pieceList = map(this._pieceList, function (piece) {\r\n piece = clone(piece);\r\n if (state !== 'inRange') {\r\n piece.visual = null;\r\n }\r\n return piece;\r\n });\r\n }\r\n });\r\n };\r\n PiecewiseModel.prototype.completeVisualOption = function () {\r\n var option = this.option;\r\n var visualTypesInPieces = {};\r\n var visualTypes = VisualMapping.listVisualTypes();\r\n var isCategory = this.isCategory();\r\n each(option.pieces, function (piece) {\r\n each(visualTypes, function (visualType) {\r\n if (piece.hasOwnProperty(visualType)) {\r\n visualTypesInPieces[visualType] = 1;\r\n }\r\n });\r\n });\r\n each(visualTypesInPieces, function (v, visualType) {\r\n var exists = false;\r\n each(this.stateList, function (state) {\r\n exists = exists || has(option, state, visualType)\r\n || has(option.target, state, visualType);\r\n }, this);\r\n !exists && each(this.stateList, function (state) {\r\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\r\n });\r\n }, this);\r\n function has(obj, state, visualType) {\r\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\r\n }\r\n _super.prototype.completeVisualOption.apply(this, arguments);\r\n };\r\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\r\n var thisOption = this.option;\r\n var pieceList = this._pieceList;\r\n var selected = (isInit ? thisOption : newOption).selected || {};\r\n thisOption.selected = selected;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (!selected.hasOwnProperty(key)) {\r\n selected[key] = true;\r\n }\r\n }, this);\r\n if (thisOption.selectedMode === 'single') {\r\n var hasSel_1 = false;\r\n each(pieceList, function (piece, index) {\r\n var key = this.getSelectedMapKey(piece);\r\n if (selected[key]) {\r\n hasSel_1\r\n ? (selected[key] = false)\r\n : (hasSel_1 = true);\r\n }\r\n }, this);\r\n }\r\n };\r\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\r\n return this._mode === 'categories'\r\n ? piece.value + '' : piece.index + '';\r\n };\r\n PiecewiseModel.prototype.getPieceList = function () {\r\n return this._pieceList;\r\n };\r\n PiecewiseModel.prototype._determineMode = function () {\r\n var option = this.option;\r\n return option.pieces && option.pieces.length > 0\r\n ? 'pieces'\r\n : this.option.categories\r\n ? 'categories'\r\n : 'splitNumber';\r\n };\r\n PiecewiseModel.prototype.setSelected = function (selected) {\r\n this.option.selected = clone(selected);\r\n };\r\n PiecewiseModel.prototype.getValueState = function (value) {\r\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\r\n return index != null\r\n ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]\r\n ? 'inRange' : 'outOfRange')\r\n : 'outOfRange';\r\n };\r\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\r\n var result = [];\r\n var pieceList = this._pieceList;\r\n this.eachTargetSeries(function (seriesModel) {\r\n var dataIndices = [];\r\n var data = seriesModel.getData();\r\n data.each(this.getDataDimension(data), function (value, dataIndex) {\r\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\r\n pIdx === pieceIndex && dataIndices.push(dataIndex);\r\n }, this);\r\n result.push({ seriesId: seriesModel.id, dataIndex: dataIndices });\r\n }, this);\r\n return result;\r\n };\r\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\r\n var representValue;\r\n if (this.isCategory()) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n if (piece.value != null) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n var pieceInterval = piece.interval || [];\r\n representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)\r\n ? 0\r\n : (pieceInterval[0] + pieceInterval[1]) / 2;\r\n }\r\n }\r\n return representValue;\r\n };\r\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\r\n if (this.isCategory()) {\r\n return;\r\n }\r\n var stops = [];\r\n var outerColors = ['', ''];\r\n var visualMapModel = this;\r\n function setStop(interval, valueState) {\r\n var representValue = visualMapModel.getRepresentValue({\r\n interval: interval\r\n });\r\n if (!valueState) {\r\n valueState = visualMapModel.getValueState(representValue);\r\n }\r\n var color = getColorVisual(representValue, valueState);\r\n if (interval[0] === -Infinity) {\r\n outerColors[0] = color;\r\n }\r\n else if (interval[1] === Infinity) {\r\n outerColors[1] = color;\r\n }\r\n else {\r\n stops.push({ value: interval[0], color: color }, { value: interval[1], color: color });\r\n }\r\n }\r\n var pieceList = this._pieceList.slice();\r\n if (!pieceList.length) {\r\n pieceList.push({ interval: [-Infinity, Infinity] });\r\n }\r\n else {\r\n var edge = pieceList[0].interval[0];\r\n edge !== -Infinity && pieceList.unshift({ interval: [-Infinity, edge] });\r\n edge = pieceList[pieceList.length - 1].interval[1];\r\n edge !== Infinity && pieceList.push({ interval: [edge, Infinity] });\r\n }\r\n var curr = -Infinity;\r\n each(pieceList, function (piece) {\r\n var interval = piece.interval;\r\n if (interval) {\r\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\r\n setStop(interval.slice());\r\n curr = interval[1];\r\n }\r\n }, this);\r\n return { stops: stops, outerColors: outerColors };\r\n };\r\n PiecewiseModel.type = 'visualMap.piecewise';\r\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n selected: null,\r\n minOpen: false,\r\n maxOpen: false,\r\n align: 'auto',\r\n itemWidth: 20,\r\n itemHeight: 14,\r\n itemSymbol: 'roundRect',\r\n pieces: null,\r\n categories: null,\r\n splitNumber: 5,\r\n selectedMode: 'multiple',\r\n itemGap: 10,\r\n hoverLink: true\r\n });\r\n return PiecewiseModel;\r\n }(VisualMapModel));\r\n var resetMethods = {\r\n splitNumber: function (outPieceList) {\r\n var thisOption = this.option;\r\n var precision = Math.min(thisOption.precision, 20);\r\n var dataExtent = this.getExtent();\r\n var splitNumber = thisOption.splitNumber;\r\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\r\n thisOption.splitNumber = splitNumber;\r\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\r\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\r\n precision++;\r\n }\r\n thisOption.precision = precision;\r\n splitStep = +splitStep.toFixed(precision);\r\n if (thisOption.minOpen) {\r\n outPieceList.push({\r\n interval: [-Infinity, dataExtent[0]],\r\n close: [0, 0]\r\n });\r\n }\r\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\r\n var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);\r\n outPieceList.push({\r\n interval: [curr, max],\r\n close: [1, 1]\r\n });\r\n }\r\n if (thisOption.maxOpen) {\r\n outPieceList.push({\r\n interval: [dataExtent[1], Infinity],\r\n close: [0, 0]\r\n });\r\n }\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece, index) {\r\n piece.index = index;\r\n piece.text = this.formatValueText(piece.interval);\r\n }, this);\r\n },\r\n categories: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.categories, function (cate) {\r\n outPieceList.push({\r\n text: this.formatValueText(cate, true),\r\n value: cate\r\n });\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n },\r\n pieces: function (outPieceList) {\r\n var thisOption = this.option;\r\n each(thisOption.pieces, function (pieceListItem, index) {\r\n if (!isObject(pieceListItem)) {\r\n pieceListItem = { value: pieceListItem };\r\n }\r\n var item = { text: '', index: index };\r\n if (pieceListItem.label != null) {\r\n item.text = pieceListItem.label;\r\n }\r\n if (pieceListItem.hasOwnProperty('value')) {\r\n var value = item.value = pieceListItem.value;\r\n item.interval = [value, value];\r\n item.close = [1, 1];\r\n }\r\n else {\r\n var interval = item.interval = [];\r\n var close_1 = item.close = [0, 0];\r\n var closeList = [1, 0, 1];\r\n var infinityList = [-Infinity, Infinity];\r\n var useMinMax = [];\r\n for (var lg = 0; lg < 2; lg++) {\r\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\r\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\r\n interval[lg] = pieceListItem[names[i]];\r\n close_1[lg] = closeList[i];\r\n useMinMax[lg] = i === 2;\r\n }\r\n interval[lg] == null && (interval[lg] = infinityList[lg]);\r\n }\r\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\r\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\r\n if (__DEV__) {\r\n if (interval[0] > interval[1]) {\r\n console.warn('Piece ' + index + 'is illegal: ' + interval\r\n + ' lower bound should not greater then uppper bound.');\r\n }\r\n }\r\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\r\n item.value = interval[0];\r\n }\r\n }\r\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\r\n outPieceList.push(item);\r\n }, this);\r\n normalizeReverse(thisOption, outPieceList);\r\n reformIntervals(outPieceList);\r\n each(outPieceList, function (piece) {\r\n var close = piece.close;\r\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\r\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\r\n }, this);\r\n }\r\n };\r\n function normalizeReverse(thisOption, pieceList) {\r\n var inverse = thisOption.inverse;\r\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\r\n pieceList.reverse();\r\n }\r\n }\r\n ComponentModel.registerClass(PiecewiseModel);\n\n var PiecewiseVisualMapView = (function (_super) {\r\n __extends(PiecewiseVisualMapView, _super);\r\n function PiecewiseVisualMapView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = PiecewiseVisualMapView.type;\r\n return _this;\r\n }\r\n PiecewiseVisualMapView.prototype.doRender = function () {\r\n var thisGroup = this.group;\r\n thisGroup.removeAll();\r\n var visualMapModel = this.visualMapModel;\r\n var textGap = visualMapModel.get('textGap');\r\n var textStyleModel = visualMapModel.textStyleModel;\r\n var textFont = textStyleModel.getFont();\r\n var textFill = textStyleModel.getTextColor();\r\n var itemAlign = this._getItemAlign();\r\n var itemSize = visualMapModel.itemSize;\r\n var viewData = this._getViewData();\r\n var endsText = viewData.endsText;\r\n var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText);\r\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\r\n each(viewData.viewPieceList, function (item) {\r\n var piece = item.piece;\r\n var itemGroup = new Group();\r\n itemGroup.onclick = bind(this._onItemClick, this, piece);\r\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\r\n var representValue = visualMapModel.getRepresentValue(piece);\r\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\r\n if (showLabel) {\r\n var visualState = this.visualMapModel.getValueState(representValue);\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\r\n y: itemSize[1] / 2,\r\n text: piece.text,\r\n verticalAlign: 'middle',\r\n align: itemAlign,\r\n font: textFont,\r\n fill: textFill,\r\n opacity: visualState === 'outOfRange' ? 0.5 : 1\r\n }\r\n }));\r\n }\r\n thisGroup.add(itemGroup);\r\n }, this);\r\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\r\n box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\r\n this.renderBackground(thisGroup);\r\n this.positionGroup(thisGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\r\n var _this = this;\r\n itemGroup\r\n .on('mouseover', function () { return onHoverLink('highlight'); })\r\n .on('mouseout', function () { return onHoverLink('downplay'); });\r\n var onHoverLink = function (method) {\r\n var visualMapModel = _this.visualMapModel;\r\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\r\n type: method,\r\n batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\r\n });\r\n };\r\n };\r\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var modelOption = visualMapModel.option;\r\n if (modelOption.orient === 'vertical') {\r\n return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\r\n }\r\n else {\r\n var align = modelOption.align;\r\n if (!align || align === 'auto') {\r\n align = 'left';\r\n }\r\n return align;\r\n }\r\n };\r\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\r\n if (!text) {\r\n return;\r\n }\r\n var itemGroup = new Group();\r\n var textStyleModel = this.visualMapModel.textStyleModel;\r\n itemGroup.add(new ZRText({\r\n style: {\r\n x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2,\r\n y: itemSize[1] / 2,\r\n verticalAlign: 'middle',\r\n align: showLabel ? itemAlign : 'center',\r\n text: text,\r\n font: textStyleModel.getFont(),\r\n fill: textStyleModel.getTextColor()\r\n }\r\n }));\r\n group.add(itemGroup);\r\n };\r\n PiecewiseVisualMapView.prototype._getViewData = function () {\r\n var visualMapModel = this.visualMapModel;\r\n var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) {\r\n return { piece: piece, indexInModelPieceList: index };\r\n });\r\n var endsText = visualMapModel.get('text');\r\n var orient = visualMapModel.get('orient');\r\n var inverse = visualMapModel.get('inverse');\r\n if (orient === 'horizontal' ? inverse : !inverse) {\r\n viewPieceList.reverse();\r\n }\r\n else if (endsText) {\r\n endsText = endsText.slice().reverse();\r\n }\r\n return { viewPieceList: viewPieceList, endsText: endsText };\r\n };\r\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\r\n group.add(createSymbol(this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, 'color')));\r\n };\r\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\r\n var visualMapModel = this.visualMapModel;\r\n var option = visualMapModel.option;\r\n var selected = clone(option.selected);\r\n var newKey = visualMapModel.getSelectedMapKey(piece);\r\n if (option.selectedMode === 'single') {\r\n selected[newKey] = true;\r\n each(selected, function (o, key) {\r\n selected[key] = key === newKey;\r\n });\r\n }\r\n else {\r\n selected[newKey] = !selected[newKey];\r\n }\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: selected\r\n });\r\n };\r\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\r\n return PiecewiseVisualMapView;\r\n }(VisualMapView));\r\n ComponentView.registerClass(PiecewiseVisualMapView);\n\n registerPreprocessor(visualMapPreprocessor);\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$n = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$n(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$n(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n function createElement(name) {\r\n return document.createElementNS('http://www.w3.org/2000/svg', name);\r\n }\n\n var NONE = 'none';\r\n var mathRound = Math.round;\r\n var mathSin$4 = Math.sin;\r\n var mathCos$4 = Math.cos;\r\n var PI$a = Math.PI;\r\n var PI2$a = Math.PI * 2;\r\n var degree = 180 / PI$a;\r\n var EPSILON$4 = 1e-4;\r\n function round3(val) {\r\n return mathRound(val * 1e3) / 1e3;\r\n }\r\n function round4(val) {\r\n return mathRound(val * 1e4) / 1e4;\r\n }\r\n function isAroundZero$1(val) {\r\n return val < EPSILON$4 && val > -EPSILON$4;\r\n }\r\n function pathHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== NONE;\r\n }\r\n function pathHasStroke(style) {\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== NONE;\r\n }\r\n function setTransform(svgEl, m) {\r\n if (m) {\r\n attr(svgEl, 'transform', 'matrix('\r\n + round3(m[0]) + ','\r\n + round3(m[1]) + ','\r\n + round3(m[2]) + ','\r\n + round3(m[3]) + ','\r\n + round4(m[4]) + ','\r\n + round4(m[5])\r\n + ')');\r\n }\r\n }\r\n function attr(el, key, val) {\r\n if (!val || val.type !== 'linear' && val.type !== 'radial') {\r\n el.setAttribute(key, val);\r\n }\r\n }\r\n function attrXLink(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/1999/xlink', key, val);\r\n }\r\n function attrXML(el, key, val) {\r\n el.setAttributeNS('http://www.w3.org/XML/1998/namespace', key, val);\r\n }\r\n function bindStyle(svgEl, style, el) {\r\n var opacity = style.opacity == null ? 1 : style.opacity;\r\n if (pathHasFill(style)) {\r\n var fill = style.fill;\r\n fill = fill === 'transparent' ? NONE : fill;\r\n attr(svgEl, 'fill', fill);\r\n attr(svgEl, 'fill-opacity', (style.fillOpacity != null ? style.fillOpacity * opacity : opacity) + '');\r\n }\r\n else {\r\n attr(svgEl, 'fill', NONE);\r\n }\r\n if (pathHasStroke(style)) {\r\n var stroke = style.stroke;\r\n stroke = stroke === 'transparent' ? NONE : stroke;\r\n attr(svgEl, 'stroke', stroke);\r\n var strokeWidth = style.lineWidth;\r\n var strokeScale_1 = style.strokeNoScale\r\n ? el.getLineScale()\r\n : 1;\r\n attr(svgEl, 'stroke-width', (strokeScale_1 ? strokeWidth / strokeScale_1 : 0) + '');\r\n attr(svgEl, 'paint-order', style.strokeFirst ? 'stroke' : 'fill');\r\n attr(svgEl, 'stroke-opacity', (style.strokeOpacity != null ? style.strokeOpacity * opacity : opacity) + '');\r\n var lineDash = style.lineDash && strokeWidth > 0 && normalizeLineDash(style.lineDash, strokeWidth);\r\n if (lineDash) {\r\n var lineDashOffset = style.lineDashOffset;\r\n if (strokeScale_1 && strokeScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / strokeScale_1;\r\n });\r\n if (lineDashOffset) {\r\n lineDashOffset /= strokeScale_1;\r\n lineDashOffset = mathRound(lineDashOffset);\r\n }\r\n }\r\n attr(svgEl, 'stroke-dasharray', lineDash.join(','));\r\n attr(svgEl, 'stroke-dashoffset', (lineDashOffset || 0) + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke-dasharray', '');\r\n }\r\n style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap);\r\n style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin);\r\n style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit + '');\r\n }\r\n else {\r\n attr(svgEl, 'stroke', NONE);\r\n }\r\n }\r\n var SVGPathRebuilder = (function () {\r\n function SVGPathRebuilder() {\r\n }\r\n SVGPathRebuilder.prototype.reset = function () {\r\n this._d = [];\r\n this._str = '';\r\n };\r\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\r\n this._add('M', x, y);\r\n };\r\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\r\n this._add('C', x, y, x2, y2, x3, y3);\r\n };\r\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\r\n this._add('Q', x, y, x2, y2);\r\n };\r\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\r\n };\r\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\r\n var firstCmd = this._d.length === 0;\r\n var dTheta = endAngle - startAngle;\r\n var clockwise = !anticlockwise;\r\n var dThetaPositive = Math.abs(dTheta);\r\n var isCircle = isAroundZero$1(dThetaPositive - PI2$a)\r\n || (clockwise ? dTheta >= PI2$a : -dTheta >= PI2$a);\r\n var unifiedTheta = dTheta > 0 ? dTheta % PI2$a : (dTheta % PI2$a + PI2$a);\r\n var large = false;\r\n if (isCircle) {\r\n large = true;\r\n }\r\n else if (isAroundZero$1(dThetaPositive)) {\r\n large = false;\r\n }\r\n else {\r\n large = (unifiedTheta >= PI$a) === !!clockwise;\r\n }\r\n var x0 = round4(cx + rx * mathCos$4(startAngle));\r\n var y0 = round4(cy + ry * mathSin$4(startAngle));\r\n if (isCircle) {\r\n if (clockwise) {\r\n dTheta = PI2$a - 1e-4;\r\n }\r\n else {\r\n dTheta = -PI2$a + 1e-4;\r\n }\r\n large = true;\r\n if (firstCmd) {\r\n this._d.push('M', x0, y0);\r\n }\r\n }\r\n var x = round4(cx + rx * mathCos$4(startAngle + dTheta));\r\n var y = round4(cy + ry * mathSin$4(startAngle + dTheta));\r\n if (isNaN(x0) || isNaN(y0) || isNaN(rx) || isNaN(ry) || isNaN(psi) || isNaN(degree) || isNaN(x) || isNaN(y)) {\r\n return '';\r\n }\r\n this._d.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y);\r\n };\r\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\r\n this._add('M', x, y);\r\n this._add('L', x + w, y);\r\n this._add('L', x + w, y + h);\r\n this._add('L', x, y + h);\r\n this._add('L', x, y);\r\n };\r\n SVGPathRebuilder.prototype.closePath = function () {\r\n if (this._d.length > 0) {\r\n this._add('Z');\r\n }\r\n };\r\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\r\n this._d.push(cmd);\r\n for (var i = 1; i < arguments.length; i++) {\r\n var val = arguments[i];\r\n if (isNaN(val)) {\r\n this._invalid = true;\r\n return;\r\n }\r\n this._d.push(round4(val));\r\n }\r\n };\r\n SVGPathRebuilder.prototype.generateStr = function () {\r\n this._str = this._invalid ? '' : this._d.join(' ');\r\n this._d = [];\r\n };\r\n SVGPathRebuilder.prototype.getStr = function () {\r\n return this._str;\r\n };\r\n return SVGPathRebuilder;\r\n }());\r\n var svgPath = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('path');\r\n el.__svgEl = svgEl;\r\n }\r\n if (!el.path) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path;\r\n if (el.shapeChanged()) {\r\n path.beginPath();\r\n el.buildPath(path, el.shape);\r\n el.pathUpdated();\r\n }\r\n var pathVersion = path.getVersion();\r\n var elExt = el;\r\n var svgPathBuilder = elExt.__svgPathBuilder;\r\n if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || el.style.strokePercent < 1) {\r\n if (!svgPathBuilder) {\r\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\r\n }\r\n svgPathBuilder.reset();\r\n path.rebuildPath(svgPathBuilder, el.style.strokePercent);\r\n svgPathBuilder.generateStr();\r\n elExt.__svgPathVersion = pathVersion;\r\n }\r\n attr(svgEl, 'd', svgPathBuilder.getStr());\r\n bindStyle(svgEl, style, el);\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var svgImage = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var image = style.image;\r\n if (image instanceof HTMLImageElement) {\r\n var src = image.src;\r\n image = src;\r\n }\r\n if (!image) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var dw = style.width;\r\n var dh = style.height;\r\n var svgEl = el.__svgEl;\r\n if (!svgEl) {\r\n svgEl = createElement('image');\r\n el.__svgEl = svgEl;\r\n }\r\n if (image !== el.__imageSrc) {\r\n attrXLink(svgEl, 'href', image);\r\n el.__imageSrc = image;\r\n }\r\n attr(svgEl, 'width', dw + '');\r\n attr(svgEl, 'height', dh + '');\r\n attr(svgEl, 'x', x + '');\r\n attr(svgEl, 'y', y + '');\r\n setTransform(svgEl, el.transform);\r\n }\r\n };\r\n var TEXT_ALIGN_TO_ANCHOR = {\r\n left: 'start',\r\n right: 'end',\r\n center: 'middle',\r\n middle: 'middle'\r\n };\r\n function adjustTextY$1(y, lineHeight, textBaseline) {\r\n if (textBaseline === 'top') {\r\n y += lineHeight / 2;\r\n }\r\n else if (textBaseline === 'bottom') {\r\n y -= lineHeight / 2;\r\n }\r\n return y;\r\n }\r\n var svgText = {\r\n brush: function (el) {\r\n var style = el.style;\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (!text || isNaN(style.x) || isNaN(style.y)) {\r\n return;\r\n }\r\n var textSvgEl = el.__svgEl;\r\n if (!textSvgEl) {\r\n textSvgEl = createElement('text');\r\n attrXML(textSvgEl, 'xml:space', 'preserve');\r\n el.__svgEl = textSvgEl;\r\n }\r\n var font = style.font || DEFAULT_FONT;\r\n var textSvgElStyle = textSvgEl.style;\r\n textSvgElStyle.font = font;\r\n textSvgEl.textContent = text;\r\n bindStyle(textSvgEl, style, el);\r\n setTransform(textSvgEl, el.transform);\r\n var x = style.x || 0;\r\n var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);\r\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\r\n || style.textAlign;\r\n attr(textSvgEl, 'dominant-baseline', 'central');\r\n attr(textSvgEl, 'text-anchor', textAlign);\r\n attr(textSvgEl, 'x', x + '');\r\n attr(textSvgEl, 'y', y + '');\r\n }\r\n };\n\n function diff(oldArr, newArr, equals) {\r\n if (!equals) {\r\n equals = function (a, b) {\r\n return a === b;\r\n };\r\n }\r\n oldArr = oldArr.slice();\r\n newArr = newArr.slice();\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var editLength = 1;\r\n var maxEditLength = newLen + oldLen;\r\n var bestPath = [{ newPos: -1, components: [] }];\r\n var oldPos = extractCommon(bestPath[0], newArr, oldArr, 0, equals);\r\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n var indices = [];\r\n for (var i = 0; i < newArr.length; i++) {\r\n indices.push(i);\r\n }\r\n return [{\r\n indices: indices,\r\n count: newArr.length,\r\n added: false,\r\n removed: false\r\n }];\r\n }\r\n function execEditLength() {\r\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\r\n var basePath;\r\n var addPath = bestPath[diagonalPath - 1];\r\n var removePath = bestPath[diagonalPath + 1];\r\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\r\n if (addPath) {\r\n bestPath[diagonalPath - 1] = undefined;\r\n }\r\n var canAdd = addPath && addPath.newPos + 1 < newLen;\r\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\r\n if (!canAdd && !canRemove) {\r\n bestPath[diagonalPath] = undefined;\r\n continue;\r\n }\r\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\r\n basePath = clonePath(removePath);\r\n pushComponent(basePath.components, false, true);\r\n }\r\n else {\r\n basePath = addPath;\r\n basePath.newPos++;\r\n pushComponent(basePath.components, true, false);\r\n }\r\n oldPos = extractCommon(basePath, newArr, oldArr, diagonalPath, equals);\r\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\r\n return buildValues(basePath.components);\r\n }\r\n else {\r\n bestPath[diagonalPath] = basePath;\r\n }\r\n }\r\n editLength++;\r\n }\r\n while (editLength <= maxEditLength) {\r\n var ret = execEditLength();\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n }\r\n function extractCommon(basePath, newArr, oldArr, diagonalPath, equals) {\r\n var newLen = newArr.length;\r\n var oldLen = oldArr.length;\r\n var newPos = basePath.newPos;\r\n var oldPos = newPos - diagonalPath;\r\n var commonCount = 0;\r\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && equals(newArr[newPos + 1], oldArr[oldPos + 1])) {\r\n newPos++;\r\n oldPos++;\r\n commonCount++;\r\n }\r\n if (commonCount) {\r\n basePath.components.push({\r\n count: commonCount,\r\n added: false,\r\n removed: false,\r\n indices: []\r\n });\r\n }\r\n basePath.newPos = newPos;\r\n return oldPos;\r\n }\r\n function pushComponent(components, added, removed) {\r\n var last = components[components.length - 1];\r\n if (last && last.added === added && last.removed === removed) {\r\n components[components.length - 1] = {\r\n count: last.count + 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n };\r\n }\r\n else {\r\n components.push({\r\n count: 1,\r\n added: added,\r\n removed: removed,\r\n indices: []\r\n });\r\n }\r\n }\r\n function buildValues(components) {\r\n var componentPos = 0;\r\n var componentLen = components.length;\r\n var newPos = 0;\r\n var oldPos = 0;\r\n for (; componentPos < componentLen; componentPos++) {\r\n var component = components[componentPos];\r\n if (!component.removed) {\r\n var indices = [];\r\n for (var i = newPos; i < newPos + component.count; i++) {\r\n indices.push(i);\r\n }\r\n component.indices = indices;\r\n newPos += component.count;\r\n if (!component.added) {\r\n oldPos += component.count;\r\n }\r\n }\r\n else {\r\n for (var i = oldPos; i < oldPos + component.count; i++) {\r\n component.indices.push(i);\r\n }\r\n oldPos += component.count;\r\n }\r\n }\r\n return components;\r\n }\r\n function clonePath(path) {\r\n return { newPos: path.newPos, components: path.components.slice(0) };\r\n }\r\n function arrayDiff(oldArr, newArr, equal) {\r\n return diff(oldArr, newArr, equal);\r\n }\n\n var MARK_UNUSED = '0';\r\n var MARK_USED = '1';\r\n var Definable = (function () {\r\n function Definable(zrId, svgRoot, tagNames, markLabel, domName) {\r\n this.nextId = 0;\r\n this._domName = '_dom';\r\n this.createElement = createElement;\r\n this._zrId = zrId;\r\n this._svgRoot = svgRoot;\r\n this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames;\r\n this._markLabel = markLabel;\r\n if (domName) {\r\n this._domName = domName;\r\n }\r\n }\r\n Definable.prototype.getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgRoot;\r\n var defs = this._svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(this.createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n Definable.prototype.doUpdate = function (target, onUpdate) {\r\n if (!target) {\r\n return;\r\n }\r\n var defs = this.getDefs(false);\r\n if (target[this._domName] && defs.contains(target[this._domName])) {\r\n if (typeof onUpdate === 'function') {\r\n onUpdate(target);\r\n }\r\n }\r\n else {\r\n var dom = this.add(target);\r\n if (dom) {\r\n target[this._domName] = dom;\r\n }\r\n }\r\n };\r\n Definable.prototype.add = function (target) {\r\n return null;\r\n };\r\n Definable.prototype.addDom = function (dom) {\r\n var defs = this.getDefs(true);\r\n if (dom.parentNode !== defs) {\r\n defs.appendChild(dom);\r\n }\r\n };\r\n Definable.prototype.removeDom = function (target) {\r\n var defs = this.getDefs(false);\r\n if (defs && target[this._domName]) {\r\n defs.removeChild(target[this._domName]);\r\n target[this._domName] = null;\r\n }\r\n };\r\n Definable.prototype.getDoms = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return [];\r\n }\r\n var doms = [];\r\n each(this._tagNames, function (tagName) {\r\n var tags = defs.getElementsByTagName(tagName);\r\n for (var i = 0; i < tags.length; i++) {\r\n doms.push(tags[i]);\r\n }\r\n });\r\n return doms;\r\n };\r\n Definable.prototype.markAllUnused = function () {\r\n var doms = this.getDoms();\r\n var that = this;\r\n each(doms, function (dom) {\r\n dom[that._markLabel] = MARK_UNUSED;\r\n });\r\n };\r\n Definable.prototype.markDomUsed = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_USED);\r\n };\r\n Definable.prototype.markDomUnused = function (dom) {\r\n dom && (dom[this._markLabel] = MARK_UNUSED);\r\n };\r\n Definable.prototype.isDomUnused = function (dom) {\r\n return dom && dom[this._markLabel] !== MARK_USED;\r\n };\r\n Definable.prototype.removeUnused = function () {\r\n var _this = this;\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var doms = this.getDoms();\r\n each(doms, function (dom) {\r\n if (_this.isDomUnused(dom)) {\r\n defs.removeChild(dom);\r\n }\r\n });\r\n };\r\n Definable.prototype.getSvgProxy = function (displayable) {\r\n if (displayable instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (displayable instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (displayable instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n };\r\n Definable.prototype.getSvgElement = function (displayable) {\r\n return displayable.__svgEl;\r\n };\r\n return Definable;\r\n }());\n\n function isLinearGradient(value) {\r\n return value.type === 'linear';\r\n }\r\n function isRadialGradient(value) {\r\n return value.type === 'radial';\r\n }\r\n function isGradient(value) {\r\n return value && (value.type === 'linear'\r\n || value.type === 'radial');\r\n }\r\n var GradientManager = (function (_super) {\r\n __extends(GradientManager, _super);\r\n function GradientManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__') || this;\r\n }\r\n GradientManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var value = displayable.style[fillOrStroke];\r\n if (isGradient(value)) {\r\n var gradient = value;\r\n var defs = that_1.getDefs(true);\r\n var dom = void 0;\r\n if (gradient.__dom) {\r\n dom = gradient.__dom;\r\n if (!defs.contains(gradient.__dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(gradient);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n GradientManager.prototype.add = function (gradient) {\r\n var dom;\r\n if (isLinearGradient(gradient)) {\r\n dom = this.createElement('linearGradient');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom = this.createElement('radialGradient');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return null;\r\n }\r\n gradient.id = gradient.id || this.nextId++;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-gradient-' + gradient.id);\r\n this.updateDom(gradient, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n GradientManager.prototype.update = function (gradient) {\r\n if (!isGradient(gradient)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(gradient, function () {\r\n var dom = gradient.__dom;\r\n if (!dom) {\r\n return;\r\n }\r\n var tagName = dom.tagName;\r\n var type = gradient.type;\r\n if (type === 'linear' && tagName === 'linearGradient'\r\n || type === 'radial' && tagName === 'radialGradient') {\r\n that.updateDom(gradient, gradient.__dom);\r\n }\r\n else {\r\n that.removeDom(gradient);\r\n that.add(gradient);\r\n }\r\n });\r\n };\r\n GradientManager.prototype.updateDom = function (gradient, dom) {\r\n if (isLinearGradient(gradient)) {\r\n dom.setAttribute('x1', gradient.x + '');\r\n dom.setAttribute('y1', gradient.y + '');\r\n dom.setAttribute('x2', gradient.x2 + '');\r\n dom.setAttribute('y2', gradient.y2 + '');\r\n }\r\n else if (isRadialGradient(gradient)) {\r\n dom.setAttribute('cx', gradient.x + '');\r\n dom.setAttribute('cy', gradient.y + '');\r\n dom.setAttribute('r', gradient.r + '');\r\n }\r\n else {\r\n logError('Illegal gradient type.');\r\n return;\r\n }\r\n if (gradient.global) {\r\n dom.setAttribute('gradientUnits', 'userSpaceOnUse');\r\n }\r\n else {\r\n dom.setAttribute('gradientUnits', 'objectBoundingBox');\r\n }\r\n dom.innerHTML = '';\r\n var colors = gradient.colorStops;\r\n for (var i = 0, len = colors.length; i < len; ++i) {\r\n var stop_1 = this.createElement('stop');\r\n stop_1.setAttribute('offset', colors[i].offset * 100 + '%');\r\n var color$1 = colors[i].color;\r\n if (color$1.indexOf('rgba') > -1) {\r\n var opacity = parse(color$1)[3];\r\n var hex = toHex(color$1);\r\n stop_1.setAttribute('stop-color', '#' + hex);\r\n stop_1.setAttribute('stop-opacity', opacity + '');\r\n }\r\n else {\r\n stop_1.setAttribute('stop-color', colors[i].color);\r\n }\r\n dom.appendChild(stop_1);\r\n }\r\n gradient.__dom = dom;\r\n };\r\n GradientManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n var gradient = displayable.style.fill;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n gradient = displayable.style.stroke;\r\n if (gradient && gradient.__dom) {\r\n _super.prototype.markDomUsed.call(this, gradient.__dom);\r\n }\r\n }\r\n };\r\n return GradientManager;\r\n }(Definable));\n\n function isPattern(value) {\r\n return value && (!!value.image || !!value.svgElement);\r\n }\r\n var patternDomMap = new WeakMap();\r\n var PatternManager = (function (_super) {\r\n __extends(PatternManager, _super);\r\n function PatternManager(zrId, svgRoot) {\r\n return _super.call(this, zrId, svgRoot, ['pattern'], '__pattern_in_use__') || this;\r\n }\r\n PatternManager.prototype.addWithoutUpdate = function (svgElement, displayable) {\r\n if (displayable && displayable.style) {\r\n var that_1 = this;\r\n each(['fill', 'stroke'], function (fillOrStroke) {\r\n var pattern = displayable.style[fillOrStroke];\r\n if (isPattern(pattern)) {\r\n var defs = that_1.getDefs(true);\r\n var dom = patternDomMap.get(pattern);\r\n if (dom) {\r\n if (!defs.contains(dom)) {\r\n that_1.addDom(dom);\r\n }\r\n }\r\n else {\r\n dom = that_1.add(pattern);\r\n }\r\n that_1.markUsed(displayable);\r\n var id = dom.getAttribute('id');\r\n svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')');\r\n }\r\n });\r\n }\r\n };\r\n PatternManager.prototype.add = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var dom = this.createElement('pattern');\r\n pattern.id = pattern.id == null ? this.nextId++ : pattern.id;\r\n dom.setAttribute('id', 'zr' + this._zrId\r\n + '-pattern-' + pattern.id);\r\n dom.setAttribute('x', '0');\r\n dom.setAttribute('y', '0');\r\n dom.setAttribute('patternUnits', 'userSpaceOnUse');\r\n this.updateDom(pattern, dom);\r\n this.addDom(dom);\r\n return dom;\r\n };\r\n PatternManager.prototype.update = function (pattern) {\r\n if (!isPattern(pattern)) {\r\n return;\r\n }\r\n var that = this;\r\n this.doUpdate(pattern, function () {\r\n var dom = patternDomMap.get(pattern);\r\n that.updateDom(pattern, dom);\r\n });\r\n };\r\n PatternManager.prototype.updateDom = function (pattern, patternDom) {\r\n var svgElement = pattern.svgElement;\r\n if (svgElement instanceof SVGElement) {\r\n if (svgElement.parentNode !== patternDom) {\r\n patternDom.innerHTML = '';\r\n patternDom.appendChild(svgElement);\r\n patternDom.setAttribute('width', pattern.svgWidth + '');\r\n patternDom.setAttribute('height', pattern.svgHeight + '');\r\n }\r\n }\r\n else {\r\n var img = void 0;\r\n var prevImage = patternDom.getElementsByTagName('image');\r\n if (prevImage.length) {\r\n if (pattern.image) {\r\n img = prevImage[0];\r\n }\r\n else {\r\n patternDom.removeChild(prevImage[0]);\r\n return;\r\n }\r\n }\r\n else if (pattern.image) {\r\n img = this.createElement('image');\r\n }\r\n if (img) {\r\n var imageSrc = void 0;\r\n if (typeof pattern.image === 'string') {\r\n imageSrc = pattern.image;\r\n }\r\n else if (pattern.image instanceof HTMLImageElement) {\r\n imageSrc = pattern.image.src;\r\n }\r\n else if (pattern.image instanceof HTMLCanvasElement) {\r\n imageSrc = pattern.image.toDataURL();\r\n }\r\n if (imageSrc) {\r\n img.setAttribute('href', imageSrc);\r\n img.setAttribute('x', '0');\r\n img.setAttribute('y', '0');\r\n var hostEl = {\r\n dirty: function () { }\r\n };\r\n var createdImage = createOrUpdateImage(imageSrc, img, hostEl, function (img) {\r\n patternDom.setAttribute('width', img.width + '');\r\n patternDom.setAttribute('height', img.height + '');\r\n });\r\n if (createdImage && createdImage.width && createdImage.height) {\r\n patternDom.setAttribute('width', createdImage.width + '');\r\n patternDom.setAttribute('height', createdImage.height + '');\r\n }\r\n patternDom.appendChild(img);\r\n }\r\n }\r\n }\r\n var x = pattern.x || 0;\r\n var y = pattern.y || 0;\r\n var rotation = (pattern.rotation || 0) / Math.PI * 180;\r\n var scaleX = pattern.scaleX || 1;\r\n var scaleY = pattern.scaleY || 1;\r\n var transform = \"translate(\" + x + \", \" + y + \") rotate(\" + rotation + \") scale(\" + scaleX + \", \" + scaleY + \")\";\r\n patternDom.setAttribute('patternTransform', transform);\r\n patternDomMap.set(pattern, patternDom);\r\n };\r\n PatternManager.prototype.markUsed = function (displayable) {\r\n if (displayable.style) {\r\n if (isPattern(displayable.style.fill)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));\r\n }\r\n if (isPattern(displayable.style.stroke)) {\r\n _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke));\r\n }\r\n }\r\n };\r\n return PatternManager;\r\n }(Definable));\n\n function generateClipPathsKey(clipPaths) {\r\n var key = [];\r\n if (clipPaths) {\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n key.push(clipPath.id);\r\n }\r\n }\r\n return key.join(',');\r\n }\r\n function hasClipPath(displayable) {\r\n var clipPaths = displayable.__clipPaths;\r\n return clipPaths && clipPaths.length > 0;\r\n }\r\n var ClippathManager = (function (_super) {\r\n __extends(ClippathManager, _super);\r\n function ClippathManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__') || this;\r\n _this._refGroups = {};\r\n _this._keyDuplicateCount = {};\r\n return _this;\r\n }\r\n ClippathManager.prototype.markAllUnused = function () {\r\n _super.prototype.markAllUnused.call(this);\r\n for (var key in this._refGroups) {\r\n this.markDomUnused(this._refGroups[key]);\r\n }\r\n this._keyDuplicateCount = {};\r\n };\r\n ClippathManager.prototype._getClipPathGroup = function (displayable, prevDisplayable) {\r\n if (!hasClipPath(displayable)) {\r\n return;\r\n }\r\n var clipPaths = displayable.__clipPaths;\r\n var keyDuplicateCount = this._keyDuplicateCount;\r\n var clipPathKey = generateClipPathsKey(clipPaths);\r\n if (isClipPathChanged(clipPaths, prevDisplayable && prevDisplayable.__clipPaths)) {\r\n keyDuplicateCount[clipPathKey] = keyDuplicateCount[clipPathKey] || 0;\r\n keyDuplicateCount[clipPathKey] && (clipPathKey += '-' + keyDuplicateCount[clipPathKey]);\r\n keyDuplicateCount[clipPathKey]++;\r\n }\r\n return this._refGroups[clipPathKey]\r\n || (this._refGroups[clipPathKey] = this.createElement('g'));\r\n };\r\n ClippathManager.prototype.update = function (displayable, prevDisplayable) {\r\n var clipGroup = this._getClipPathGroup(displayable, prevDisplayable);\r\n if (clipGroup) {\r\n this.markDomUsed(clipGroup);\r\n this.updateDom(clipGroup, displayable.__clipPaths);\r\n }\r\n return clipGroup;\r\n };\r\n ClippathManager.prototype.updateDom = function (parentEl, clipPaths) {\r\n if (clipPaths && clipPaths.length > 0) {\r\n var defs = this.getDefs(true);\r\n var clipPath = clipPaths[0];\r\n var clipPathEl = void 0;\r\n var id = void 0;\r\n if (clipPath._dom) {\r\n id = clipPath._dom.getAttribute('id');\r\n clipPathEl = clipPath._dom;\r\n if (!defs.contains(clipPathEl)) {\r\n defs.appendChild(clipPathEl);\r\n }\r\n }\r\n else {\r\n id = 'zr' + this._zrId + '-clip-' + this.nextId;\r\n ++this.nextId;\r\n clipPathEl = this.createElement('clipPath');\r\n clipPathEl.setAttribute('id', id);\r\n defs.appendChild(clipPathEl);\r\n clipPath._dom = clipPathEl;\r\n }\r\n var svgProxy = this.getSvgProxy(clipPath);\r\n svgProxy.brush(clipPath);\r\n var pathEl = this.getSvgElement(clipPath);\r\n clipPathEl.innerHTML = '';\r\n clipPathEl.appendChild(pathEl);\r\n parentEl.setAttribute('clip-path', 'url(#' + id + ')');\r\n if (clipPaths.length > 1) {\r\n this.updateDom(clipPathEl, clipPaths.slice(1));\r\n }\r\n }\r\n else {\r\n if (parentEl) {\r\n parentEl.setAttribute('clip-path', 'none');\r\n }\r\n }\r\n };\r\n ClippathManager.prototype.markUsed = function (displayable) {\r\n var _this = this;\r\n if (displayable.__clipPaths) {\r\n each(displayable.__clipPaths, function (clipPath) {\r\n if (clipPath._dom) {\r\n _super.prototype.markDomUsed.call(_this, clipPath._dom);\r\n }\r\n });\r\n }\r\n };\r\n ClippathManager.prototype.removeUnused = function () {\r\n _super.prototype.removeUnused.call(this);\r\n var newRefGroupsMap = {};\r\n for (var key in this._refGroups) {\r\n var group = this._refGroups[key];\r\n if (!this.isDomUnused(group)) {\r\n newRefGroupsMap[key] = group;\r\n }\r\n else if (group.parentNode) {\r\n group.parentNode.removeChild(group);\r\n }\r\n }\r\n this._refGroups = newRefGroupsMap;\r\n };\r\n return ClippathManager;\r\n }(Definable));\n\n var ShadowManager = (function (_super) {\r\n __extends(ShadowManager, _super);\r\n function ShadowManager(zrId, svgRoot) {\r\n var _this = _super.call(this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom') || this;\r\n _this._shadowDomMap = {};\r\n _this._shadowDomPool = [];\r\n return _this;\r\n }\r\n ShadowManager.prototype._getFromPool = function () {\r\n var shadowDom = this._shadowDomPool.pop();\r\n if (!shadowDom) {\r\n shadowDom = this.createElement('filter');\r\n shadowDom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + this.nextId++);\r\n var domChild = this.createElement('feDropShadow');\r\n shadowDom.appendChild(domChild);\r\n this.addDom(shadowDom);\r\n }\r\n return shadowDom;\r\n };\r\n ShadowManager.prototype.update = function (svgElement, displayable) {\r\n var style = displayable.style;\r\n if (hasShadow(style)) {\r\n var shadowKey = getShadowKey(displayable);\r\n var shadowDom = displayable._shadowDom = this._shadowDomMap[shadowKey];\r\n if (!shadowDom) {\r\n shadowDom = this._getFromPool();\r\n this._shadowDomMap[shadowKey] = shadowDom;\r\n }\r\n this.updateDom(svgElement, displayable, shadowDom);\r\n }\r\n else {\r\n this.remove(svgElement, displayable);\r\n }\r\n };\r\n ShadowManager.prototype.remove = function (svgElement, displayable) {\r\n if (displayable._shadowDom != null) {\r\n displayable._shadowDom = null;\r\n svgElement.style.filter = '';\r\n }\r\n };\r\n ShadowManager.prototype.updateDom = function (svgElement, displayable, shadowDom) {\r\n var domChild = shadowDom.children[0];\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n var scaleX = globalScale[0];\r\n var scaleY = globalScale[1];\r\n if (!scaleX || !scaleY) {\r\n return;\r\n }\r\n var offsetX = style.shadowOffsetX || 0;\r\n var offsetY = style.shadowOffsetY || 0;\r\n var blur = style.shadowBlur;\r\n var color = style.shadowColor;\r\n domChild.setAttribute('dx', offsetX / scaleX + '');\r\n domChild.setAttribute('dy', offsetY / scaleY + '');\r\n domChild.setAttribute('flood-color', color);\r\n var stdDx = blur / 2 / scaleX;\r\n var stdDy = blur / 2 / scaleY;\r\n var stdDeviation = stdDx + ' ' + stdDy;\r\n domChild.setAttribute('stdDeviation', stdDeviation);\r\n shadowDom.setAttribute('x', '-100%');\r\n shadowDom.setAttribute('y', '-100%');\r\n shadowDom.setAttribute('width', '300%');\r\n shadowDom.setAttribute('height', '300%');\r\n displayable._shadowDom = shadowDom;\r\n var id = shadowDom.getAttribute('id');\r\n svgElement.style.filter = 'url(#' + id + ')';\r\n };\r\n ShadowManager.prototype.removeUnused = function () {\r\n var defs = this.getDefs(false);\r\n if (!defs) {\r\n return;\r\n }\r\n var shadowDomsPool = this._shadowDomPool;\r\n for (var key in this._shadowDomMap) {\r\n var dom = this._shadowDomMap[key];\r\n shadowDomsPool.push(dom);\r\n }\r\n this._shadowDomMap = {};\r\n };\r\n return ShadowManager;\r\n }(Definable));\r\n function hasShadow(style) {\r\n return style\r\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\r\n }\r\n function getShadowKey(displayable) {\r\n var style = displayable.style;\r\n var globalScale = displayable.getGlobalScale();\r\n return [\r\n style.shadowColor,\r\n (style.shadowBlur || 0).toFixed(2),\r\n (style.shadowOffsetX || 0).toFixed(2),\r\n (style.shadowOffsetY || 0).toFixed(2),\r\n globalScale[0],\r\n globalScale[1]\r\n ].join(',');\r\n }\n\n function parseInt10$1(val) {\r\n return parseInt(val, 10);\r\n }\r\n function getSvgProxy(el) {\r\n if (el instanceof Path) {\r\n return svgPath;\r\n }\r\n else if (el instanceof ZRImage) {\r\n return svgImage;\r\n }\r\n else if (el instanceof TSpan) {\r\n return svgText;\r\n }\r\n else {\r\n return svgPath;\r\n }\r\n }\r\n function checkParentAvailable(parent, child) {\r\n return child && parent && child.parentNode !== parent;\r\n }\r\n function insertAfter(parent, child, prevSibling) {\r\n if (checkParentAvailable(parent, child) && prevSibling) {\r\n var nextSibling = prevSibling.nextSibling;\r\n nextSibling ? parent.insertBefore(child, nextSibling)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function prepend(parent, child) {\r\n if (checkParentAvailable(parent, child)) {\r\n var firstChild = parent.firstChild;\r\n firstChild ? parent.insertBefore(child, firstChild)\r\n : parent.appendChild(child);\r\n }\r\n }\r\n function remove(parent, child) {\r\n if (child && parent && child.parentNode === parent) {\r\n parent.removeChild(child);\r\n }\r\n }\r\n function removeFromMyParent(child) {\r\n if (child && child.parentNode) {\r\n child.parentNode.removeChild(child);\r\n }\r\n }\r\n function getSvgElement(displayable) {\r\n return displayable.__svgEl;\r\n }\r\n var SVGPainter = (function () {\r\n function SVGPainter(root, storage, opts, zrId) {\r\n this.type = 'svg';\r\n this.refreshHover = createMethodNotSupport('refreshHover');\r\n this.pathToImage = createMethodNotSupport('pathToImage');\r\n this.configLayer = createMethodNotSupport('configLayer');\r\n this.root = root;\r\n this.storage = storage;\r\n this._opts = opts = extend({}, opts || {});\r\n var svgDom = createElement('svg');\r\n svgDom.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgDom.setAttribute('version', '1.1');\r\n svgDom.setAttribute('baseProfile', 'full');\r\n svgDom.style.cssText = 'user-select:none;position:absolute;left:0;top:0;';\r\n var bgRoot = createElement('g');\r\n svgDom.appendChild(bgRoot);\r\n var svgRoot = createElement('g');\r\n svgDom.appendChild(svgRoot);\r\n this._gradientManager = new GradientManager(zrId, svgRoot);\r\n this._patternManager = new PatternManager(zrId, svgRoot);\r\n this._clipPathManager = new ClippathManager(zrId, svgRoot);\r\n this._shadowManager = new ShadowManager(zrId, svgRoot);\r\n var viewport = document.createElement('div');\r\n viewport.style.cssText = 'overflow:hidden;position:relative';\r\n this._svgDom = svgDom;\r\n this._svgRoot = svgRoot;\r\n this._backgroundRoot = bgRoot;\r\n this._viewport = viewport;\r\n root.appendChild(viewport);\r\n viewport.appendChild(svgDom);\r\n this.resize(opts.width, opts.height);\r\n this._visibleList = [];\r\n }\r\n SVGPainter.prototype.getType = function () {\r\n return 'svg';\r\n };\r\n SVGPainter.prototype.getViewportRoot = function () {\r\n return this._viewport;\r\n };\r\n SVGPainter.prototype.getSvgDom = function () {\r\n return this._svgDom;\r\n };\r\n SVGPainter.prototype.getSvgRoot = function () {\r\n return this._svgRoot;\r\n };\r\n SVGPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n SVGPainter.prototype.refresh = function () {\r\n var list = this.storage.getDisplayList(true);\r\n this._paintList(list);\r\n };\r\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this._backgroundRoot && this._backgroundNode) {\r\n this._backgroundRoot.removeChild(this._backgroundNode);\r\n }\r\n var bgNode = createElement('rect');\r\n bgNode.setAttribute('width', this.getWidth());\r\n bgNode.setAttribute('height', this.getHeight());\r\n bgNode.setAttribute('x', 0);\r\n bgNode.setAttribute('y', 0);\r\n bgNode.setAttribute('id', 0);\r\n bgNode.style.fill = backgroundColor;\r\n this._backgroundRoot.appendChild(bgNode);\r\n this._backgroundNode = bgNode;\r\n };\r\n SVGPainter.prototype.createSVGElement = function (tag) {\r\n return createElement(tag);\r\n };\r\n SVGPainter.prototype.paintOne = function (el) {\r\n var svgProxy = getSvgProxy(el);\r\n svgProxy && svgProxy.brush(el);\r\n return getSvgElement(el);\r\n };\r\n SVGPainter.prototype._paintList = function (list) {\r\n var gradientManager = this._gradientManager;\r\n var patternManager = this._patternManager;\r\n var clipPathManager = this._clipPathManager;\r\n var shadowManager = this._shadowManager;\r\n gradientManager.markAllUnused();\r\n patternManager.markAllUnused();\r\n clipPathManager.markAllUnused();\r\n shadowManager.markAllUnused();\r\n var svgRoot = this._svgRoot;\r\n var visibleList = this._visibleList;\r\n var listLen = list.length;\r\n var newVisibleList = [];\r\n for (var i = 0; i < listLen; i++) {\r\n var displayable = list[i];\r\n var svgProxy = getSvgProxy(displayable);\r\n var svgElement = getSvgElement(displayable);\r\n if (!displayable.invisible) {\r\n if (displayable.__dirty || !svgElement) {\r\n svgProxy && svgProxy.brush(displayable);\r\n svgElement = getSvgElement(displayable);\r\n if (svgElement && displayable.style) {\r\n gradientManager.update(displayable.style.fill);\r\n gradientManager.update(displayable.style.stroke);\r\n patternManager.update(displayable.style.fill);\r\n patternManager.update(displayable.style.stroke);\r\n shadowManager.update(svgElement, displayable);\r\n }\r\n displayable.__dirty = 0;\r\n }\r\n if (svgElement) {\r\n newVisibleList.push(displayable);\r\n }\r\n }\r\n }\r\n var diff = arrayDiff(visibleList, newVisibleList);\r\n var prevSvgElement;\r\n var topPrevSvgElement;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n if (item.removed) {\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = visibleList[item.indices[k]];\r\n var svgElement = getSvgElement(displayable);\r\n hasClipPath(displayable) ? removeFromMyParent(svgElement)\r\n : remove(svgRoot, svgElement);\r\n }\r\n }\r\n }\r\n var prevDisplayable;\r\n var currentClipGroup;\r\n for (var i = 0; i < diff.length; i++) {\r\n var item = diff[i];\r\n var isAdd = item.added;\r\n if (item.removed) {\r\n continue;\r\n }\r\n for (var k = 0; k < item.count; k++) {\r\n var displayable = newVisibleList[item.indices[k]];\r\n var clipGroup = clipPathManager.update(displayable, prevDisplayable);\r\n if (clipGroup !== currentClipGroup) {\r\n prevSvgElement = topPrevSvgElement;\r\n if (clipGroup) {\r\n prevSvgElement ? insertAfter(svgRoot, clipGroup, prevSvgElement)\r\n : prepend(svgRoot, clipGroup);\r\n topPrevSvgElement = clipGroup;\r\n prevSvgElement = null;\r\n }\r\n currentClipGroup = clipGroup;\r\n }\r\n var svgElement = getSvgElement(displayable);\r\n prevSvgElement\r\n ? insertAfter(currentClipGroup || svgRoot, svgElement, prevSvgElement)\r\n : prepend(currentClipGroup || svgRoot, svgElement);\r\n prevSvgElement = svgElement || prevSvgElement;\r\n if (!currentClipGroup) {\r\n topPrevSvgElement = prevSvgElement;\r\n }\r\n gradientManager.markUsed(displayable);\r\n gradientManager.addWithoutUpdate(svgElement, displayable);\r\n patternManager.markUsed(displayable);\r\n patternManager.addWithoutUpdate(svgElement, displayable);\r\n clipPathManager.markUsed(displayable);\r\n prevDisplayable = displayable;\r\n }\r\n }\r\n gradientManager.removeUnused();\r\n patternManager.removeUnused();\r\n clipPathManager.removeUnused();\r\n shadowManager.removeUnused();\r\n this._visibleList = newVisibleList;\r\n };\r\n SVGPainter.prototype._getDefs = function (isForceCreating) {\r\n var svgRoot = this._svgDom;\r\n var defs = svgRoot.getElementsByTagName('defs');\r\n if (defs.length === 0) {\r\n if (isForceCreating) {\r\n var defs_1 = svgRoot.insertBefore(createElement('defs'), svgRoot.firstChild);\r\n if (!defs_1.contains) {\r\n defs_1.contains = function (el) {\r\n var children = defs_1.children;\r\n if (!children) {\r\n return false;\r\n }\r\n for (var i = children.length - 1; i >= 0; --i) {\r\n if (children[i] === el) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n }\r\n return defs_1;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return defs[0];\r\n }\r\n };\r\n SVGPainter.prototype.resize = function (width, height) {\r\n var viewport = this._viewport;\r\n viewport.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n viewport.style.display = '';\r\n if (this._width !== width || this._height !== height) {\r\n this._width = width;\r\n this._height = height;\r\n var viewportStyle = viewport.style;\r\n viewportStyle.width = width + 'px';\r\n viewportStyle.height = height + 'px';\r\n var svgRoot = this._svgDom;\r\n svgRoot.setAttribute('width', width + '');\r\n svgRoot.setAttribute('height', height + '');\r\n }\r\n if (this._backgroundNode) {\r\n this._backgroundNode.setAttribute('width', width);\r\n this._backgroundNode.setAttribute('height', height);\r\n }\r\n };\r\n SVGPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n SVGPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n SVGPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10$1(stl[wh]) || parseInt10$1(root.style[wh]))\r\n - (parseInt10$1(stl[plt]) || 0)\r\n - (parseInt10$1(stl[prb]) || 0)) | 0;\r\n };\r\n SVGPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this._svgRoot\r\n = this._backgroundRoot\r\n = this._svgDom\r\n = this._backgroundNode\r\n = this._viewport\r\n = this.storage\r\n = null;\r\n };\r\n SVGPainter.prototype.clear = function () {\r\n var viewportNode = this._viewport;\r\n if (viewportNode && viewportNode.parentNode) {\r\n viewportNode.parentNode.removeChild(viewportNode);\r\n }\r\n };\r\n SVGPainter.prototype.toDataURL = function () {\r\n this.refresh();\r\n var html = encodeURIComponent(this._svgDom.outerHTML.replace(/>\\n\\r<'));\r\n return 'data:image/svg+xml;charset=UTF-8,' + html;\r\n };\r\n return SVGPainter;\r\n }());\r\n function createMethodNotSupport(method) {\r\n return function () {\r\n logError('In SVG mode painter not support method \"' + method + '\"');\r\n };\r\n }\n\n registerPainter('svg', SVGPainter);\n\n exports.Axis = Axis;\n exports.List = List;\n exports.Model = Model;\n exports.PRIORITY = PRIORITY;\n exports.color = color;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose$1;\n exports.env = env;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.format = format$1;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.graphic = graphic$1;\n exports.helper = helper;\n exports.init = init$1;\n exports.innerDrawElementOnCanvas = brushSingle;\n exports.matrix = matrix;\n exports.number = number;\n exports.parseGeoJSON = parseGeoJSON;\n exports.parseGeoJson = parseGeoJson;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.throttle = throttle;\n exports.time = time;\n exports.util = ecUtil;\n exports.vector = vector;\n exports.version = version$1;\n exports.zrender = zrender;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file diff --git a/dist/echarts.min.js b/dist/echarts.min.js index 14dcd514ba..ecce0b7a04 100644 --- a/dist/echarts.min.js +++ b/dist/echarts.min.js @@ -19,4 +19,4 @@ */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).echarts={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",o[u]+":0",i[1-l]+":auto",o[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,r),r,o);if(o)return o(t,n,i),!0}return!1}function jt(t){return"CANVAS"===t.nodeName.toUpperCase()}var qt="undefined"!=typeof window&&!!window.addEventListener,Kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,$t=[];function Jt(t,e,n,i){return n=n||{},i||!w.canvasSupported?Qt(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Qt(t,e,n),n}function Qt(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(jt(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=o-e.top)}if(Zt($t,t,i,o))return n.zrX=$t[0],void(n.zrY=$t[1])}n.zrX=n.zrY=0}function te(t){return t||window.event}function ee(t,e,n){if(null!=(e=te(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Jt(t,i,e,n):(Jt(t,e,e,n),o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function _e(){return[1,0,0,1,0,0]}function be(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function we(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Se(t,e,n){var i=e[0]*n[0]+e[2]*n[1],o=e[1]*n[0]+e[3]*n[1],r=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=s,t[5]=e,t}function Me(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Ie(t,e,n){var i=e[0],o=e[2],r=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=o*n+s*e,t[3]=-o*e+n*s,t[4]=n*r+e*l,t[5]=n*l-e*r,t}function Te(t,e,n){var i=n[0],n=n[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function Ce(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],e=n*a-r*i;return e?(e=1/e,t[0]=a*e,t[1]=-r*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*o)*e,t[5]=(r*o-n*s)*e,t):null}function De(t){var e=_e();return we(e,t),e}N(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){me.prototype[a]=function(t){var e,n,i=t.zrX,o=t.zrY,r=xe(this,i,o);if("mouseup"===a&&r||(n=(e=this.findHover(i,o)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),on(t,e),e):void Qe(e,0,0,0,1):7===o||9===o?0<=(r=parseInt(i.slice(1,7),16))&&r<=16777215?(Qe(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),on(t,e),e):void Qe(e,0,0,0,1):void 0;var n=i.indexOf("("),r=i.indexOf(")");if(-1!==n&&r+1===o){o=i.substr(0,n),r=i.substr(n+1,r-(n+1)).split(","),n=1;switch(o){case"rgba":if(4!==r.length)return 3===r.length?Qe(e,+r[0],+r[1],+r[2],1):Qe(e,0,0,0,1);n=Ke(r.pop());case"rgb":return 3!==r.length?void Qe(e,0,0,0,1):(Qe(e,qe(r[0]),qe(r[1]),qe(r[2]),n),on(t,e),e);case"hsla":return 4!==r.length?void Qe(e,0,0,0,1):(r[3]=Ke(r[3]),an(r,e),on(t,e),e);case"hsl":return 3!==r.length?void Qe(e,0,0,0,1):(an(r,e),on(t,e),e);default:return}}Qe(e,0,0,0,1)}}function an(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Ke(t[1]),o=Ke(t[2]),i=o<=.5?o*(i+1):o+i-o*i,o=2*o-i;return Qe(e=e||[],Ze(255*$e(o,i,n+1/3)),Ze(255*$e(o,i,n)),Ze(255*$e(o,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function sn(t,e){var n=rn(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(k(e)){var o,r=k((r=e)&&r[0])?2:1;if(0e);u++);u=Math.min(u-1,r-2)}var h,c,p,d,f,g,y,m=o[u+1],v=o[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?Tn:t[a],(0=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height},Hn.prototype.clone=function(){return new Hn(this.x,this.y,this.width,this.height)},Hn.prototype.copy=function(t){Hn.copy(this,t)},Hn.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},Hn.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Hn.prototype.isZero=function(){return 0===this.width||0===this.height},Hn.create=function(t){return new Hn(t.x,t.y,t.width,t.height)},Hn.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},Hn.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=r:s=1+r;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function wi(f,g){var r,a,y=mi,s=0,m=(f.length,[]);function e(t){var e=r[t],n=a[t],i=r[t+1],o=a[t+1];a[t]=n+o,t===s-3&&(r[t+1]=r[t+2],a[t+1]=a[t+2]),s--;t=bi(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(o=_i(f[e+n-1],f,i,o,o-1,g))&&(n<=o?function(t,e,n,i){var o=0;for(o=0;oa[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(o);do{}while((r=vi(t,n,i,e))this._ux||er(e-this._yi)>this._uy||this._len<5;return this.addData(Wo.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},ur.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this.addData(Wo.C,t,e,n,i,o,r),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,o,r):this._ctx.bezierCurveTo(t,e,n,i,o,r)),this._xi=o,this._yi=r,this},ur.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(Wo.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},ur.prototype.arc=function(t,e,n,i,o,r){rr[0]=i,rr[1]=o,sr(rr,r),i=rr[0];var a=(o=rr[1])-i;return this.addData(Wo.A,t,e,n,n,i,a,0,r?0:1),this._ctx&&this._ctx.arc(t,e,n,i,o,r),this._xi=Jo(o)*n+t,this._yi=Qo(o)*n+e,this},ur.prototype.arcTo=function(t,e,n,i,o){return this._ctx&&this._ctx.arcTo(t,e,n,i,o),this},ur.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Wo.R,t,e,n,i),this},ur.prototype.closePath=function(){this.addData(Wo.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},ur.prototype.fill=function(t){t&&t.fill(),this.toStatic()},ur.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},ur.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||er(y)>i||c===e-1)&&(f=Math.sqrt(T*T+y*y),o=g,r=x);break;case Wo.C:var m=t[c++],v=t[c++],g=t[c++],x=t[c++],_=t[c++],b=t[c++],f=function(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=_o(t,n,o,a,f),y=_o(e,i,r,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(o,r,m,v,g,x,_,b,10),o=_,r=b;break;case Wo.Q:f=function(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=To(t,n,o,p),f=To(e,i,r,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(o,r,m=t[c++],v=t[c++],g=t[c++],x=t[c++],10),o=g,r=x;break;case Wo.A:var w=t[c++],S=t[c++],M=t[c++],I=t[c++],p=t[c++],_=t[c++],b=_+p;c+=1;t[c++];d&&(a=Jo(p)*M+w,s=Qo(p)*I+S),f=$o(M,I)*Ko(ir,Math.abs(_)),o=Jo(b)*M+w,r=Qo(b)*I+S;break;case Wo.R:a=o=t[c++],s=r=t[c++];f=2*t[c++]+2*t[c++];break;case Wo.Z:var T=a-o,y=s-r;f=Math.sqrt(T*T+y*y),o=a,r=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},ur.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||er(s-r)>p||m===d-1){if(f){if(u=xr[i=0]+t&&a<=xr[1]+t?l:0}oMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,x,_,_+b,f,g,o);u=Math.cos(_+b)*v+y,h=Math.sin(_+b)*x+m;break;case yr.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(hr(c,p,w,p,e,i,o)||hr(w,p,w,S,e,i,o)||hr(w,S,c,S,e,i,o)||hr(c,S,c,p,e,i,o))return!0}else l+=gr(w,p,w,S,i,o),l+=gr(c,S,c,p,i,o);break;case yr.Z:if(n){if(hr(u,h,c,p,e,i,o))return!0}else l+=gr(u,h,c,p,i,o);u=c,h=p}}return n||(r=h,t=p,Math.abs(r-t)c.width?1:0,o=Ts[i],r=Is[i],a=c[o]/e,s=c[r],l=0;l=e.maxIterations){t+=e.ellipsis;break}var a=0===r?function(t,e,n,i){for(var o=0,r=0,a=t.length;rr){0i.width&&(r=e.split("\n"),p=!0),i.accumWidth=s):(s=fl(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,r=s.lines)):r=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},Au.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Au.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Au.prototype.addHover=function(t){},Au.prototype.removeHover=function(t){},Au.prototype.clearHover=function(){},Au.prototype.refreshHover=function(){this._needsRefreshHover=!0},Au.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},Au.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Au.prototype.clearAnimation=function(){this.animation.clear()},Au.prototype.getWidth=function(){return this.painter.getWidth()},Au.prototype.getHeight=function(){return this.painter.getHeight()},Au.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Au.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Au.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Au.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},Au.prototype.off=function(t,e){this.handler.off(t,e)},Au.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Au.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/o*r+n[0]}function Nu(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Eu(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function zu(t){return t.sort(function(t,e){return t-e}),t}function Bu(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Vu(t){var e=t.toString(),t=e.indexOf("e");if(0u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/o}var Hu=9007199254740991;function Wu(t){var e=2*Math.PI;return(t%e+e)%e}function Xu(t){return-OuMath.abs(o[1])?0"'])/g,Ad={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ld(t){return null==t?"":(t+"").replace(Dd,function(t,e){return Ad[e]})}function kd(t,e,n){function i(t){return t&&rt(t)?t:"-"}function o(t){return null!=t&&!isNaN(t)&&isFinite(t)}var r="time"===e,a=t instanceof Date;if(r||a){r=r?Uu(t):t;if(!isNaN(+r))return ud(r,"yyyy-MM-dd hh:mm:ss",n);if(a)return"-"}if("ordinal"===e)return W(t)?i(t):X(t)&&o(t)?t+"":"-";e=Ju(t);return o(e)?Id(e):W(t)?i(t):"-"}function Pd(t,e){return"{"+t+(null==e?"":e)+"}"}var Od=["a","b","c","d","e","f","g"];function Rd(t,e,n){F(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;r':'':{renderMode:t,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function zd(t,e){return e=e||"transparent",H(t)?t:Y(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Bd(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var Vd=Object.freeze({__proto__:null,addCommas:Id,toCamelCase:Td,normalizeCssArray:Cd,encodeHTML:Ld,makeValueReadable:kd,formatTpl:Rd,formatTplSimple:Nd,getTooltipMarker:Ed,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Uu(e),o=i["get"+(l=n?"UTC":"")+"FullYear"](),r=i["get"+l+"Month"]()+1,a=i["get"+l+"Date"](),s=i["get"+l+"Hours"](),e=i["get"+l+"Minutes"](),n=i["get"+l+"Seconds"](),l=i["get"+l+"Milliseconds"]();return t=t.replace("MM",sd(r,2)).replace("M",r).replace("yyyy",o).replace("yy",o%100+"").replace("dd",sd(a,2)).replace("d",a).replace("hh",sd(s,2)).replace("h",s).replace("mm",sd(e,2)).replace("m",e).replace("ss",sd(n,2)).replace("s",n).replace("SSS",sd(l,3))},capitalFirst:function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},convertToColorString:zd,windowOpen:Bd,truncateText:rl,getTextRect:function(t,e,n,i,o,r,a,s){return oh(),new vl({style:{text:t,font:e,align:n,verticalAlign:i,padding:o,rich:r,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}}),Fd=N,Gd=["left","right","top","bottom","width","height"],Hd=[["width","left","right"],["height","top","bottom"]];function Wd(a,s,l,u,h){var c=0,p=0;null==u&&(u=1/0),null==h&&(h=1/0);var d=0;s.eachChild(function(t,e){var n,i,o=t.getBoundingRect(),r=s.childAt(e+1),e=r&&r.getBoundingRect();d="horizontal"===a?(r=o.width+(e?-e.x+o.x:0),u<(n=c+r)||t.newline?(c=0,n=r,p+=d+l,o.height):Math.max(d,o.height)):(e=o.height+(e?-e.y+o.y:0),h<(i=p+e)||t.newline?(c+=d+l,p=0,i=e,o.width):Math.max(d,o.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=i+l)})}var Xd=Wd;V(Wd,"vertical"),V(Wd,"horizontal");function Yd(t,e,n){n=Cd(n||0);var i=e.width,o=e.height,r=Nu(t.left,i),a=Nu(t.top,o),s=Nu(t.right,i),l=Nu(t.bottom,o),u=Nu(t.width,i),h=Nu(t.height,o),c=n[2]+n[0],p=n[1]+n[3],e=t.aspect;switch(isNaN(u)&&(u=i-s-p-r),isNaN(h)&&(h=o-l-c-a),null!=e&&(isNaN(u)&&isNaN(h)&&(i/oe)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return o&&(r[o]=n),e.paletteIdx=(t+1)%a.length,n}}var Nf,Ef="\0_ec_inner",zf=(l(Bf,Nf=Fp),Bf.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new Fp(i),this._locale=new Fp(o),this._optionManager=r},Bf.prototype.setOption=function(t,e,n){ot(!(Ef in t),"please use chart.getOption()");e=Gf(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},Bf.prototype.resetOption=function(t,e){return this._resetOption(t,Gf(e))},Bf.prototype._resetOption=function(t,e){var n,i=!1,o=this._optionManager;return t&&"recreate"!==t||(n=o.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):Df(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=o.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(o=o.getMediaOption(this)).length&&N(o,function(t){i=!0,this._mergeOption(t,e)},this),i},Bf.prototype.mergeOption=function(t){this._mergeOption(t,null)},Bf.prototype._mergeOption=function(i,t){var o=this.option,u=this._componentsMap,h=this._componentsCount,n=[],r=ct(),c=t&&t.replaceMergeMainTypeMap;xf(this).datasetMap=ct(),N(i,function(t,e){null!=t&&(nf.hasClass(e)?e&&(n.push(e),r.set(e,!0)):o[e]=null==o[e]?C(t):b(o[e],t,!0))}),c&&c.each(function(t,e){nf.hasClass(e)&&!r.get(e)&&(n.push(e),r.set(e,!0))}),nf.topologicalTravel(n,nf.getAllClassMainTypes(),function(r){var t=function(t,e,n){return(e=If.get(e))&&(t=e(t))?n.concat(t):n}(this,r,lh(i[r])),e=u.get(r),n=e?c&&c.get(r)?"replaceMerge":"normalMerge":"replaceAll",n=ph(e,t,n);vh(n,r,nf),o[r]=null,u.set(r,null),h.set(r,0);var a=[],s=[],l=0;N(n,function(t,e){var n,i=t.existing,o=t.newOption;o?(n=nf.getClass(r,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1)):(e=O({componentIndex:e},t.keyInfo),O(i=new n(o,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),o[r]=a,u.set(r,s),h.set(r,l),"series"===r&&Tf(this)},this),this._seriesIndices||Tf(this)},Bf.prototype.getOption=function(){var a=C(this.option);return N(a,function(t,e){if(nf.hasClass(e)){for(var n=lh(t),i=n.length,o=!1,r=i-1;0<=r;r--)n[r]&&!mh(n[r])?o=!0:(n[r]=null,o||i--);n.length=i,a[e]=n}}),delete a[Ef],a},Bf.prototype.getTheme=function(){return this._theme},Bf.prototype.getLocaleModel=function(){return this._locale},Bf.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},Bf.prototype.setUpdatePayload=function(t){this._payload=t},Bf.prototype.getUpdatePayload=function(){return this._payload},Bf.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;i'+Ld(e)+""+r,n)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n){var i=t.renderMode,o=e.noName,r=e.noValue,a=!e.markerType,s=e.name,l=e.value,u=t.useUTC;if(!o||!r){var h=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),c=o?"":kd(s,"ordinal",u),p=e.valueType,d=r?[]:F(l)?P(l,function(t,e){return kd(t,F(p)?p[e]:p,u)}):[kd(l,F(p)?p[0]:p,u)],f=!a||!o,s=!a&&o;return"richText"===i?(a?"":h)+(o?"":ky(t,c))+(r?"":(e=t,l=d,i=[by],t=(t=s)?10:20,f&&i.push({padding:[0,0,0,t],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(l.join(" "),i))):Ly((a?"":h)+(o?"":''+Ld(c)+"")+(r?"":function(t,e,n){n=n?"10px":"20px";return''+P(t,Ld).join("  ")+""}(d,f,s)),n)}}}};function Dy(t,e,n,i,o){if(t){var r=Ty(t);r.planLayout(t);e={useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e};return r.build(e,t,0)}}function Ay(t){t=t.__gapLevelBetweenSubBlocks;return{html:Sy[t],richText:My[t]}}function Ly(t,e){return'
'+t+'
'}function ky(t,e){return t.markupStyleCreator.wrapRichTextStyle(e,_y)}function Py(t,e){return zd(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function Oy(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}var Ry=(Ny.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},Ny.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,n=Ed({color:e,type:t,renderMode:n,markerId:i});return H(n)?n:(this.richTextStyles[i]=n.style,n.content)},Ny.prototype.wrapRichTextStyle=function(t,e){var n={};F(e)?N(e,function(t){return O(n,t)}):O(n,e);e=this._generateStyleName();return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"},Ny);function Ny(){this.richTextStyles={},this._nextStyleNameId=th()}function Ey(t){var e,n,i,o,r,a,s,l,u,h,c,p=t.series,d=t.dataIndex,f=t.multipleSeries,g=p.getData(),y=g.mapDimensionsAll("defaultedTooltip"),m=y.length,v=p.getRawValue(d),x=F(v),t=Py(p,d);function _(t,e){e=s.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(l?c.push(Iy("nameValue",{markerType:"subItem",markerColor:a,name:e.displayName,value:t,valueType:e.type})):(u.push(t),h.push(e.type)))}1this.getShallow("animationThreshold")&&(t=!1),!!t},Gy.prototype.restoreData=function(){this.dataTask.dirty()},Gy.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return kf.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Gy.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Gy.prototype.getProgressive=function(){return this.get("progressive")},Gy.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Gy.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Gy.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),o=0;oe.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Uy(e,n){N(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,V(Zy,n))})}function Zy(t,e){t=jy(t);return t&&t.setOutputEnd((e||this).count()),e}function jy(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}I(Fy,ni),I(Fy,kf),Rh(Fy,nf);var qy=(Ky.prototype.init=function(t,e){},Ky.prototype.render=function(t,e,n,i){},Ky.prototype.dispose=function(t,e){},Ky.prototype.updateView=function(t,e,n,i){},Ky.prototype.updateLayout=function(t,e,n,i){},Ky.prototype.updateVisual=function(t,e,n,i){},Ky.prototype.blurSeries=function(t,e){},Ky);function Ky(){this.group=new $r,this.uid=Wp("viewComponent")}function $y(){var r=_h();return function(t){var e=r(t),n=t.pipelineContext,i=!!e.large,o=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&o==n)&&"reset"}}Oh(qy),Bh(qy,{registerWhenExtend:!0});var Jy=_h(),Qy=$y(),tm=(em.prototype.init=function(t,e){},em.prototype.render=function(t,e,n,i){},em.prototype.highlight=function(t,e,n,i){im(t.getData(),i,"emphasis")},em.prototype.downplay=function(t,e,n,i){im(t.getData(),i,"normal")},em.prototype.remove=function(t,e){this.group.removeAll()},em.prototype.dispose=function(t,e){},em.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},em.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},em.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},em.markUpdateMethod=function(t,e){Jy(t).updateMethod=e},em.protoInitialize=void(em.prototype.type="chart"),em);function em(){this.group=new $r,this.uid=Wp("viewChart"),this.renderTask=Bg({plan:om,reset:rm}),this.renderTask.context={view:this}}function nm(t,e,n){t&&("emphasis"===e?bc:wc)(t,n)}function im(e,t,n){var i,o=xh(e,t),r=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=Yh[i])&&Xh<=32&&(t=Yh[i]=Xh++),t):null;null!=o?N(lh(o),function(t){nm(e.getItemGraphicEl(t),n,r)}):e.eachItemGraphicEl(function(t){nm(t,n,r)})}function om(t){return Qy(t.model)}function rm(t){var e=t.model,n=t.ecModel,i=t.api,o=t.payload,r=e.pipelineContext.progressiveRender,a=t.view,t=o&&Jy(o).updateMethod,t=r?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,o),am[t]}Oh(tm),Bh(tm,{registerWhenExtend:!0});var am={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},sm="\0__throttleOriginMethod",lm="\0__throttleRate",um="\0__throttleType";function hm(t,o,r){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}o=o||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},bm.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},bm.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:i,large:e}},bm.prototype.restorePipelines=function(t){var i=this,o=i._pipelineMap=ct();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;o.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},bm.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,o=this.api.getModel(),r=this.api;N(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";ot(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,o,r),t.overallReset&&this._createOverallStageTask(t,e,o,r)},this)},bm.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},bm.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},bm.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},bm.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}N(t,function(i,t){var e,n,o,r,a;u.visualType&&u.visualType!==i.visualType||(e=(r=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=r.overallTask)?((r=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),o=!0)}),o&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),r.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},bm.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},bm.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},bm.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},bm.prototype._createSeriesStageTask=function(n,t,i,o){var r=this,a=t.seriesTaskMap,s=t.seriesTaskMap=ct(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||Bg({plan:Tm,reset:Cm,count:Lm}));e.context={model:t,ecModel:i,api:o,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:r},r._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,o).each(l)},bm.prototype._createOverallStageTask=function(t,e,n,i){var o=this,r=e.overallTask=e.overallTask||Bg({reset:wm});r.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:o};var a=r.agentStubMap,s=r.agentStubMap=ct(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,Bg({reset:Sm,onDirty:Im})));e.context={model:t,overallProgress:h},e.agent=r,e.__block=h,o._pipe(t,e)}ot(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,N(n.getSeries(),p)),c&&r.dirty()},bm.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},bm.wrapStageHandler=function(t,e){return G(t)&&(t={overallReset:t,seriesType:function(t){km=null;try{t(Pm,Om)}catch(t){}return km}(t)}),t.uid=Wp("stageHandler"),e&&(t.visualType=e),t},bm);function bm(t,e,n,i){this._stageTaskMap=ct(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function wm(t){t.overallReset(t.ecModel,t.api,t.payload)}function Sm(t){return t.overallProgress&&Mm}function Mm(){this.agent.dirty(),this.getDownstream().dirty()}function Im(){this.agent&&this.agent.dirty()}function Tm(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function Cm(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=lh(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var r,a=this.__startIndex;ao[0]){for(l=0;lt);l++);s=i[o[l]]}o.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else _("Layer of zlevel "+t+" is not valid")},ox.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new ga({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),xx(p,function(t){t=new na({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},i_.prototype.convertToPixel=function(t,e){return Bx(this,"convertToPixel",t,e)},i_.prototype.convertFromPixel=function(t,e){return Bx(this,"convertFromPixel",t,e)},i_.prototype.containPixel=function(t,o){var r;if(!this._disposed)return N(wh(this._model,t),function(t,i){0<=i.indexOf("Models")&&N(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?r=r||!!n.containPoint(o):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(r=r||e.containPoint(o,t))},this)},this),!!r;u_(this.id)},i_.prototype.getVisual=function(t,e){var n=wh(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?Zm(t,n,e):jm(t,e)},i_.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},i_.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},i_.prototype._initEvents=function(){var t,e,n,s=this;xx(l_,function(a){function t(t){var n,e,i=s.getModel(),o=t.target,r="globalout"===a;r?n={}:o&&rx(o,function(t){var e=Wh(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=O({},e.eventData),1)},!0),n&&(e=n.componentType,r=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",r=n.seriesIndex),r=(e=e&&null!=r&&i.getComponent(e,r))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:e,view:r},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),xx(c_,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),xx(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(Dv("map","selectchanged",e,n,t),Dv("pie","selectchanged",e,n,t)):"select"===t.fromAction?(Dv("map","selected",e,n,t),Dv("pie","selected",e,n,t)):"unselect"===t.fromAction&&(Dv("map","unselected",e,n,t),Dv("pie","unselected",e,n,t))})},i_.prototype.isDisposed=function(){return this._disposed},i_.prototype.clear=function(){this._disposed?u_(this.id):this.setOption({series:[]},!0)},i_.prototype.dispose=function(){var e,n;this._disposed?u_(this.id):(this._disposed=!0,Th(this.getDom(),S_,""),e=this._api,n=this._model,xx(this._componentsViews,function(t){t.dispose(n,e)}),xx(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete x_[this.id])},i_.prototype.resize=function(t){var e;this._disposed?u_(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[Sx]=!0,e&&Rx(this),zx.update.call(this,{type:"resize",animation:{duration:0}}),this[Sx]=!1,Gx.call(this,t),Hx.call(this,t)))},i_.prototype.showLoading=function(t,e){this._disposed?u_(this.id):(bx(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),v_[t]&&(t=v_[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},i_.prototype.hideLoading=function(){this._disposed?u_(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},i_.prototype.makeActionFromEvent=function(t){var e=O({},t);return e.type=c_[t.type],e},i_.prototype.dispatchAction=function(t,e){var n;this._disposed?u_(this.id):(bx(e)||(e={silent:!!e}),h_[t.type]&&this._model&&(this[Sx]?this._pendingActions.push(t):(n=e.silent,Fx.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),Gx.call(this,n),Hx.call(this,n))))},i_.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},i_.prototype.appendData=function(t){var e;this._disposed?u_(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},i_.internalField=(Rx=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Nx(t,!0),Nx(t,!1),e.plan()},Nx=function(t,o){for(var r=t._model,a=t._scheduler,s=o?t._componentsViews:t._chartsViews,l=o?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},qx=function(e,n){xx(g_,function(t){t(e,n)})},Qx=function(t){t[Ix]=!0,t.getZr().wakeUp()},t_=function(t){t[Ix]&&(t.getZr().storage.traverse(function(t){ip(t)||o_(t)}),t[Ix]=!1)},Kx=function(n){return l(t,e=Hf),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){bc(t,e),Qx(n)},t.prototype.leaveEmphasis=function(t,e){wc(t,e),Qx(n)},t.prototype.enterBlur=function(t){Sc(t),Qx(n)},t.prototype.leaveBlur=function(t){Mc(t),Qx(n)},t.prototype.enterSelect=function(t){Ic(t),Qx(n)},t.prototype.leaveSelect=function(t){Tc(t),Qx(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},$x=function(i){function o(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||$_(this,d))}this._rawCount=this._count=s,this._extent={},X_(this)},fb.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,o=this._storage,r=this.dimensions,a=r.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===hf,p=0;p_[1]&&(_[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=gh(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=gh(v,null))),this._dontMakeIdFromName||$_(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},X_(this)}},fb.prototype.count=function(){return this._count},fb.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){o=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},fb.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],o=[];if(!i)return o;null==n&&(n=1/0);for(var r=1/0,a=-1,s=0,l=0,u=this.count();lt[I][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return lx[1]&&(x[1]=v)}}}return t},fb.prototype.downSample=function(t,e,n,i){for(var o=Q_(this,[t]),r=o._storage,a=[],s=ob(1/e),l=r[t],u=this.count(),h=o._rawExtent[t],c=new(Y_(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return o._count=p,o._indices=c,o.getRawIndex=j_,o},fb.prototype.lttbDownSample=function(t,e){var n,i=Q_(this,[]),o=i._storage[t],r=this.count(),a=new(Y_(this))(r),s=0,l=ob(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;he[1]&&(e[1]=t[1])},Cb.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Cb.prototype.getExtent=function(){return this._extent.slice()},Cb.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},Cb.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},Cb.prototype.isBlank=function(){return this._isBlank},Cb.prototype.setBlank=function(t){this._isBlank=t},Cb);function Cb(t){this._setting=t||{},this._extent=[1/0,-1/0]}Bh(Tb,{registerWhenExtend:!0});var Db=(Ab.createByAxisModel=function(t){var e=t.option,t=e.data,t=t&&P(t,Lb);return new Ab({categories:t,needCollect:!t,deduplication:!1!==e.dedplication})},Ab.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},Ab.prototype.parseAndCollect=function(t){var e=this._needCollect;if("string"!=typeof t&&!e)return t;if(e&&!this._deduplication)return n=this.categories.length,this.categories[n]=t,n;var n,i=this._getOrCreateMap();return null==(n=i.get(t))&&(e?(n=this.categories.length,this.categories[n]=t,i.set(t,n)):n=NaN),n},Ab.prototype._getOrCreateMap=function(){return this._map||(this._map=ct(this.categories))},Ab);function Ab(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}function Lb(t){return Y(t)&&null!=t.value?t.value:t+""}var kb=Eu;function Pb(t,e,n,i){var o={},r=t[1]-t[0],e=o.interval=qu(r/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),o}function Ob(t){return Vu(t)+2}function Rb(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Nb(t,e){return t>=e[0]&&t<=e[1]}function Eb(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function zb(t,e){return t*(e[1]-e[0])+e[0]}var Bb,Vb=(l(Fb,Bb=Tb),Fb.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},Fb.prototype.contain=function(t){return Nb(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},Fb.prototype.normalize=function(t){return Eb(t=this.getCategoryIndex(this.parse(t)),this._extent)},Fb.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(zb(t,this._extent))},Fb.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},Fb.prototype.getMinorTicks=function(t){},Fb.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},Fb.prototype.getCategorySortInfo=function(){return this._categorySortInfo},Fb.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},Fb.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},Fb.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},Fb.prototype.count=function(){return this._extent[1]-this._extent[0]+1},Fb.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Fb.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},Fb.prototype.getOrdinalMeta=function(){return this._ordinalMeta},Fb.prototype.niceTicks=function(){},Fb.prototype.niceExtent=function(){},Fb.type="ordinal",Fb);function Fb(t){var e=Bb.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return F(t=t||new Db({}))&&(t=new Db({categories:P(t,function(t){return Y(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}Tb.registerClass(Vb);var Gb,Hb=Eu,Wb=(l(Xb,Gb=Tb),Xb.prototype.parse=function(t){return t},Xb.prototype.contain=function(t){return Nb(t,this._extent)},Xb.prototype.normalize=function(t){return Eb(t,this._extent)},Xb.prototype.scale=function(t){return zb(t,this._extent)},Xb.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},Xb.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},Xb.prototype.getInterval=function(){return this._interval},Xb.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Ob(t)},Xb.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=[];if(!e)return r;n[0]s&&(t?r.push({value:Hb(s+e,o)}):r.push({value:n[1]})),r},Xb.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),o=1;oi[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=aw.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]e[1]&&(e[1]=t[1])})}var Ew=(zw.prototype.getNeedCrossZero=function(){return!this.option.scale},zw.prototype.getCoordSysModel=function(){},zw);function zw(){}Op={isDimensionStacked:Sb,enableDataStack:wb,getStackedDimension:Mb};var Ea=Object.freeze({__proto__:null,createList:function(t){return Ib(t.getSource(),t)},getLayoutRect:Yd,dataStack:Op,createScale:function(t,e){var n=e;return e instanceof Fp||(n=new Fp(e)),(e=Dw(n)).setExtent(t[0],t[1]),Cw(e,n),e},mixinAxisModelCommonMethods:function(t){I(t,Ew)},getECData:Wh,createDimensions:vb,createSymbol:px}),Bw=1e-8;function Vw(t,e){return Math.abs(t-e)>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l),o=s+=o,r=l+=r;i.push([s/n,l/n])}return i}function Xw(t,o){return P(R((t=function(t){if(!t.UTF8Encoding)return t;var e=(t=t).UTF8Scale;null==e&&(e=1024);for(var n=t.features,i=0;ia[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],r.coord)&&(i?r.coord=a[1]:e.pop());i&&u(r.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=Eu(t),e=Eu(e),l?e":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},lS=(uS.prototype.evaluate=function(t){var e=typeof t;return"string"==e?this._condVal.test(t):"number"==e&&this._condVal.test(t+"")},uS);function uS(t){null==(this._condVal=H(t)?new RegExp(t):$(t)?t:null)&&rh("")}var hS=(cS.prototype.evaluate=function(){return this.value},cS);function cS(){}var pS=(dS.prototype.evaluate=function(){for(var t=this.children,e=0;ei)return!1;return!0}(n,e))){var o=e.mapDimension(n.dim),r={};return N(n.getViewLabels(),function(t){r[t.tickValue]=1}),function(t){return!r.hasOwnProperty(e.get(o,t))}}}}function dM(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";N(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Va(0,0,0,0,l,!0);return l[r]=c,l[r+"2"]=e,l}}}(a,o)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(A(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Rc(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;nl[1]?-1:1,r=["start"===u?l[0]-r*s:"end"===u?l[1]+r*s:(l[0]+l[1])/2,RM(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*DM/180),RM(u)?c=AM.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var o,t=Wu(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=Xu(t-DM/2)?(o=i?"bottom":"top","center"):Xu(t-1.5*DM)?(o=i?"top":"bottom","center"):(o="middle",t<1.5*DM&&DM/2l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),ot[1]&&(t[1]=e)}qy.registerClass(nI),qy.registerClass(vm),D_(r.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=ct();return t.eachSeries(function(t){YM(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,T,n=[],i=ct();l=i,u=n,t.eachSeries(function(t){var e,n,i,o,r,a,s;YM(t)&&(e=(s=UM(t)).xAxisModel,n=s.yAxisModel,i=e.axis,o=n.axis,r=i.scale.rawExtentInfo,a=o.scale.rawExtentInfo,s=t.getData(),r&&r.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),Nw(aI(l,e).condExtent,s,i.dim),Nw(aI(l,n).condExtent,s,o.dim)))}),T=i,N(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,o=n.axis,r=aI(T,e),a=aI(T,n);r.rawExtentInfo=Mw(i.scale,e,r.condExtent),a.rawExtentInfo=Mw(o.scale,n,a.condExtent),r.rawExtentResult=r.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]e[1]&&e.reverse(),e},bI.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},bI.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},bI);function bI(t,e,n,i,o){n=xI.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=o||"bottom",n}wI.prototype.getRect=function(){return this._rect},wI.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),N(n.x,function(t){Cw(t.scale,t.model)}),N(n.y,function(t){Cw(t.scale,t.model)});var i={};N(n.x,function(t){MI(n,"y",t,i)}),N(n.y,function(t){MI(n,"x",t,i)}),this.resize(this.model,e)},wI.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=Yd(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var o=this._axesList;function r(){N(o,function(t){var e,n,i=t.isHorizontal(),o=i?[0,a.width]:[0,a.height],r=t.inverse?1:0;t.setExtent(o[r],o[1-r]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}r(),t&&(N(o,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=kw(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),r()),N(this._coordsList,function(t){t.calcAffineTransform()})},wI.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},wI.prototype.getAxes=function(){return this._axesList.slice()},wI.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}Y(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,o=this._coordsList;ih?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(r=(o=e.label.x-u-e.len2*p)<(r=c+e.len)?Math.sqrt(i*i/(1-o*o/r/r)):r,n.rB=r,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},dT.type="pie",dT);function dT(){var t=null!==pT&&pT.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}tm.registerClass(af);var fT=2*Math.PI,gT=Math.PI/180;function yT(t){return{seriesType:t,reset:function(t,e){var i,o=e.findComponents({mainType:"legend"});o&&o.length&&(i=t.getData()).filterSelf(function(t){for(var e=i.getName(t),n=0;nn[0]&&isFinite(u)&&isFinite(n[0]););else{i=o.getTicks().length-1;he&&(e=i.height)}this.height=e+1},ZC.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;er&&(r=t.depth)});var a=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:r;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),o.data},JC.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},JC.prototype.setZoom=function(t){this.option.zoom=t},JC.prototype.setCenter=function(t){this.option.center=t},JC.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,o=i.root.children[0],r=i.getNodeByDataIndex(t),t=r.getValue(),a=r.name;r&&r!==o;)a=r.parentNode.name+"."+a,r=r.parentNode;return Iy("nameValue",{name:a,value:t,noValue:isNaN(t)||null==t})},JC.type="series.tree",JC.layoutMode="box",JC.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},JC);function JC(){var t=null!==$C&&$C.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}function QC(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,o=t.hierNode.i?i[t.hierNode.i-1]:null;n.length?(function(t){var e=t.children,n=e.length,i=0,o=0;for(;0<=--n;){var r=e[n];r.hierNode.prelim+=i,r.hierNode.modifier+=i,o+=r.hierNode.change,i+=r.hierNode.shift+o}}(t),n=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2,o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-n):t.hierNode.prelim=n):o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o)),t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var o=t,r=t,a=r.parentNode.children[0],s=e,l=o.hierNode.modifier,u=r.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;s=iD(s),r=oD(r),s&&r;){o=iD(o),a=oD(a),o.hierNode.ancestor=t;var p=s.hierNode.prelim+c-r.hierNode.prelim-u+i(s,r);0p.x)||(u-=Math.PI)),r=t?"left":"right",p=(m=(y=s.getModel("label")).get("rotate"))*(Math.PI/180),(t=l.getTextContent())&&(l.setTextConfig({position:y.get("position")||r,rotation:null==m?-u:p,origin:"center"}),t.setStyle("verticalAlign","middle")));s=s.get(["emphasis","focus"]),s="ancestor"===s?a.getAncestorsIndices():"descendant"===s?a.getDescendantIndices():null;s&&(Wh(i).focus=s),function(t,e,n,i,o,r,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),p=t.get(["lineStyle","curveness"]),d=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&Jc(g=g||(i.__edge=new Nl({shape:gD(h,c,p,o,o)})),{shape:gD(h,c,p,r,a)},t);else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,m=[],v=0;vl.getLayout().x&&(l=t),t.depth>u.depth&&(u=t)}),a=s===l?1:a(s,l)/2,h=a-s.getLayout().x,f=d=p=c=0,"radial"===i?(c=o/(l.getLayout().x+a+h),p=r/(u.depth-1||1),yD(n,function(t){d=(t.getLayout().x+h)*c,f=(t.depth-1)*p;var e=nD(d,f);t.setLayout({x:e.x,y:e.y,rawX:d,rawY:f},!0)})):"RL"===(g=t.getOrient())||"LR"===g?(p=r/(l.getLayout().x+a+h),c=o/(u.depth-1||1),yD(n,function(t){f=(t.getLayout().x+h)*p,d="LR"===g?(t.depth-1)*c:o-(t.depth-1)*c,t.setLayout({x:d,y:f},!0)})):"TB"!==g&&"BT"!==g||(c=o/(l.getLayout().x+a+h),p=r/(u.depth-1||1),yD(n,function(t){d=(t.getLayout().x+h)*c,f="TB"===g?(t.depth-1)*p:r-(t.depth-1)*p,t.setLayout({x:d,y:f},!0)})))}}(t,e)})}),P_(function(t){t.eachSeriesByType("tree",function(t){var n=t.getData();n.tree.eachNode(function(t){var e=t.getModel().getModel("itemStyle").getItemStyle();O(n.ensureUniqueItemVisual(t.dataIndex,"style"),e)})})});var wD,nd=(l(SD,wD=Fy),SD.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};!function e(t){var n=0;N(t.children,function(t){e(t);var t=t.value;F(t)&&(t=t[0]),n+=t});var i=t.value;F(i)&&(i=i[0]);null!=i&&!isNaN(i)||(i=n);i<0&&(i=0);F(t.value)?t.value[0]=i:t.value=i}(n);var i=t.levels||[],o=this.designatedVisualItemStyle={},r=new Fp({itemStyle:o},this,e),a=P((i=t.levels=function(t,e){var i,o,n=lh(e.get("color")),r=lh(e.get("decals"));if(!n)return;N(t=t||[],function(t){var e=new Fp(t),n=e.get("color"),t=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(i=!0),(e.get(["itemStyle","decal"])||t&&"none"!==t)&&(o=!0)});e=t[0]||(t[0]={});i||(e.color=n.slice());!o&&r&&(e.decal=r.slice());return t}(i,e))||[],function(t){return new Fp(t,r,e)},this),s=jC.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){e=s.getNodeByDataIndex(e),e=a[e.depth];return t.parentModel=e||r,t})});return s.data},SD.prototype.optionUpdated=function(){this.resetViewRoot()},SD.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t);return Iy("nameValue",{name:i.getName(t),value:o})},SD.prototype.getDataParams=function(t){var e=wD.prototype.getDataParams.apply(this,arguments),t=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=_D(t,this),e},SD.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},O(this.layoutInfo,t)},SD.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=ct(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},SD.prototype.getViewRoot=function(){return this._viewRoot},SD.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},SD.prototype.enableAriaDecal=function(){bD(this)},SD.type="series.treemap",SD.layoutMode="box",SD.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},SD);function SD(){var t=null!==wD&&wD.apply(this,arguments)||this;return t.type=SD.type,t.preventUsingHoverLayer=!0,t}Fy.registerClass(nd);var MD=5,ID=(TD.prototype.render=function(t,e,n,i){var o,r,a=t.getModel("breadcrumb"),s=this.group;s.removeAll(),a.get("show")&&n&&(r=(o=a.getModel("itemStyle")).getModel("textStyle"),a={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},this._prepare(n,a,r),this._renderContent(t,a,o,r,i),Ud(s,a.pos,a.box))},TD.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var o=gh(i.getModel().get("name"),""),r=n.getTextRect(o),r=Math.max(r.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:i,text:o,width:r})}},TD.prototype._renderContent=function(t,e,n,i,o){for(var r,a,s,l,u,h,c,p,d,f,g,y,m,v=0,x=e.emptyItemWidth,_=t.get(["breadcrumb","height"]),b=(r=e.pos,a=e.box,l=a.width,u=a.height,h=Nu(r.left,l),c=Nu(r.top,u),p=Nu(r.right,l),a=Nu(r.bottom,u),(isNaN(h)||isNaN(parseFloat(r.left)))&&(h=0),(isNaN(p)||isNaN(parseFloat(r.right)))&&(p=l),(isNaN(c)||isNaN(parseFloat(r.top)))&&(c=0),(isNaN(a)||isNaN(parseFloat(r.bottom)))&&(a=u),s=Cd(s||0),{width:Math.max(p-h-s[1]-s[3],0),height:Math.max(a-c-s[0]-s[2],0)}),w=e.totalWidth,S=e.renderList,M=S.length-1;0<=M;M--){var I=S[M],T=I.node,C=I.width,D=I.text;b.width=i.length||t===i[t.depth])&&(e=fA(r,u,t,e,d,o),n(t,e,i,o))})):(p=hA(u),h.fill=p)}}(e,{},t.getViewRoot().getAncestors(),t)}};function uA(n,i,t){var o=O({},i),r=t.designatedVisualItemStyle;return N(["color","colorAlpha","colorSaturation"],function(t){r[t]=i[t];var e=n.get(t);(r[t]=null)!=e&&(o[t]=e)}),o}function hA(t){var e=cA(t,"color");if(e){var n=cA(t,"colorAlpha"),t=cA(t,"colorSaturation");return t&&(e=cn(e,null,null,t)),n&&(e=pn(e,n)),e}}function cA(t,e){e=t[e];if(null!=e&&"none"!==e)return e}function pA(t,e,n,i,o,r){if(r&&r.length){var a=dA(e,"color")||null!=o.color&&"none"!==o.color&&(dA(e,"colorAlpha")||dA(e,"colorSaturation"));if(a){r=e.get("visualMin"),o=e.get("visualMax"),n=n.dataExtent.slice();null!=r&&rn[1]&&(n[1]=o);e=e.get("colorMappingBy"),a={type:a.name,dataExtent:n,visual:a.range};"color"!==a.type||"index"!==e&&"id"!==e?a.mappingMethod="linear":(a.mappingMethod="category",a.loop=!0);a=new jD(a);return lA(a).drColorMappingBy=e,a}}}function dA(t,e){t=t.get(e);return F(t)&&t.length?{name:e,range:t}:null}function fA(t,e,n,i,o,r){var a,s=O({},e);return o&&(t="index"===(e="color"===(a=o.type)&&lA(o).drColorMappingBy)?i:"id"===e?r.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension")),s[a]=o.mapValueToVisual(t)),s}var gA=Math.max,yA=Math.min,mA=Q,vA=N,xA=["itemStyle","borderWidth"],_A=["itemStyle","gapWidth"],bA=["upperLabel","show"],wA=["upperLabel","height"],af={seriesType:"treemap",reset:function(t,e,n,i){var o,r=n.getWidth(),a=n.getHeight(),s=t.option,l=Yd(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),u=s.size||[],h=Nu(mA(l.width,u[0]),r),c=Nu(mA(l.height,u[1]),a),n=i&&i.type,u=mD(i,["treemapZoomToNode","treemapRootToNode"],t),i="treemapRender"===n||"treemapMove"===n?i.rootRect:null,p=t.getViewRoot(),d=vD(p);"treemapMove"!==n&&(c="treemapZoomToNode"===n?function(t,e,n,i,o){var r,a=(e||{}).node,s=[i,o];if(!a||a===n)return s;var n=i*o,l=n*t.option.zoomToNodeRatio;for(;r=a.parentNode;){for(var u=0,h=r.children,c=0,p=h.length;ca[1]&&(a[1]=t)})):a=[NaN,NaN];return{sum:i,dataExtent:a}}(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,n,i,o){if(!i)return n;for(var r=t.get("visibleMin"),a=o.length,s=a,l=a-1;0<=l;l--){var u=o["asc"===i?a-l-1:l].getValue();u/n*en[l[a]])&&(h=n[l[a]]);for(var c=0,p=t.length;c "+p)),u++)}var d,i=n.get("coordinateSystem");"cartesian2d"===i||"polar"===i?d=Ib(t,n):(L(i=(i=Yf.get(i))&&i.dimensions||[],"value")<0&&i.concat(["value"]),i=vb(t,{coordDimensions:i}),(d=new db(i,n)).initData(t));n=new db(["value"],n);return n.initData(l,s),o&&o(d,n),BC({mainData:d,struct:r,structAttr:"graph",datas:{node:d,edge:n},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}I(LA,RA("hostGraph","data")),I(PA,RA("hostGraph","edgeData"));var EA="--\x3e",zA=function(t){return t.get("autoCurveness")||null},BA=function(t,e){var n=zA(t),i=20,o=[];if("number"==typeof n)i=n;else if(F(n))return void(t.__curvenessList=n);i "),value:e.value,noValue:null==e.value})},UA.prototype._updateCategoriesData=function(){var t=P(this.option.categories||[],function(t){return null!=t.value?t:O({value:0},t)}),e=new db(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},UA.prototype.setZoom=function(t){this.option.zoom=t},UA.prototype.setCenter=function(t){this.option.center=t},UA.prototype.isAnimationEnabled=function(){return YA.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},UA.type="series.graph",UA.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},UA);function UA(){var t=null!==YA&&YA.apply(this,arguments)||this;return t.type=UA.type,t.hasSymbolVisual=!0,t}Fy.registerClass(nd);var ZA,jA=Ma.prototype,qA=Nl.prototype,KA=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};l($A,ZA=KA);function $A(){return null!==ZA&&ZA.apply(this,arguments)||this}function JA(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var QA,tL=(l(eL,QA=Dr),eL.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},eL.prototype.getDefaultShape=function(){return new KA},eL.prototype.buildPath=function(t,e){(JA(e)?jA:qA).buildPath.call(this,t,e)},eL.prototype.pointAt=function(t){return(JA(this.shape)?jA:qA).pointAt.call(this,t)},eL.prototype.tangentAt=function(t){var e=this.shape,t=JA(e)?[e.x2-e.x1,e.y2-e.y1]:qA.tangentAt.call(this,t);return Ct(t,t)},eL);function eL(t){t=QA.call(this,t)||this;return t.type="ec-line",t}var nL=["fromSymbol","toSymbol"];function iL(t){return"_"+t+"Type"}function oL(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),n=e.getItemVisual(n,t+"Rotate"),o=F(o)?o:[o,o],o=px(i,-o[0]/2,-o[1]/2,o[0],o[1]);return o.__specifiedRotation=null==n||isNaN(n)?void 0:+n*Math.PI/180||0,o.name=t,o}}function rL(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;e=e[2];e?(t.cpx1=e[0],t.cpy1=e[1]):(t.cpx1=NaN,t.cpy1=NaN)}var aL,sL=(l(lL,aL=$r),lL.prototype._createLine=function(n,i,t){var e,o=n.hostModel,r=n.getItemLayout(i),r=(e=r,rL((r=new tL({name:"line",subPixelOptimize:!0})).shape,e),r);r.shape.percent=0,Qc(r,{shape:{percent:1}},o,i),this.add(r),N(nL,function(t){var e=oL(t,n,i);this.add(e),this[iL(t)]=n.getItemVisual(i,t)},this),this._updateCommonStl(n,i,t)},lL.prototype.updateData=function(i,o,t){var e=i.hostModel,n=this.childOfName("line"),r=i.getItemLayout(o),a={shape:{}};rL(a.shape,r),Jc(n,a,e,o),N(nL,function(t){var e=i.getItemVisual(o,t),n=iL(t);this[n]!==e&&(this.remove(this.childOfName(t)),t=oL(t,i,o),this.add(t)),this[n]=e},this),this._updateCommonStl(i,o,t)},lL.prototype.getLinePath=function(){return this.childAt(0)},lL.prototype._updateCommonStl=function(n,t,e){var i=n.hostModel,r=this.childOfName("line"),o=e&&e.emphasisLineStyle,a=e&&e.blurLineStyle,s=e&&e.selectLineStyle,l=e&&e.labelStatesModels;e&&!n.hasItemOption||(o=(e=n.getItemModel(t)).getModel(["emphasis","lineStyle"]).getLineStyle(),a=e.getModel(["blur","lineStyle"]).getLineStyle(),s=e.getModel(["select","lineStyle"]).getLineStyle(),l=vp(e));var u=n.getItemVisual(t,"style"),h=u.stroke;r.useStyle(u),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,N(nL,function(t){var e=this.childOfName(t);if(e){e.setColor(h),e.style.opacity=u.opacity;for(var n=0;n=t&&(0===e?0:i[e-1][0])r&&(e[1-i]=e[i]+n.sign*r),e}function ik(t,e){t=t[e]-t[1-e];return{span:Math.abs(t),sign:0o*(1-t[0])?(l="jump",a=s-o*(1-t[2])):0<=(a=s-o*t[1])&&(a=s-o*(1-t[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?nk(a,i,r,"all"):l="none"):(a=i[1]-i[0],(i=[sk(0,r[1]*s/a-a/2)])[1]=ak(r[1],i[0]+a),i[0]=i[1]-a),{axisExpandWindow:i,behavior:l}},dk);function dk(t,e,n){this.type="parallel",this._axesMap=ct(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}function fk(t,e){return ak(sk(t,e[0]),e[1])}Yf.register("parallel",{create:function(i,o){var r=[];return i.eachComponent("parallel",function(t,e){var n=new pk(t,i,o);n.name="parallel_"+e,n.resize(t,o),(t.coordinateSystem=n).model=t,r.push(n)}),i.eachSeries(function(t){var e;"parallel"===t.get("coordinateSystem")&&(e=t.getReferringComponents("parallel",Sh).models[0],t.coordinateSystem=e.coordinateSystem)}),r}});var gk,nd=(l(yk,gk=nf),yk.prototype.getAreaSelectStyle=function(){return Vh([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},yk.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=C(t);if(e)for(var n=e.length-1;0<=n;n--)zu(e[n])},yk.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,o=e.length;it.getWidth()||n<0||n>t.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=Fk(t,e,n);if(!t._dragging)for(var a=0;ad&&(d=y.depth),g.setLayout({depth:m?y.depth:c},!0),"vertical"===r?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;v ")})},WO.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},WO.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},WO.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},WO.type="series.lines",WO.dependencies=["grid","polar","geo","calendar"],WO.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},WO);function WO(){var t=null!==HO&&HO.apply(this,arguments)||this;return t.type=WO.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}Fy.registerClass(nd);var XO,YO=(l(UO,XO=$r),UO.prototype.createLine=function(t,e,n){return new sL(t,e,n)},UO.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),i=n.get("symbolSize"),o=n.get("symbol");F(i)||(i=[i,i]);var r=t.getItemVisual(e,"style"),a=n.get("color")||r&&r.stroke,r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=px(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(n.getItemStyle(["color"])),r.scaleX=i[0],r.scaleY=i[1],r.setColor(a),this._symbolType=o,this._symbolScale=i,this._updateEffectAnimation(t,n,e))},UO.prototype._updateEffectAnimation=function(e,t,n){var i,o,r,a,s,l=this.childAt(1);l&&(i=this,o=e.getItemLayout(n),r=1e3*t.get("period"),a=t.get("loop"),s=t.get("constantSpeed"),t=Q(t.get("delay"),function(t){return t/e.count()*r/3}),l.ignore=!0,this._updateAnimationPoints(l,o),0e);a++);a=Math.min(a-1,o-2)}var s=(e-i[a])/(i[a+1]-i[a]),r=n[a],n=n[a+1];t.x=r[0]*(1-s)+s*n[0],t.y=r[1]*(1-s)+s*n[1];s=n[0]-r[0],r=n[1]-r[1];t.rotation=-Math.atan2(r,s)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=e,t.ignore=!1}},JO);function JO(){var t=null!==KO&&KO.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}var QO,tR=function(){this.polyline=!1,this.curveness=0,this.segs=[]},eR=(l(nR,QO=Dr),nR.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},nR.prototype.getDefaultShape=function(){return new tR},nR.prototype.buildPath=function(t,e){var n=e.segs,i=e.curveness;if(e.polyline)for(var o=0;os[1]||Il[1])continue;I=c.dataToPoint([M,I]),w=new ga({shape:{x:Math.floor(Math.round(I[0])-r/2),y:Math.floor(Math.round(I[1])-a/2),width:Math.ceil(r),height:Math.ceil(a)},style:S})}else{if(isNaN(d.get(_[1],b)))continue;w=new ga({z2:1,shape:c.dataToRect([d.get(_[0],b)]).contentShape,style:S})}I=d.getItemModel(b);d.hasItemOption&&(f=(T=I.getModel("emphasis")).getModel("itemStyle").getItemStyle(),g=I.getModel(["blur","itemStyle"]).getItemStyle(),y=I.getModel(["select","itemStyle"]).getItemStyle(),v=T.get("focus"),x=T.get("blurScope"),m=vp(I));var T=t.getRawValue(b),I="-";T&&null!=T[2]&&(I=T[2]+""),mp(w,m,{labelFetcher:t,labelDataIndex:b,defaultOpacity:S.opacity,defaultText:I}),w.ensureState("emphasis").style=f,w.ensureState("blur").style=g,w.ensureState("select").style=y,Lc(w,v,x),(w.incremental=o)&&(w.states.emphasis.hoverLayer=!0),p.add(w),d.setItemGraphicEl(b,w)}},fR.prototype._renderOnGeo=function(i,t,e,n){var o=e.targetVisuals.inRange,r=e.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new cR;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=i.getViewRect().clone(),u=i.getRoamTransform();l.applyTransform(u);var h,c,p,d,f,g,y,m=Math.max(l.x,0),v=Math.max(l.y,0),x=Math.min(l.width+l.x,n.getWidth()),t=Math.min(l.height+l.y,n.getHeight()),u=x-m,l=t-v,n=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],x=a.mapArray(n,function(t,e,n){e=i.dataToPoint([t,e]);return e[0]-=m,e[1]-=v,e.push(n),e}),t=e.getExtent(),e="visualMap.continuous"===e.type?(a=t,y=e.option.range,n=a[1]-a[0],y=[(y[0]-a[0])/n,(y[1]-a[0])/n],function(t){return t>=y[0]&&t<=y[1]}):(h=t,c=e.getPieceList(),p=e.option.selected,d=h[1]-h[0],f=(c=P(c,function(t){return{interval:[(t.interval[0]-h[0])/d,(t.interval[1]-h[0])/d]}})).length,g=0,function(t){for(var e,n=g;n=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},WR.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},WR.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[o]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-o]=0==o?n.y+n.height/2:n.x+n.width/2,i},WR.prototype.convertToPixel=function(t,e,n){return XR(e)===this?this.dataToPoint(n):null},WR.prototype.convertFromPixel=function(t,e,n){return XR(e)===this?this.pointToData(n):null},WR);function WR(t,e,n){this.type="single",this.dimension="single",this.dimensions=["single"],this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}function XR(t){var e=t.seriesModel,t=t.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function YR(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,o={},r=i.position,a=i.orient,i=n.getRect(),n=[i.x,i.x+i.width,i.y,i.y+i.height],i={horizontal:{top:n[2],bottom:n[3]},vertical:{left:n[0],right:n[1]}};o.position=["vertical"===a?i.vertical[r]:n[0],"horizontal"===a?i.horizontal[r]:n[3]];o.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Q(e.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);e=e.rotate;return null==e&&(e=t.get(["axisLabel","rotate"])),o.labelRotation="top"===r?-e:e,o.z2=1,o}Yf.register("single",{create:function(i,o){var r=[];return i.eachComponent("singleAxis",function(t,e){var n=new HR(t,i,o);n.name="single_"+e,n.resize(t,o),t.coordinateSystem=n,r.push(n)}),i.eachSeries(function(t){var e;"singleAxis"===t.get("coordinateSystem")&&(e=t.getReferringComponents("singleAxis",Sh).models[0],t.coordinateSystem=e&&e.coordinateSystem)}),r},dimensions:HR.prototype.dimensions});var UR,ZR=["axisLine","axisTickLabel","axisName"],jR=["splitArea","splitLine"],vm=(l(qR,UR=Op),qR.prototype.render=function(e,t,n,i){var o=this.group;o.removeAll();var r=this._axisGroup;this._axisGroup=new $r;var a=YR(e),a=new AM(e,a);N(ZR,a.add,a),o.add(this._axisGroup),o.add(a.getGroup()),N(jR,function(t){e.get([t,"show"])&&KR[t](this,this.group,this._axisGroup,e)},this),lp(r,this._axisGroup,e),UR.prototype.render.call(this,e,t,n,i)},qR.prototype.remove=function(){qM(this)},qR.type="singleAxis",qR);function qR(){var t=null!==UR&&UR.apply(this,arguments)||this;return t.type=qR.type,t.axisPointerClass="SingleAxisPointer",t}var KR={splitLine:function(t,e,n,i){var o=i.axis;if(!o.scale.isBlank()){for(var r=i.getModel("splitLine"),a=r.getModel("lineStyle"),s=(s=a.get("color"))instanceof Array?s:[s],l=i.coordinateSystem.getRect(),u=o.isHorizontal(),h=[],c=0,p=o.getTicksCoords({tickModel:r}),d=[],f=[],g=0;gn)return!0;if(e){t=BM(t).seriesDataCount,i=i.getExtent();return Math.abs(i[0]-i[1])/t>n}return!1},mN.prototype.makeElOption=function(t,e,n,i,o){},mN.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;o&&(e=fN(t).pointerEl=new dp[o.type](gN(e.pointer)),t.add(e))},mN.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=fN(t).labelEl=new vl(gN(e.label)),t.add(e),xN(e,i))},mN.prototype.updatePointerEl=function(t,e,n){t=fN(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},mN.prototype.updateLabelEl=function(t,e,n,i){t=fN(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),xN(t,i))},mN.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=hp(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){ie(t.event)},onmousedown:yN(this._onHandleDragMove,this,0,0),drift:yN(this._onHandleDragMove,this),ondragend:yN(this._onHandleDragEnd,this)}),i.add(o)),bN(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));n=r.get("size");F(n)||(n=[n,n]),o.scaleX=n[0]/2,o.scaleY=n[1]/2,cm(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},mN.prototype._moveHandleToValue=function(t,e){vN(this._axisPointerModel,!e&&this._moveAnimation,this._handle,_N(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},mN.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,e=this.updateHandleTransform(_N(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=e,n.stopAnimation(),n.attr(_N(e)),fN(n).lastProp=null,this._doDispatchAxisPointer())},mN.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},mN.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},mN.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,t=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),t&&e.remove(t),this._group=null,this._handle=null,this._payloadInfo=null)},mN.prototype.doClear=function(){},mN.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},mN);function mN(){this._dragging=!1,this.animationThreshold=15}function vN(t,e,n,i){!function n(i,t){{if(Y(i)&&Y(t)){var o=!0;return N(t,function(t,e){o=o&&n(i[e],t)}),!!o}return i===t}}(fN(n).lastProp,i)&&(fN(n).lastProp=i,e?Jc(n,i,t):(n.stopAnimation(),n.attr(i)))}function xN(t,e){t[e.get(["label","show"])?"show":"hide"]()}function _N(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function bN(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function wN(t){var e,n=t.get("type"),t=t.getModel(n+"Style");return"line"===n?(e=t.getLineStyle()).fill=null:"shadow"===n&&((e=t.getAreaStyle()).stroke=null),e}function SN(t,e,n,i,o){var r=MN(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=Cd(a.get("padding")||0),l=a.getFont(),u=Kn(r,l),h=o.position,c=u.width+s[1]+s[3],n=u.height+s[0]+s[2],u=o.align;"right"===u&&(h[0]-=c),"center"===u&&(h[0]-=c/2);u=o.verticalAlign;"bottom"===u&&(h[1]-=n),"middle"===u&&(h[1]-=n/2),o=h,u=c,c=n,i=(n=i).getWidth(),n=n.getHeight(),o[0]=Math.min(o[0]+u,i)-u,o[1]=Math.min(o[1]+c,n)-c,o[0]=Math.max(o[0],0),o[1]=Math.max(o[1],0);o=a.get("backgroundColor");o&&"auto"!==o||(o=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:xp(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:o}),z2:10}}function MN(t,e,n,i,o){t=e.scale.parse(t);var r,a=e.scale.getLabel({value:t},{precision:o.precision}),o=o.formatter;return o&&(r={value:Lw(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},N(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,t=e&&e.getDataParams(t);t&&r.seriesData.push(t)}),H(o)?a=o.replace("{value}",a):G(o)&&(a=o(r))),a}function IN(t,e,n){var i=_e();return Ie(i,i,n.rotation),Me(i,i,n.position),rp([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function TN(t,e,n,i,o,r){var a=AM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),SN(e,i,o,r,{position:IN(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function CN(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function DN(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function AN(t,e,n,i,o,r){return{cx:t,cy:e,r0:n,r:i,startAngle:o,endAngle:r,clockwise:!0}}var LN,af=(l(kN,LN=vm),kN.prototype.makeElOption=function(t,e,n,i,o){var r,a=n.axis,s=a.grid,l=i.get("type"),u=PN(s,a).getOtherAxis(a).getGlobalExtent(),h=a.toGlobalCoord(a.dataToCoord(e,!0));l&&"none"!==l&&(r=wN(i),(u=ON[l](a,h,u)).style=r,t.graphicKey=u.type,t.pointer=u),TN(e,t,XM(s.model,n),n,i,o)},kN.prototype.getHandleTransform=function(t,e,n){var i=XM(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=IN(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},kN.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),n=PN(r,o).getOtherAxis(o).getGlobalExtent(),r="x"===o.dim?0:1,o=[t.x,t.y];o[r]+=e[r],o[r]=Math.min(a[1],o[r]),o[r]=Math.max(a[0],o[r]);n=(n[1]+n[0])/2,n=[n,n];n[r]=o[r];return{x:o[0],y:o[1],rotation:t.rotation,cursorPoint:n,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][r]}},kN);function kN(){return null!==LN&&LN.apply(this,arguments)||this}function PN(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var ON={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:CN([e,n[0]],[e,n[1]],RN(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),o=n[1]-n[0];return{type:"Rect",shape:DN([e-i/2,n[0]],[i,o],RN(t))}}};function RN(t){return"x"===t.dim?0:1}Op.registerAxisPointerClass("CartesianAxisPointer",af);var NN,nd=(l(EN,NN=nf),EN.type="axisPointer",EN.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},EN);function EN(){var t=null!==NN&&NN.apply(this,arguments)||this;return t.type=EN.type,t}nf.registerClass(nd),C_(function(t){var e;t&&(t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={}),(e=t.axisPointer.link)&&!F(e)&&(t.axisPointer.link=[e]))}),D_(r.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=EM(t,e)}),A_({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||B(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){rN(r)&&(r=QR({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=rN(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||rN(r),p={},d={},o={list:[],map:{}},f={showPointer:V(nN,d),showTooltip:V(iN,o)};N(s.coordSysMap,function(t,e){var o=l||t.containPoint(r);N(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);c||!o||u&&!i||(null!=(i=i&&i.value)||l||(i=n.pointToData(r)),null!=i&&eN(t,i,f,!1,p))})});var g,y,m={};return N(h,function(n,t){var i=n.linkGroup;i&&!d[t]&&N(i.axesInfo,function(t,e){e=d[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,oN(t),oN(n)))),m[n.key]=e)})}),N(m,function(t,e){eN(h[e],t,f,!0,p)}),g=d,i=h,y=p.axesInfo=[],N(i,function(t,e){var n=t.axisPointerModel.option,e=g[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&y.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),function(t,e,n,i){if(rN(e)||!t.list.length)return i({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(o,r,t,a),function(t,e){var n=e.getZr(),i="axisPointerLastHighlights",o=tN(n)[i]||{},r=tN(n)[i]={};N(t,function(t,e){t=t.axisPointerModel.option;"show"===t.status&&N(t.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var a=[],s=[];N(o,function(t,e){r[e]||s.push(t)}),N(r,function(t,e){o[e]||a.push(t)}),s.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:s}),a.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(h,n),p}});var zN,BN=["x","y"],VN=["width","height"],af=(l(FN,zN=vm),FN.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.coordinateSystem,s=WN(a,1-HN(r)),l=a.dataToPoint(e)[0],u=i.get("type");u&&"none"!==u&&(a=wN(i),(s=GN[u](r,l,s)).style=a,t.graphicKey=s.type,t.pointer=s),TN(e,t,YR(n),n,i,o)},FN.prototype.getHandleTransform=function(t,e,n){var i=YR(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=IN(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},FN.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.coordinateSystem,a=HN(o),n=WN(r,a),o=[t.x,t.y];o[a]+=e[a],o[a]=Math.min(n[1],o[a]),o[a]=Math.max(n[0],o[a]);r=WN(r,1-a),r=(r[1]+r[0])/2,r=[r,r];return r[a]=o[a],{x:o[0],y:o[1],rotation:t.rotation,cursorPoint:r,tooltipOption:{verticalAlign:"middle"}}},FN);function FN(){return null!==zN&&zN.apply(this,arguments)||this}var GN={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:CN([e,n[0]],[e,n[1]],HN(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),o=n[1]-n[0];return{type:"Rect",shape:DN([e-i/2,n[0]],[i,o],HN(t))}}};function HN(t){return t.isHorizontal()?0:1}function WN(t,e){t=t.getRect();return[t[BN[e]],t[BN[e]]+t[VN[e]]]}Op.registerAxisPointerClass("SingleAxisPointer",af),N_({type:"single"});var XN,nd=(l(YN,XN=Fy),YN.prototype.init=function(t){XN.prototype.init.apply(this,arguments),this.legendVisualProvider=new tT(B(this.getData,this),B(this.getRawData,this))},YN.prototype.fixData=function(t){var e=t.length,n={},i=Ch(t,function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]}),o=[];i.buckets.each(function(t,e){o.push({name:e,dataList:t})});for(var r=o.length,a=0;aMath.PI/2?"right":"left"):t&&"center"!==t?"left"===t?(r=u.r0+n,h>Math.PI/2&&(t="right")):"right"===t&&(r=u.r-n,h>Math.PI/2&&(t="left")):(r=(u.r+u.r0)/2,t="center"),i.style.align=t,i.style.verticalAlign=y(e,"verticalAlign")||"middle",i.x=r*c+u.cx,i.y=r*p+u.cy;var r=y(e,"rotate"),e=0;"radial"===r?(e=-h)<-Math.PI/2&&(e+=Math.PI):"tangential"===r?(e=Math.PI/2-h)>Math.PI/2?e-=Math.PI:e<-Math.PI/2&&(e+=Math.PI):"number"==typeof r&&(e=r*Math.PI/180),i.rotation=e}),f.dirtyStyle()},QN);function QN(t,e,n,i){var o=$N.call(this)||this;o.z2=2,o.textConfig={inside:!0},Wh(o).seriesIndex=e.seriesIndex;var r=new vl({z2:4,silent:t.getModel().get(["label","silent"])});return o.setTextContent(r),o.updateData(!0,t,e,n,i),o}var tE="sunburstRootToNode";A_({type:tE,update:"updateView"},function(o,t){t.eachComponent({mainType:"series",subType:"sunburst",query:o},function(t,e){var n=mD(o,[tE],t);{var i;n&&((i=t.getViewRoot())&&(o.direction=xD(i,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node))}})});var eE="sunburstHighlight";A_({type:eE,update:"none"},function(e,t,n){e=O({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},function(t){t=mD(e,[eE],t);t&&(e.dataIndex=t.node.dataIndex)}),n.dispatchAction(O(e,{type:"highlight"}))});A_({type:"sunburstUnhighlight",update:"updateView"},function(t,e,n){t=O({},t),n.dispatchAction(O(t,{type:"downplay"}))});var nE,af=(l(iE,nE=tm),iE.prototype.render=function(o,r,a,t){var e=this;this.seriesModel=o,this.api=a,this.ecModel=r;var s=o.getData(),l=s.tree.root,n=o.getViewRoot(),u=this.group,h=o.get("renderLabelForZeroData"),i=[];n.eachNode(function(t){i.push(t)});var c,p,d=this._oldChildren||[];!function(n,i){if(0===n.length&&0===i.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){h||!t||t.getValue()||(t=null);{t!==l&&e!==l&&(e&&e.piece?t?(e.piece.updateData(!1,t,o,r,a),s.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(u.remove(t.piece),t.piece=null)}(e):t&&(e=new JN(t,o,r,a),u.add(e),s.setItemGraphicEl(t.dataIndex,e)))}}(null==t?null:n[t],null==e?null:i[e])}new B_(i,n,t,t).add(e).update(e).remove(V(e,null)).execute()}(i,d),c=l,0<(p=n).depth?(e.virtualPiece?e.virtualPiece.updateData(!1,c,o,r,a):(e.virtualPiece=new JN(c,o,r,a),u.add(e.virtualPiece)),p.piece.off("click"),e.virtualPiece.on("click",function(t){e._rootToNode(p.parentNode)})):e.virtualPiece&&(u.remove(e.virtualPiece),e.virtualPiece=null),this._initEvents(),this._oldChildren=i},iE.prototype._initEvents=function(){var o=this;this.group.off("click"),this.group.on("click",function(n){var i=!1;o.seriesModel.getViewRoot().eachNode(function(t){var e;!i&&t.piece&&t.piece===n.target&&("rootToNode"===(e=t.getModel().get("nodeClick"))?o._rootToNode(t):"link"!==e||(t=(e=t.getModel()).get("link"))&&Bd(t,e.get("target",!0)||"_blank"),i=!0)})})},iE.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:tE,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},iE.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){e=t[0]-n.cx,t=t[1]-n.cy,t=Math.sqrt(e*e+t*t);return t<=n.r&&t>=n.r0}},iE.type="sunburst",iE);function iE(){var t=null!==nE&&nE.apply(this,arguments)||this;return t.type=iE.type,t}tm.registerClass(af);var oE=Math.PI/180;function rE(e,n){if("function"==typeof n){var t=P(e,function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}});return t.sort(function(t,e){return n(t.params,e.params)}),P(t,function(t){return e[t.index]})}var i="asc"===n;return e.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0==n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function aE(i,o){return o=o||[0,0],P(["x","y"],function(t,e){var n=this.getAxis(t),t=o[e],e=i[e]/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(t-e)-n.dataToCoord(t+e))},this)}function sE(r,a){return a=a||[0,0],P([0,1],function(t){var e=a[t],n=r[t]/2,i=[],o=[];return i[t]=e-n,o[t]=e+n,i[1-t]=o[1-t]=a[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(o)[t])},this)}function lE(t,e){var n=this.getAxis(),e=e instanceof Array?e[0]:e,t=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(e-t)-n.dataToCoord(e+t))}function uE(o,r){return r=r||[0,0],P(["Radius","Angle"],function(t,e){var n=this["get"+t+"Axis"](),i=r[e],e=o[e]/2,e="category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-e)-n.dataToCoord(i+e));return"Angle"===t&&(e=e*Math.PI/180),e},this)}k_(V(function(t,e,a){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");F(n)||(n=[0,n]),F(e)||(e=[e,e]);var i=a.getWidth(),o=a.getHeight(),l=Math.min(i,o),u=Nu(e[0],i),h=Nu(e[1],o),c=Nu(n[0],l/2),i=Nu(n[1],l/2),e=-t.get("startAngle")*oE,p=t.get("minAngle")*oE,d=t.getData().tree.root,o=t.getViewRoot(),f=o.depth,n=t.get("sort");null!=n&&!function e(t,n){var i=t.children||[];t.children=rE(i,n);i.length&&N(t.children,function(t){e(t,n)})}(o,n);var r=0;N(o.children,function(t){isNaN(t.getValue())||r++});var g=o.getValue(),y=Math.PI/(g||r)*2,m=0t[1]&&t.reverse(),{coordSys:{type:"polar",cx:i.cx,cy:i.cy,r:t[1],r0:t[0]},api:{coord:function(t){var e=o.dataToRadius(t[0]),n=r.dataToAngle(t[1]),t=i.coordToPoint([e,n]);return t.push(e,n*Math.PI/180),t},size:B(uE,i)}}},calendar:function(n){var t=n.getRect(),e=n.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return n.dataToPoint(t,e)}}}}},af=(l(AE,gE=Fy),AE.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},AE.prototype.getInitialData=function(t,e){return Ib(this.getSource(),this)},AE.prototype.getDataParams=function(t,e,n){e=gE.prototype.getDataParams.call(this,t,e);return n&&(e.info=yE(n).info),e},AE.type="series.custom",AE.dependencies=["grid","polar","geo","singleAxis","calendar"],AE.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},AE);function AE(){var t=null!==gE&&gE.apply(this,arguments)||this;return t.type=AE.type,t}nf.registerClass(af);var LE,nd=(l(kE,LE=tm),kE.prototype.render=function(o,t,r,a){var s,l=this._data,u=o.getData(),h=this.group,c=KE(o,u,t,r),t=o.__transientTransitionOpt;!t||null!=t.from&&null!=t.to?(s=new hz(o,t),e=t?"multiple":"oneToOne",new B_(l?l.getIndices():[],u.getIndices(),PE(l,e,t&&t.from),PE(u,e,t&&t.to),null,e).add(function(t){$E(r,null,t,c(t,a),o,h,u,null)}).remove(function(t){az(l.getItemGraphicEl(t),o,h)}).update(function(t,e){s.reset("oneToOne");e=l.getItemGraphicEl(e);s.findAndAddFrom(e),s.hasFrom()&&(uz(e,h),e=null),$E(r,e,t,c(t,a),o,h,u,s),s.applyMorphing()}).updateManyToOne(function(t,e){s.reset("manyToOne");for(var n=0;ne[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,t=e-this.cy,e=n*n+t*t,n=this.r,t=this.r0;return e<=n*n&&t*t<=e}}},kz.prototype.convertToPixel=function(t,e,n){return Pz(e)===this?this.dataToPoint(n):null},kz.prototype.convertFromPixel=function(t,e,n){return Pz(e)===this?this.pointToData(n):null},kz);function kz(t){this.dimensions=["radius","angle"],this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Mz,this._angleAxis=new Dz,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}function Pz(t){var e=t.seriesModel,t=t.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function Oz(t,e){var n,i=this,o=i.getAngleAxis(),r=i.getRadiusAxis();o.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){var e;t.coordinateSystem===i&&(N(Rw(e=t.getData(),"radius"),function(t){r.scale.unionExtentFromData(e,t)}),N(Rw(e,"angle"),function(t){o.scale.unionExtentFromData(e,t)}))}),Cw(o.scale,o.model),Cw(r.scale,r.model),"category"!==o.type||o.onBand||(n=o.getExtent(),t=360/o.scale.count(),o.inverse?n[1]+=t:n[1]-=t,o.setExtent(n[0],n[1]))}function Rz(t,e){var n;t.type=e.get("type"),t.scale=Dw(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType&&(t.inverse=t.inverse!==e.get("clockwise"),n=e.get("startAngle"),t.setExtent(n,n+(t.inverse?-360:360))),(e.axis=t).model=e}nd={dimensions:Lz.prototype.dimensions,create:function(t,s){var l=[];return t.eachComponent("polar",function(t,e){var n=new Lz(e+"");n.update=Oz;var i=n.getRadiusAxis(),o=n.getAngleAxis(),r=t.findAxisModel("radiusAxis"),a=t.findAxisModel("angleAxis");Rz(i,r),Rz(o,a),e=n,i=s,o=(r=t).get("center"),a=i.getWidth(),i=i.getHeight(),e.cx=Nu(o[0],a),e.cy=Nu(o[1],i),e=e.getRadiusAxis(),i=Math.min(a,i)/2,null==(r=r.get("radius"))?r=[0,"100%"]:F(r)||(r=[0,r]),i=[Nu(r[0],i),Nu(r[1],i)],e.inverse?e.setExtent(i[1],i[0]):e.setExtent(i[0],i[1]),l.push(n),(t.coordinateSystem=n).model=t}),t.eachSeries(function(t){var e;"polar"===t.get("coordinateSystem")&&(e=t.getReferringComponents("polar",Sh).models[0],t.coordinateSystem=e.coordinateSystem)}),l}};Yf.register("polar",nd);var Nz=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ez(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),n=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function zz(t){return t.getRadiusAxis().inverse?0:1}function Bz(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var Vz,nd=(l(Fz,Vz=Op),Fz.prototype.render=function(e,t){var n,i,o,r,a,s;this.group.removeAll(),e.get("show")&&(n=e.axis,i=n.polar,o=i.getRadiusAxis().getExtent(),r=n.getTicksCoords(),a=n.getMinorTicksCoords(),Bz(s=P(n.getViewLabels(),function(t){return(t=C(t)).coord=n.dataToCoord(t.tickValue),t})),Bz(r),N(Nz,function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||Gz[t](this.group,e,i,r,a,o,s)},this))},Fz.type="angleAxis",Fz);function Fz(){var t=null!==Vz&&Vz.apply(this,arguments)||this;return t.type=Fz.type,t.axisPointerClass="PolarAxisPointer",t}var Gz={axisLine:function(t,e,n,i,o,r){var a=e.getModel(["axisLine","lineStyle"]),s=zz(n),e=s?0:1,a=0===r[e]?new aa({shape:{cx:n.cx,cy:n.cy,r:r[s]},style:a.getLineStyle(),z2:1,silent:!0}):new $l({shape:{cx:n.cx,cy:n.cy,r:r[s],r0:r[e]},style:a.getLineStyle(),z2:1,silent:!0});a.style.fill=null,t.add(a)},axisTick:function(t,e,n,i,o,r){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=r[zz(n)],i=P(i,function(t){return new Ma({shape:Ez(n,[l,l+s],t.coord)})});t.add(jc(i,{style:A(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=r[zz(n)],h=[],c=0;ca?"left":"right",s=Math.abs(r[1]-s)/o<.3?"middle":r[1]>s?"top":"bottom";p&&p[i]&&(Y(i=p[i])&&i.textStyle&&(n=new Fp(i.textStyle,d,d.ecModel)));a=new vl({silent:AM.isLabelSilent(u),style:xp(n,{x:r[0],y:r[1],fill:n.getTextColor()||u.get(["axisLine","lineStyle","color"]),text:t.formattedLabel,align:a,verticalAlign:s})});l.add(a),g&&((s=AM.makeAxisEventDataBase(u)).targetType="axisLabel",s.value=t.rawLabel,Wh(a).eventData=s)},this)},splitLine:function(t,e,n,i,o,r){for(var a=e.getModel("splitLine").getModel("lineStyle"),s=0,l=(l=a.get("color"))instanceof Array?l:[l],u=[],h=0;hr?"left":"right",Math.abs(s[1]-u)/t<.3?"middle":s[1]>u?"top":"bottom")}return{position:s,align:l,verticalAlign:u}}(e,n,s,c))},jz);function jz(){return null!==Zz&&Zz.apply(this,arguments)||this}var qz={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:CN(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var o=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:AN(e.cx,e.cy,i[0],i[1],(-n-o/2)*r,(o/2-n)*r)}:{type:"Sector",shape:AN(e.cx,e.cy,n-o/2,n+o/2,0,2*Math.PI)}}};Op.registerAxisPointerClass("PolarAxisPointer",nd),k_(V(function(t,e,n){var L={},k=function(t){var l={};N(t,function(t,e){var n=t.getData(),i=t.coordinateSystem,o=i.getBaseAxis(),r=fz(i,o),a=o.getExtent(),s="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),i=l[r]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=i.stacks;l[r]=i;a=dz(t);o[a]||i.autoWidthCount++,o[a]=o[a]||{width:0,maxWidth:0};n=Nu(t.get("barWidth"),s),r=Nu(t.get("barMaxWidth"),s),s=t.get("barGap"),t=t.get("barCategoryGap");n&&!o[a].width&&(n=Math.min(i.remainedWidth,n),o[a].width=n,i.remainedWidth-=n),r&&(o[a].maxWidth=r),null!=s&&(i.gap=s),null!=t&&(i.categoryGap=t)});var c={};return N(l,function(t,n){c[n]={};var e=t.stacks,i=t.bandWidth,i=Nu(t.categoryGap,i),o=Nu(t.gap,1),r=t.remainedWidth,a=t.autoWidthCount,s=(r-i)/(a+(a-1)*o),s=Math.max(s,0);N(e,function(t,e){var n=t.maxWidth;n&&n=i.start.time&&n.timeo.end.time&&i.reverse(),i},eB.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/864e5)-Math.floor(n[0].time/864e5)+1,o=new Date(n[0].time),r=o.getDate(),a=n[1].date.getDate();o.setDate(r+i-1);var s=o.getDate();if(s!==a)for(var l=0n.weeks||0===t&&en.lweek)return null;t=7*(t-1)-n.fweek+e,e=new Date(n.start.time);return e.setDate(+n.start.d+t),this.getDateInfo(e)},eB.create=function(t,e){var n=[];return t.eachComponent("calendar",function(t){var e=new eB(t);n.push(e),t.coordinateSystem=e}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=n[t.get("calendarIndex")||0])}),n},eB.dimensions=["time","value"],nd=eB;function eB(t,e,n){this.type="calendar",this.dimensions=eB.dimensions,this.getDimensionsInfo=eB.getDimensionsInfo,this._model=t}function nB(t){var e=t.calendarModel,t=t.seriesModel;return e?e.coordinateSystem:t?t.coordinateSystem:null}Yf.register("calendar",nd);var iB,vm=(l(oB,iB=nf),oB.prototype.init=function(t,e,n){var i=qd(t);iB.prototype.init.apply(this,arguments),rB(t,i)},oB.prototype.mergeOption=function(t){iB.prototype.mergeOption.apply(this,arguments),rB(this.option,t)},oB.prototype.getCellSize=function(){return this.option.cellSize},oB.type="calendar",oB.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},oB);function oB(){var t=null!==iB&&iB.apply(this,arguments)||this;return t.type=oB.type,t}function rB(t,i){var e=t.cellSize,o=F(e)?e:t.cellSize=[e,e];1===o.length&&(o[1]=o[0]);e=P([0,1],function(t){var e,n;return(null!=(e=i)[Hd[n=t][0]]||null!=e[Hd[n][1]]&&null!=e[Hd[n][2]])&&(o[t]="auto"),null!=o[t]&&"auto"!==o[t]});jd(t,i,{type:"box",ignoreSize:e})}nf.registerClass(vm);var aB,sB={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},lB={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]},Op=(l(uB,aB=qy),uB.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var o=t.coordinateSystem,r=o.getRangeInfo(),o=o.getOrient();this._renderDayRect(t,r,i),this._renderLines(t,r,o,i),this._renderYearText(t,r,o,i),this._renderMonthText(t,o,i),this._renderWeekText(t,r,o,i)},uB.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,l=new ga({shape:{x:l[0],y:l[1],width:r,height:a},cursor:"default",style:o});n.add(l)}},uB.prototype._renderLines=function(e,t,n,i){var o=this,r=e.coordinateSystem,a=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){p(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function p(t){o._firstDayOfMonth.push(r.getDateInfo(t)),o._firstDayPoints.push(r.dataToRect([t],!1).tl);t=o._getLinePointsOfOneWeek(e,t,n);o._tlpoints.push(t[0]),o._blpoints.push(t[t.length-1]),s&&o._drawSplitline(t,a,i)}p(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,l,n),a,i),s&&this._drawSplitline(o._getEdgesPoints(o._blpoints,l,n),a,i)},uB.prototype._getEdgesPoints=function(t,e,n){t=[t[0].slice(),t[t.length-1].slice()],n="horizontal"===n?0:1;return t[0][n]=t[0][n]-e/2,t[1][n]=t[1][n]+e/2,t},uB.prototype._drawSplitline=function(t,e,n){e=new Ra({z2:20,shape:{points:t},style:e});n.add(e)},uB.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,o=i.getDateInfo(e),r=[],a=0;a<7;a++){var s=i.getNextNDay(o.time,a),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},uB.prototype._formatterLabel=function(t,e){return"string"==typeof t&&t?Nd(t,e):"function"==typeof t?t(e):e.nameMap},uB.prototype._yearTextPositionControl=function(t,e,n,i,o){var r=e[0],a=e[1],e=["center","bottom"];"bottom"===i?(a+=o,e=["center","top"]):"left"===i?r-=o:"right"===i?(r+=o,e=["center","top"]):a-=o;o=0;return"left"!==i&&"right"!==i||(o=Math.PI/2),{rotation:o,x:r,y:a,style:{align:e[0],verticalAlign:e[1]}}},uB.prototype._renderYearText=function(t,e,n,i){var o,r,a,s,l,u=t.getModel("yearLabel");u.get("show")&&(o=u.get("margin"),r=(r=u.get("position"))||("horizontal"!==n?"top":"left"),a=((s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]])[0][0]+s[1][0])/2,l=(s[0][1]+s[1][1])/2,s={top:[a,s[t="horizontal"===n?0:1][1]],bottom:[a,s[1-t][1]],left:[s[1-t][0],l],right:[s[t][0],l]},t=e.start.y,+e.end.y>+e.start.y&&(t=t+"-"+e.end.y),l=u.get("formatter"),t={start:e.start.y,end:e.end.y,nameMap:t},t=this._formatterLabel(l,t),(t=new vl({z2:30,style:xp(u,{text:t})})).attr(this._yearTextPositionControl(t,s[r],n,r,o)),i.add(t))},uB.prototype._monthTextPositionControl=function(t,e,n,i,o){var r="left",a="top",s=t[0],t=t[1];return"horizontal"===n?(t+=o,e&&(r="center"),"start"===i&&(a="bottom")):(s+=o,e&&(a="middle"),"start"===i&&(r="right")),{x:s,y:t,align:r,verticalAlign:a}},uB.prototype._renderMonthText=function(t,e,n){var i=t.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),r=i.get("margin"),a=i.get("position"),t=i.get("align"),s=[this._tlpoints,this._blpoints];H(o)&&(o=sB[o.toUpperCase()]||[]);for(var l="start"===a?0:1,u="horizontal"===e?0:1,r="start"===a?-r:r,h="center"===t,c=0;cp.getHeight()&&(i.position="top",e=!0),e=e?-5-o.height:d+8,r+o.width/2>p.getWidth()?(i.position=["100%",e],n.align="right"):r-o.width/2<0&&(i.position=[0,e],n.align="left"))}))},CB.prototype.updateView=function(t,e,n,i){N(this._features,function(t){t instanceof xB&&t.updateView&&t.updateView(t.model,e,n,i)})},CB.prototype.remove=function(e,n){N(this._features,function(t){t instanceof xB&&t.remove&&t.remove(e,n)}),this.group.removeAll()},CB.prototype.dispose=function(e,n){N(this._features,function(t){t instanceof xB&&t.dispose&&t.dispose(e,n)})},CB.type="toolbox",CB);function CB(){return null!==TB&&TB.apply(this,arguments)||this}qy.registerClass(nd);var DB,vm=(l(AB,DB=xB),AB.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType()?"svg":n.get("type",!0)||"png",e=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||w.browser.ie||w.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(e.split(",")[1]),a=r.length,s=new Uint8Array(a);a--;)s[a]=r.charCodeAt(a);t=new Blob([s]);window.navigator.msSaveOrOpenBlob(t,i+"."+o)}else{var l=n.get("lang"),l='';window.open().document.write(l)}else{l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=e;e=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(e)}},AB.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:t.getLocale(["toolbox","saveAsImage","lang"])}},AB);function AB(){return null!==DB&&DB.apply(this,arguments)||this}vm.prototype.unusable=!w.canvasSupported,bB("saveAsImage",vm);var LB,kB="__ec_magicType_stack__",PB=[["line","bar"],["stack"]],Op=(l(OB,LB=xB),OB.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return N(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},OB.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},OB.prototype.onclick=function(t,e,a){var s,n,l=this.model,i=l.get(["seriesIndex",a]);RB[a]&&(s={series:[]},N(PB,function(t){0<=L(t,a)&&N(t,function(t){l.setIconStatus(t,"normal")})}),l.setIconStatus(a,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},function(t){var e=t.subType,n=t.id,n=RB[a](e,n,t,l);n&&(A(n,t.option),s.series.push(n));n=t.coordinateSystem;if(n&&"cartesian2d"===n.type&&("line"===a||"bar"===a)){n=n.getAxesByScale("ordinal")[0];if(n){var i=n.dim+"Axis",o=t.getReferringComponents(i,Sh).models[0].componentIndex;s[i]=s[i]||[];for(var r=0;r<=o;r++)s[i][o]=s[i][o]||{};s[i][o].boundaryGap="bar"===a}}}),"stack"===a&&(n=b({stack:l.option.title.tiled,tiled:l.option.title.stack},l.option.title)),e.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:n,featureName:"magicType"}))},OB);function OB(){return null!==LB&&LB.apply(this,arguments)||this}var RB={line:function(t,e,n,i){if("bar"===t)return b({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return b({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){n=n.get("stack")===kB;if("line"===t||"bar"===t)return i.setIconStatus("stack",n?"normal":"emphasis"),b({id:e,stack:n?"":kB},i.get(["option","stack"])||{},!0)}};A_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),bB("magicType",Op);var NB=new Array(60).join("-"),EB="\t";function zB(t){var o,r,a,h,t=(o={},r=[],a=[],t.eachRawSeries(function(t){var e,n,i=t.coordinateSystem;i&&("cartesian2d"===i.type||"polar"===i.type)&&"category"===(e=i.getBaseAxis()).type?(n=e.dim+"_"+e.index,o[n]||(o[n]={categoryAxis:e,valueAxis:i.getOtherAxis(e),series:[]},a.push({axisDim:e.dim,axisIndex:e.index})),o[n].series.push(t)):r.push(t)}),{seriesGroupByCategoryAxis:o,other:r,meta:a});return{value:R([(h=[],N(t.seriesGroupByCategoryAxis,function(t,e){var n=t.categoryAxis,i=t.valueAxis.dim,o=[" "].concat(P(t.series,function(t){return t.name})),r=[n.model.getCategories()];N(t.series,function(t){var e=t.getRawData();r.push(t.getRawData().mapArray(e.mapDimension(i),function(t){return t}))});for(var a=[o.join(EB)],s=0;st[1]&&t.reverse(),t}function jB(t,e){return wh(t,e,{includeMainTypes:XB})}var qB={grid:function(t,i){var o=t.xAxisModels,r=t.yAxisModels,t=t.gridModels,e=ct(),a={},s={};(o||r||t)&&(N(o,function(t){t=t.axis.grid.model;e.set(t.id,t),a[t.id]=!0}),N(r,function(t){t=t.axis.grid.model;e.set(t.id,t),s[t.id]=!0}),N(t,function(t){e.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),e.each(function(t){var e=t.coordinateSystem,n=[];N(e.getCartesians(),function(t,e){(0<=L(o,t.getAxis("x").model)||0<=L(r,t.getAxis("y").model))&&n.push(t)}),i.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:n[0],coordSyses:n,getPanelRect:$B.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,n){N(t.geoModels,function(t){var e=t.coordinateSystem;n.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:$B.geo})})}},KB=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,t=t.gridModel;return!t&&n&&(t=n.axis.grid.model),!t&&i&&(t=i.axis.grid.model),t&&t===e.gridModel},function(t,e){t=t.geoModel;return t&&t===e.geoModel}],$B={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(op(t)),e}},JB={lineX:V(QB,0),lineY:V(QB,1),rect:function(t,e,n){var i=e[WB[t]]([n[0][0],n[1][0]]),n=e[WB[t]]([n[0][1],n[1][1]]),n=[ZB([i[0],n[0]]),ZB([i[1],n[1]])];return{values:n,xyMinMax:n}},polygon:function(e,n,t){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:P(t,function(t){t=n[WB[e]](t);return i[0][0]=Math.min(i[0][0],t[0]),i[1][0]=Math.min(i[1][0],t[1]),i[0][1]=Math.max(i[0][1],t[0]),i[1][1]=Math.max(i[1][1],t[1]),t}),xyMinMax:i}}};function QB(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=ZB(P([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t])):o.toGlobalCoord(o.dataToCoord(i[t]))})),n=[];return n[t]=r,n[1-t]=[NaN,NaN],{values:r,xyMinMax:n}}var tV={lineX:V(eV,0),lineY:V(eV,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,n,i){return P(t,function(t,e){return[t[0]-i[0]*n[e][0],t[1]-i[1]*n[e][1]]})}};function eV(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function nV(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var iV=N,oV=_h();function rV(t){t=oV(t);return t.snapshots||(t.snapshots=[{}]),t.snapshots}nf.registerSubTypeDefaulter("dataZoom",function(){return"slider"});var aV=["x","y","radius","angle","single"],sV=["cartesian2d","polar","singleAxis"];function lV(t){return t+"Axis"}function uV(t,e){var i,o=ct(),n=[],r=ct();for(t.eachComponent({mainType:"dataZoom",query:e},function(t){r.get(t.uid)||s(t)});i=!1,t.eachComponent("dataZoom",a),i;);function a(t){var n;!r.get(t.uid)&&(n=!1,t.eachTargetAxis(function(t,e){t=o.get(t);t&&t[e]&&(n=!0)}),n)&&(s(t),i=!0)}function s(t){r.set(t.uid,!0),n.push(t),t.eachTargetAxis(function(t,e){(o.get(t)||o.set(t,[]))[e]=!0})}return n}function hV(t){var o=t.ecModel,r={infoList:[],infoMap:ct()};return t.eachTargetAxis(function(t,e){var n,i=o.getComponent(lV(t),e);!i||(n=i.getCoordSysModel())&&(t=n.uid,(e=r.infoMap.get(t))||(e={model:n,axisModels:[]},r.infoList.push(e),r.infoMap.set(t,e)),e.axisModels.push(i))}),r}var cV=(pV.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},pV);function pV(){this.indexList=[],this.indexMap=[]}var dV,nd=(l(fV,dV=nf),fV.prototype.init=function(t,e,n){var i=gV(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},fV.prototype.mergeOption=function(t){var e=gV(t);b(this.option,t,!0),b(this.settledOption,e,!0),this._doInit(e)},fV.prototype._doInit=function(t){var n=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;N([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(n[t[0]]=i[t[0]]=null)},this),this._resetTarget()},fV.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=ct();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},fV.prototype._fillSpecifiedTargetAxis=function(i){var o=!1;return N(aV,function(t){var e,n=this.getReferringComponents(lV(t),Mh);n.specified&&(o=!0,e=new cV,N(n.models,function(t){e.add(t.componentIndex)}),i.set(t,e))},this),o},fV.prototype._fillAutoTargetAxisByOrient=function(r,e){var t,i=this.ecModel,a=!0;function n(t,e){var n,i,o=t[0];o&&((n=new cV).add(o.componentIndex),r.set(e,n),a=!1,"x"!==e&&"y"!==e||(i=o.getReferringComponents("grid",Sh).models[0])&&N(t,function(t){o.componentIndex!==t.componentIndex&&i===t.getReferringComponents("grid",Sh).models[0]&&n.add(t.componentIndex)}))}a&&(t="vertical"===e?"y":"x",n(i.findComponents({mainType:t+"Axis"}),t)),a&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),a&&N(aV,function(t){var e,n;!a||(e=i.findComponents({mainType:lV(t),filter:function(t){return"category"===t.get("type",!0)}}))[0]&&((n=new cV).add(e[0].componentIndex),r.set(t,n),a=!1)},this)},fV.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){e=e||t},this),"y"===e?"vertical":"horizontal"},fV.prototype._setDefaultThrottle=function(t){t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle&&(t=this.ecModel.option,this.option.throttle=t.animation&&0h[1];if(a&&!s&&!r)return!0;a&&(i=!0),s&&(e=!0),r&&(n=!0)}return i&&e&&n}):wV(u,function(t){var e;"empty"===o?n.setData(l=l.map(t,function(t){return(e=t)>=h[0]&&e<=h[1]?t:NaN;var e})):((e={})[t]=h,l.selectRange(e))}),wV(u,function(t){l.setApproximateExtent(h,t)}))}))},IV.prototype._updateMinMaxSpan=function(){var i=this._minMaxSpan={},o=this._dataZoomModel,r=this._dataExtent;wV(["min","max"],function(t){var e=o.get(t+"Span"),n=o.get(t+"ValueSpan");null!=n&&(n=this.getAxisModel().axis.scale.parse(n)),null!=n?e=Ru(r[0]+n,r,[0,100],!0):null!=e&&(n=Ru(e,[0,100],r,!0)-r[0]),i[t+"Span"]=e,i[t+"ValueSpan"]=n},this)},IV.prototype._setAxisModel=function(){var t,e=this.getAxisModel(),n=this._percentWindow,i=this._valueWindow;n&&(t=Fu(i,[0,500]),t=Math.min(t,20),e=e.axis.scale.rawExtentInfo,0!==n[0]&&e.setDeterminedMinMax("min",+i[0].toFixed(t)),100!==n[1]&&e.setDeterminedMinMax("max",+i[1].toFixed(t)),e.freeze())},IV);function IV(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}D_(r.PROCESSOR.FILTER,{getTargetSeries:function(r){function t(o){r.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(t,e){var n=r.getComponent(lV(t),e);o(t,e,n,i)})})}t(function(t,e,n,i){n.__dzAxisProxy=null});var o=[];t(function(t,e,n,i){n.__dzAxisProxy||(n.__dzAxisProxy=new MV(t,e,i,r),o.push(n.__dzAxisProxy))});var e=ct();return N(o,function(t){N(t.getTargetSeriesModels(),function(t){e.set(t.uid,t)})}),e},overallReset:function(t,i){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).reset(n)}),n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).filterData(n,i)})}),t.eachComponent("dataZoom",function(t){var e,n=t.findRepresentativeAxisProxy();n&&(e=n.getDataPercentWindow(),n=n.getDataValueWindow(),t.setCalculatedRange({start:e[0],end:e[1],startValue:n[0],endValue:n[1]}))})}}),A_("dataZoom",function(e,t){N(uV(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})});var TV,CV=N,DV=sh+"toolbox-dataZoom_",Op=(l(AV,TV=xB),AV.prototype.render=function(t,e,n,i){this.brushController||(this.brushController=new Pk(n.getZr()),this.brushController.on("brush",B(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n.isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");o=new YB(RV(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n.brushController.setPanels(o).enableBrush(!(!r||!o.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),e=e,t.setIconStatus("back",1'}(n.get("backgroundColor"),i,o)),H(t))r.innerHTML=t;else if(t){r.innerHTML="",F(t)||(t=[t]);for(var a=0;a",a=p.join(e);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(o,r,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(o,a,h,Math.random()+"",i[0],i[1],r,null,d)})},tF.prototype._showSeriesItemTooltip=function(t,e,n){var i,o,r,a,s=rx(e,function(t){return null!=Wh(t).dataIndex}),l=this._ecModel,u=Wh(s),h=u.seriesIndex,c=l.getSeriesByIndex(h),p=u.dataModel||c,d=u.dataIndex,e=u.dataType,s=p.getData(e),u=this._renderMode,f=eF([s.getItemModel(d),p,c&&(c.coordinateSystem||{}).model,this._tooltipModel]),c=f.get("trigger");null!=c&&"item"!==c||(i=p.getDataParams(d,e),o=new Ry,i.marker=o.makeTooltipMarker("item",zd(i.color),u),c=zg(p.formatTooltip(d,!1,e)),e=f.get("order"),r=c.markupFragment?Dy(c.markupFragment,o,u,e,l.get("useUTC")):c.markupText,a="item_"+p.name+"_"+d,this._showOrMove(f,function(){this._showTooltipContent(f,r,i,a,t.offsetX,t.offsetY,t.position,t.target,o)}),n({type:"showTip",dataIndexInside:d,dataIndex:s.getRawIndex(d),seriesIndex:h,from:this.uid}))},tF.prototype._showComponentItemTooltip=function(t,e,n){var i=e.tooltip;H(i)&&(i={content:i,formatter:i});var o=new Fp(i,this._tooltipModel,this._ecModel),r=o.get("content"),a=Math.random()+"",s=new Ry;this._showOrMove(o,function(){this._showTooltipContent(o,r,o.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e,s)}),n({type:"showTip",from:this.uid})},tF.prototype._showTooltipContent=function(n,t,i,e,o,r,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&(u=this._tooltipContent,h=n.get("formatter"),a=a||n.get("position"),p=t,c=this._getNearestPoint([o,r],i,n.get("trigger")),h&&H(h)?(d=n.ecModel.get("useUTC"),p=h,(t=F(i)?i[0]:i)&&t.axisType&&0<=t.axisType.indexOf("time")&&(p=ud(t.axisValue,p,d)),p=Rd(p,i,!0)):G(h)&&(d=KV(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c.color,a),this._updatePosition(n,a,o,r,u,i,s))},this),this._ticket=e,p=h(i,e,d)),u.setContent(p,l,n,c.color,a),u.show(n,c.color),this._updatePosition(n,a,o,r,u,i,s))},tF.prototype._getNearestPoint=function(t,e,n){return"axis"===n||F(e)?{color:"html"===this._renderMode?"#fff":"none"}:F(e)?void 0:{color:e.color||e.borderColor}},tF.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u,h=o.getSize(),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),G(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:h.slice()})),F(e)?(n=JV(e[0],s),i=JV(e[1],l)):Y(e)?((r=e).width=h[0],r.height=h[1],n=(r=Yd(r,{width:s,height:l})).x,i=r.y,p=c=null):i=(n=(u=H(e)&&a?function(t,e,n){var i=n[0],o=n[1],r=0,a=0,s=e.width,n=e.height;switch(t){case"inside":r=e.x+s/2-i/2,a=e.y+n/2-o/2;break;case"top":r=e.x+s/2-i/2,a=e.y-o-10;break;case"bottom":r=e.x+s/2-i/2,a=e.y+n+10;break;case"left":r=e.x-i-10-5,a=e.y+n/2-o/2;break;case"right":r=e.x+s+10+5,a=e.y+n/2-o/2}return[r,a]}(e,d,h):function(t,e,n,i,o,r,a){var s=n.getOuterSize(),n=s.width,s=s.height;null!=r&&(ie[0][1]&&(e[0][1]=r[0]),r[1]e[1][1]&&(e[1][1]=r[1])}return e&&xF(e)}};function xF(t){return new Gn(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var _F,Op=(l(bF,_F=nf),bF.prototype.optionUpdated=function(t,e){var n=this.option;e||lF(n,t,["inBrush","outOfBrush"]);t=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},t.hasOwnProperty("liftZ")||(t.liftZ=5)},bF.prototype.setAreas=function(t){t&&(this.areas=P(t,function(t){return wF(this.option,t)},this))},bF.prototype.setBrushOption=function(t){this.brushOption=wF(this.option,t),this.brushType=this.brushOption.brushType},bF.type="brush",bF.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],bF.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},bF);function bF(){var t=null!==_F&&_F.apply(this,arguments)||this;return t.type=bF.type,t.areas=[],t.brushOption={},t}function wF(t,e){return b({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Fp(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}nf.registerClass(Op);var SF,Op=(l(MF,SF=qy),MF.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Pk(e.getZr())).on("brush",B(this._onBrush,this)).mount()},MF.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},MF.prototype.updateTransform=function(t,e,n,i){gF(e),this._updateController(t,e,n,i)},MF.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},MF.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},MF.prototype._updateController=function(t,e,n,i){i&&i.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},MF.prototype.dispose=function(){this._brushController.dispose()},MF.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);t.isEnd&&!t.removeOnClick||this.api.dispatchAction({type:"brush",brushId:e,areas:C(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:C(n),$from:e})},MF.type="brush",MF);function MF(){var t=null!==SF&&SF.apply(this,arguments)||this;return t.type=MF.type,t}qy.registerClass(Op),A_({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),A_({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),A_({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var IF,TF=["rect","polygon","lineX","lineY","keep","clear"];function CF(){return null!==IF&&IF.apply(this,arguments)||this}bB("brush",(l(CF,IF=xB),CF.prototype.render=function(e,t,n){var i,o,r;t.eachComponent({mainType:"brush"},function(t){i=t.brushType,o=t.brushOption.brushMode||"single",r=r||!!t.areas.length}),this._brushType=i,this._brushMode=o,N(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===o:"clear"===t?r:t===i)?"emphasis":"normal")})},CF.prototype.updateView=function(t,e,n){this.render(t,e,n)},CF.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return N(t.get("type",!0),function(t){e[t]&&(n[t]=e[t])}),n},CF.prototype.onclick=function(t,e,n){var i=this._brushType,o=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===o?"single":"multiple":o}})},CF.getDefaultOption=function(t){return{show:!0,type:TF.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocale(["toolbox","brush","title"])}},CF)),C_(function(t,e){var n,i,o,r=lh(t?t.brush:[]);r.length&&(n=[],N(r,function(t){t=t.hasOwnProperty("toolbox")?t.toolbox:[];t instanceof Array&&(n=n.concat(t))}),F(r=t&&t.toolbox)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]),(r=(r=(r=r.feature||(r.feature={})).brush||(r.brush={})).type||(r.type=[])).push.apply(r,n),o={},N(i=r,function(t){o[t]=1}),i.length=0,N(o,function(t,e){i.push(e)}),e&&!r.length&&r.push.apply(r,oF))});var DF,Op=(l(AF,DF=nf),AF.type="title",AF.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},AF);function AF(){var t=null!==DF&&DF.apply(this,arguments)||this;return t.type=AF.type,t.layoutMode={type:"box",ignoreSize:!0},t}nf.registerClass(Op);var LF,Op=(l(kF,LF=qy),kF.prototype.render=function(t,e,n){var i,o,r,a,s,l,u,h,c;this.group.removeAll(),t.get("show")&&(i=this.group,h=t.getModel("textStyle"),a=t.getModel("subtextStyle"),o=t.get("textAlign"),c=tt(t.get("textBaseline"),t.get("textVerticalAlign")),u=(r=new vl({style:xp(h,{text:t.get("text"),fill:h.getTextColor()},{disableBox:!0}),z2:10})).getBoundingRect(),h=t.get("subtext"),a=new vl({style:xp(a,{text:h,fill:a.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),s=t.get("link"),l=t.get("sublink"),u=t.get("triggerEvent",!0),r.silent=!s&&!u,a.silent=!l&&!u,s&&r.on("click",function(){Bd(s,"_"+t.get("target"))}),l&&a.on("click",function(){Bd(l,"_"+t.get("subtarget"))}),Wh(r).eventData=Wh(a).eventData=u?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(r),h&&i.add(a),u=i.getBoundingRect(),(h=t.getBoxLayoutParams()).width=u.width,h.height=u.height,n=Yd(h,{width:n.getWidth(),height:n.getHeight()},t.get("padding")),o||("middle"===(o=t.get("left")||t.get("right"))&&(o="center"),"right"===o?n.x+=n.width:"center"===o&&(n.x+=n.width/2)),c||("center"===(c=t.get("top")||t.get("bottom"))&&(c="middle"),"bottom"===c?n.y+=n.height:"middle"===c&&(n.y+=n.height/2),c=c||"top"),i.x=n.x,i.y=n.y,i.markRedraw(),c={align:o,verticalAlign:c},r.setStyle(c),a.setStyle(c),u=i.getBoundingRect(),c=n.margin,(n=t.getItemStyle(["color","opacity"])).fill=t.get("backgroundColor"),n=new ga({shape:{x:u.x-c[3],y:u.y-c[0],width:u.width+c[1]+c[3],height:u.height+c[0]+c[2],r:t.get("borderRadius")},style:n,subPixelOptimize:!0,silent:!0}),i.add(n))},kF.type="title",kF);function kF(){var t=null!==LF&&LF.apply(this,arguments)||this;return t.type=kF.type,t}function PF(t){var e=t.itemStyle||(t.itemStyle={}),e=e.emphasis||(e.emphasis={}),t=t.label||t.label||{},n=t.normal||(t.normal={}),i={normal:1,emphasis:1};N(t,function(t,e){i[e]||OF(n,e)||(n[e]=t)}),e.label&&!OF(t,"emphasis")&&(t.emphasis=e.label,delete e.label)}function OF(t,e){return t.hasOwnProperty(e)}qy.registerClass(Op),nf.registerSubTypeDefaulter("timeline",function(){return"slider"}),A_({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var n=e.getComponent("timeline");return n&&null!=t.currentIndex&&(n.setCurrentIndex(t.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),e.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),A({currentIndex:n.option.currentIndex},t)}),A_({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){e=e.getComponent("timeline");e&&null!=t.playState&&e.setPlayState(t.playState)});var RF,Op=(l(NF,RF=nf),NF.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},NF.prototype.mergeOption=function(t){RF.prototype.mergeOption.apply(this,arguments),this._initData()},NF.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},NF.prototype.getCurrentIndex=function(){return this.option.currentIndex},NF.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},NF.prototype.setPlayState=function(t){this.option.autoPlay=!!t},NF.prototype.getPlayState=function(){return!!this.option.autoPlay},NF.prototype._initData=function(){var o,t=this.option,e=t.data||[],t=t.axisType,r=this._names=[];"category"===t?(o=[],N(e,function(t,e){var n,i=gh(ch(t),"");Y(t)?(n=C(t)).value=e:n=e,o.push(n),r.push(i)})):o=e;t={category:"ordinal",time:"time",value:"number"}[t]||"number";(this._data=new db([{name:"value",type:t}],this)).initData(o,r)},NF.prototype.getData=function(){return this._data},NF.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},NF.type="timeline",NF.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},NF);function NF(){var t=null!==RF&&RF.apply(this,arguments)||this;return t.type=NF.type,t.layoutMode="box",t}nf.registerClass(Op);var EF,Op=(l(zF,EF=Op),zF.type="timeline.slider",zF.defaultOption=Xp(Op.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),zF);function zF(){var t=null!==EF&&EF.apply(this,arguments)||this;return t.type=zF.type,t}I(Op,ni.prototype),nf.registerClass(Op);var BF,Op=(l(VF,BF=qy),VF.type="timeline",VF);function VF(){var t=null!==BF&&BF.apply(this,arguments)||this;return t.type=VF.type,t}var FF,GF=(l(HF,FF=mu),HF.prototype.getLabelModel=function(){return this.model.getModel("label")},HF.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},HF);function HF(t,e,n,i){n=FF.call(this,t,e,n)||this;return n.type=i||"value",n}var WF,XF=Math.PI,YF=_h(),Op=(l(UF,WF=Op),UF.prototype.init=function(t,e){this.api=e},UF.prototype.render=function(e,t,n){var i,o,r;this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)&&(i=this._layout(e,n),o=this._createGroup("_mainGroup"),n=this._createGroup("_labelGroup"),r=this._axis=this._createAxis(i,e),e.formatTooltip=function(t){return Iy("nameValue",{noName:!0,value:r.scale.getLabel({value:t})})},N(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](i,o,r,e)},this),this._renderAxisLabel(i,n,r,e),this._position(i,e)),this._doPlayStop(),this._updateTicksStatus()},UF.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},UF.prototype.dispose=function(){this._clearTimer()},UF.prototype._layout=function(t,e){var n,i,o,r=t.get(["label","position"]),a=t.get("orient"),s=(x=e,Yd((_=t).getBoxLayoutParams(),{width:x.getWidth(),height:x.getHeight()},_.get("padding"))),l=null==r||"auto"===r?"horizontal"===a?s.y+s.height/2t[1]&&(n=t[1]),nn[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],e=[-p.x,-p.y],s=tt(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?e[i]+=n[o]-p[o]:g[i]+=p[o]+s),e[1-i]+=c[r]/2-p[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(e);g={x:0,y:0};g[o]=(d?n:c)[o],g[r]=Math.max(c[r],p[r]),g[a]=Math.min(0,p[a]+e[1-i]),u.__rectSize=n[o],d?((i={x:0,y:0})[o]=Math.max(n[o]-p[o]-s,0),i[r]=g[r],u.setClipPath(new ga({shape:i})),u.__rectSize=i[o]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});h=this._getPageInfo(t);return null!=h.pageIndex&&Jc(l,{x:h.contentPosition[0],y:h.contentPosition[1]},d?t:null),this._updatePageInfoView(t,h),g},nH.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},nH.prototype._updatePageInfoView=function(n,i){var o=this._controllerGroup;N(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=o.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")});var t=o.childOfName("pageText"),e=n.get("pageFormatter"),r=i.pageIndex,a=null!=r?r+1:0,r=i.pageCount;t&&e&&t.setStyle("text",H(e)?e.replace("{current}",null==a?"":a+"").replace("{total}",null==r?"":r+""):e({current:a,total:r}))},nH.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,o=t.getOrient().index,r=tH[o],a=eH[o],s=this._findTargetItemIndex(e),l=n.children(),t=l[s],u=l.length,e=u?1:0,h={contentPosition:[n.x,n.y],pageCount:e,pageIndex:e-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!t)return h;t=g(t);h.contentPosition[o]=-t.s;for(var c=s+1,p=t,d=t,f=null;c<=u;++c)(!(f=g(l[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=s-1,p=t,d=t,f=null;-1<=c;--c)(f=g(l[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},nH.prototype._findTargetItemIndex=function(n){return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==o&&null!=t&&(o=e),t===n&&(i=e)}),null!=i?i:o):0;var i,o},nH.type="legend.scroll",nH);function nH(){var t=null!==JG&&JG.apply(this,arguments)||this;return t.type=nH.type,t.newlineDisabled=!0,t._currentIndex=0,t}qy.registerClass(Op),A_("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})});var iH,Op=(l(oH,iH=nd),oH.type="dataZoom.slider",oH.layoutMode="box",oH.defaultOption=Xp(nd.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),oH);function oH(){var t=null!==iH&&iH.apply(this,arguments)||this;return t.type=oH.type,t}nf.registerClass(Op);var rH,aH=ga,sH="horizontal",lH="vertical",uH=["line","bar","candlestick","scatter"],hH={easing:"cubicOut",duration:100},Op=(l(cH,rH=vm),cH.prototype.init=function(t,e){this.api=e,this._onBrush=B(this._onBrush,this),this._onBrushEnd=B(this._onBrushEnd,this)},cH.prototype.render=function(t,e,n,i){if(rH.prototype.render.apply(this,arguments),cm(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},cH.prototype.dispose=function(){this._clear(),rH.prototype.dispose.apply(this,arguments)},cH.prototype._clear=function(){var t,e;(n=(t=this)[e="_dispatchZoomAction"])&&n[sm]&&(t[e]=n[sm]);var n=this.api.getZr();n.off("mousemove",this._onBrush),n.off("mouseup",this._onBrushEnd)},cH.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new $r;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},cH.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),e={width:e.getWidth(),height:e.getHeight()},o=this._orient===sH?{right:e.width-i.x-i.width,top:e.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},r=qd(t.option);N(["right","top","width","height"],function(t){"ph"===r[t]&&(r[t]=o[t])});e=Yd(r,e);this._location={x:e.x,y:e.y},this._size=[e.width,e.height],this._orient===lH&&this._size.reverse()},cH.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),o=i&&i.get("inverse"),r=this._displayables.sliderGroup,i=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(n!==sH||o?n===sH&&o?{scaleY:i?1:-1,scaleX:-1}:n!==lH||o?{scaleY:i?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:i?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:i?1:-1,scaleX:1});r=t.getBoundingRect([r]);t.x=e.x-r.x,t.y=e.y-r.y,t.markRedraw()},cH.prototype._getViewExtent=function(){return[0,this._size[0]]},cH.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new aH({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));t=new aH({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:B(this._onClickPanel,this)}),e=this.api.getZr();i?(t.on("mousedown",this._onBrushStart,this),t.cursor="crosshair",e.on("mousemove",this._onBrush),e.on("mouseup",this._onBrushEnd)):(e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)),n.add(t)},cH.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=t.series,i=n.getRawData(),n=n.getShadowDim?n.getShadowDim():t.otherDim;if(null!=n){var o,t=.3*((r=i.getDataExtent(n))[1]-r[0]),r=[r[0]-t,r[1]+t],a=[0,e[1]],t=[0,e[0]],s=[[e[0],0],[0,0]],l=[],u=t[1]/(i.count()-1),h=0,c=Math.round(i.count()/e[0]);i.each([n],function(t,e){var n;0e[0]||t[1]<0||t[1]>e[1]||(e=((e=this._handleEnds)[0]+e[1])/2,e=this._updateInterval("all",t[0]-e),this._updateView(),e&&this._dispatchZoomAction(!1))},cH.prototype._onBrushStart=function(t){var e=t.offsetX,t=t.offsetY;this._brushStart=new kn(e,t),this._brushing=!0,this._brushStartTime=+new Date},cH.prototype._onBrushEnd=function(t){var e,n,i;this._brushing&&(i=this._displayables.brushRect,this._brushing=!1,i&&(i.attr("ignore",!0),e=i.shape,+new Date-this._brushStartTime<200&&Math.abs(e.width)<5||(n=this._getViewExtent(),i=[0,100],this._range=zu([Ru(e.x,n,i,!0),Ru(e.x+e.width,n,i,!0)]),this._handleEnds=[e.x,e.x+e.width],this._updateView(),this._dispatchZoomAction(!1))))},cH.prototype._onBrush=function(t){this._brushing&&(ie(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},cH.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new aH({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);i=this._brushStart,n=this._displayables.sliderGroup,e=n.transformCoordToLocal(t,e),n=n.transformCoordToLocal(i.x,i.y),i=this._size;e[0]=Math.max(Math.min(i[0],e[0]),0),o.setShape({x:n[0],y:0,width:e[0]-n[0],height:i[1]})},cH.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?hH:null,start:e[0],end:e[1]})},cH.prototype._findCoordRect=function(){var t,e,n=hV(this.dataZoomModel).infoList;return!t&&n.length&&(t=(e=n[0].model.coordinateSystem).getRect&&e.getRect()),t||(t={x:.2*(n=this.api.getWidth()),y:.2*(e=this.api.getHeight()),width:.6*n,height:.6*e}),t},cH.type="dataZoom.slider",cH);function cH(){var t=null!==rH&&rH.apply(this,arguments)||this;return t.type=cH.type,t._displayables={},t}function pH(t){return"vertical"===t?"ns-resize":"ew-resize"}qy.registerClass(Op);var dH,Op=(l(fH,dH=nd),fH.type="dataZoom.inside",fH.defaultOption=Xp(nd.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),fH);function fH(){var t=null!==dH&&dH.apply(this,arguments)||this;return t.type=fH.type,t}nf.registerClass(Op);var gH=_h();function yH(t,e){e&&(t.removeKey(e.model.uid),(e=e.controller)&&e.dispose())}function mH(t,e){t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function vH(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}D_(r.PROCESSOR.FILTER,function(t,a){var e=gH(a),l=e.coordSysRecordMap||(e.coordSysRecordMap=ct());l.each(function(t){t.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(o){N(hV(o).infoList,function(t){var e,r,n,i=t.model.uid,e=l.get(i)||l.set(i,(e=a,i=t.model,r={model:i,containsPoint:V(vH,i),dispatchAction:V(mH,e),dataZoomInfoMap:null,controller:null},n=r.controller=new hC(e.getZr()),N(["pan","zoom","scrollMove"],function(o){n.on(o,function(n){var i=[];r.dataZoomInfoMap.each(function(t){var e;n.isAvailableBehavior(t.model.option)&&(e=(e=(t.getRange||{})[o])&&e(t.dzReferCoordSysInfo,r.model.mainType,r.controller,n),!t.model.get("disabled",!0)&&e&&i.push({dataZoomId:t.model.id,start:e[0],end:e[1]}))}),i.length&&r.dispatchAction(i)})}),r));(e.dataZoomInfoMap||(e.dataZoomInfoMap=ct())).set(o.uid,{dzReferCoordSysInfo:t,model:o,getRange:null})})}),l.each(function(t){var e,n,i,o,r,a=t.controller,s=t.dataZoomInfoMap;!s||null!=(n=s.keys()[0])&&(e=s.get(n)),e?(o={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0,s.each(function(t){var e=t.model,t=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+i]"],F(t)&&(t=t.slice(),i=!0);e=e?t:i?[s(t[0]),s(t[1])]:s(t);return H(o)?o.replace("{value}",i?e[0]:e).replace("{value2}",i?e[1]:e):G(o)?i?o(t[0],t[1]):o(t):i?t[0]===a[0]?n[0]+" "+e[1]:t[1]===a[1]?n[1]+" "+e[0]:e[0]+" - "+e[1]:e;function s(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(r,20))}},zH.prototype.resetExtent=function(){var t=this.option,t=NH([t.min,t.max]);this._dataExtent=t},zH.prototype.getDataDimension=function(t){var e=this.option.dimension,n=t.dimensions;if(null!=e||n.length){if(null!=e)return t.getDimension(e);for(var i=t.dimensions,o=i.length-1;0<=o;o--){var r=i[o];if(!t.getDimensionInfo(r).isCalculationCoord)return r}}},zH.prototype.getExtent=function(){return this._dataExtent.slice()},zH.prototype.completeVisualOption=function(){var e=this.ecModel,n=this.option,t={inRange:n.inRange,outOfRange:n.outOfRange},i=n.target||(n.target={}),o=n.controller||(n.controller={});b(i,t),b(o,t);var l=this.isCategory();function r(t){OH(n.color)&&!t.inRange&&(t.inRange={color:n.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")}}r.call(this,i),r.call(this,o),function(t,e,n){var e=t[e],i=t[n];e&&!i&&(i=t[n]={},RH(e,function(t,e){var n;!jD.isValidType(e)||null!=(n=AH(e,"inactive",l))&&(i[e]=n,"color"!==e||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}))}.call(this,i,"inRange","outOfRange"),function(o){var r=(o.inRange||{}).symbol||(o.outOfRange||{}).symbol,a=(o.inRange||{}).symbolSize||(o.outOfRange||{}).symbolSize,s=this.get("inactiveColor");RH(this.stateList,function(t){var e=this.itemSize,n=o[t];null==(n=n||(o[t]={color:l?s:[s]})).symbol&&(n.symbol=r&&C(r)||(l?"roundRect":["roundRect"])),null==n.symbolSize&&(n.symbolSize=a&&C(a)||(l?e[0]:[e[0],e[0]])),n.symbol=kH(n.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var i,t=n.symbolSize;null!=t&&(i=-1/0,PH(t,function(t){ie[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},FH.prototype.completeVisualOption=function(){BH.prototype.completeVisualOption.apply(this,arguments),N(this.stateList,function(t){t=this.option.controller[t].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},FH.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},FH.prototype.getSelected=function(){var t=this.getExtent(),e=zu((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},FH.prototype.findTargetDataIndices=function(i){var o=[];return this.eachTargetSeries(function(t){var n=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){i[0]<=t&&t<=i[1]&&n.push(e)},this),o.push({seriesId:t.id,dataIndex:n})},this),o},FH.prototype.getVisualMeta=function(n){var t=GH(0,0,this.getExtent()),e=GH(0,0,this.option.range.slice()),i=[];function o(t,e){i.push({value:t,color:n(t,e)})}for(var r=0,a=0,s=e.length,l=t.length;at[1])break;n.push({color:this.getControllerVisual(r,"color",e),offset:o/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},JH.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},JH.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new $r("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},JH.prototype._updateHandle=function(i,o){var r,a,s,l,u,h;this._useHandle&&(r=this._shapes,a=this.visualMapModel,s=r.handleThumbs,l=r.handleLabels,u=a.itemSize,h=a.getExtent(),qH([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.y=i[t];var n=jH(i[t],[0,u[1]],h,!0),n=this.getControllerVisual(n,"symbolSize");e.scaleX=e.scaleY=n/u[0],e.x=u[0]-n/2;e=rp(r.handleLabelPoints[t],op(e,this.group));l[t].setStyle({x:e[0],y:e[1],text:a.formatValueText(this._dataInterval[t]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",r.mainGroup):"center"})},this))},JH.prototype._showIndicator=function(t,e,n,i){var o=this.visualMapModel,r=o.getExtent(),a=o.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),c=this.getControllerVisual(t,"symbolSize"),p=jH(t,r,s,!0),t=a[0]-c/2,r={x:u.x,y:u.y};u.y=p,u.x=t;s=rp(l.indicatorLabelPoint,op(u,this.group)),a=l.indicatorLabel;a.attr("invisible",!1);c=this._applyTransform("left",l.mainGroup),l="horizontal"===this._orient;a.setStyle({text:(n||"")+o.formatValueText(e),verticalAlign:l?c:"middle",align:l?"center":c});h={x:t,y:p,style:{fill:h}},s={style:{x:s[0],y:s[1]}};o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator?(o={duration:100,easing:"cubicInOut",additive:!0},u.x=r.x,u.y=r.y,u.animateTo(h,o),a.animateTo(s,o)):(u.attr(h),a.attr(s)),this._firstShowIndicator=!1;var d=this._shapes.handleLabels;if(d)for(var f=0;f ",o):this._showIndicator(t,t,"≈ ",o)),t=this._hoverLinkDataIndices,o=[],(e||tW(r))&&(o=this._hoverLinkDataIndices=r.findTargetDataIndices(i)),i=o,o={},s(t||[],t={}),s(i||[],o,t),o=[l(t),l(o)],this._dispatchHighDown("downplay",UH(o[0],r)),this._dispatchHighDown("highlight",UH(o[1],r)))},JH.prototype._hoverLinkFromSeriesMouseOver=function(t){var e=t.target,n=this.visualMapModel;e&&null!=Wh(e).dataIndex&&(t=Wh(e),e=this.ecModel.getSeriesByIndex(t.seriesIndex),n.isTargetSeries(e)&&(t=(e=e.getData(t.dataType)).get(n.getDataDimension(e),t.dataIndex),isNaN(t)||this._showIndicator(t,t)))},JH.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;nn&&s([n,t[0]],"outOfRange"),s(t.slice()),n=t[1])},this),{stops:o,outerColors:r}}function s(t,e){var n=a.getRepresentValue({interval:t});e=e||a.getValueState(n);e=i(n,e);t[0]===-1/0?r[0]=e:t[1]===1/0?r[1]=e:o.push({value:t[0],color:e},{value:t[1],color:e})}},iW.type="visualMap.piecewise",iW.defaultOption=Xp(vm.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),iW);function iW(){var t=null!==nW&&nW.apply(this,arguments)||this;return t.type=iW.type,t._pieceList=[],t}var oW={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),o=e.splitNumber,o=Math.max(parseInt(o,10),1);e.splitNumber=o;for(var r=(i[1]-i[0])/o;+r.toFixed(n)!==r&&n<5;)n++;e.precision=n,r=+r.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,e)},this)}};function rW(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}nf.registerClass(vm);var aW,Op=(l(sW,aW=Op),sW.prototype.doRender=function(){var i=this.group;i.removeAll();var o=this.visualMapModel,r=o.get("textGap"),t=o.textStyleModel,a=t.getFont(),s=t.getTextColor(),l=this._getItemAlign(),u=o.itemSize,e=this._getViewData(),t=e.endsText,h=Q(o.get("showLabel",!0),!t);t&&this._renderEndsText(i,t[0],u,h,l),N(e.viewPieceList,function(t){var e=t.piece,n=new $r;n.onclick=B(this._onItemClick,this,e),this._enableHoverLink(n,t.indexInModelPieceList);t=o.getRepresentValue(e);this._createItemSymbol(n,t,[0,0,u[0],u[1]]),h&&(t=this.visualMapModel.getValueState(t),n.add(new vl({style:{x:"right"===l?-r:u[0]+r,y:u[1]/2,text:e.text,verticalAlign:"middle",align:l,font:a,fill:s,opacity:"outOfRange"===t?.5:1}}))),i.add(n)},this),t&&this._renderEndsText(i,t[1],u,h,l),Xd(o.get("orient"),i,o.get("itemGap")),this.renderBackground(i),this.positionGroup(i)},sW.prototype._enableHoverLink=function(t,n){var i=this;t.on("mouseover",function(){return e("highlight")}).on("mouseout",function(){return e("downplay")});var e=function(t){var e=i.visualMapModel;e.option.hoverLink&&i.api.dispatchAction({type:t,batch:UH(e.findTargetDataIndices(n),e)})}},sW.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return YH(t,this.api,t.itemSize);e=e.align;return e&&"auto"!==e||(e="left"),e},sW.prototype._renderEndsText=function(t,e,n,i,o){var r,a;e&&(r=new $r,a=this.visualMapModel.textStyleModel,r.add(new vl({style:{x:i?"right"===o?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?o:"center",text:e,font:a.getFont(),fill:a.getTextColor()}})),t.add(r))},sW.prototype._getViewData=function(){var t=this.visualMapModel,e=P(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),i=t.get("orient"),t=t.get("inverse");return("horizontal"===i?t:!t)?e.reverse():n=n&&n.slice().reverse(),{viewPieceList:e,endsText:n}},sW.prototype._createItemSymbol=function(t,e,n){t.add(px(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},sW.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=C(n.selected),o=e.getSelectedMapKey(t);"single"===n.selectedMode?(i[o]=!0,N(i,function(t,e){i[e]=e===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})},sW.type="visualMap.piecewise",sW);function sW(){var t=null!==aW&&aW.apply(this,arguments)||this;return t.type=sW.type,t}qy.registerClass(Op),C_(IH);var lW={label:{enabled:!0},decal:{show:!1}},uW=_h(),hW={};Op=r.VISUAL.ARIA;function cW(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}C_(function(t){var e;t&&t.aria&&(null!=(e=t.aria).show&&(e.enabled=e.show),e.label=e.label||{},N(["description","general","series","data"],function(t){null!=e[t]&&(e.label[t]=e[t])}))}),P_(Op,function(f,o){var t,r=f.getModel("aria");function g(t,e){if("string"!=typeof t)return t;var n=t;return N(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}r.get("enabled")&&(b((t=C(lW)).label,f.getLocaleModel().get("aria"),!1),b(r.option,t,!1),function(){{var n;r.getModel("decal").get("show")&&(n=ct(),f.eachSeries(function(t){var e;t.useColorPaletteOnData&&((e=n.get(t.type))||(e={},n.set(t.type,e)),uW(t).scope=e)}),f.eachRawSeries(function(i){var o,r,a,s,l,t,e;function u(t,e){e=t?O(O({},e),t):e;return e.dirty=!0,e}f.isSeriesFiltered(i)||("function"!=typeof i.enableAriaDecal?(o=i.getData(),i.useColorPaletteOnData?(r=i.getRawData(),a={},s=uW(i).scope,o.each(function(t){var e=o.getRawIndex(t);a[e]=t}),l=r.count(),r.each(function(t){var e=a[t],n=r.getName(t)||t+"",t=Of(i.ecModel,n,s,l),n=o.getItemVisual(e,"decal");o.setItemVisual(e,"decal",u(n,t))})):(t=Of(i.ecModel,i.name,hW,f.getSeriesCount()),e=o.getVisual("decal"),o.setVisual("decal",u(e,t)))):i.enableAriaDecal())}))}}(),function(){var t=f.getLocaleModel().get("aria"),u=r.getModel("label");if(u.option=A(u.option,t),!u.get("enabled"))return;var e=o.getZr().dom;if(u.get("description"))return e.setAttribute("aria-label",u.get("description"));var h=f.getSeriesCount(),c=u.get(["data","maxCount"])||10,n=u.get(["series","maxCount"])||10,p=Math.min(h,n);{var d,i;h<1||(i=function(){var t=f.get("title");t&&t.length&&(t=t[0]);return t&&t.text}(),t=i?g(u.get(["general","withTitle"]),{title:i}):u.get(["general","withoutTitle"]),d=[],n=1c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var o,r,a,s=[],l=0;l=h&&c<=e+1){for(var n=[],i=0;i=h&&c<=o+1)return function(t){for(var e=0,n=t.length,i=0,o=0;e\n\r<"))},oX)),t.Axis=mu,t.List=db,t.Model=Fp,t.PRIORITY=r,t.color=gn,t.connect=function(e){var t;return F(e)&&(t=e,e=null,xx(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+w_++,xx(t,function(t){t.group=e})),__[e]=!0,e},t.dataTool={},t.dependencies={zrender:"5.0.0"},t.disConnect=M_,t.disconnect=g,t.dispose=function(t){"string"==typeof t?t=x_[t]:t instanceof n_||(t=I_(t)),t instanceof n_&&!t.isDisposed()&&t.dispose()},t.env=w,t.extendChartView=function(t){return tm.extend(t)},t.extendComponentModel=function(t){return nf.extend(t)},t.extendComponentView=N_,t.extendSeriesModel=function(t){return Fy.extend(t)},t.format=oS,t.getCoordinateSystemDimensions=function(t){if(t=Yf.get(t))return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.getInstanceByDom=I_,t.getInstanceById=function(t){return x_[t]},t.getMap=function(t){return(t=Wm(t))&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.graphic=aS,t.helper=Ea,t.init=function(t,e,n){var i=I_(t);if(i)return i;var o=new n_(t,e,n);return o.id="ec_"+b_++,x_[o.id]=o,Th(t,S_,o.id),$x(o),xx(f_,function(t){t(o)}),o},t.innerDrawElementOnCanvas=qv,t.matrix=Ae,t.number=iS,t.parseGeoJSON=Xw,t.parseGeoJson=kp,t.registerAction=A_,t.registerCoordinateSystem=L_,t.registerLayout=k_,t.registerLoading=R_,t.registerLocale=$p,t.registerMap=function(t,e,n){Hm(t,e,n)},t.registerPostInit=function(t){t&&f_.push(t)},t.registerPostUpdate=function(t){t&&g_.push(t)},t.registerPreprocessor=C_,t.registerProcessor=D_,t.registerTheme=T_,t.registerTransform=n,t.registerVisual=P_,t.setCanvasCreator=function(t){m("createCanvas",t)},t.throttle=hm,t.time=sf,t.util=rS,t.vector=Et,t.version="5.0.0",t.zrender=Pu,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).echarts={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",o[u]+":0",i[1-l]+":auto",o[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,r),r,o);if(o)return o(t,n,i),!0}return!1}function jt(t){return"CANVAS"===t.nodeName.toUpperCase()}var qt="undefined"!=typeof window&&!!window.addEventListener,Kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,$t=[];function Jt(t,e,n,i){return n=n||{},i||!w.canvasSupported?Qt(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Qt(t,e,n),n}function Qt(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,o=e.clientY;if(jt(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=o-e.top)}if(Zt($t,t,i,o))return n.zrX=$t[0],void(n.zrY=$t[1])}n.zrX=n.zrY=0}function te(t){return t||window.event}function ee(t,e,n){if(null!=(e=te(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Jt(t,i,e,n):(Jt(t,e,e,n),o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function _e(){return[1,0,0,1,0,0]}function be(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function we(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Se(t,e,n){var i=e[0]*n[0]+e[2]*n[1],o=e[1]*n[0]+e[3]*n[1],r=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=s,t[5]=e,t}function Me(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Ie(t,e,n){var i=e[0],o=e[2],r=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=o*n+s*e,t[3]=-o*e+n*s,t[4]=n*r+e*l,t[5]=n*l-e*r,t}function Te(t,e,n){var i=n[0],n=n[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function Ce(t,e){var n=e[0],i=e[2],o=e[4],r=e[1],a=e[3],s=e[5],e=n*a-r*i;return e?(e=1/e,t[0]=a*e,t[1]=-r*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*o)*e,t[5]=(r*o-n*s)*e,t):null}function De(t){var e=_e();return we(e,t),e}N(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){me.prototype[a]=function(t){var e,n,i=t.zrX,o=t.zrY,r=xe(this,i,o);if("mouseup"===a&&r||(n=(e=this.findHover(i,o)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),on(t,e),e):void Qe(e,0,0,0,1):7===o||9===o?0<=(r=parseInt(i.slice(1,7),16))&&r<=16777215?(Qe(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),on(t,e),e):void Qe(e,0,0,0,1):void 0;var n=i.indexOf("("),r=i.indexOf(")");if(-1!==n&&r+1===o){o=i.substr(0,n),r=i.substr(n+1,r-(n+1)).split(","),n=1;switch(o){case"rgba":if(4!==r.length)return 3===r.length?Qe(e,+r[0],+r[1],+r[2],1):Qe(e,0,0,0,1);n=Ke(r.pop());case"rgb":return 3!==r.length?void Qe(e,0,0,0,1):(Qe(e,qe(r[0]),qe(r[1]),qe(r[2]),n),on(t,e),e);case"hsla":return 4!==r.length?void Qe(e,0,0,0,1):(r[3]=Ke(r[3]),an(r,e),on(t,e),e);case"hsl":return 3!==r.length?void Qe(e,0,0,0,1):(an(r,e),on(t,e),e);default:return}}Qe(e,0,0,0,1)}}function an(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Ke(t[1]),o=Ke(t[2]),i=o<=.5?o*(i+1):o+i-o*i,o=2*o-i;return Qe(e=e||[],Ze(255*$e(o,i,n+1/3)),Ze(255*$e(o,i,n)),Ze(255*$e(o,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function sn(t,e){var n=rn(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(k(e)){var o,r=k((r=e)&&r[0])?2:1;if(0e);u++);u=Math.min(u-1,r-2)}var h,c,p,d,f,g,y,m=o[u+1],v=o[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?Tn:t[a],(0=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height},Hn.prototype.clone=function(){return new Hn(this.x,this.y,this.width,this.height)},Hn.prototype.copy=function(t){Hn.copy(this,t)},Hn.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},Hn.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Hn.prototype.isZero=function(){return 0===this.width||0===this.height},Hn.create=function(t){return new Hn(t.x,t.y,t.width,t.height)},Hn.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},Hn.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=r:s=1+r;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);r(t,e[n+h])<0?l=h:a=h+1}return l}function wi(f,g){var r,a,y=mi,s=0,m=(f.length,[]);function e(t){var e=r[t],n=a[t],i=r[t+1],o=a[t+1];a[t]=n+o,t===s-3&&(r[t+1]=r[t+2],a[t+1]=a[t+2]),s--;t=bi(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(o=_i(f[e+n-1],f,i,o,o-1,g))&&(n<=o?function(t,e,n,i){var o=0;for(o=0;oa[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(o);do{}while((r=vi(t,n,i,e))this._ux||er(e-this._yi)>this._uy||this._len<5;return this.addData(Wo.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},ur.prototype.bezierCurveTo=function(t,e,n,i,o,r){return this.addData(Wo.C,t,e,n,i,o,r),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,o,r):this._ctx.bezierCurveTo(t,e,n,i,o,r)),this._xi=o,this._yi=r,this},ur.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(Wo.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},ur.prototype.arc=function(t,e,n,i,o,r){rr[0]=i,rr[1]=o,sr(rr,r),i=rr[0];var a=(o=rr[1])-i;return this.addData(Wo.A,t,e,n,n,i,a,0,r?0:1),this._ctx&&this._ctx.arc(t,e,n,i,o,r),this._xi=Jo(o)*n+t,this._yi=Qo(o)*n+e,this},ur.prototype.arcTo=function(t,e,n,i,o){return this._ctx&&this._ctx.arcTo(t,e,n,i,o),this},ur.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Wo.R,t,e,n,i),this},ur.prototype.closePath=function(){this.addData(Wo.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},ur.prototype.fill=function(t){t&&t.fill(),this.toStatic()},ur.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},ur.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||er(y)>i||c===e-1)&&(f=Math.sqrt(T*T+y*y),o=g,r=x);break;case Wo.C:var m=t[c++],v=t[c++],g=t[c++],x=t[c++],_=t[c++],b=t[c++],f=function(t,e,n,i,o,r,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=_o(t,n,o,a,f),y=_o(e,i,r,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(o,r,m,v,g,x,_,b,10),o=_,r=b;break;case Wo.Q:f=function(t,e,n,i,o,r,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=To(t,n,o,p),f=To(e,i,r,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(o,r,m=t[c++],v=t[c++],g=t[c++],x=t[c++],10),o=g,r=x;break;case Wo.A:var w=t[c++],S=t[c++],M=t[c++],I=t[c++],p=t[c++],_=t[c++],b=_+p;c+=1;t[c++];d&&(a=Jo(p)*M+w,s=Qo(p)*I+S),f=$o(M,I)*Ko(ir,Math.abs(_)),o=Jo(b)*M+w,r=Qo(b)*I+S;break;case Wo.R:a=o=t[c++],s=r=t[c++];f=2*t[c++]+2*t[c++];break;case Wo.Z:var T=a-o,y=s-r;f=Math.sqrt(T*T+y*y),o=a,r=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},ur.prototype.rebuildPath=function(t,e){var n,i,o,r,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||er(s-r)>p||m===d-1){if(f){if(u=xr[i=0]+t&&a<=xr[1]+t?l:0}oMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,x,_,_+b,f,g,o);u=Math.cos(_+b)*v+y,h=Math.sin(_+b)*x+m;break;case yr.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(hr(c,p,w,p,e,i,o)||hr(w,p,w,S,e,i,o)||hr(w,S,c,S,e,i,o)||hr(c,S,c,p,e,i,o))return!0}else l+=gr(w,p,w,S,i,o),l+=gr(c,S,c,p,i,o);break;case yr.Z:if(n){if(hr(u,h,c,p,e,i,o))return!0}else l+=gr(u,h,c,p,i,o);u=c,h=p}}return n||(r=h,t=p,Math.abs(r-t)c.width?1:0,o=Ts[i],r=Is[i],a=c[o]/e,s=c[r],l=0;l=e.maxIterations){t+=e.ellipsis;break}var a=0===r?function(t,e,n,i){for(var o=0,r=0,a=t.length;rr){0i.width&&(r=e.split("\n"),p=!0),i.accumWidth=s):(s=fl(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,r=s.lines)):r=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},Au.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Au.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Au.prototype.addHover=function(t){},Au.prototype.removeHover=function(t){},Au.prototype.clearHover=function(){},Au.prototype.refreshHover=function(){this._needsRefreshHover=!0},Au.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},Au.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Au.prototype.clearAnimation=function(){this.animation.clear()},Au.prototype.getWidth=function(){return this.painter.getWidth()},Au.prototype.getHeight=function(){return this.painter.getHeight()},Au.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Au.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Au.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Au.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},Au.prototype.off=function(t,e){this.handler.off(t,e)},Au.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Au.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/o*r+n[0]}function Nu(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Eu(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function zu(t){return t.sort(function(t,e){return t-e}),t}function Bu(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Vu(t){var e=t.toString(),t=e.indexOf("e");if(0u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/o}var Hu=9007199254740991;function Wu(t){var e=2*Math.PI;return(t%e+e)%e}function Xu(t){return-OuMath.abs(o[1])?0"'])/g,Ad={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ld(t){return null==t?"":(t+"").replace(Dd,function(t,e){return Ad[e]})}function kd(t,e,n){function i(t){return t&&rt(t)?t:"-"}function o(t){return null!=t&&!isNaN(t)&&isFinite(t)}var r="time"===e,a=t instanceof Date;if(r||a){r=r?Uu(t):t;if(!isNaN(+r))return ud(r,"yyyy-MM-dd hh:mm:ss",n);if(a)return"-"}if("ordinal"===e)return W(t)?i(t):X(t)&&o(t)?t+"":"-";e=Ju(t);return o(e)?Id(e):W(t)?i(t):"-"}function Pd(t,e){return"{"+t+(null==e?"":e)+"}"}var Od=["a","b","c","d","e","f","g"];function Rd(t,e,n){F(e)||(e=[e]);var i=e.length;if(!i)return"";for(var o=e[0].$vars||[],r=0;r':'':{renderMode:t,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===o?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function zd(t,e){return e=e||"transparent",H(t)?t:Y(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Bd(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var Vd=Object.freeze({__proto__:null,addCommas:Id,toCamelCase:Td,normalizeCssArray:Cd,encodeHTML:Ld,makeValueReadable:kd,formatTpl:Rd,formatTplSimple:Nd,getTooltipMarker:Ed,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Uu(e),o=i["get"+(l=n?"UTC":"")+"FullYear"](),r=i["get"+l+"Month"]()+1,a=i["get"+l+"Date"](),s=i["get"+l+"Hours"](),e=i["get"+l+"Minutes"](),n=i["get"+l+"Seconds"](),l=i["get"+l+"Milliseconds"]();return t=t.replace("MM",sd(r,2)).replace("M",r).replace("yyyy",o).replace("yy",o%100+"").replace("dd",sd(a,2)).replace("d",a).replace("hh",sd(s,2)).replace("h",s).replace("mm",sd(e,2)).replace("m",e).replace("ss",sd(n,2)).replace("s",n).replace("SSS",sd(l,3))},capitalFirst:function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},convertToColorString:zd,windowOpen:Bd,truncateText:rl,getTextRect:function(t,e,n,i,o,r,a,s){return oh(),new vl({style:{text:t,font:e,align:n,verticalAlign:i,padding:o,rich:r,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}}),Fd=N,Gd=["left","right","top","bottom","width","height"],Hd=[["width","left","right"],["height","top","bottom"]];function Wd(a,s,l,u,h){var c=0,p=0;null==u&&(u=1/0),null==h&&(h=1/0);var d=0;s.eachChild(function(t,e){var n,i,o=t.getBoundingRect(),r=s.childAt(e+1),e=r&&r.getBoundingRect();d="horizontal"===a?(r=o.width+(e?-e.x+o.x:0),u<(n=c+r)||t.newline?(c=0,n=r,p+=d+l,o.height):Math.max(d,o.height)):(e=o.height+(e?-e.y+o.y:0),h<(i=p+e)||t.newline?(c+=d+l,p=0,i=e,o.width):Math.max(d,o.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=i+l)})}var Xd=Wd;V(Wd,"vertical"),V(Wd,"horizontal");function Yd(t,e,n){n=Cd(n||0);var i=e.width,o=e.height,r=Nu(t.left,i),a=Nu(t.top,o),s=Nu(t.right,i),l=Nu(t.bottom,o),u=Nu(t.width,i),h=Nu(t.height,o),c=n[2]+n[0],p=n[1]+n[3],e=t.aspect;switch(isNaN(u)&&(u=i-s-p-r),isNaN(h)&&(h=o-l-c-a),null!=e&&(isNaN(u)&&isNaN(h)&&(i/oe)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return o&&(r[o]=n),e.paletteIdx=(t+1)%a.length,n}}var Nf,Ef="\0_ec_inner",zf=(l(Bf,Nf=Fp),Bf.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,this._theme=new Fp(i),this._locale=new Fp(o),this._optionManager=r},Bf.prototype.setOption=function(t,e,n){ot(!(Ef in t),"please use chart.getOption()");e=Gf(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},Bf.prototype.resetOption=function(t,e){return this._resetOption(t,Gf(e))},Bf.prototype._resetOption=function(t,e){var n,i=!1,o=this._optionManager;return t&&"recreate"!==t||(n=o.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):Df(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=o.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(o=o.getMediaOption(this)).length&&N(o,function(t){i=!0,this._mergeOption(t,e)},this),i},Bf.prototype.mergeOption=function(t){this._mergeOption(t,null)},Bf.prototype._mergeOption=function(i,t){var o=this.option,u=this._componentsMap,h=this._componentsCount,n=[],r=ct(),c=t&&t.replaceMergeMainTypeMap;xf(this).datasetMap=ct(),N(i,function(t,e){null!=t&&(nf.hasClass(e)?e&&(n.push(e),r.set(e,!0)):o[e]=null==o[e]?C(t):b(o[e],t,!0))}),c&&c.each(function(t,e){nf.hasClass(e)&&!r.get(e)&&(n.push(e),r.set(e,!0))}),nf.topologicalTravel(n,nf.getAllClassMainTypes(),function(r){var t=function(t,e,n){return(e=If.get(e))&&(t=e(t))?n.concat(t):n}(this,r,lh(i[r])),e=u.get(r),n=e?c&&c.get(r)?"replaceMerge":"normalMerge":"replaceAll",n=ph(e,t,n);vh(n,r,nf),o[r]=null,u.set(r,null),h.set(r,0);var a=[],s=[],l=0;N(n,function(t,e){var n,i=t.existing,o=t.newOption;o?(n=nf.getClass(r,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(o,this),i.optionUpdated(o,!1)):(e=O({componentIndex:e},t.keyInfo),O(i=new n(o,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),o[r]=a,u.set(r,s),h.set(r,l),"series"===r&&Tf(this)},this),this._seriesIndices||Tf(this)},Bf.prototype.getOption=function(){var a=C(this.option);return N(a,function(t,e){if(nf.hasClass(e)){for(var n=lh(t),i=n.length,o=!1,r=i-1;0<=r;r--)n[r]&&!mh(n[r])?o=!0:(n[r]=null,o||i--);n.length=i,a[e]=n}}),delete a[Ef],a},Bf.prototype.getTheme=function(){return this._theme},Bf.prototype.getLocaleModel=function(){return this._locale},Bf.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},Bf.prototype.setUpdatePayload=function(t){this._payload=t},Bf.prototype.getUpdatePayload=function(){return this._payload},Bf.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;i'+Ld(e)+""+r,n)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n){var i=t.renderMode,o=e.noName,r=e.noValue,a=!e.markerType,s=e.name,l=e.value,u=t.useUTC;if(!o||!r){var h=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),c=o?"":kd(s,"ordinal",u),p=e.valueType,d=r?[]:F(l)?P(l,function(t,e){return kd(t,F(p)?p[e]:p,u)}):[kd(l,F(p)?p[0]:p,u)],f=!a||!o,s=!a&&o;return"richText"===i?(a?"":h)+(o?"":ky(t,c))+(r?"":(e=t,l=d,i=[by],t=(t=s)?10:20,f&&i.push({padding:[0,0,0,t],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(l.join(" "),i))):Ly((a?"":h)+(o?"":''+Ld(c)+"")+(r?"":function(t,e,n){n=n?"10px":"20px";return''+P(t,Ld).join("  ")+""}(d,f,s)),n)}}}};function Dy(t,e,n,i,o){if(t){var r=Ty(t);r.planLayout(t);e={useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e};return r.build(e,t,0)}}function Ay(t){t=t.__gapLevelBetweenSubBlocks;return{html:Sy[t],richText:My[t]}}function Ly(t,e){return'
'+t+'
'}function ky(t,e){return t.markupStyleCreator.wrapRichTextStyle(e,_y)}function Py(t,e){return zd(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function Oy(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}var Ry=(Ny.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},Ny.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,n=Ed({color:e,type:t,renderMode:n,markerId:i});return H(n)?n:(this.richTextStyles[i]=n.style,n.content)},Ny.prototype.wrapRichTextStyle=function(t,e){var n={};F(e)?N(e,function(t){return O(n,t)}):O(n,e);e=this._generateStyleName();return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"},Ny);function Ny(){this.richTextStyles={},this._nextStyleNameId=th()}function Ey(t){var e,n,i,o,r,a,s,l,u,h,c,p=t.series,d=t.dataIndex,f=t.multipleSeries,g=p.getData(),y=g.mapDimensionsAll("defaultedTooltip"),m=y.length,v=p.getRawValue(d),x=F(v),t=Py(p,d);function _(t,e){e=s.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(l?c.push(Iy("nameValue",{markerType:"subItem",markerColor:a,name:e.displayName,value:t,valueType:e.type})):(u.push(t),h.push(e.type)))}1this.getShallow("animationThreshold")&&(t=!1),!!t},Gy.prototype.restoreData=function(){this.dataTask.dirty()},Gy.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return kf.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Gy.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Gy.prototype.getProgressive=function(){return this.get("progressive")},Gy.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Gy.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Gy.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),o=0;oe.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Uy(e,n){N(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,V(Zy,n))})}function Zy(t,e){t=jy(t);return t&&t.setOutputEnd((e||this).count()),e}function jy(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}I(Fy,ni),I(Fy,kf),Rh(Fy,nf);var qy=(Ky.prototype.init=function(t,e){},Ky.prototype.render=function(t,e,n,i){},Ky.prototype.dispose=function(t,e){},Ky.prototype.updateView=function(t,e,n,i){},Ky.prototype.updateLayout=function(t,e,n,i){},Ky.prototype.updateVisual=function(t,e,n,i){},Ky.prototype.blurSeries=function(t,e){},Ky);function Ky(){this.group=new $r,this.uid=Wp("viewComponent")}function $y(){var r=_h();return function(t){var e=r(t),n=t.pipelineContext,i=!!e.large,o=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&o==n)&&"reset"}}Oh(qy),Bh(qy,{registerWhenExtend:!0});var Jy=_h(),Qy=$y(),tm=(em.prototype.init=function(t,e){},em.prototype.render=function(t,e,n,i){},em.prototype.highlight=function(t,e,n,i){im(t.getData(),i,"emphasis")},em.prototype.downplay=function(t,e,n,i){im(t.getData(),i,"normal")},em.prototype.remove=function(t,e){this.group.removeAll()},em.prototype.dispose=function(t,e){},em.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},em.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},em.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},em.markUpdateMethod=function(t,e){Jy(t).updateMethod=e},em.protoInitialize=void(em.prototype.type="chart"),em);function em(){this.group=new $r,this.uid=Wp("viewChart"),this.renderTask=Bg({plan:om,reset:rm}),this.renderTask.context={view:this}}function nm(t,e,n){t&&("emphasis"===e?bc:wc)(t,n)}function im(e,t,n){var i,o=xh(e,t),r=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=Yh[i])&&Xh<=32&&(t=Yh[i]=Xh++),t):null;null!=o?N(lh(o),function(t){nm(e.getItemGraphicEl(t),n,r)}):e.eachItemGraphicEl(function(t){nm(t,n,r)})}function om(t){return Qy(t.model)}function rm(t){var e=t.model,n=t.ecModel,i=t.api,o=t.payload,r=e.pipelineContext.progressiveRender,a=t.view,t=o&&Jy(o).updateMethod,t=r?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,o),am[t]}Oh(tm),Bh(tm,{registerWhenExtend:!0});var am={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},sm="\0__throttleOriginMethod",lm="\0__throttleRate",um="\0__throttleType";function hm(t,o,r){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}o=o||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},bm.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},bm.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:i,large:e}},bm.prototype.restorePipelines=function(t){var i=this,o=i._pipelineMap=ct();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;o.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},bm.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,o=this.api.getModel(),r=this.api;N(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";ot(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,o,r),t.overallReset&&this._createOverallStageTask(t,e,o,r)},this)},bm.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},bm.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},bm.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},bm.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}N(t,function(i,t){var e,n,o,r,a;u.visualType&&u.visualType!==i.visualType||(e=(r=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=r.overallTask)?((r=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),o=!0)}),o&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),r.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},bm.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},bm.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},bm.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},bm.prototype._createSeriesStageTask=function(n,t,i,o){var r=this,a=t.seriesTaskMap,s=t.seriesTaskMap=ct(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||Bg({plan:Tm,reset:Cm,count:Lm}));e.context={model:t,ecModel:i,api:o,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:r},r._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,o).each(l)},bm.prototype._createOverallStageTask=function(t,e,n,i){var o=this,r=e.overallTask=e.overallTask||Bg({reset:wm});r.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:o};var a=r.agentStubMap,s=r.agentStubMap=ct(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,Bg({reset:Sm,onDirty:Im})));e.context={model:t,overallProgress:h},e.agent=r,e.__block=h,o._pipe(t,e)}ot(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,N(n.getSeries(),p)),c&&r.dirty()},bm.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},bm.wrapStageHandler=function(t,e){return G(t)&&(t={overallReset:t,seriesType:function(t){km=null;try{t(Pm,Om)}catch(t){}return km}(t)}),t.uid=Wp("stageHandler"),e&&(t.visualType=e),t},bm);function bm(t,e,n,i){this._stageTaskMap=ct(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function wm(t){t.overallReset(t.ecModel,t.api,t.payload)}function Sm(t){return t.overallProgress&&Mm}function Mm(){this.agent.dirty(),this.getDownstream().dirty()}function Im(){this.agent&&this.agent.dirty()}function Tm(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function Cm(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=lh(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var r,a=this.__startIndex;ao[0]){for(l=0;lt);l++);s=i[o[l]]}o.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else _("Layer of zlevel "+t+" is not valid")},ox.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new ga({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),xx(p,function(t){t=new na({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},i_.prototype.convertToPixel=function(t,e){return Bx(this,"convertToPixel",t,e)},i_.prototype.convertFromPixel=function(t,e){return Bx(this,"convertFromPixel",t,e)},i_.prototype.containPixel=function(t,o){var r;if(!this._disposed)return N(wh(this._model,t),function(t,i){0<=i.indexOf("Models")&&N(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?r=r||!!n.containPoint(o):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(r=r||e.containPoint(o,t))},this)},this),!!r;u_(this.id)},i_.prototype.getVisual=function(t,e){var n=wh(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?Zm(t,n,e):jm(t,e)},i_.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},i_.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},i_.prototype._initEvents=function(){var t,e,n,s=this;xx(l_,function(a){function t(t){var n,e,i=s.getModel(),o=t.target,r="globalout"===a;r?n={}:o&&rx(o,function(t){var e=Wh(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=O({},e.eventData),1)},!0),n&&(e=n.componentType,r=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",r=n.seriesIndex),r=(e=e&&null!=r&&i.getComponent(e,r))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:e,view:r},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),xx(c_,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),xx(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(Dv("map","selectchanged",e,n,t),Dv("pie","selectchanged",e,n,t)):"select"===t.fromAction?(Dv("map","selected",e,n,t),Dv("pie","selected",e,n,t)):"unselect"===t.fromAction&&(Dv("map","unselected",e,n,t),Dv("pie","unselected",e,n,t))})},i_.prototype.isDisposed=function(){return this._disposed},i_.prototype.clear=function(){this._disposed?u_(this.id):this.setOption({series:[]},!0)},i_.prototype.dispose=function(){var e,n;this._disposed?u_(this.id):(this._disposed=!0,Th(this.getDom(),S_,""),e=this._api,n=this._model,xx(this._componentsViews,function(t){t.dispose(n,e)}),xx(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete x_[this.id])},i_.prototype.resize=function(t){var e;this._disposed?u_(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[Sx]=!0,e&&Rx(this),zx.update.call(this,{type:"resize",animation:{duration:0}}),this[Sx]=!1,Gx.call(this,t),Hx.call(this,t)))},i_.prototype.showLoading=function(t,e){this._disposed?u_(this.id):(bx(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),v_[t]&&(t=v_[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},i_.prototype.hideLoading=function(){this._disposed?u_(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},i_.prototype.makeActionFromEvent=function(t){var e=O({},t);return e.type=c_[t.type],e},i_.prototype.dispatchAction=function(t,e){var n;this._disposed?u_(this.id):(bx(e)||(e={silent:!!e}),h_[t.type]&&this._model&&(this[Sx]?this._pendingActions.push(t):(n=e.silent,Fx.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),Gx.call(this,n),Hx.call(this,n))))},i_.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},i_.prototype.appendData=function(t){var e;this._disposed?u_(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},i_.internalField=(Rx=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Nx(t,!0),Nx(t,!1),e.plan()},Nx=function(t,o){for(var r=t._model,a=t._scheduler,s=o?t._componentsViews:t._chartsViews,l=o?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},qx=function(e,n){xx(g_,function(t){t(e,n)})},Qx=function(t){t[Ix]=!0,t.getZr().wakeUp()},t_=function(t){t[Ix]&&(t.getZr().storage.traverse(function(t){ip(t)||o_(t)}),t[Ix]=!1)},Kx=function(n){return l(t,e=Hf),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){bc(t,e),Qx(n)},t.prototype.leaveEmphasis=function(t,e){wc(t,e),Qx(n)},t.prototype.enterBlur=function(t){Sc(t),Qx(n)},t.prototype.leaveBlur=function(t){Mc(t),Qx(n)},t.prototype.enterSelect=function(t){Ic(t),Qx(n)},t.prototype.leaveSelect=function(t){Tc(t),Qx(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},$x=function(i){function o(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||$_(this,d))}this._rawCount=this._count=s,this._extent={},X_(this)},fb.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,o=this._storage,r=this.dimensions,a=r.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===hf,p=0;p_[1]&&(_[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=gh(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=gh(v,null))),this._dontMakeIdFromName||$_(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},X_(this)}},fb.prototype.count=function(){return this._count},fb.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){o=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return r;o=r-1}}return-1},fb.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],o=[];if(!i)return o;null==n&&(n=1/0);for(var r=1/0,a=-1,s=0,l=0,u=this.count();lt[I][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return lx[1]&&(x[1]=v)}}}return t},fb.prototype.downSample=function(t,e,n,i){for(var o=Q_(this,[t]),r=o._storage,a=[],s=ob(1/e),l=r[t],u=this.count(),h=o._rawExtent[t],c=new(Y_(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return o._count=p,o._indices=c,o.getRawIndex=j_,o},fb.prototype.lttbDownSample=function(t,e){var n,i=Q_(this,[]),o=i._storage[t],r=this.count(),a=new(Y_(this))(r),s=0,l=ob(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;he[1]&&(e[1]=t[1])},Cb.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Cb.prototype.getExtent=function(){return this._extent.slice()},Cb.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},Cb.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},Cb.prototype.isBlank=function(){return this._isBlank},Cb.prototype.setBlank=function(t){this._isBlank=t},Cb);function Cb(t){this._setting=t||{},this._extent=[1/0,-1/0]}Bh(Tb,{registerWhenExtend:!0});var Db=(Ab.createByAxisModel=function(t){var e=t.option,t=e.data,t=t&&P(t,Lb);return new Ab({categories:t,needCollect:!t,deduplication:!1!==e.dedplication})},Ab.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},Ab.prototype.parseAndCollect=function(t){var e=this._needCollect;if("string"!=typeof t&&!e)return t;if(e&&!this._deduplication)return n=this.categories.length,this.categories[n]=t,n;var n,i=this._getOrCreateMap();return null==(n=i.get(t))&&(e?(n=this.categories.length,this.categories[n]=t,i.set(t,n)):n=NaN),n},Ab.prototype._getOrCreateMap=function(){return this._map||(this._map=ct(this.categories))},Ab);function Ab(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}function Lb(t){return Y(t)&&null!=t.value?t.value:t+""}var kb=Eu;function Pb(t,e,n,i){var o={},r=t[1]-t[0],e=o.interval=qu(r/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),o}function Ob(t){return Vu(t)+2}function Rb(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Nb(t,e){return t>=e[0]&&t<=e[1]}function Eb(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function zb(t,e){return t*(e[1]-e[0])+e[0]}var Bb,Vb=(l(Fb,Bb=Tb),Fb.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},Fb.prototype.contain=function(t){return Nb(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},Fb.prototype.normalize=function(t){return Eb(t=this.getCategoryIndex(this.parse(t)),this._extent)},Fb.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(zb(t,this._extent))},Fb.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},Fb.prototype.getMinorTicks=function(t){},Fb.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},Fb.prototype.getCategorySortInfo=function(){return this._categorySortInfo},Fb.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},Fb.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},Fb.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},Fb.prototype.count=function(){return this._extent[1]-this._extent[0]+1},Fb.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Fb.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},Fb.prototype.getOrdinalMeta=function(){return this._ordinalMeta},Fb.prototype.niceTicks=function(){},Fb.prototype.niceExtent=function(){},Fb.type="ordinal",Fb);function Fb(t){var e=Bb.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return F(t=t||new Db({}))&&(t=new Db({categories:P(t,function(t){return Y(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}Tb.registerClass(Vb);var Gb,Hb=Eu,Wb=(l(Xb,Gb=Tb),Xb.prototype.parse=function(t){return t},Xb.prototype.contain=function(t){return Nb(t,this._extent)},Xb.prototype.normalize=function(t){return Eb(t,this._extent)},Xb.prototype.scale=function(t){return zb(t,this._extent)},Xb.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},Xb.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},Xb.prototype.getInterval=function(){return this._interval},Xb.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Ob(t)},Xb.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=[];if(!e)return r;n[0]s&&(t?r.push({value:Hb(s+e,o)}):r.push({value:n[1]})),r},Xb.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),o=1;oi[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=aw.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[o][1]e[1]&&(e[1]=t[1])})}var Ew=(zw.prototype.getNeedCrossZero=function(){return!this.option.scale},zw.prototype.getCoordSysModel=function(){},zw);function zw(){}Op={isDimensionStacked:Sb,enableDataStack:wb,getStackedDimension:Mb};var Ea=Object.freeze({__proto__:null,createList:function(t){return Ib(t.getSource(),t)},getLayoutRect:Yd,dataStack:Op,createScale:function(t,e){var n=e;return e instanceof Fp||(n=new Fp(e)),(e=Dw(n)).setExtent(t[0],t[1]),Cw(e,n),e},mixinAxisModelCommonMethods:function(t){I(t,Ew)},getECData:Wh,createDimensions:vb,createSymbol:px}),Bw=1e-8;function Vw(t,e){return Math.abs(t-e)>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l),o=s+=o,r=l+=r;i.push([s/n,l/n])}return i}function Xw(t,o){return P(R((t=function(t){if(!t.UTF8Encoding)return t;var e=(t=t).UTF8Scale;null==e&&(e=1024);for(var n=t.features,i=0;ia[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],r.coord)&&(i?r.coord=a[1]:e.pop());i&&u(r.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=Eu(t),e=Eu(e),l?e":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},lS=(uS.prototype.evaluate=function(t){var e=typeof t;return"string"==e?this._condVal.test(t):"number"==e&&this._condVal.test(t+"")},uS);function uS(t){null==(this._condVal=H(t)?new RegExp(t):$(t)?t:null)&&rh("")}var hS=(cS.prototype.evaluate=function(){return this.value},cS);function cS(){}var pS=(dS.prototype.evaluate=function(){for(var t=this.children,e=0;ei)return!1;return!0}(n,e))){var o=e.mapDimension(n.dim),r={};return N(n.getViewLabels(),function(t){r[t.tickValue]=1}),function(t){return!r.hasOwnProperty(e.get(o,t))}}}}function dM(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";N(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Va(0,0,0,0,l,!0);return l[r]=c,l[r+"2"]=e,l}}}(a,o)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(A(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Rc(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;nl[1]?-1:1,r=["start"===u?l[0]-r*s:"end"===u?l[1]+r*s:(l[0]+l[1])/2,RM(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*DM/180),RM(u)?c=AM.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var o,t=Wu(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=Xu(t-DM/2)?(o=i?"bottom":"top","center"):Xu(t-1.5*DM)?(o=i?"top":"bottom","center"):(o="middle",t<1.5*DM&&DM/2l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),ot[1]&&(t[1]=e)}qy.registerClass(nI),qy.registerClass(vm),D_(zm.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=ct();return t.eachSeries(function(t){YM(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,T,n=[],i=ct();l=i,u=n,t.eachSeries(function(t){var e,n,i,o,r,a,s;YM(t)&&(e=(s=UM(t)).xAxisModel,n=s.yAxisModel,i=e.axis,o=n.axis,r=i.scale.rawExtentInfo,a=o.scale.rawExtentInfo,s=t.getData(),r&&r.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),Nw(aI(l,e).condExtent,s,i.dim),Nw(aI(l,n).condExtent,s,o.dim)))}),T=i,N(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,o=n.axis,r=aI(T,e),a=aI(T,n);r.rawExtentInfo=Mw(i.scale,e,r.condExtent),a.rawExtentInfo=Mw(o.scale,n,a.condExtent),r.rawExtentResult=r.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]e[1]&&e.reverse(),e},bI.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},bI.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},bI);function bI(t,e,n,i,o){n=xI.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=o||"bottom",n}wI.prototype.getRect=function(){return this._rect},wI.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),N(n.x,function(t){Cw(t.scale,t.model)}),N(n.y,function(t){Cw(t.scale,t.model)});var i={};N(n.x,function(t){MI(n,"y",t,i)}),N(n.y,function(t){MI(n,"x",t,i)}),this.resize(this.model,e)},wI.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=Yd(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var o=this._axesList;function r(){N(o,function(t){var e,n,i=t.isHorizontal(),o=i?[0,a.width]:[0,a.height],r=t.inverse?1:0;t.setExtent(o[r],o[1-r]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}r(),t&&(N(o,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=kw(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),r()),N(this._coordsList,function(t){t.calcAffineTransform()})},wI.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},wI.prototype.getAxes=function(){return this._axesList.slice()},wI.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}Y(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,o=this._coordsList;ih?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(r=(o=e.label.x-u-e.len2*p)<(r=c+e.len)?Math.sqrt(i*i/(1-o*o/r/r)):r,n.rB=r,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},dT.type="pie",dT);function dT(){var t=null!==pT&&pT.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}tm.registerClass(af);var fT=2*Math.PI,gT=Math.PI/180;function yT(t){return{seriesType:t,reset:function(t,e){var i,o=e.findComponents({mainType:"legend"});o&&o.length&&(i=t.getData()).filterSelf(function(t){for(var e=i.getName(t),n=0;nn[0]&&isFinite(u)&&isFinite(n[0]););else{i=o.getTicks().length-1;he&&(e=i.height)}this.height=e+1},ZC.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;er&&(r=t.depth)});var a=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:r;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),o.data},JC.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},JC.prototype.setZoom=function(t){this.option.zoom=t},JC.prototype.setCenter=function(t){this.option.center=t},JC.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,o=i.root.children[0],r=i.getNodeByDataIndex(t),t=r.getValue(),a=r.name;r&&r!==o;)a=r.parentNode.name+"."+a,r=r.parentNode;return Iy("nameValue",{name:a,value:t,noValue:isNaN(t)||null==t})},JC.type="series.tree",JC.layoutMode="box",JC.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},JC);function JC(){var t=null!==$C&&$C.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}function QC(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,o=t.hierNode.i?i[t.hierNode.i-1]:null;n.length?(function(t){var e=t.children,n=e.length,i=0,o=0;for(;0<=--n;){var r=e[n];r.hierNode.prelim+=i,r.hierNode.modifier+=i,o+=r.hierNode.change,i+=r.hierNode.shift+o}}(t),n=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2,o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-n):t.hierNode.prelim=n):o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o)),t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var o=t,r=t,a=r.parentNode.children[0],s=e,l=o.hierNode.modifier,u=r.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;s=iD(s),r=oD(r),s&&r;){o=iD(o),a=oD(a),o.hierNode.ancestor=t;var p=s.hierNode.prelim+c-r.hierNode.prelim-u+i(s,r);0p.x)||(u-=Math.PI)),r=t?"left":"right",p=(m=(y=s.getModel("label")).get("rotate"))*(Math.PI/180),(t=l.getTextContent())&&(l.setTextConfig({position:y.get("position")||r,rotation:null==m?-u:p,origin:"center"}),t.setStyle("verticalAlign","middle")));s=s.get(["emphasis","focus"]),s="ancestor"===s?a.getAncestorsIndices():"descendant"===s?a.getDescendantIndices():null;s&&(Wh(i).focus=s),function(t,e,n,i,o,r,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),p=t.get(["lineStyle","curveness"]),d=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&Jc(g=g||(i.__edge=new Nl({shape:gD(h,c,p,o,o)})),{shape:gD(h,c,p,r,a)},t);else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,m=[],v=0;vl.getLayout().x&&(l=t),t.depth>u.depth&&(u=t)}),a=s===l?1:a(s,l)/2,h=a-s.getLayout().x,f=d=p=c=0,"radial"===i?(c=o/(l.getLayout().x+a+h),p=r/(u.depth-1||1),yD(n,function(t){d=(t.getLayout().x+h)*c,f=(t.depth-1)*p;var e=nD(d,f);t.setLayout({x:e.x,y:e.y,rawX:d,rawY:f},!0)})):"RL"===(g=t.getOrient())||"LR"===g?(p=r/(l.getLayout().x+a+h),c=o/(u.depth-1||1),yD(n,function(t){f=(t.getLayout().x+h)*p,d="LR"===g?(t.depth-1)*c:o-(t.depth-1)*c,t.setLayout({x:d,y:f},!0)})):"TB"!==g&&"BT"!==g||(c=o/(l.getLayout().x+a+h),p=r/(u.depth-1||1),yD(n,function(t){d=(t.getLayout().x+h)*c,f="TB"===g?(t.depth-1)*p:r-(t.depth-1)*p,t.setLayout({x:d,y:f},!0)})))}}(t,e)})}),P_(function(t){t.eachSeriesByType("tree",function(t){var n=t.getData();n.tree.eachNode(function(t){var e=t.getModel().getModel("itemStyle").getItemStyle();O(n.ensureUniqueItemVisual(t.dataIndex,"style"),e)})})});var wD,nd=(l(SD,wD=Fy),SD.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};!function e(t){var n=0;N(t.children,function(t){e(t);var t=t.value;F(t)&&(t=t[0]),n+=t});var i=t.value;F(i)&&(i=i[0]);null!=i&&!isNaN(i)||(i=n);i<0&&(i=0);F(t.value)?t.value[0]=i:t.value=i}(n);var i=t.levels||[],o=this.designatedVisualItemStyle={},r=new Fp({itemStyle:o},this,e),a=P((i=t.levels=function(t,e){var i,o,n=lh(e.get("color")),r=lh(e.get("decals"));if(!n)return;N(t=t||[],function(t){var e=new Fp(t),n=e.get("color"),t=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(i=!0),(e.get(["itemStyle","decal"])||t&&"none"!==t)&&(o=!0)});e=t[0]||(t[0]={});i||(e.color=n.slice());!o&&r&&(e.decal=r.slice());return t}(i,e))||[],function(t){return new Fp(t,r,e)},this),s=jC.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){e=s.getNodeByDataIndex(e),e=a[e.depth];return t.parentModel=e||r,t})});return s.data},SD.prototype.optionUpdated=function(){this.resetViewRoot()},SD.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t);return Iy("nameValue",{name:i.getName(t),value:o})},SD.prototype.getDataParams=function(t){var e=wD.prototype.getDataParams.apply(this,arguments),t=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=_D(t,this),e},SD.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},O(this.layoutInfo,t)},SD.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=ct(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},SD.prototype.getViewRoot=function(){return this._viewRoot},SD.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},SD.prototype.enableAriaDecal=function(){bD(this)},SD.type="series.treemap",SD.layoutMode="box",SD.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},SD);function SD(){var t=null!==wD&&wD.apply(this,arguments)||this;return t.type=SD.type,t.preventUsingHoverLayer=!0,t}Fy.registerClass(nd);var MD=5,ID=(TD.prototype.render=function(t,e,n,i){var o,r,a=t.getModel("breadcrumb"),s=this.group;s.removeAll(),a.get("show")&&n&&(r=(o=a.getModel("itemStyle")).getModel("textStyle"),a={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},this._prepare(n,a,r),this._renderContent(t,a,o,r,i),Ud(s,a.pos,a.box))},TD.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var o=gh(i.getModel().get("name"),""),r=n.getTextRect(o),r=Math.max(r.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:i,text:o,width:r})}},TD.prototype._renderContent=function(t,e,n,i,o){for(var r,a,s,l,u,h,c,p,d,f,g,y,m,v=0,x=e.emptyItemWidth,_=t.get(["breadcrumb","height"]),b=(r=e.pos,a=e.box,l=a.width,u=a.height,h=Nu(r.left,l),c=Nu(r.top,u),p=Nu(r.right,l),a=Nu(r.bottom,u),(isNaN(h)||isNaN(parseFloat(r.left)))&&(h=0),(isNaN(p)||isNaN(parseFloat(r.right)))&&(p=l),(isNaN(c)||isNaN(parseFloat(r.top)))&&(c=0),(isNaN(a)||isNaN(parseFloat(r.bottom)))&&(a=u),s=Cd(s||0),{width:Math.max(p-h-s[1]-s[3],0),height:Math.max(a-c-s[0]-s[2],0)}),w=e.totalWidth,S=e.renderList,M=S.length-1;0<=M;M--){var I=S[M],T=I.node,C=I.width,D=I.text;b.width=i.length||t===i[t.depth])&&(e=fA(r,u,t,e,d,o),n(t,e,i,o))})):(p=hA(u),h.fill=p)}}(e,{},t.getViewRoot().getAncestors(),t)}};function uA(n,i,t){var o=O({},i),r=t.designatedVisualItemStyle;return N(["color","colorAlpha","colorSaturation"],function(t){r[t]=i[t];var e=n.get(t);(r[t]=null)!=e&&(o[t]=e)}),o}function hA(t){var e=cA(t,"color");if(e){var n=cA(t,"colorAlpha"),t=cA(t,"colorSaturation");return t&&(e=cn(e,null,null,t)),n&&(e=pn(e,n)),e}}function cA(t,e){e=t[e];if(null!=e&&"none"!==e)return e}function pA(t,e,n,i,o,r){if(r&&r.length){var a=dA(e,"color")||null!=o.color&&"none"!==o.color&&(dA(e,"colorAlpha")||dA(e,"colorSaturation"));if(a){r=e.get("visualMin"),o=e.get("visualMax"),n=n.dataExtent.slice();null!=r&&rn[1]&&(n[1]=o);e=e.get("colorMappingBy"),a={type:a.name,dataExtent:n,visual:a.range};"color"!==a.type||"index"!==e&&"id"!==e?a.mappingMethod="linear":(a.mappingMethod="category",a.loop=!0);a=new jD(a);return lA(a).drColorMappingBy=e,a}}}function dA(t,e){t=t.get(e);return F(t)&&t.length?{name:e,range:t}:null}function fA(t,e,n,i,o,r){var a,s=O({},e);return o&&(t="index"===(e="color"===(a=o.type)&&lA(o).drColorMappingBy)?i:"id"===e?r.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension")),s[a]=o.mapValueToVisual(t)),s}var gA=Math.max,yA=Math.min,mA=Q,vA=N,xA=["itemStyle","borderWidth"],_A=["itemStyle","gapWidth"],bA=["upperLabel","show"],wA=["upperLabel","height"],af={seriesType:"treemap",reset:function(t,e,n,i){var o,r=n.getWidth(),a=n.getHeight(),s=t.option,l=Yd(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),u=s.size||[],h=Nu(mA(l.width,u[0]),r),c=Nu(mA(l.height,u[1]),a),n=i&&i.type,u=mD(i,["treemapZoomToNode","treemapRootToNode"],t),i="treemapRender"===n||"treemapMove"===n?i.rootRect:null,p=t.getViewRoot(),d=vD(p);"treemapMove"!==n&&(c="treemapZoomToNode"===n?function(t,e,n,i,o){var r,a=(e||{}).node,s=[i,o];if(!a||a===n)return s;var n=i*o,l=n*t.option.zoomToNodeRatio;for(;r=a.parentNode;){for(var u=0,h=r.children,c=0,p=h.length;ca[1]&&(a[1]=t)})):a=[NaN,NaN];return{sum:i,dataExtent:a}}(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,n,i,o){if(!i)return n;for(var r=t.get("visibleMin"),a=o.length,s=a,l=a-1;0<=l;l--){var u=o["asc"===i?a-l-1:l].getValue();u/n*en[l[a]])&&(h=n[l[a]]);for(var c=0,p=t.length;c "+p)),u++)}var d,i=n.get("coordinateSystem");"cartesian2d"===i||"polar"===i?d=Ib(t,n):(L(i=(i=Yf.get(i))&&i.dimensions||[],"value")<0&&i.concat(["value"]),i=vb(t,{coordDimensions:i}),(d=new db(i,n)).initData(t));n=new db(["value"],n);return n.initData(l,s),o&&o(d,n),BC({mainData:d,struct:r,structAttr:"graph",datas:{node:d,edge:n},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}I(LA,RA("hostGraph","data")),I(PA,RA("hostGraph","edgeData"));var EA="--\x3e",zA=function(t){return t.get("autoCurveness")||null},BA=function(t,e){var n=zA(t),i=20,o=[];if("number"==typeof n)i=n;else if(F(n))return void(t.__curvenessList=n);i "),value:e.value,noValue:null==e.value})},UA.prototype._updateCategoriesData=function(){var t=P(this.option.categories||[],function(t){return null!=t.value?t:O({value:0},t)}),e=new db(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},UA.prototype.setZoom=function(t){this.option.zoom=t},UA.prototype.setCenter=function(t){this.option.center=t},UA.prototype.isAnimationEnabled=function(){return YA.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},UA.type="series.graph",UA.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},UA);function UA(){var t=null!==YA&&YA.apply(this,arguments)||this;return t.type=UA.type,t.hasSymbolVisual=!0,t}Fy.registerClass(nd);var ZA,jA=Ma.prototype,qA=Nl.prototype,KA=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};l($A,ZA=KA);function $A(){return null!==ZA&&ZA.apply(this,arguments)||this}function JA(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var QA,tL=(l(eL,QA=Dr),eL.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},eL.prototype.getDefaultShape=function(){return new KA},eL.prototype.buildPath=function(t,e){(JA(e)?jA:qA).buildPath.call(this,t,e)},eL.prototype.pointAt=function(t){return(JA(this.shape)?jA:qA).pointAt.call(this,t)},eL.prototype.tangentAt=function(t){var e=this.shape,t=JA(e)?[e.x2-e.x1,e.y2-e.y1]:qA.tangentAt.call(this,t);return Ct(t,t)},eL);function eL(t){t=QA.call(this,t)||this;return t.type="ec-line",t}var nL=["fromSymbol","toSymbol"];function iL(t){return"_"+t+"Type"}function oL(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),n=e.getItemVisual(n,t+"Rotate"),o=F(o)?o:[o,o],o=px(i,-o[0]/2,-o[1]/2,o[0],o[1]);return o.__specifiedRotation=null==n||isNaN(n)?void 0:+n*Math.PI/180||0,o.name=t,o}}function rL(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;e=e[2];e?(t.cpx1=e[0],t.cpy1=e[1]):(t.cpx1=NaN,t.cpy1=NaN)}var aL,sL=(l(lL,aL=$r),lL.prototype._createLine=function(n,i,t){var e,o=n.hostModel,r=n.getItemLayout(i),r=(e=r,rL((r=new tL({name:"line",subPixelOptimize:!0})).shape,e),r);r.shape.percent=0,Qc(r,{shape:{percent:1}},o,i),this.add(r),N(nL,function(t){var e=oL(t,n,i);this.add(e),this[iL(t)]=n.getItemVisual(i,t)},this),this._updateCommonStl(n,i,t)},lL.prototype.updateData=function(i,o,t){var e=i.hostModel,n=this.childOfName("line"),r=i.getItemLayout(o),a={shape:{}};rL(a.shape,r),Jc(n,a,e,o),N(nL,function(t){var e=i.getItemVisual(o,t),n=iL(t);this[n]!==e&&(this.remove(this.childOfName(t)),t=oL(t,i,o),this.add(t)),this[n]=e},this),this._updateCommonStl(i,o,t)},lL.prototype.getLinePath=function(){return this.childAt(0)},lL.prototype._updateCommonStl=function(n,t,e){var i=n.hostModel,r=this.childOfName("line"),o=e&&e.emphasisLineStyle,a=e&&e.blurLineStyle,s=e&&e.selectLineStyle,l=e&&e.labelStatesModels;e&&!n.hasItemOption||(o=(e=n.getItemModel(t)).getModel(["emphasis","lineStyle"]).getLineStyle(),a=e.getModel(["blur","lineStyle"]).getLineStyle(),s=e.getModel(["select","lineStyle"]).getLineStyle(),l=vp(e));var u=n.getItemVisual(t,"style"),h=u.stroke;r.useStyle(u),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,N(nL,function(t){var e=this.childOfName(t);if(e){e.setColor(h),e.style.opacity=u.opacity;for(var n=0;n=t&&(0===e?0:i[e-1][0])r&&(e[1-i]=e[i]+n.sign*r),e}function ik(t,e){t=t[e]-t[1-e];return{span:Math.abs(t),sign:0o*(1-t[0])?(l="jump",a=s-o*(1-t[2])):0<=(a=s-o*t[1])&&(a=s-o*(1-t[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?nk(a,i,r,"all"):l="none"):(a=i[1]-i[0],(i=[sk(0,r[1]*s/a-a/2)])[1]=ak(r[1],i[0]+a),i[0]=i[1]-a),{axisExpandWindow:i,behavior:l}},dk);function dk(t,e,n){this.type="parallel",this._axesMap=ct(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}function fk(t,e){return ak(sk(t,e[0]),e[1])}Yf.register("parallel",{create:function(i,o){var r=[];return i.eachComponent("parallel",function(t,e){var n=new pk(t,i,o);n.name="parallel_"+e,n.resize(t,o),(t.coordinateSystem=n).model=t,r.push(n)}),i.eachSeries(function(t){var e;"parallel"===t.get("coordinateSystem")&&(e=t.getReferringComponents("parallel",Sh).models[0],t.coordinateSystem=e.coordinateSystem)}),r}});var gk,nd=(l(yk,gk=nf),yk.prototype.getAreaSelectStyle=function(){return Vh([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},yk.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=C(t);if(e)for(var n=e.length-1;0<=n;n--)zu(e[n])},yk.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,o=e.length;it.getWidth()||n<0||n>t.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=Fk(t,e,n);if(!t._dragging)for(var a=0;ad&&(d=y.depth),g.setLayout({depth:m?y.depth:c},!0),"vertical"===r?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;v ")})},WO.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},WO.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},WO.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},WO.type="series.lines",WO.dependencies=["grid","polar","geo","calendar"],WO.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},WO);function WO(){var t=null!==HO&&HO.apply(this,arguments)||this;return t.type=WO.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}Fy.registerClass(nd);var XO,YO=(l(UO,XO=$r),UO.prototype.createLine=function(t,e,n){return new sL(t,e,n)},UO.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),i=n.get("symbolSize"),o=n.get("symbol");F(i)||(i=[i,i]);var r=t.getItemVisual(e,"style"),a=n.get("color")||r&&r.stroke,r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=px(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(n.getItemStyle(["color"])),r.scaleX=i[0],r.scaleY=i[1],r.setColor(a),this._symbolType=o,this._symbolScale=i,this._updateEffectAnimation(t,n,e))},UO.prototype._updateEffectAnimation=function(e,t,n){var i,o,r,a,s,l=this.childAt(1);l&&(i=this,o=e.getItemLayout(n),r=1e3*t.get("period"),a=t.get("loop"),s=t.get("constantSpeed"),t=Q(t.get("delay"),function(t){return t/e.count()*r/3}),l.ignore=!0,this._updateAnimationPoints(l,o),0e);a++);a=Math.min(a-1,o-2)}var s=(e-i[a])/(i[a+1]-i[a]),r=n[a],n=n[a+1];t.x=r[0]*(1-s)+s*n[0],t.y=r[1]*(1-s)+s*n[1];s=n[0]-r[0],r=n[1]-r[1];t.rotation=-Math.atan2(r,s)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=e,t.ignore=!1}},JO);function JO(){var t=null!==KO&&KO.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}var QO,tR=function(){this.polyline=!1,this.curveness=0,this.segs=[]},eR=(l(nR,QO=Dr),nR.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},nR.prototype.getDefaultShape=function(){return new tR},nR.prototype.buildPath=function(t,e){var n=e.segs,i=e.curveness;if(e.polyline)for(var o=0;os[1]||Il[1])continue;I=c.dataToPoint([M,I]),w=new ga({shape:{x:Math.floor(Math.round(I[0])-r/2),y:Math.floor(Math.round(I[1])-a/2),width:Math.ceil(r),height:Math.ceil(a)},style:S})}else{if(isNaN(d.get(_[1],b)))continue;w=new ga({z2:1,shape:c.dataToRect([d.get(_[0],b)]).contentShape,style:S})}I=d.getItemModel(b);d.hasItemOption&&(f=(T=I.getModel("emphasis")).getModel("itemStyle").getItemStyle(),g=I.getModel(["blur","itemStyle"]).getItemStyle(),y=I.getModel(["select","itemStyle"]).getItemStyle(),v=T.get("focus"),x=T.get("blurScope"),m=vp(I));var T=t.getRawValue(b),I="-";T&&null!=T[2]&&(I=T[2]+""),mp(w,m,{labelFetcher:t,labelDataIndex:b,defaultOpacity:S.opacity,defaultText:I}),w.ensureState("emphasis").style=f,w.ensureState("blur").style=g,w.ensureState("select").style=y,Lc(w,v,x),(w.incremental=o)&&(w.states.emphasis.hoverLayer=!0),p.add(w),d.setItemGraphicEl(b,w)}},fR.prototype._renderOnGeo=function(i,t,e,n){var o=e.targetVisuals.inRange,r=e.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new cR;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=i.getViewRect().clone(),u=i.getRoamTransform();l.applyTransform(u);var h,c,p,d,f,g,y,m=Math.max(l.x,0),v=Math.max(l.y,0),x=Math.min(l.width+l.x,n.getWidth()),t=Math.min(l.height+l.y,n.getHeight()),u=x-m,l=t-v,n=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],x=a.mapArray(n,function(t,e,n){e=i.dataToPoint([t,e]);return e[0]-=m,e[1]-=v,e.push(n),e}),t=e.getExtent(),e="visualMap.continuous"===e.type?(a=t,y=e.option.range,n=a[1]-a[0],y=[(y[0]-a[0])/n,(y[1]-a[0])/n],function(t){return t>=y[0]&&t<=y[1]}):(h=t,c=e.getPieceList(),p=e.option.selected,d=h[1]-h[0],f=(c=P(c,function(t){return{interval:[(t.interval[0]-h[0])/d,(t.interval[1]-h[0])/d]}})).length,g=0,function(t){for(var e,n=g;n=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},WR.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},WR.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[o]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-o]=0==o?n.y+n.height/2:n.x+n.width/2,i},WR.prototype.convertToPixel=function(t,e,n){return XR(e)===this?this.dataToPoint(n):null},WR.prototype.convertFromPixel=function(t,e,n){return XR(e)===this?this.pointToData(n):null},WR);function WR(t,e,n){this.type="single",this.dimension="single",this.dimensions=["single"],this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}function XR(t){var e=t.seriesModel,t=t.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function YR(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,o={},r=i.position,a=i.orient,i=n.getRect(),n=[i.x,i.x+i.width,i.y,i.y+i.height],i={horizontal:{top:n[2],bottom:n[3]},vertical:{left:n[0],right:n[1]}};o.position=["vertical"===a?i.vertical[r]:n[0],"horizontal"===a?i.horizontal[r]:n[3]];o.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Q(e.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);e=e.rotate;return null==e&&(e=t.get(["axisLabel","rotate"])),o.labelRotation="top"===r?-e:e,o.z2=1,o}Yf.register("single",{create:function(i,o){var r=[];return i.eachComponent("singleAxis",function(t,e){var n=new HR(t,i,o);n.name="single_"+e,n.resize(t,o),t.coordinateSystem=n,r.push(n)}),i.eachSeries(function(t){var e;"singleAxis"===t.get("coordinateSystem")&&(e=t.getReferringComponents("singleAxis",Sh).models[0],t.coordinateSystem=e&&e.coordinateSystem)}),r},dimensions:HR.prototype.dimensions});var UR,ZR=["axisLine","axisTickLabel","axisName"],jR=["splitArea","splitLine"],vm=(l(qR,UR=Op),qR.prototype.render=function(e,t,n,i){var o=this.group;o.removeAll();var r=this._axisGroup;this._axisGroup=new $r;var a=YR(e),a=new AM(e,a);N(ZR,a.add,a),o.add(this._axisGroup),o.add(a.getGroup()),N(jR,function(t){e.get([t,"show"])&&KR[t](this,this.group,this._axisGroup,e)},this),lp(r,this._axisGroup,e),UR.prototype.render.call(this,e,t,n,i)},qR.prototype.remove=function(){qM(this)},qR.type="singleAxis",qR);function qR(){var t=null!==UR&&UR.apply(this,arguments)||this;return t.type=qR.type,t.axisPointerClass="SingleAxisPointer",t}var KR={splitLine:function(t,e,n,i){var o=i.axis;if(!o.scale.isBlank()){for(var r=i.getModel("splitLine"),a=r.getModel("lineStyle"),s=(s=a.get("color"))instanceof Array?s:[s],l=i.coordinateSystem.getRect(),u=o.isHorizontal(),h=[],c=0,p=o.getTicksCoords({tickModel:r}),d=[],f=[],g=0;gn)return!0;if(e){t=BM(t).seriesDataCount,i=i.getExtent();return Math.abs(i[0]-i[1])/t>n}return!1},mN.prototype.makeElOption=function(t,e,n,i,o){},mN.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;o&&(e=fN(t).pointerEl=new dp[o.type](gN(e.pointer)),t.add(e))},mN.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=fN(t).labelEl=new vl(gN(e.label)),t.add(e),xN(e,i))},mN.prototype.updatePointerEl=function(t,e,n){t=fN(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},mN.prototype.updateLabelEl=function(t,e,n,i){t=fN(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),xN(t,i))},mN.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),o=this._handle,r=n.getModel("handle"),a=n.get("status");if(!r.get("show")||!a||"hide"===a)return o&&i.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=hp(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){ie(t.event)},onmousedown:yN(this._onHandleDragMove,this,0,0),drift:yN(this._onHandleDragMove,this),ondragend:yN(this._onHandleDragEnd,this)}),i.add(o)),bN(o,n,!1),o.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));n=r.get("size");F(n)||(n=[n,n]),o.scaleX=n[0]/2,o.scaleY=n[1]/2,cm(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},mN.prototype._moveHandleToValue=function(t,e){vN(this._axisPointerModel,!e&&this._moveAnimation,this._handle,_N(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},mN.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,e=this.updateHandleTransform(_N(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=e,n.stopAnimation(),n.attr(_N(e)),fN(n).lastProp=null,this._doDispatchAxisPointer())},mN.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},mN.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},mN.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,t=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),t&&e.remove(t),this._group=null,this._handle=null,this._payloadInfo=null)},mN.prototype.doClear=function(){},mN.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},mN);function mN(){this._dragging=!1,this.animationThreshold=15}function vN(t,e,n,i){!function n(i,t){{if(Y(i)&&Y(t)){var o=!0;return N(t,function(t,e){o=o&&n(i[e],t)}),!!o}return i===t}}(fN(n).lastProp,i)&&(fN(n).lastProp=i,e?Jc(n,i,t):(n.stopAnimation(),n.attr(i)))}function xN(t,e){t[e.get(["label","show"])?"show":"hide"]()}function _N(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function bN(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)})}function wN(t){var e,n=t.get("type"),t=t.getModel(n+"Style");return"line"===n?(e=t.getLineStyle()).fill=null:"shadow"===n&&((e=t.getAreaStyle()).stroke=null),e}function SN(t,e,n,i,o){var r=MN(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=Cd(a.get("padding")||0),l=a.getFont(),u=Kn(r,l),h=o.position,c=u.width+s[1]+s[3],n=u.height+s[0]+s[2],u=o.align;"right"===u&&(h[0]-=c),"center"===u&&(h[0]-=c/2);u=o.verticalAlign;"bottom"===u&&(h[1]-=n),"middle"===u&&(h[1]-=n/2),o=h,u=c,c=n,i=(n=i).getWidth(),n=n.getHeight(),o[0]=Math.min(o[0]+u,i)-u,o[1]=Math.min(o[1]+c,n)-c,o[0]=Math.max(o[0],0),o[1]=Math.max(o[1],0);o=a.get("backgroundColor");o&&"auto"!==o||(o=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:xp(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:o}),z2:10}}function MN(t,e,n,i,o){t=e.scale.parse(t);var r,a=e.scale.getLabel({value:t},{precision:o.precision}),o=o.formatter;return o&&(r={value:Lw(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},N(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,t=e&&e.getDataParams(t);t&&r.seriesData.push(t)}),H(o)?a=o.replace("{value}",a):G(o)&&(a=o(r))),a}function IN(t,e,n){var i=_e();return Ie(i,i,n.rotation),Me(i,i,n.position),rp([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function TN(t,e,n,i,o,r){var a=AM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),SN(e,i,o,r,{position:IN(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function CN(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function DN(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function AN(t,e,n,i,o,r){return{cx:t,cy:e,r0:n,r:i,startAngle:o,endAngle:r,clockwise:!0}}var LN,af=(l(kN,LN=vm),kN.prototype.makeElOption=function(t,e,n,i,o){var r,a=n.axis,s=a.grid,l=i.get("type"),u=PN(s,a).getOtherAxis(a).getGlobalExtent(),h=a.toGlobalCoord(a.dataToCoord(e,!0));l&&"none"!==l&&(r=wN(i),(u=ON[l](a,h,u)).style=r,t.graphicKey=u.type,t.pointer=u),TN(e,t,XM(s.model,n),n,i,o)},kN.prototype.getHandleTransform=function(t,e,n){var i=XM(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=IN(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},kN.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),n=PN(r,o).getOtherAxis(o).getGlobalExtent(),r="x"===o.dim?0:1,o=[t.x,t.y];o[r]+=e[r],o[r]=Math.min(a[1],o[r]),o[r]=Math.max(a[0],o[r]);n=(n[1]+n[0])/2,n=[n,n];n[r]=o[r];return{x:o[0],y:o[1],rotation:t.rotation,cursorPoint:n,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][r]}},kN);function kN(){return null!==LN&&LN.apply(this,arguments)||this}function PN(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var ON={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:CN([e,n[0]],[e,n[1]],RN(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),o=n[1]-n[0];return{type:"Rect",shape:DN([e-i/2,n[0]],[i,o],RN(t))}}};function RN(t){return"x"===t.dim?0:1}Op.registerAxisPointerClass("CartesianAxisPointer",af);var NN,nd=(l(EN,NN=nf),EN.type="axisPointer",EN.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},EN);function EN(){var t=null!==NN&&NN.apply(this,arguments)||this;return t.type=EN.type,t}nf.registerClass(nd),C_(function(t){var e;t&&(t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={}),(e=t.axisPointer.link)&&!F(e)&&(t.axisPointer.link=[e]))}),D_(zm.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=EM(t,e)}),A_({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||B(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){rN(r)&&(r=QR({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=rN(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||rN(r),p={},d={},o={list:[],map:{}},f={showPointer:V(nN,d),showTooltip:V(iN,o)};N(s.coordSysMap,function(t,e){var o=l||t.containPoint(r);N(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(u,t);c||!o||u&&!i||(null!=(i=i&&i.value)||l||(i=n.pointToData(r)),null!=i&&eN(t,i,f,!1,p))})});var g,y,m={};return N(h,function(n,t){var i=n.linkGroup;i&&!d[t]&&N(i.axesInfo,function(t,e){e=d[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,oN(t),oN(n)))),m[n.key]=e)})}),N(m,function(t,e){eN(h[e],t,f,!0,p)}),g=d,i=h,y=p.axesInfo=[],N(i,function(t,e){var n=t.axisPointerModel.option,e=g[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&y.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),function(t,e,n,i){if(rN(e)||!t.list.length)return i({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(o,r,t,a),function(t,e){var n=e.getZr(),i="axisPointerLastHighlights",o=tN(n)[i]||{},r=tN(n)[i]={};N(t,function(t,e){t=t.axisPointerModel.option;"show"===t.status&&N(t.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var a=[],s=[];N(o,function(t,e){r[e]||s.push(t)}),N(r,function(t,e){o[e]||a.push(t)}),s.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:s}),a.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(h,n),p}});var zN,BN=["x","y"],VN=["width","height"],af=(l(FN,zN=vm),FN.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.coordinateSystem,s=WN(a,1-HN(r)),l=a.dataToPoint(e)[0],u=i.get("type");u&&"none"!==u&&(a=wN(i),(s=GN[u](r,l,s)).style=a,t.graphicKey=s.type,t.pointer=s),TN(e,t,YR(n),n,i,o)},FN.prototype.getHandleTransform=function(t,e,n){var i=YR(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);t=IN(e.axis,t,i);return{x:t[0],y:t[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},FN.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.coordinateSystem,a=HN(o),n=WN(r,a),o=[t.x,t.y];o[a]+=e[a],o[a]=Math.min(n[1],o[a]),o[a]=Math.max(n[0],o[a]);r=WN(r,1-a),r=(r[1]+r[0])/2,r=[r,r];return r[a]=o[a],{x:o[0],y:o[1],rotation:t.rotation,cursorPoint:r,tooltipOption:{verticalAlign:"middle"}}},FN);function FN(){return null!==zN&&zN.apply(this,arguments)||this}var GN={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:CN([e,n[0]],[e,n[1]],HN(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),o=n[1]-n[0];return{type:"Rect",shape:DN([e-i/2,n[0]],[i,o],HN(t))}}};function HN(t){return t.isHorizontal()?0:1}function WN(t,e){t=t.getRect();return[t[BN[e]],t[BN[e]]+t[VN[e]]]}Op.registerAxisPointerClass("SingleAxisPointer",af),N_({type:"single"});var XN,nd=(l(YN,XN=Fy),YN.prototype.init=function(t){XN.prototype.init.apply(this,arguments),this.legendVisualProvider=new tT(B(this.getData,this),B(this.getRawData,this))},YN.prototype.fixData=function(t){var e=t.length,n={},i=Ch(t,function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]}),o=[];i.buckets.each(function(t,e){o.push({name:e,dataList:t})});for(var r=o.length,a=0;aMath.PI/2?"right":"left"):t&&"center"!==t?"left"===t?(r=u.r0+n,h>Math.PI/2&&(t="right")):"right"===t&&(r=u.r-n,h>Math.PI/2&&(t="left")):(r=(u.r+u.r0)/2,t="center"),i.style.align=t,i.style.verticalAlign=y(e,"verticalAlign")||"middle",i.x=r*c+u.cx,i.y=r*p+u.cy;var r=y(e,"rotate"),e=0;"radial"===r?(e=-h)<-Math.PI/2&&(e+=Math.PI):"tangential"===r?(e=Math.PI/2-h)>Math.PI/2?e-=Math.PI:e<-Math.PI/2&&(e+=Math.PI):"number"==typeof r&&(e=r*Math.PI/180),i.rotation=e}),f.dirtyStyle()},QN);function QN(t,e,n,i){var o=$N.call(this)||this;o.z2=2,o.textConfig={inside:!0},Wh(o).seriesIndex=e.seriesIndex;var r=new vl({z2:4,silent:t.getModel().get(["label","silent"])});return o.setTextContent(r),o.updateData(!0,t,e,n,i),o}var tE="sunburstRootToNode";A_({type:tE,update:"updateView"},function(o,t){t.eachComponent({mainType:"series",subType:"sunburst",query:o},function(t,e){var n=mD(o,[tE],t);{var i;n&&((i=t.getViewRoot())&&(o.direction=xD(i,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node))}})});var eE="sunburstHighlight";A_({type:eE,update:"none"},function(e,t,n){e=O({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},function(t){t=mD(e,[eE],t);t&&(e.dataIndex=t.node.dataIndex)}),n.dispatchAction(O(e,{type:"highlight"}))});A_({type:"sunburstUnhighlight",update:"updateView"},function(t,e,n){t=O({},t),n.dispatchAction(O(t,{type:"downplay"}))});var nE,af=(l(iE,nE=tm),iE.prototype.render=function(o,r,a,t){var e=this;this.seriesModel=o,this.api=a,this.ecModel=r;var s=o.getData(),l=s.tree.root,n=o.getViewRoot(),u=this.group,h=o.get("renderLabelForZeroData"),i=[];n.eachNode(function(t){i.push(t)});var c,p,d=this._oldChildren||[];!function(n,i){if(0===n.length&&0===i.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){h||!t||t.getValue()||(t=null);{t!==l&&e!==l&&(e&&e.piece?t?(e.piece.updateData(!1,t,o,r,a),s.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(u.remove(t.piece),t.piece=null)}(e):t&&(e=new JN(t,o,r,a),u.add(e),s.setItemGraphicEl(t.dataIndex,e)))}}(null==t?null:n[t],null==e?null:i[e])}new B_(i,n,t,t).add(e).update(e).remove(V(e,null)).execute()}(i,d),c=l,0<(p=n).depth?(e.virtualPiece?e.virtualPiece.updateData(!1,c,o,r,a):(e.virtualPiece=new JN(c,o,r,a),u.add(e.virtualPiece)),p.piece.off("click"),e.virtualPiece.on("click",function(t){e._rootToNode(p.parentNode)})):e.virtualPiece&&(u.remove(e.virtualPiece),e.virtualPiece=null),this._initEvents(),this._oldChildren=i},iE.prototype._initEvents=function(){var o=this;this.group.off("click"),this.group.on("click",function(n){var i=!1;o.seriesModel.getViewRoot().eachNode(function(t){var e;!i&&t.piece&&t.piece===n.target&&("rootToNode"===(e=t.getModel().get("nodeClick"))?o._rootToNode(t):"link"!==e||(t=(e=t.getModel()).get("link"))&&Bd(t,e.get("target",!0)||"_blank"),i=!0)})})},iE.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:tE,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},iE.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){e=t[0]-n.cx,t=t[1]-n.cy,t=Math.sqrt(e*e+t*t);return t<=n.r&&t>=n.r0}},iE.type="sunburst",iE);function iE(){var t=null!==nE&&nE.apply(this,arguments)||this;return t.type=iE.type,t}tm.registerClass(af);var oE=Math.PI/180;function rE(e,n){if("function"==typeof n){var t=P(e,function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}});return t.sort(function(t,e){return n(t.params,e.params)}),P(t,function(t){return e[t.index]})}var i="asc"===n;return e.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0==n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function aE(i,o){return o=o||[0,0],P(["x","y"],function(t,e){var n=this.getAxis(t),t=o[e],e=i[e]/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(t-e)-n.dataToCoord(t+e))},this)}function sE(r,a){return a=a||[0,0],P([0,1],function(t){var e=a[t],n=r[t]/2,i=[],o=[];return i[t]=e-n,o[t]=e+n,i[1-t]=o[1-t]=a[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(o)[t])},this)}function lE(t,e){var n=this.getAxis(),e=e instanceof Array?e[0]:e,t=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(e-t)-n.dataToCoord(e+t))}function uE(o,r){return r=r||[0,0],P(["Radius","Angle"],function(t,e){var n=this["get"+t+"Axis"](),i=r[e],e=o[e]/2,e="category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-e)-n.dataToCoord(i+e));return"Angle"===t&&(e=e*Math.PI/180),e},this)}k_(V(function(t,e,a){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");F(n)||(n=[0,n]),F(e)||(e=[e,e]);var i=a.getWidth(),o=a.getHeight(),l=Math.min(i,o),u=Nu(e[0],i),h=Nu(e[1],o),c=Nu(n[0],l/2),i=Nu(n[1],l/2),e=-t.get("startAngle")*oE,p=t.get("minAngle")*oE,d=t.getData().tree.root,o=t.getViewRoot(),f=o.depth,n=t.get("sort");null!=n&&!function e(t,n){var i=t.children||[];t.children=rE(i,n);i.length&&N(t.children,function(t){e(t,n)})}(o,n);var r=0;N(o.children,function(t){isNaN(t.getValue())||r++});var g=o.getValue(),y=Math.PI/(g||r)*2,m=0t[1]&&t.reverse(),{coordSys:{type:"polar",cx:i.cx,cy:i.cy,r:t[1],r0:t[0]},api:{coord:function(t){var e=o.dataToRadius(t[0]),n=r.dataToAngle(t[1]),t=i.coordToPoint([e,n]);return t.push(e,n*Math.PI/180),t},size:B(uE,i)}}},calendar:function(n){var t=n.getRect(),e=n.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return n.dataToPoint(t,e)}}}}},af=(l(AE,gE=Fy),AE.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},AE.prototype.getInitialData=function(t,e){return Ib(this.getSource(),this)},AE.prototype.getDataParams=function(t,e,n){e=gE.prototype.getDataParams.call(this,t,e);return n&&(e.info=yE(n).info),e},AE.type="series.custom",AE.dependencies=["grid","polar","geo","singleAxis","calendar"],AE.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},AE);function AE(){var t=null!==gE&&gE.apply(this,arguments)||this;return t.type=AE.type,t}nf.registerClass(af);var LE,nd=(l(kE,LE=tm),kE.prototype.render=function(o,t,r,a){var s,l=this._data,u=o.getData(),h=this.group,c=KE(o,u,t,r),t=o.__transientTransitionOpt;!t||null!=t.from&&null!=t.to?(s=new hz(o,t),e=t?"multiple":"oneToOne",new B_(l?l.getIndices():[],u.getIndices(),PE(l,e,t&&t.from),PE(u,e,t&&t.to),null,e).add(function(t){$E(r,null,t,c(t,a),o,h,u,null)}).remove(function(t){az(l.getItemGraphicEl(t),o,h)}).update(function(t,e){s.reset("oneToOne");e=l.getItemGraphicEl(e);s.findAndAddFrom(e),s.hasFrom()&&(uz(e,h),e=null),$E(r,e,t,c(t,a),o,h,u,s),s.applyMorphing()}).updateManyToOne(function(t,e){s.reset("manyToOne");for(var n=0;ne[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,t=e-this.cy,e=n*n+t*t,n=this.r,t=this.r0;return e<=n*n&&t*t<=e}}},kz.prototype.convertToPixel=function(t,e,n){return Pz(e)===this?this.dataToPoint(n):null},kz.prototype.convertFromPixel=function(t,e,n){return Pz(e)===this?this.pointToData(n):null},kz);function kz(t){this.dimensions=["radius","angle"],this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Mz,this._angleAxis=new Dz,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}function Pz(t){var e=t.seriesModel,t=t.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function Oz(t,e){var n,i=this,o=i.getAngleAxis(),r=i.getRadiusAxis();o.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){var e;t.coordinateSystem===i&&(N(Rw(e=t.getData(),"radius"),function(t){r.scale.unionExtentFromData(e,t)}),N(Rw(e,"angle"),function(t){o.scale.unionExtentFromData(e,t)}))}),Cw(o.scale,o.model),Cw(r.scale,r.model),"category"!==o.type||o.onBand||(n=o.getExtent(),t=360/o.scale.count(),o.inverse?n[1]+=t:n[1]-=t,o.setExtent(n[0],n[1]))}function Rz(t,e){var n;t.type=e.get("type"),t.scale=Dw(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType&&(t.inverse=t.inverse!==e.get("clockwise"),n=e.get("startAngle"),t.setExtent(n,n+(t.inverse?-360:360))),(e.axis=t).model=e}nd={dimensions:Lz.prototype.dimensions,create:function(t,s){var l=[];return t.eachComponent("polar",function(t,e){var n=new Lz(e+"");n.update=Oz;var i=n.getRadiusAxis(),o=n.getAngleAxis(),r=t.findAxisModel("radiusAxis"),a=t.findAxisModel("angleAxis");Rz(i,r),Rz(o,a),e=n,i=s,o=(r=t).get("center"),a=i.getWidth(),i=i.getHeight(),e.cx=Nu(o[0],a),e.cy=Nu(o[1],i),e=e.getRadiusAxis(),i=Math.min(a,i)/2,null==(r=r.get("radius"))?r=[0,"100%"]:F(r)||(r=[0,r]),i=[Nu(r[0],i),Nu(r[1],i)],e.inverse?e.setExtent(i[1],i[0]):e.setExtent(i[0],i[1]),l.push(n),(t.coordinateSystem=n).model=t}),t.eachSeries(function(t){var e;"polar"===t.get("coordinateSystem")&&(e=t.getReferringComponents("polar",Sh).models[0],t.coordinateSystem=e.coordinateSystem)}),l}};Yf.register("polar",nd);var Nz=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ez(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),n=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function zz(t){return t.getRadiusAxis().inverse?0:1}function Bz(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var Vz,nd=(l(Fz,Vz=Op),Fz.prototype.render=function(e,t){var n,i,o,r,a,s;this.group.removeAll(),e.get("show")&&(n=e.axis,i=n.polar,o=i.getRadiusAxis().getExtent(),r=n.getTicksCoords(),a=n.getMinorTicksCoords(),Bz(s=P(n.getViewLabels(),function(t){return(t=C(t)).coord=n.dataToCoord(t.tickValue),t})),Bz(r),N(Nz,function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||Gz[t](this.group,e,i,r,a,o,s)},this))},Fz.type="angleAxis",Fz);function Fz(){var t=null!==Vz&&Vz.apply(this,arguments)||this;return t.type=Fz.type,t.axisPointerClass="PolarAxisPointer",t}var Gz={axisLine:function(t,e,n,i,o,r){var a=e.getModel(["axisLine","lineStyle"]),s=zz(n),e=s?0:1,a=0===r[e]?new aa({shape:{cx:n.cx,cy:n.cy,r:r[s]},style:a.getLineStyle(),z2:1,silent:!0}):new $l({shape:{cx:n.cx,cy:n.cy,r:r[s],r0:r[e]},style:a.getLineStyle(),z2:1,silent:!0});a.style.fill=null,t.add(a)},axisTick:function(t,e,n,i,o,r){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=r[zz(n)],i=P(i,function(t){return new Ma({shape:Ez(n,[l,l+s],t.coord)})});t.add(jc(i,{style:A(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=r[zz(n)],h=[],c=0;ca?"left":"right",s=Math.abs(r[1]-s)/o<.3?"middle":r[1]>s?"top":"bottom";p&&p[i]&&(Y(i=p[i])&&i.textStyle&&(n=new Fp(i.textStyle,d,d.ecModel)));a=new vl({silent:AM.isLabelSilent(u),style:xp(n,{x:r[0],y:r[1],fill:n.getTextColor()||u.get(["axisLine","lineStyle","color"]),text:t.formattedLabel,align:a,verticalAlign:s})});l.add(a),g&&((s=AM.makeAxisEventDataBase(u)).targetType="axisLabel",s.value=t.rawLabel,Wh(a).eventData=s)},this)},splitLine:function(t,e,n,i,o,r){for(var a=e.getModel("splitLine").getModel("lineStyle"),s=0,l=(l=a.get("color"))instanceof Array?l:[l],u=[],h=0;hr?"left":"right",Math.abs(s[1]-u)/t<.3?"middle":s[1]>u?"top":"bottom")}return{position:s,align:l,verticalAlign:u}}(e,n,s,c))},jz);function jz(){return null!==Zz&&Zz.apply(this,arguments)||this}var qz={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:CN(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var o=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:AN(e.cx,e.cy,i[0],i[1],(-n-o/2)*r,(o/2-n)*r)}:{type:"Sector",shape:AN(e.cx,e.cy,n-o/2,n+o/2,0,2*Math.PI)}}};Op.registerAxisPointerClass("PolarAxisPointer",nd),k_(V(function(t,e,n){var L={},k=function(t){var l={};N(t,function(t,e){var n=t.getData(),i=t.coordinateSystem,o=i.getBaseAxis(),r=fz(i,o),a=o.getExtent(),s="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),i=l[r]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=i.stacks;l[r]=i;a=dz(t);o[a]||i.autoWidthCount++,o[a]=o[a]||{width:0,maxWidth:0};n=Nu(t.get("barWidth"),s),r=Nu(t.get("barMaxWidth"),s),s=t.get("barGap"),t=t.get("barCategoryGap");n&&!o[a].width&&(n=Math.min(i.remainedWidth,n),o[a].width=n,i.remainedWidth-=n),r&&(o[a].maxWidth=r),null!=s&&(i.gap=s),null!=t&&(i.categoryGap=t)});var c={};return N(l,function(t,n){c[n]={};var e=t.stacks,i=t.bandWidth,i=Nu(t.categoryGap,i),o=Nu(t.gap,1),r=t.remainedWidth,a=t.autoWidthCount,s=(r-i)/(a+(a-1)*o),s=Math.max(s,0);N(e,function(t,e){var n=t.maxWidth;n&&n=i.start.time&&n.timeo.end.time&&i.reverse(),i},eB.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/864e5)-Math.floor(n[0].time/864e5)+1,o=new Date(n[0].time),r=o.getDate(),a=n[1].date.getDate();o.setDate(r+i-1);var s=o.getDate();if(s!==a)for(var l=0n.weeks||0===t&&en.lweek)return null;t=7*(t-1)-n.fweek+e,e=new Date(n.start.time);return e.setDate(+n.start.d+t),this.getDateInfo(e)},eB.create=function(t,e){var n=[];return t.eachComponent("calendar",function(t){var e=new eB(t);n.push(e),t.coordinateSystem=e}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=n[t.get("calendarIndex")||0])}),n},eB.dimensions=["time","value"],nd=eB;function eB(t,e,n){this.type="calendar",this.dimensions=eB.dimensions,this.getDimensionsInfo=eB.getDimensionsInfo,this._model=t}function nB(t){var e=t.calendarModel,t=t.seriesModel;return e?e.coordinateSystem:t?t.coordinateSystem:null}Yf.register("calendar",nd);var iB,vm=(l(oB,iB=nf),oB.prototype.init=function(t,e,n){var i=qd(t);iB.prototype.init.apply(this,arguments),rB(t,i)},oB.prototype.mergeOption=function(t){iB.prototype.mergeOption.apply(this,arguments),rB(this.option,t)},oB.prototype.getCellSize=function(){return this.option.cellSize},oB.type="calendar",oB.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},oB);function oB(){var t=null!==iB&&iB.apply(this,arguments)||this;return t.type=oB.type,t}function rB(t,i){var e=t.cellSize,o=F(e)?e:t.cellSize=[e,e];1===o.length&&(o[1]=o[0]);e=P([0,1],function(t){var e,n;return(null!=(e=i)[Hd[n=t][0]]||null!=e[Hd[n][1]]&&null!=e[Hd[n][2]])&&(o[t]="auto"),null!=o[t]&&"auto"!==o[t]});jd(t,i,{type:"box",ignoreSize:e})}nf.registerClass(vm);var aB,sB={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},lB={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]},Op=(l(uB,aB=qy),uB.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var o=t.coordinateSystem,r=o.getRangeInfo(),o=o.getOrient();this._renderDayRect(t,r,i),this._renderLines(t,r,o,i),this._renderYearText(t,r,o,i),this._renderMonthText(t,o,i),this._renderWeekText(t,r,o,i)},uB.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,l=new ga({shape:{x:l[0],y:l[1],width:r,height:a},cursor:"default",style:o});n.add(l)}},uB.prototype._renderLines=function(e,t,n,i){var o=this,r=e.coordinateSystem,a=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){p(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function p(t){o._firstDayOfMonth.push(r.getDateInfo(t)),o._firstDayPoints.push(r.dataToRect([t],!1).tl);t=o._getLinePointsOfOneWeek(e,t,n);o._tlpoints.push(t[0]),o._blpoints.push(t[t.length-1]),s&&o._drawSplitline(t,a,i)}p(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,l,n),a,i),s&&this._drawSplitline(o._getEdgesPoints(o._blpoints,l,n),a,i)},uB.prototype._getEdgesPoints=function(t,e,n){t=[t[0].slice(),t[t.length-1].slice()],n="horizontal"===n?0:1;return t[0][n]=t[0][n]-e/2,t[1][n]=t[1][n]+e/2,t},uB.prototype._drawSplitline=function(t,e,n){e=new Ra({z2:20,shape:{points:t},style:e});n.add(e)},uB.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,o=i.getDateInfo(e),r=[],a=0;a<7;a++){var s=i.getNextNDay(o.time,a),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},uB.prototype._formatterLabel=function(t,e){return"string"==typeof t&&t?Nd(t,e):"function"==typeof t?t(e):e.nameMap},uB.prototype._yearTextPositionControl=function(t,e,n,i,o){var r=e[0],a=e[1],e=["center","bottom"];"bottom"===i?(a+=o,e=["center","top"]):"left"===i?r-=o:"right"===i?(r+=o,e=["center","top"]):a-=o;o=0;return"left"!==i&&"right"!==i||(o=Math.PI/2),{rotation:o,x:r,y:a,style:{align:e[0],verticalAlign:e[1]}}},uB.prototype._renderYearText=function(t,e,n,i){var o,r,a,s,l,u=t.getModel("yearLabel");u.get("show")&&(o=u.get("margin"),r=(r=u.get("position"))||("horizontal"!==n?"top":"left"),a=((s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]])[0][0]+s[1][0])/2,l=(s[0][1]+s[1][1])/2,s={top:[a,s[t="horizontal"===n?0:1][1]],bottom:[a,s[1-t][1]],left:[s[1-t][0],l],right:[s[t][0],l]},t=e.start.y,+e.end.y>+e.start.y&&(t=t+"-"+e.end.y),l=u.get("formatter"),t={start:e.start.y,end:e.end.y,nameMap:t},t=this._formatterLabel(l,t),(t=new vl({z2:30,style:xp(u,{text:t})})).attr(this._yearTextPositionControl(t,s[r],n,r,o)),i.add(t))},uB.prototype._monthTextPositionControl=function(t,e,n,i,o){var r="left",a="top",s=t[0],t=t[1];return"horizontal"===n?(t+=o,e&&(r="center"),"start"===i&&(a="bottom")):(s+=o,e&&(a="middle"),"start"===i&&(r="right")),{x:s,y:t,align:r,verticalAlign:a}},uB.prototype._renderMonthText=function(t,e,n){var i=t.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),r=i.get("margin"),a=i.get("position"),t=i.get("align"),s=[this._tlpoints,this._blpoints];H(o)&&(o=sB[o.toUpperCase()]||[]);for(var l="start"===a?0:1,u="horizontal"===e?0:1,r="start"===a?-r:r,h="center"===t,c=0;cp.getHeight()&&(i.position="top",e=!0),e=e?-5-o.height:d+8,r+o.width/2>p.getWidth()?(i.position=["100%",e],n.align="right"):r-o.width/2<0&&(i.position=[0,e],n.align="left"))}))},CB.prototype.updateView=function(t,e,n,i){N(this._features,function(t){t instanceof xB&&t.updateView&&t.updateView(t.model,e,n,i)})},CB.prototype.remove=function(e,n){N(this._features,function(t){t instanceof xB&&t.remove&&t.remove(e,n)}),this.group.removeAll()},CB.prototype.dispose=function(e,n){N(this._features,function(t){t instanceof xB&&t.dispose&&t.dispose(e,n)})},CB.type="toolbox",CB);function CB(){return null!==TB&&TB.apply(this,arguments)||this}qy.registerClass(nd);var DB,vm=(l(AB,DB=xB),AB.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType()?"svg":n.get("type",!0)||"png",e=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!=typeof MouseEvent||w.browser.ie||w.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(e.split(",")[1]),a=r.length,s=new Uint8Array(a);a--;)s[a]=r.charCodeAt(a);t=new Blob([s]);window.navigator.msSaveOrOpenBlob(t,i+"."+o)}else{var l=n.get("lang"),l='';window.open().document.write(l)}else{l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=e;e=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(e)}},AB.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocale(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:t.getLocale(["toolbox","saveAsImage","lang"])}},AB);function AB(){return null!==DB&&DB.apply(this,arguments)||this}vm.prototype.unusable=!w.canvasSupported,bB("saveAsImage",vm);var LB,kB="__ec_magicType_stack__",PB=[["line","bar"],["stack"]],Op=(l(OB,LB=xB),OB.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return N(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},OB.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocale(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},OB.prototype.onclick=function(t,e,a){var s,n,l=this.model,i=l.get(["seriesIndex",a]);RB[a]&&(s={series:[]},N(PB,function(t){0<=L(t,a)&&N(t,function(t){l.setIconStatus(t,"normal")})}),l.setIconStatus(a,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},function(t){var e=t.subType,n=t.id,n=RB[a](e,n,t,l);n&&(A(n,t.option),s.series.push(n));n=t.coordinateSystem;if(n&&"cartesian2d"===n.type&&("line"===a||"bar"===a)){n=n.getAxesByScale("ordinal")[0];if(n){var i=n.dim+"Axis",o=t.getReferringComponents(i,Sh).models[0].componentIndex;s[i]=s[i]||[];for(var r=0;r<=o;r++)s[i][o]=s[i][o]||{};s[i][o].boundaryGap="bar"===a}}}),"stack"===a&&(n=b({stack:l.option.title.tiled,tiled:l.option.title.stack},l.option.title)),e.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:n,featureName:"magicType"}))},OB);function OB(){return null!==LB&&LB.apply(this,arguments)||this}var RB={line:function(t,e,n,i){if("bar"===t)return b({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return b({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){n=n.get("stack")===kB;if("line"===t||"bar"===t)return i.setIconStatus("stack",n?"normal":"emphasis"),b({id:e,stack:n?"":kB},i.get(["option","stack"])||{},!0)}};A_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),bB("magicType",Op);var NB=new Array(60).join("-"),EB="\t";function zB(t){var o,r,a,h,t=(o={},r=[],a=[],t.eachRawSeries(function(t){var e,n,i=t.coordinateSystem;i&&("cartesian2d"===i.type||"polar"===i.type)&&"category"===(e=i.getBaseAxis()).type?(n=e.dim+"_"+e.index,o[n]||(o[n]={categoryAxis:e,valueAxis:i.getOtherAxis(e),series:[]},a.push({axisDim:e.dim,axisIndex:e.index})),o[n].series.push(t)):r.push(t)}),{seriesGroupByCategoryAxis:o,other:r,meta:a});return{value:R([(h=[],N(t.seriesGroupByCategoryAxis,function(t,e){var n=t.categoryAxis,i=t.valueAxis.dim,o=[" "].concat(P(t.series,function(t){return t.name})),r=[n.model.getCategories()];N(t.series,function(t){var e=t.getRawData();r.push(t.getRawData().mapArray(e.mapDimension(i),function(t){return t}))});for(var a=[o.join(EB)],s=0;st[1]&&t.reverse(),t}function jB(t,e){return wh(t,e,{includeMainTypes:XB})}var qB={grid:function(t,i){var o=t.xAxisModels,r=t.yAxisModels,t=t.gridModels,e=ct(),a={},s={};(o||r||t)&&(N(o,function(t){t=t.axis.grid.model;e.set(t.id,t),a[t.id]=!0}),N(r,function(t){t=t.axis.grid.model;e.set(t.id,t),s[t.id]=!0}),N(t,function(t){e.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),e.each(function(t){var e=t.coordinateSystem,n=[];N(e.getCartesians(),function(t,e){(0<=L(o,t.getAxis("x").model)||0<=L(r,t.getAxis("y").model))&&n.push(t)}),i.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:n[0],coordSyses:n,getPanelRect:$B.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,n){N(t.geoModels,function(t){var e=t.coordinateSystem;n.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:$B.geo})})}},KB=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,t=t.gridModel;return!t&&n&&(t=n.axis.grid.model),!t&&i&&(t=i.axis.grid.model),t&&t===e.gridModel},function(t,e){t=t.geoModel;return t&&t===e.geoModel}],$B={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(op(t)),e}},JB={lineX:V(QB,0),lineY:V(QB,1),rect:function(t,e,n){var i=e[WB[t]]([n[0][0],n[1][0]]),n=e[WB[t]]([n[0][1],n[1][1]]),n=[ZB([i[0],n[0]]),ZB([i[1],n[1]])];return{values:n,xyMinMax:n}},polygon:function(e,n,t){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:P(t,function(t){t=n[WB[e]](t);return i[0][0]=Math.min(i[0][0],t[0]),i[1][0]=Math.min(i[1][0],t[1]),i[0][1]=Math.max(i[0][1],t[0]),i[1][1]=Math.max(i[1][1],t[1]),t}),xyMinMax:i}}};function QB(t,e,n,i){var o=n.getAxis(["x","y"][t]),r=ZB(P([0,1],function(t){return e?o.coordToData(o.toLocalCoord(i[t])):o.toGlobalCoord(o.dataToCoord(i[t]))})),n=[];return n[t]=r,n[1-t]=[NaN,NaN],{values:r,xyMinMax:n}}var tV={lineX:V(eV,0),lineY:V(eV,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,n,i){return P(t,function(t,e){return[t[0]-i[0]*n[e][0],t[1]-i[1]*n[e][1]]})}};function eV(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function nV(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var iV=N,oV=_h();function rV(t){t=oV(t);return t.snapshots||(t.snapshots=[{}]),t.snapshots}nf.registerSubTypeDefaulter("dataZoom",function(){return"slider"});var aV=["x","y","radius","angle","single"],sV=["cartesian2d","polar","singleAxis"];function lV(t){return t+"Axis"}function uV(t,e){var i,o=ct(),n=[],r=ct();for(t.eachComponent({mainType:"dataZoom",query:e},function(t){r.get(t.uid)||s(t)});i=!1,t.eachComponent("dataZoom",a),i;);function a(t){var n;!r.get(t.uid)&&(n=!1,t.eachTargetAxis(function(t,e){t=o.get(t);t&&t[e]&&(n=!0)}),n)&&(s(t),i=!0)}function s(t){r.set(t.uid,!0),n.push(t),t.eachTargetAxis(function(t,e){(o.get(t)||o.set(t,[]))[e]=!0})}return n}function hV(t){var o=t.ecModel,r={infoList:[],infoMap:ct()};return t.eachTargetAxis(function(t,e){var n,i=o.getComponent(lV(t),e);!i||(n=i.getCoordSysModel())&&(t=n.uid,(e=r.infoMap.get(t))||(e={model:n,axisModels:[]},r.infoList.push(e),r.infoMap.set(t,e)),e.axisModels.push(i))}),r}var cV=(pV.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},pV);function pV(){this.indexList=[],this.indexMap=[]}var dV,nd=(l(fV,dV=nf),fV.prototype.init=function(t,e,n){var i=gV(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},fV.prototype.mergeOption=function(t){var e=gV(t);b(this.option,t,!0),b(this.settledOption,e,!0),this._doInit(e)},fV.prototype._doInit=function(t){var n=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;N([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(n[t[0]]=i[t[0]]=null)},this),this._resetTarget()},fV.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=ct();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},fV.prototype._fillSpecifiedTargetAxis=function(i){var o=!1;return N(aV,function(t){var e,n=this.getReferringComponents(lV(t),Mh);n.specified&&(o=!0,e=new cV,N(n.models,function(t){e.add(t.componentIndex)}),i.set(t,e))},this),o},fV.prototype._fillAutoTargetAxisByOrient=function(r,e){var t,i=this.ecModel,a=!0;function n(t,e){var n,i,o=t[0];o&&((n=new cV).add(o.componentIndex),r.set(e,n),a=!1,"x"!==e&&"y"!==e||(i=o.getReferringComponents("grid",Sh).models[0])&&N(t,function(t){o.componentIndex!==t.componentIndex&&i===t.getReferringComponents("grid",Sh).models[0]&&n.add(t.componentIndex)}))}a&&(t="vertical"===e?"y":"x",n(i.findComponents({mainType:t+"Axis"}),t)),a&&n(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),a&&N(aV,function(t){var e,n;!a||(e=i.findComponents({mainType:lV(t),filter:function(t){return"category"===t.get("type",!0)}}))[0]&&((n=new cV).add(e[0].componentIndex),r.set(t,n),a=!1)},this)},fV.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){e=e||t},this),"y"===e?"vertical":"horizontal"},fV.prototype._setDefaultThrottle=function(t){t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle&&(t=this.ecModel.option,this.option.throttle=t.animation&&0h[1];if(a&&!s&&!r)return!0;a&&(i=!0),s&&(e=!0),r&&(n=!0)}return i&&e&&n}):wV(u,function(t){var e;"empty"===o?n.setData(l=l.map(t,function(t){return(e=t)>=h[0]&&e<=h[1]?t:NaN;var e})):((e={})[t]=h,l.selectRange(e))}),wV(u,function(t){l.setApproximateExtent(h,t)}))}))},IV.prototype._updateMinMaxSpan=function(){var i=this._minMaxSpan={},o=this._dataZoomModel,r=this._dataExtent;wV(["min","max"],function(t){var e=o.get(t+"Span"),n=o.get(t+"ValueSpan");null!=n&&(n=this.getAxisModel().axis.scale.parse(n)),null!=n?e=Ru(r[0]+n,r,[0,100],!0):null!=e&&(n=Ru(e,[0,100],r,!0)-r[0]),i[t+"Span"]=e,i[t+"ValueSpan"]=n},this)},IV.prototype._setAxisModel=function(){var t,e=this.getAxisModel(),n=this._percentWindow,i=this._valueWindow;n&&(t=Fu(i,[0,500]),t=Math.min(t,20),e=e.axis.scale.rawExtentInfo,0!==n[0]&&e.setDeterminedMinMax("min",+i[0].toFixed(t)),100!==n[1]&&e.setDeterminedMinMax("max",+i[1].toFixed(t)),e.freeze())},IV);function IV(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}D_(zm.PROCESSOR.FILTER,{getTargetSeries:function(r){function t(o){r.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(t,e){var n=r.getComponent(lV(t),e);o(t,e,n,i)})})}t(function(t,e,n,i){n.__dzAxisProxy=null});var o=[];t(function(t,e,n,i){n.__dzAxisProxy||(n.__dzAxisProxy=new MV(t,e,i,r),o.push(n.__dzAxisProxy))});var e=ct();return N(o,function(t){N(t.getTargetSeriesModels(),function(t){e.set(t.uid,t)})}),e},overallReset:function(t,i){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).reset(n)}),n.eachTargetAxis(function(t,e){n.getAxisProxy(t,e).filterData(n,i)})}),t.eachComponent("dataZoom",function(t){var e,n=t.findRepresentativeAxisProxy();n&&(e=n.getDataPercentWindow(),n=n.getDataValueWindow(),t.setCalculatedRange({start:e[0],end:e[1],startValue:n[0],endValue:n[1]}))})}}),A_("dataZoom",function(e,t){N(uV(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})});var TV,CV=N,DV=sh+"toolbox-dataZoom_",Op=(l(AV,TV=xB),AV.prototype.render=function(t,e,n,i){this.brushController||(this.brushController=new Pk(n.getZr()),this.brushController.on("brush",B(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n.isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n.isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");o=new YB(RV(t),e,{include:["grid"]}).makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n.brushController.setPanels(o).enableBrush(!(!r||!o.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),e=e,t.setIconStatus("back",1'}(n.get("backgroundColor"),i,o)),H(t))r.innerHTML=t;else if(t){r.innerHTML="",F(t)||(t=[t]);for(var a=0;a",a=p.join(e);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(o,r,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(o,a,h,Math.random()+"",i[0],i[1],r,null,d)})},tF.prototype._showSeriesItemTooltip=function(t,e,n){var i,o,r,a,s=rx(e,function(t){return null!=Wh(t).dataIndex}),l=this._ecModel,u=Wh(s),h=u.seriesIndex,c=l.getSeriesByIndex(h),p=u.dataModel||c,d=u.dataIndex,e=u.dataType,s=p.getData(e),u=this._renderMode,f=eF([s.getItemModel(d),p,c&&(c.coordinateSystem||{}).model,this._tooltipModel]),c=f.get("trigger");null!=c&&"item"!==c||(i=p.getDataParams(d,e),o=new Ry,i.marker=o.makeTooltipMarker("item",zd(i.color),u),c=zg(p.formatTooltip(d,!1,e)),e=f.get("order"),r=c.markupFragment?Dy(c.markupFragment,o,u,e,l.get("useUTC")):c.markupText,a="item_"+p.name+"_"+d,this._showOrMove(f,function(){this._showTooltipContent(f,r,i,a,t.offsetX,t.offsetY,t.position,t.target,o)}),n({type:"showTip",dataIndexInside:d,dataIndex:s.getRawIndex(d),seriesIndex:h,from:this.uid}))},tF.prototype._showComponentItemTooltip=function(t,e,n){var i=e.tooltip;H(i)&&(i={content:i,formatter:i});var o=new Fp(i,this._tooltipModel,this._ecModel),r=o.get("content"),a=Math.random()+"",s=new Ry;this._showOrMove(o,function(){this._showTooltipContent(o,r,o.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e,s)}),n({type:"showTip",from:this.uid})},tF.prototype._showTooltipContent=function(n,t,i,e,o,r,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&(u=this._tooltipContent,h=n.get("formatter"),a=a||n.get("position"),p=t,c=this._getNearestPoint([o,r],i,n.get("trigger")),h&&H(h)?(d=n.ecModel.get("useUTC"),p=h,(t=F(i)?i[0]:i)&&t.axisType&&0<=t.axisType.indexOf("time")&&(p=ud(t.axisValue,p,d)),p=Rd(p,i,!0)):G(h)&&(d=KV(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c.color,a),this._updatePosition(n,a,o,r,u,i,s))},this),this._ticket=e,p=h(i,e,d)),u.setContent(p,l,n,c.color,a),u.show(n,c.color),this._updatePosition(n,a,o,r,u,i,s))},tF.prototype._getNearestPoint=function(t,e,n){return"axis"===n||F(e)?{color:"html"===this._renderMode?"#fff":"none"}:F(e)?void 0:{color:e.color||e.borderColor}},tF.prototype._updatePosition=function(t,e,n,i,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u,h=o.getSize(),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),G(e)&&(e=e([n,i],r,o.el,d,{viewSize:[s,l],contentSize:h.slice()})),F(e)?(n=JV(e[0],s),i=JV(e[1],l)):Y(e)?((r=e).width=h[0],r.height=h[1],n=(r=Yd(r,{width:s,height:l})).x,i=r.y,p=c=null):i=(n=(u=H(e)&&a?function(t,e,n){var i=n[0],o=n[1],r=0,a=0,s=e.width,n=e.height;switch(t){case"inside":r=e.x+s/2-i/2,a=e.y+n/2-o/2;break;case"top":r=e.x+s/2-i/2,a=e.y-o-10;break;case"bottom":r=e.x+s/2-i/2,a=e.y+n+10;break;case"left":r=e.x-i-10-5,a=e.y+n/2-o/2;break;case"right":r=e.x+s+10+5,a=e.y+n/2-o/2}return[r,a]}(e,d,h):function(t,e,n,i,o,r,a){var s=n.getOuterSize(),n=s.width,s=s.height;null!=r&&(ie[0][1]&&(e[0][1]=r[0]),r[1]e[1][1]&&(e[1][1]=r[1])}return e&&xF(e)}};function xF(t){return new Gn(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var _F,Op=(l(bF,_F=nf),bF.prototype.optionUpdated=function(t,e){var n=this.option;e||lF(n,t,["inBrush","outOfBrush"]);t=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},t.hasOwnProperty("liftZ")||(t.liftZ=5)},bF.prototype.setAreas=function(t){t&&(this.areas=P(t,function(t){return wF(this.option,t)},this))},bF.prototype.setBrushOption=function(t){this.brushOption=wF(this.option,t),this.brushType=this.brushOption.brushType},bF.type="brush",bF.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],bF.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},bF);function bF(){var t=null!==_F&&_F.apply(this,arguments)||this;return t.type=bF.type,t.areas=[],t.brushOption={},t}function wF(t,e){return b({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Fp(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}nf.registerClass(Op);var SF,Op=(l(MF,SF=qy),MF.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Pk(e.getZr())).on("brush",B(this._onBrush,this)).mount()},MF.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},MF.prototype.updateTransform=function(t,e,n,i){gF(e),this._updateController(t,e,n,i)},MF.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},MF.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},MF.prototype._updateController=function(t,e,n,i){i&&i.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},MF.prototype.dispose=function(){this._brushController.dispose()},MF.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);t.isEnd&&!t.removeOnClick||this.api.dispatchAction({type:"brush",brushId:e,areas:C(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:C(n),$from:e})},MF.type="brush",MF);function MF(){var t=null!==SF&&SF.apply(this,arguments)||this;return t.type=MF.type,t}qy.registerClass(Op),A_({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),A_({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),A_({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var IF,TF=["rect","polygon","lineX","lineY","keep","clear"];function CF(){return null!==IF&&IF.apply(this,arguments)||this}bB("brush",(l(CF,IF=xB),CF.prototype.render=function(e,t,n){var i,o,r;t.eachComponent({mainType:"brush"},function(t){i=t.brushType,o=t.brushOption.brushMode||"single",r=r||!!t.areas.length}),this._brushType=i,this._brushMode=o,N(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===o:"clear"===t?r:t===i)?"emphasis":"normal")})},CF.prototype.updateView=function(t,e,n){this.render(t,e,n)},CF.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return N(t.get("type",!0),function(t){e[t]&&(n[t]=e[t])}),n},CF.prototype.onclick=function(t,e,n){var i=this._brushType,o=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===o?"single":"multiple":o}})},CF.getDefaultOption=function(t){return{show:!0,type:TF.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocale(["toolbox","brush","title"])}},CF)),C_(function(t,e){var n,i,o,r=lh(t?t.brush:[]);r.length&&(n=[],N(r,function(t){t=t.hasOwnProperty("toolbox")?t.toolbox:[];t instanceof Array&&(n=n.concat(t))}),F(r=t&&t.toolbox)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]),(r=(r=(r=r.feature||(r.feature={})).brush||(r.brush={})).type||(r.type=[])).push.apply(r,n),o={},N(i=r,function(t){o[t]=1}),i.length=0,N(o,function(t,e){i.push(e)}),e&&!r.length&&r.push.apply(r,oF))});var DF,Op=(l(AF,DF=nf),AF.type="title",AF.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},AF);function AF(){var t=null!==DF&&DF.apply(this,arguments)||this;return t.type=AF.type,t.layoutMode={type:"box",ignoreSize:!0},t}nf.registerClass(Op);var LF,Op=(l(kF,LF=qy),kF.prototype.render=function(t,e,n){var i,o,r,a,s,l,u,h,c;this.group.removeAll(),t.get("show")&&(i=this.group,h=t.getModel("textStyle"),a=t.getModel("subtextStyle"),o=t.get("textAlign"),c=tt(t.get("textBaseline"),t.get("textVerticalAlign")),u=(r=new vl({style:xp(h,{text:t.get("text"),fill:h.getTextColor()},{disableBox:!0}),z2:10})).getBoundingRect(),h=t.get("subtext"),a=new vl({style:xp(a,{text:h,fill:a.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),s=t.get("link"),l=t.get("sublink"),u=t.get("triggerEvent",!0),r.silent=!s&&!u,a.silent=!l&&!u,s&&r.on("click",function(){Bd(s,"_"+t.get("target"))}),l&&a.on("click",function(){Bd(l,"_"+t.get("subtarget"))}),Wh(r).eventData=Wh(a).eventData=u?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(r),h&&i.add(a),u=i.getBoundingRect(),(h=t.getBoxLayoutParams()).width=u.width,h.height=u.height,n=Yd(h,{width:n.getWidth(),height:n.getHeight()},t.get("padding")),o||("middle"===(o=t.get("left")||t.get("right"))&&(o="center"),"right"===o?n.x+=n.width:"center"===o&&(n.x+=n.width/2)),c||("center"===(c=t.get("top")||t.get("bottom"))&&(c="middle"),"bottom"===c?n.y+=n.height:"middle"===c&&(n.y+=n.height/2),c=c||"top"),i.x=n.x,i.y=n.y,i.markRedraw(),c={align:o,verticalAlign:c},r.setStyle(c),a.setStyle(c),u=i.getBoundingRect(),c=n.margin,(n=t.getItemStyle(["color","opacity"])).fill=t.get("backgroundColor"),n=new ga({shape:{x:u.x-c[3],y:u.y-c[0],width:u.width+c[1]+c[3],height:u.height+c[0]+c[2],r:t.get("borderRadius")},style:n,subPixelOptimize:!0,silent:!0}),i.add(n))},kF.type="title",kF);function kF(){var t=null!==LF&&LF.apply(this,arguments)||this;return t.type=kF.type,t}function PF(t){var e=t.itemStyle||(t.itemStyle={}),e=e.emphasis||(e.emphasis={}),t=t.label||t.label||{},n=t.normal||(t.normal={}),i={normal:1,emphasis:1};N(t,function(t,e){i[e]||OF(n,e)||(n[e]=t)}),e.label&&!OF(t,"emphasis")&&(t.emphasis=e.label,delete e.label)}function OF(t,e){return t.hasOwnProperty(e)}qy.registerClass(Op),nf.registerSubTypeDefaulter("timeline",function(){return"slider"}),A_({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var n=e.getComponent("timeline");return n&&null!=t.currentIndex&&(n.setCurrentIndex(t.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),e.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),A({currentIndex:n.option.currentIndex},t)}),A_({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){e=e.getComponent("timeline");e&&null!=t.playState&&e.setPlayState(t.playState)});var RF,Op=(l(NF,RF=nf),NF.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},NF.prototype.mergeOption=function(t){RF.prototype.mergeOption.apply(this,arguments),this._initData()},NF.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},NF.prototype.getCurrentIndex=function(){return this.option.currentIndex},NF.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},NF.prototype.setPlayState=function(t){this.option.autoPlay=!!t},NF.prototype.getPlayState=function(){return!!this.option.autoPlay},NF.prototype._initData=function(){var o,t=this.option,e=t.data||[],t=t.axisType,r=this._names=[];"category"===t?(o=[],N(e,function(t,e){var n,i=gh(ch(t),"");Y(t)?(n=C(t)).value=e:n=e,o.push(n),r.push(i)})):o=e;t={category:"ordinal",time:"time",value:"number"}[t]||"number";(this._data=new db([{name:"value",type:t}],this)).initData(o,r)},NF.prototype.getData=function(){return this._data},NF.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},NF.type="timeline",NF.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},NF);function NF(){var t=null!==RF&&RF.apply(this,arguments)||this;return t.type=NF.type,t.layoutMode="box",t}nf.registerClass(Op);var EF,Op=(l(zF,EF=Op),zF.type="timeline.slider",zF.defaultOption=Xp(Op.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),zF);function zF(){var t=null!==EF&&EF.apply(this,arguments)||this;return t.type=zF.type,t}I(Op,ni.prototype),nf.registerClass(Op);var BF,Op=(l(VF,BF=qy),VF.type="timeline",VF);function VF(){var t=null!==BF&&BF.apply(this,arguments)||this;return t.type=VF.type,t}var FF,GF=(l(HF,FF=mu),HF.prototype.getLabelModel=function(){return this.model.getModel("label")},HF.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},HF);function HF(t,e,n,i){n=FF.call(this,t,e,n)||this;return n.type=i||"value",n}var WF,XF=Math.PI,YF=_h(),Op=(l(UF,WF=Op),UF.prototype.init=function(t,e){this.api=e},UF.prototype.render=function(e,t,n){var i,o,r;this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)&&(i=this._layout(e,n),o=this._createGroup("_mainGroup"),n=this._createGroup("_labelGroup"),r=this._axis=this._createAxis(i,e),e.formatTooltip=function(t){return Iy("nameValue",{noName:!0,value:r.scale.getLabel({value:t})})},N(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](i,o,r,e)},this),this._renderAxisLabel(i,n,r,e),this._position(i,e)),this._doPlayStop(),this._updateTicksStatus()},UF.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},UF.prototype.dispose=function(){this._clearTimer()},UF.prototype._layout=function(t,e){var n,i,o,r=t.get(["label","position"]),a=t.get("orient"),s=(x=e,Yd((_=t).getBoxLayoutParams(),{width:x.getWidth(),height:x.getHeight()},_.get("padding"))),l=null==r||"auto"===r?"horizontal"===a?s.y+s.height/2t[1]&&(n=t[1]),nn[o],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],e=[-p.x,-p.y],s=tt(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?e[i]+=n[o]-p[o]:g[i]+=p[o]+s),e[1-i]+=c[r]/2-p[r]/2,l.setPosition(f),u.setPosition(g),h.setPosition(e);g={x:0,y:0};g[o]=(d?n:c)[o],g[r]=Math.max(c[r],p[r]),g[a]=Math.min(0,p[a]+e[1-i]),u.__rectSize=n[o],d?((i={x:0,y:0})[o]=Math.max(n[o]-p[o]-s,0),i[r]=g[r],u.setClipPath(new ga({shape:i})),u.__rectSize=i[o]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});h=this._getPageInfo(t);return null!=h.pageIndex&&Jc(l,{x:h.contentPosition[0],y:h.contentPosition[1]},d?t:null),this._updatePageInfoView(t,h),g},nH.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},nH.prototype._updatePageInfoView=function(n,i){var o=this._controllerGroup;N(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=o.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")});var t=o.childOfName("pageText"),e=n.get("pageFormatter"),r=i.pageIndex,a=null!=r?r+1:0,r=i.pageCount;t&&e&&t.setStyle("text",H(e)?e.replace("{current}",null==a?"":a+"").replace("{total}",null==r?"":r+""):e({current:a,total:r}))},nH.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,o=t.getOrient().index,r=tH[o],a=eH[o],s=this._findTargetItemIndex(e),l=n.children(),t=l[s],u=l.length,e=u?1:0,h={contentPosition:[n.x,n.y],pageCount:e,pageIndex:e-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!t)return h;t=g(t);h.contentPosition[o]=-t.s;for(var c=s+1,p=t,d=t,f=null;c<=u;++c)(!(f=g(l[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=s-1,p=t,d=t,f=null;-1<=c;--c)(f=g(l[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},nH.prototype._findTargetItemIndex=function(n){return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==o&&null!=t&&(o=e),t===n&&(i=e)}),null!=i?i:o):0;var i,o},nH.type="legend.scroll",nH);function nH(){var t=null!==JG&&JG.apply(this,arguments)||this;return t.type=nH.type,t.newlineDisabled=!0,t._currentIndex=0,t}qy.registerClass(Op),A_("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})});var iH,Op=(l(oH,iH=nd),oH.type="dataZoom.slider",oH.layoutMode="box",oH.defaultOption=Xp(nd.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),oH);function oH(){var t=null!==iH&&iH.apply(this,arguments)||this;return t.type=oH.type,t}nf.registerClass(Op);var rH,aH=ga,sH="horizontal",lH="vertical",uH=["line","bar","candlestick","scatter"],hH={easing:"cubicOut",duration:100},Op=(l(cH,rH=vm),cH.prototype.init=function(t,e){this.api=e,this._onBrush=B(this._onBrush,this),this._onBrushEnd=B(this._onBrushEnd,this)},cH.prototype.render=function(t,e,n,i){if(rH.prototype.render.apply(this,arguments),cm(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},cH.prototype.dispose=function(){this._clear(),rH.prototype.dispose.apply(this,arguments)},cH.prototype._clear=function(){var t,e;(n=(t=this)[e="_dispatchZoomAction"])&&n[sm]&&(t[e]=n[sm]);var n=this.api.getZr();n.off("mousemove",this._onBrush),n.off("mouseup",this._onBrushEnd)},cH.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new $r;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},cH.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),e={width:e.getWidth(),height:e.getHeight()},o=this._orient===sH?{right:e.width-i.x-i.width,top:e.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},r=qd(t.option);N(["right","top","width","height"],function(t){"ph"===r[t]&&(r[t]=o[t])});e=Yd(r,e);this._location={x:e.x,y:e.y},this._size=[e.width,e.height],this._orient===lH&&this._size.reverse()},cH.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),o=i&&i.get("inverse"),r=this._displayables.sliderGroup,i=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(n!==sH||o?n===sH&&o?{scaleY:i?1:-1,scaleX:-1}:n!==lH||o?{scaleY:i?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:i?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:i?1:-1,scaleX:1});r=t.getBoundingRect([r]);t.x=e.x-r.x,t.y=e.y-r.y,t.markRedraw()},cH.prototype._getViewExtent=function(){return[0,this._size[0]]},cH.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new aH({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));t=new aH({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:B(this._onClickPanel,this)}),e=this.api.getZr();i?(t.on("mousedown",this._onBrushStart,this),t.cursor="crosshair",e.on("mousemove",this._onBrush),e.on("mouseup",this._onBrushEnd)):(e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)),n.add(t)},cH.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=t.series,i=n.getRawData(),n=n.getShadowDim?n.getShadowDim():t.otherDim;if(null!=n){var o,t=.3*((r=i.getDataExtent(n))[1]-r[0]),r=[r[0]-t,r[1]+t],a=[0,e[1]],t=[0,e[0]],s=[[e[0],0],[0,0]],l=[],u=t[1]/(i.count()-1),h=0,c=Math.round(i.count()/e[0]);i.each([n],function(t,e){var n;0e[0]||t[1]<0||t[1]>e[1]||(e=((e=this._handleEnds)[0]+e[1])/2,e=this._updateInterval("all",t[0]-e),this._updateView(),e&&this._dispatchZoomAction(!1))},cH.prototype._onBrushStart=function(t){var e=t.offsetX,t=t.offsetY;this._brushStart=new kn(e,t),this._brushing=!0,this._brushStartTime=+new Date},cH.prototype._onBrushEnd=function(t){var e,n,i;this._brushing&&(i=this._displayables.brushRect,this._brushing=!1,i&&(i.attr("ignore",!0),e=i.shape,+new Date-this._brushStartTime<200&&Math.abs(e.width)<5||(n=this._getViewExtent(),i=[0,100],this._range=zu([Ru(e.x,n,i,!0),Ru(e.x+e.width,n,i,!0)]),this._handleEnds=[e.x,e.x+e.width],this._updateView(),this._dispatchZoomAction(!1))))},cH.prototype._onBrush=function(t){this._brushing&&(ie(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},cH.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new aH({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);i=this._brushStart,n=this._displayables.sliderGroup,e=n.transformCoordToLocal(t,e),n=n.transformCoordToLocal(i.x,i.y),i=this._size;e[0]=Math.max(Math.min(i[0],e[0]),0),o.setShape({x:n[0],y:0,width:e[0]-n[0],height:i[1]})},cH.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?hH:null,start:e[0],end:e[1]})},cH.prototype._findCoordRect=function(){var t,e,n=hV(this.dataZoomModel).infoList;return!t&&n.length&&(t=(e=n[0].model.coordinateSystem).getRect&&e.getRect()),t||(t={x:.2*(n=this.api.getWidth()),y:.2*(e=this.api.getHeight()),width:.6*n,height:.6*e}),t},cH.type="dataZoom.slider",cH);function cH(){var t=null!==rH&&rH.apply(this,arguments)||this;return t.type=cH.type,t._displayables={},t}function pH(t){return"vertical"===t?"ns-resize":"ew-resize"}qy.registerClass(Op);var dH,Op=(l(fH,dH=nd),fH.type="dataZoom.inside",fH.defaultOption=Xp(nd.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),fH);function fH(){var t=null!==dH&&dH.apply(this,arguments)||this;return t.type=fH.type,t}nf.registerClass(Op);var gH=_h();function yH(t,e){e&&(t.removeKey(e.model.uid),(e=e.controller)&&e.dispose())}function mH(t,e){t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function vH(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}D_(zm.PROCESSOR.FILTER,function(t,a){var e=gH(a),l=e.coordSysRecordMap||(e.coordSysRecordMap=ct());l.each(function(t){t.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(o){N(hV(o).infoList,function(t){var e,r,n,i=t.model.uid,e=l.get(i)||l.set(i,(e=a,i=t.model,r={model:i,containsPoint:V(vH,i),dispatchAction:V(mH,e),dataZoomInfoMap:null,controller:null},n=r.controller=new hC(e.getZr()),N(["pan","zoom","scrollMove"],function(o){n.on(o,function(n){var i=[];r.dataZoomInfoMap.each(function(t){var e;n.isAvailableBehavior(t.model.option)&&(e=(e=(t.getRange||{})[o])&&e(t.dzReferCoordSysInfo,r.model.mainType,r.controller,n),!t.model.get("disabled",!0)&&e&&i.push({dataZoomId:t.model.id,start:e[0],end:e[1]}))}),i.length&&r.dispatchAction(i)})}),r));(e.dataZoomInfoMap||(e.dataZoomInfoMap=ct())).set(o.uid,{dzReferCoordSysInfo:t,model:o,getRange:null})})}),l.each(function(t){var e,n,i,o,r,a=t.controller,s=t.dataZoomInfoMap;!s||null!=(n=s.keys()[0])&&(e=s.get(n)),e?(o={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0,s.each(function(t){var e=t.model,t=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+i]"],F(t)&&(t=t.slice(),i=!0);e=e?t:i?[s(t[0]),s(t[1])]:s(t);return H(o)?o.replace("{value}",i?e[0]:e).replace("{value2}",i?e[1]:e):G(o)?i?o(t[0],t[1]):o(t):i?t[0]===a[0]?n[0]+" "+e[1]:t[1]===a[1]?n[1]+" "+e[0]:e[0]+" - "+e[1]:e;function s(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(r,20))}},zH.prototype.resetExtent=function(){var t=this.option,t=NH([t.min,t.max]);this._dataExtent=t},zH.prototype.getDataDimension=function(t){var e=this.option.dimension,n=t.dimensions;if(null!=e||n.length){if(null!=e)return t.getDimension(e);for(var i=t.dimensions,o=i.length-1;0<=o;o--){var r=i[o];if(!t.getDimensionInfo(r).isCalculationCoord)return r}}},zH.prototype.getExtent=function(){return this._dataExtent.slice()},zH.prototype.completeVisualOption=function(){var e=this.ecModel,n=this.option,t={inRange:n.inRange,outOfRange:n.outOfRange},i=n.target||(n.target={}),o=n.controller||(n.controller={});b(i,t),b(o,t);var l=this.isCategory();function r(t){OH(n.color)&&!t.inRange&&(t.inRange={color:n.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")}}r.call(this,i),r.call(this,o),function(t,e,n){var e=t[e],i=t[n];e&&!i&&(i=t[n]={},RH(e,function(t,e){var n;!jD.isValidType(e)||null!=(n=AH(e,"inactive",l))&&(i[e]=n,"color"!==e||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}))}.call(this,i,"inRange","outOfRange"),function(o){var r=(o.inRange||{}).symbol||(o.outOfRange||{}).symbol,a=(o.inRange||{}).symbolSize||(o.outOfRange||{}).symbolSize,s=this.get("inactiveColor");RH(this.stateList,function(t){var e=this.itemSize,n=o[t];null==(n=n||(o[t]={color:l?s:[s]})).symbol&&(n.symbol=r&&C(r)||(l?"roundRect":["roundRect"])),null==n.symbolSize&&(n.symbolSize=a&&C(a)||(l?e[0]:[e[0],e[0]])),n.symbol=kH(n.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var i,t=n.symbolSize;null!=t&&(i=-1/0,PH(t,function(t){ie[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},FH.prototype.completeVisualOption=function(){BH.prototype.completeVisualOption.apply(this,arguments),N(this.stateList,function(t){t=this.option.controller[t].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},FH.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},FH.prototype.getSelected=function(){var t=this.getExtent(),e=zu((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},FH.prototype.findTargetDataIndices=function(i){var o=[];return this.eachTargetSeries(function(t){var n=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){i[0]<=t&&t<=i[1]&&n.push(e)},this),o.push({seriesId:t.id,dataIndex:n})},this),o},FH.prototype.getVisualMeta=function(n){var t=GH(0,0,this.getExtent()),e=GH(0,0,this.option.range.slice()),i=[];function o(t,e){i.push({value:t,color:n(t,e)})}for(var r=0,a=0,s=e.length,l=t.length;at[1])break;n.push({color:this.getControllerVisual(r,"color",e),offset:o/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},JH.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},JH.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new $r("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},JH.prototype._updateHandle=function(i,o){var r,a,s,l,u,h;this._useHandle&&(r=this._shapes,a=this.visualMapModel,s=r.handleThumbs,l=r.handleLabels,u=a.itemSize,h=a.getExtent(),qH([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.y=i[t];var n=jH(i[t],[0,u[1]],h,!0),n=this.getControllerVisual(n,"symbolSize");e.scaleX=e.scaleY=n/u[0],e.x=u[0]-n/2;e=rp(r.handleLabelPoints[t],op(e,this.group));l[t].setStyle({x:e[0],y:e[1],text:a.formatValueText(this._dataInterval[t]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",r.mainGroup):"center"})},this))},JH.prototype._showIndicator=function(t,e,n,i){var o=this.visualMapModel,r=o.getExtent(),a=o.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),c=this.getControllerVisual(t,"symbolSize"),p=jH(t,r,s,!0),t=a[0]-c/2,r={x:u.x,y:u.y};u.y=p,u.x=t;s=rp(l.indicatorLabelPoint,op(u,this.group)),a=l.indicatorLabel;a.attr("invisible",!1);c=this._applyTransform("left",l.mainGroup),l="horizontal"===this._orient;a.setStyle({text:(n||"")+o.formatValueText(e),verticalAlign:l?c:"middle",align:l?"center":c});h={x:t,y:p,style:{fill:h}},s={style:{x:s[0],y:s[1]}};o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator?(o={duration:100,easing:"cubicInOut",additive:!0},u.x=r.x,u.y=r.y,u.animateTo(h,o),a.animateTo(s,o)):(u.attr(h),a.attr(s)),this._firstShowIndicator=!1;var d=this._shapes.handleLabels;if(d)for(var f=0;f ",o):this._showIndicator(t,t,"≈ ",o)),t=this._hoverLinkDataIndices,o=[],(e||tW(r))&&(o=this._hoverLinkDataIndices=r.findTargetDataIndices(i)),i=o,o={},s(t||[],t={}),s(i||[],o,t),o=[l(t),l(o)],this._dispatchHighDown("downplay",UH(o[0],r)),this._dispatchHighDown("highlight",UH(o[1],r)))},JH.prototype._hoverLinkFromSeriesMouseOver=function(t){var e=t.target,n=this.visualMapModel;e&&null!=Wh(e).dataIndex&&(t=Wh(e),e=this.ecModel.getSeriesByIndex(t.seriesIndex),n.isTargetSeries(e)&&(t=(e=e.getData(t.dataType)).get(n.getDataDimension(e),t.dataIndex),isNaN(t)||this._showIndicator(t,t)))},JH.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;nn&&s([n,t[0]],"outOfRange"),s(t.slice()),n=t[1])},this),{stops:o,outerColors:r}}function s(t,e){var n=a.getRepresentValue({interval:t});e=e||a.getValueState(n);e=i(n,e);t[0]===-1/0?r[0]=e:t[1]===1/0?r[1]=e:o.push({value:t[0],color:e},{value:t[1],color:e})}},iW.type="visualMap.piecewise",iW.defaultOption=Xp(vm.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),iW);function iW(){var t=null!==nW&&nW.apply(this,arguments)||this;return t.type=iW.type,t._pieceList=[],t}var oW={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),o=e.splitNumber,o=Math.max(parseInt(o,10),1);e.splitNumber=o;for(var r=(i[1]-i[0])/o;+r.toFixed(n)!==r&&n<5;)n++;e.precision=n,r=+r.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,e)},this)}};function rW(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}nf.registerClass(vm);var aW,Op=(l(sW,aW=Op),sW.prototype.doRender=function(){var i=this.group;i.removeAll();var o=this.visualMapModel,r=o.get("textGap"),t=o.textStyleModel,a=t.getFont(),s=t.getTextColor(),l=this._getItemAlign(),u=o.itemSize,e=this._getViewData(),t=e.endsText,h=Q(o.get("showLabel",!0),!t);t&&this._renderEndsText(i,t[0],u,h,l),N(e.viewPieceList,function(t){var e=t.piece,n=new $r;n.onclick=B(this._onItemClick,this,e),this._enableHoverLink(n,t.indexInModelPieceList);t=o.getRepresentValue(e);this._createItemSymbol(n,t,[0,0,u[0],u[1]]),h&&(t=this.visualMapModel.getValueState(t),n.add(new vl({style:{x:"right"===l?-r:u[0]+r,y:u[1]/2,text:e.text,verticalAlign:"middle",align:l,font:a,fill:s,opacity:"outOfRange"===t?.5:1}}))),i.add(n)},this),t&&this._renderEndsText(i,t[1],u,h,l),Xd(o.get("orient"),i,o.get("itemGap")),this.renderBackground(i),this.positionGroup(i)},sW.prototype._enableHoverLink=function(t,n){var i=this;t.on("mouseover",function(){return e("highlight")}).on("mouseout",function(){return e("downplay")});var e=function(t){var e=i.visualMapModel;e.option.hoverLink&&i.api.dispatchAction({type:t,batch:UH(e.findTargetDataIndices(n),e)})}},sW.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return YH(t,this.api,t.itemSize);e=e.align;return e&&"auto"!==e||(e="left"),e},sW.prototype._renderEndsText=function(t,e,n,i,o){var r,a;e&&(r=new $r,a=this.visualMapModel.textStyleModel,r.add(new vl({style:{x:i?"right"===o?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?o:"center",text:e,font:a.getFont(),fill:a.getTextColor()}})),t.add(r))},sW.prototype._getViewData=function(){var t=this.visualMapModel,e=P(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),i=t.get("orient"),t=t.get("inverse");return("horizontal"===i?t:!t)?e.reverse():n=n&&n.slice().reverse(),{viewPieceList:e,endsText:n}},sW.prototype._createItemSymbol=function(t,e,n){t.add(px(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},sW.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=C(n.selected),o=e.getSelectedMapKey(t);"single"===n.selectedMode?(i[o]=!0,N(i,function(t,e){i[e]=e===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})},sW.type="visualMap.piecewise",sW);function sW(){var t=null!==aW&&aW.apply(this,arguments)||this;return t.type=sW.type,t}qy.registerClass(Op),C_(IH);var lW={label:{enabled:!0},decal:{show:!1}},uW=_h(),hW={};Op=zm.VISUAL.ARIA;function cW(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}C_(function(t){var e;t&&t.aria&&(null!=(e=t.aria).show&&(e.enabled=e.show),e.label=e.label||{},N(["description","general","series","data"],function(t){null!=e[t]&&(e.label[t]=e[t])}))}),P_(Op,function(f,o){var t,r=f.getModel("aria");function g(t,e){if("string"!=typeof t)return t;var n=t;return N(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}r.get("enabled")&&(b((t=C(lW)).label,f.getLocaleModel().get("aria"),!1),b(r.option,t,!1),function(){{var n;r.getModel("decal").get("show")&&(n=ct(),f.eachSeries(function(t){var e;t.useColorPaletteOnData&&((e=n.get(t.type))||(e={},n.set(t.type,e)),uW(t).scope=e)}),f.eachRawSeries(function(i){var o,r,a,s,l,t,e;function u(t,e){e=t?O(O({},e),t):e;return e.dirty=!0,e}f.isSeriesFiltered(i)||("function"!=typeof i.enableAriaDecal?(o=i.getData(),i.useColorPaletteOnData?(r=i.getRawData(),a={},s=uW(i).scope,o.each(function(t){var e=o.getRawIndex(t);a[e]=t}),l=r.count(),r.each(function(t){var e=a[t],n=r.getName(t)||t+"",t=Of(i.ecModel,n,s,l),n=o.getItemVisual(e,"decal");o.setItemVisual(e,"decal",u(n,t))})):(t=Of(i.ecModel,i.name,hW,f.getSeriesCount()),e=o.getVisual("decal"),o.setVisual("decal",u(e,t)))):i.enableAriaDecal())}))}}(),function(){var t=f.getLocaleModel().get("aria"),u=r.getModel("label");if(u.option=A(u.option,t),!u.get("enabled"))return;var e=o.getZr().dom;if(u.get("description"))return e.setAttribute("aria-label",u.get("description"));var h=f.getSeriesCount(),c=u.get(["data","maxCount"])||10,n=u.get(["series","maxCount"])||10,p=Math.min(h,n);{var d,i;h<1||(i=function(){var t=f.get("title");t&&t.length&&(t=t[0]);return t&&t.text}(),t=i?g(u.get(["general","withTitle"]),{title:i}):u.get(["general","withoutTitle"]),d=[],n=1c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var o,r,a,s=[],l=0;l=h&&c<=e+1){for(var n=[],i=0;i=h&&c<=o+1)return function(t){for(var e=0,n=t.length,i=0,o=0;e\n\r<"))},rX)),t.Axis=mu,t.List=db,t.Model=Fp,t.PRIORITY=zm,t.color=gn,t.connect=function(e){var t;return F(e)&&(t=e,e=null,xx(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+w_++,xx(t,function(t){t.group=e})),__[e]=!0,e},t.dataTool={},t.dependencies={zrender:"5.0.1"},t.disConnect=M_,t.disconnect=r,t.dispose=function(t){"string"==typeof t?t=x_[t]:t instanceof n_||(t=I_(t)),t instanceof n_&&!t.isDisposed()&&t.dispose()},t.env=w,t.extendChartView=function(t){return tm.extend(t)},t.extendComponentModel=function(t){return nf.extend(t)},t.extendComponentView=N_,t.extendSeriesModel=function(t){return Fy.extend(t)},t.format=oS,t.getCoordinateSystemDimensions=function(t){if(t=Yf.get(t))return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.getInstanceByDom=I_,t.getInstanceById=function(t){return x_[t]},t.getMap=function(t){return(t=Wm(t))&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.graphic=aS,t.helper=Ea,t.init=function(t,e,n){var i=I_(t);if(i)return i;var o=new n_(t,e,n);return o.id="ec_"+b_++,x_[o.id]=o,Th(t,S_,o.id),$x(o),xx(f_,function(t){t(o)}),o},t.innerDrawElementOnCanvas=qv,t.matrix=Ae,t.number=iS,t.parseGeoJSON=Xw,t.parseGeoJson=kp,t.registerAction=A_,t.registerCoordinateSystem=L_,t.registerLayout=k_,t.registerLoading=R_,t.registerLocale=$p,t.registerMap=function(t,e,n){Hm(t,e,n)},t.registerPostInit=function(t){t&&f_.push(t)},t.registerPostUpdate=function(t){t&&g_.push(t)},t.registerPreprocessor=C_,t.registerProcessor=D_,t.registerTheme=T_,t.registerTransform=g,t.registerVisual=P_,t.setCanvasCreator=function(t){m("createCanvas",t)},t.throttle=hm,t.time=sf,t.util=rS,t.vector=Et,t.version="5.0.0",t.zrender=Pu,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/dist/echarts.simple.js b/dist/echarts.simple.js index 8cc9709470..69705996d7 100644 --- a/dist/echarts.simple.js +++ b/dist/echarts.simple.js @@ -189,7 +189,7 @@ } if (typeof console !== 'undefined') { - console.error.apply(args); + console.error.apply(console, args); } } @@ -3349,7 +3349,7 @@ this._target = target; this._loop = loop; - if (loop) { + if (loop && additiveTo) { logError('Can\' use additive animation on looped animation.'); return; } @@ -13614,7 +13614,7 @@ ZRender.prototype.refreshHoverImmediately = function () { this._needsRefreshHover = false; - if (this.painter.refreshHover) { + if (this.painter.refreshHover && this.painter.getType() === 'canvas') { this.painter.refreshHover(); } }; @@ -16575,7 +16575,7 @@ var fullDayFormatter = '{yyyy}-{MM}-{dd}'; var fullLeveledFormatter = { year: '{yyyy}', - month: '{yyyy}:{MM}', + month: '{yyyy}-{MM}', day: fullDayFormatter, hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, @@ -26269,7 +26269,7 @@ var isObject$2 = isObject; var version = '5.0.0'; var dependencies = { - zrender: '5.0.0' + zrender: '5.0.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_SERIES_FILTER = 800; diff --git a/dist/echarts.simple.js.map b/dist/echarts.simple.js.map index 15ef476673..b8c049bbc0 100644 --- a/dist/echarts.simple.js.map +++ b/dist/echarts.simple.js.map @@ -1 +1 @@ -{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","createObject","proto","properties","StyleCtor","hasOwn","own","noop","x","y","clone$1","v","add","out","v1","v2","sub","Math","sqrt","lenSquare","scale","normalize","distance","dist","distanceSquare","distSquare","lerp","applyTransform","m","min","max","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","transformCoordWithViewport","el","inX","inY","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy","mul","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","lift","color","level","colorArr","stringify","arrColor","lum","backgroundLum","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","floor","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","scaleAndAdd","dot","negate","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","offset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","random","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","ceil","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","B","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","L","Q","Z","R","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","exec","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","fontSize","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","leftIndex","lineXLeft","lineXRight","rightIndex","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","fontFamily","fontWeight","fontStyle","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","bottom","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","clearAnimation","pathToImage","eventHandler","registerPainter","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","queryDataIndex","payload","dataIndexInside","dataIndex","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","method","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","dataIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","count","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","aspect","pathRect","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","q","dateGetterName","H","hoursGetterName","minutesGetterName","secondsGetterName","S","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","convertToColorString","defaultColor","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getLayoutRect","positionInfo","containerRect","containerHeight","verticalMargin","horizontalMargin","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","hvIdx","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","useUTC","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","seriesId","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","creator","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","createTooltipMarkup","retrieveVisualColorForTooltipMarker","visualDrawType","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","markerColor","inlineValue","inlineValueType","subBlocks","sortParam","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","blocks","seriesNameSpecified","inlineName","header","noHeader","markerType","noName","valueType","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","param","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","PI2$6","CMD$3","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","tan","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","gaps","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","matrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","getType","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","zrender","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","url","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","to","finderOpt","fromResult","toResult","toSeries","dimension","dividingMethod","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","rate","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","baseAxis","getOtherAxis","valueStart","getValueStart","baseAxisDim","valueAxisDim","valueDim","baseDim","baseDataOffset","stacked","stackResultDim","dataDimsForPoint","getExtent","getStackedOnPoint","dataCoordInfo","stackedData","dataToPoint","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$4","mathMax$4","isPointNull","drawSegment","segLen","allLen","prevX","prevY","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","cartesian","hasAnimation","getArea","isHorizontal","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","toGlobalCoord","dataToCoord","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","getViewLabels","tickValue","axisExtent","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","expandSize","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","polyline","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","boundaryGap","deduplication","alignWithLabel","splitNumber","minorTick","primary","logBase","axisDefault","category","OrdinalMeta","_needCollect","needCollect","_deduplication","createByAxisModel","dedplication","getOrdinal","_getOrCreateMap","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","getCategories","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","extraOption","categorySortInfo","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","roundNumber","intervalScaleNiceTicks","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","dataNum","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","bandWidth","getBandWidth","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","axisKey","stackId","doCalBarWidthAndOffset","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","barMinHeight","isValueAxisH","valueAxisStart","getValueAxisStart","baseValue","baseCoord","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","direction","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","content","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","ticksCoords","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","tickModel","getTicksCoords","minorTickModel","minorTicksCoords","getMinorTicksCoords","minorTickLineStyle","minorTicksEls","axisLabelShow","labelModel","labelMargin","labels","labelRotation","rawCategoryData","formattedLabel","rawLabel","itemLabelModel","rawCategoryItem","fixValue","axisInfo","getAxisInfo","axisPointerModel","useHandle","isHandleTrigger","coordSysAxesInfo","axesInfo","makeKey","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$4","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","getAxes","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","containData","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","pointToData","coordToData","xExtent","getGlobalExtent","yExtent","inner$5","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","makeCategoryTicks","makeCategoryLabelsActually","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","fixExtentWithBands","getTickModel","tickVal","fixOnBandTicksCoords","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","littleThan","Axis2D","coordExtent","asc","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","getTooltipAxes","baseAxes","otherAxes","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$5","mathMin$5","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","orderMap","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","ShapeClass","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","nx","ny","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$7","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","DEFAULT_OPTION","inner$6","decalPaletteScope","ariaVisual","ariaModel","setDecal","setLabel","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","enableAriaDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesCount","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","RegExp","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,CAACD,MAAM,CAACO,OAAP,GAAiB,EAAlB,CADjC,CADA;AAGH,CAJA,EAIC,IAJD,EAIQ,UAAUL,OAAV,EAAmB;AAAE;AAE1B;;;;;;;;;;;;;AAcA;;AAEA,MAAIM,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,IAAAA,aAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,MAAAA,SAAS,EAAE;AAAb,iBAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,MAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAkB,KAD/D,IAEZ,UAAUD,CAAV,EAAaC,CAAb,EAAgB;AAAE,WAAK,IAAIK,CAAT,IAAcL,CAAd,EAAiB,IAAIA,CAAC,CAACM,cAAF,CAAiBD,CAAjB,CAAJ,EAAyBN,CAAC,CAACM,CAAD,CAAD,GAAOL,CAAC,CAACK,CAAD,CAAR;AAAc,KAF9E;;AAGA,WAAOP,aAAa,CAACC,CAAD,EAAIC,CAAJ,CAApB;AACH,GALD;;AAOA,WAASO,SAAT,CAAmBR,CAAnB,EAAsBC,CAAtB,EAAyB;AACrBF,IAAAA,aA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zB;AACA/9I,EAAAA,OAAO,CAACs+I,eAAR,GAA0BA,eAA1B;AACAt+I,EAAAA,OAAO,CAACiqF,cAAR,GAAyBA,cAAzB;AACAjqF,EAAAA,OAAO,CAAC6qH,WAAR,GAAsBA,WAAtB;AACA7qH,EAAAA,OAAO,CAACu9I,gBAAR,GAA2BA,gBAA3B;AACAv9I,EAAAA,OAAO,CAACw9I,kBAAR,GAA6BA,kBAA7B;AACAx9I,EAAAA,OAAO,CAACk9I,oBAAR,GAA+BA,oBAA/B;AACAl9I,EAAAA,OAAO,CAACo9I,iBAAR,GAA4BA,iBAA5B;AACAp9I,EAAAA,OAAO,CAACi9I,aAAR,GAAwBA,aAAxB;AACAj9I,EAAAA,OAAO,CAAC8+I,iBAAR,GAA4BA,iBAA5B;AACA9+I,EAAAA,OAAO,CAACi+I,cAAR,GAAyBA,cAAzB;AACAj+I,EAAAA,OAAO,CAAC4+I,gBAAR,GAA2BA,gBAA3B;AACA5+I,EAAAA,OAAO,CAAC8D,OAAR,GAAkBA,OAAlB;AAEArD,EAAAA,MAAM,CAAC4gC,cAAP,CAAsBrhC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEuH,IAAAA,KAAK,EAAE;AAAT,GAA7C;AAEH,CA3xiCA,CAAD","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\r\n out.zrX = _calcOut[0];\r\n out.zrY = _calcOut[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul(m, parent.transform, m);\r\n }\r\n else {\r\n copy(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n function delInstance(id) {\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover) {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n return zr;\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color) {\r\n if (typeof color !== 'string') {\r\n return color;\r\n }\r\n var liftedColor = liftedColorCache.get(color);\r\n if (!liftedColor) {\r\n liftedColor = lift(color, -0.1);\r\n liftedColorCache.put(color, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}:{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$6 = Math.PI * 2;\r\n var CMD$3 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$6;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$6;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$3.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$3.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$3.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.0'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$4 = Math.min;\r\n var mathMax$4 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$4(nextCpx0, mathMax$4(nextX, x));\r\n nextCpy0 = mathMin$4(nextCpy0, mathMax$4(nextY, y));\r\n nextCpx0 = mathMax$4(nextCpx0, mathMin$4(nextX, x));\r\n nextCpy0 = mathMax$4(nextCpy0, mathMin$4(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$4(cpx1, mathMax$4(prevX, x));\r\n cpy1 = mathMin$4(cpy1, mathMax$4(prevY, y));\r\n cpx1 = mathMax$4(cpx1, mathMin$4(prevX, x));\r\n cpy1 = mathMax$4(cpy1, mathMin$4(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$4 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$4(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$4(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$4(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var inner$5 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$5(axis)[prop] || (inner$5(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$5(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$5(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$5(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$5 = Math.max;\r\n var mathMin$5 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$5(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$5(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$5(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$5(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$5(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$5(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$7 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$7;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$7 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$7 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$7 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$6 = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$6(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$6(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n exports.PRIORITY = PRIORITY;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.init = init$1;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.version = version;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file +{"version":3,"sources":["unknown"],"names":["global","factory","exports","module","define","amd","self","echarts","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__spreadArrays","il","r","k","a","j","jl","Browser","firefox","ie","edge","weChat","Env","browser","node","wxa","worker","canvasSupported","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","env","wx","getSystemInfoSync","document","navigator","detect","userAgent","ua","match","test","version","createElement","getContext","SVGRect","window","BUILTIN_OBJECT","TYPED_ARRAY","objToString","toString","arrayProto","nativeForEach","forEach","nativeFilter","filter","nativeSlice","slice","nativeMap","map","ctorFunction","protoFunction","methods","$override","name","fn","idStart","guid","logError","args","_i","console","error","clone","source","result","typeStr","isPrimitive","len","Ctor","from","isDom","key","merge","target","overwrite","isObject","targetProp","sourceProp","isArray","isBuiltInObject","extend","defaults","overlay","keysArr","keys","createCanvas","indexOf","array","value","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","data","each","arr","cb","context","push","reduce","memo","obj","bindPolyfill","func","concat","bind","isFunction","curry","isString","isStringSafe","isNumber","type","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isPatternObject","image","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","val","assert","condition","message","Error","trim","str","replace","primitiveKey","setAsPrimitive","HashMap","isArr","thisMap","visit","set","get","removeKey","createHashMap","createObject","proto","properties","StyleCtor","hasOwn","own","noop","x","y","clone$1","v","add","out","v1","v2","sub","Math","sqrt","lenSquare","scale","normalize","distance","dist","distanceSquare","distSquare","lerp","applyTransform","m","min","max","Param","e","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","draggable","parent","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","event","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","h","wrap","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","l","trigger","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rank","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","src","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","transformCoordWithViewport","el","inX","inY","inverse","getBoundingClientRect","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","style","idxLR","idxTB","cssText","join","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","left","top","offsetLeft","offsetTop","nodeName","toUpperCase","isDomLevel2","addEventListener","MOUSE_EVENT_REG","_calcOut","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","detail","touch","targetTouches","changedTouches","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","opt","attachEvent","removeEventListener","detachEvent","stop","preventDefault","stopPropagation","cancelBubble","returnValue","GestureMgr","_track","recognize","root","_doTrack","_recognize","clear","touches","trackItem","points","pos","recognizers","gestureInfo","dist$1","pointPair","center","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","Handler","storage","painter","proxy","painterRoot","_hovered","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","zrIsToLocalDOM","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","__hostTarget","eachOtherLayer","layer","exclude","list","getDisplayList","hoverCheckResult","ignore","isHover","processGesture","stage","_gestureMgr","gestureMgr","dom","res","_downEl","_downPoint","_upEl","displayable","rectHover","ignoreClip","clipPath","getClipPath","contain","hostEl","handlerInstance","getWidth","getHeight","create$1","identity","copy","mul","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","scale$1","vx","vy","invert","mIdentity","EPSILON","isNotAroundZero","scaleTmp","tmpTransform","originTransform","Transformable","setPosition","setScale","scaleX","scaleY","setOrigin","originX","originY","needLocalTransform","rotation","updateTransform","parentHasTransform","transform","getLocalTransform","_resolveGlobalScaleRatio","globalScaleRatio","getGlobalScale","relX","relY","sx","sy","invTransform","getComputedTransform","transformNode","ancestors","pop","setLocalTransform","atan2","PI","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","initDefaultProps","easing","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","Clip","opts","_initialized","_startTime","_pausedTime","_paused","_life","life","_delay","delay","loop","gap","onframe","ondestroy","onrestart","step","globalTime","deltaTime","percent","easing$1","easingFunc","schedule","_restart","remainder","pause","resume","Entry","LinkedList","_len","insert","entry","insertEntry","head","tail","next","prev","remove","LRU","maxSize","_list","_maxSize","_map","put","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssFloat","f","parseCssInt","charAt","parseFloat","parseInt","parseCssFloat","cssHueToRgb","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","iv","op","ep","fname","substr","params","split","alpha","hsla2rgba","hsla","rgba","lift","color","level","colorArr","stringify","arrColor","lum","backgroundLum","arraySlice","interpolateNumber","p0","p1","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillArray","val0","val1","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","isNaN","is1DArraySame","catmullRomInterpolate","p2","p3","t2","t3","v0","catmullRomInterpolate1DArray","catmullRomInterpolate2DArray","cloneValue","ret","rgba2String","floor","guessArrayDim","tmpRgba","Track","propName","keyframes","maxTime","interpolable","_needsSort","_isAllValueEqual","_lastFrame","_lastFramePercent","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","time","arrayDim","lastFrame","colorArray","isValueColor","kf","prepare","additiveTrack","kfs","sort","kfsLen","lastKf","startValue","additiveValue","isAdditive","valueKey","kfsNum","frameIdx","start","nextFrame","frame","range","w","targetArr","_additiveValue","useSpline","_addToTarget","Animator","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","getTarget","changeTarget","when","props","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","lastFinalKf","isPaused","_doneCallback","_setTracksFinished","doneList","_doneList","_abortedCallback","animation","abortedList","_abortedList","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","forceAnimate","clip","stillHasAdditiveAnimator","onframeList","_onframeList","addClip","forwardToLast","during","done","aborted","getClip","stopTracks","allAborted","saveFinalToTarget","trackKeys","__changeFinalValue","finalProps","Point","other","equal","scalar","scaleAndAdd","dot","negate","toArray","fromArray","input","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","width","height","union","calculateTransform","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","plain","isZero","tx","ty","maxX","maxY","textWidthCache","DEFAULT_FONT","_ctx","_cachedFont","defaultMeasureText","text","font","measureText","methods$1","cacheOfFont","innerGetBoundingRect","textAlign","textBaseline","getLineHeight","adjustTextX","adjustTextY","getBoundingRect","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","position","halfHeight","textVerticalAlign","align","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","id","animators","currentStates","states","_init","attr","markRedraw","beforeUpdate","afterUpdate","update","__dirty","updateInnerText","forceUpdate","textEl","_textContent","textConfig","isLocal","local","attachedTransform","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","offset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","fill","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","traverse","attrKV","setTextConfig","setTextContent","setClipPath","extra","hide","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","animator","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","toNormalState","hasStates","animationCfg","stateTransition","state","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","duration","_textGuide","_updateAnimationTargets","REDARAW_BIT","useStates","stateObjects","notChange","stateObj","mergedState","_mergeStates","removeState","idx","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","getTextContent","previousTextContent","removeTextContent","cfg","getTextGuideLine","setTextGuideLine","guideLine","removeTextGuideLine","textGuide","refreshHover","refresh","dirty","inHover","textContent","addAnimator","removeAnimator","animate","updateDuringAnimation","wakeUp","stopAnimation","scope","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","logs","logDeprecatedError","xKey","yKey","warn","createLegacyProperty","privateKey","defineProperty","enhanceArray","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","force","copyArrShallow","is2DArray","copyValue","sourceArr","len0","len1","topKey","animatableKeys","changedKeys","targetKeys","additive","setToFinal","animateAll","innerKey","keyLen","existsAnimators","existsAnimatorsOnSameTarget","revertedSource","reversedTarget","sourceClone","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","right","mid","gallopLeft","hint","lastOffset","maxOffset","tmp","gallopRight","TimSort","minGallop","runStart","runLength","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","_minGallop","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","invalidZErrorLogged","logInvalidZError","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","userSetClipPath","currentClipPath","parentClipPath","childrenRef","children","child","disp","__clipPaths","decalEl","getDecalElement","addRoot","delRoot","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout","requestAnimationFrame$1","Animation","_running","_time","_pauseStart","_clipsHead","_clipsTail","notTriggerFrameAndStageUpdate","Date","getTime","nextClip","finished","_startLoop","options","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","instance","FakeGlobalEvent","isLocalEl","elTmp","domBelongToZr","parentNode","stopImmediatePropagation","currentTarget","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","__pointerCapturing","element","toElement","relatedTarget","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","click","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","STYLE_MAGIC_KEY","random","DEFAULT_COMMON_STYLE","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","opacity","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS$1","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","invisible","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","ceil","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","STYLE_CHANGED_BIT","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","getAnimationStyleProps","mergedStyle","dispProto","incremental","tmpRect","viewRect","mathPow","mathSqrt","EPSILON$1","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero$1","cubicAt","cubicDerivativeAt","cubicRootAt","c","A","B","C","t1","disc","K","discSqrt","Y1","Y2","T","theta","acos","ASqrt","cubicExtrema","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x1","y1","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","quadraticAt","quadraticDerivativeAt","quadraticRootAt","quadraticExtremum","divider","quadraticSubdivide","quadraticProjectPoint","quadraticLength","mathMin$1","mathMax$1","mathSin","mathCos","PI2","end","extremity","fromLine","xDim","yDim","fromCubic","cubicExtrema$1","cubicAt$1","fromQuadratic","quadraticExtremum$1","quadraticAt$1","fromArc","rx","ry","startAngle","endAngle","anticlockwise","min$1","max$1","vec2Min","vec2Max","diff","angle","CMD","M","L","Q","Z","R","tmpOutX","tmpOutY","min2","max2","mathMin$2","mathMax$2","mathCos$1","mathSin$1","mathSqrt$1","mathAbs","PI2$1","hasTypedArray","Float32Array","tmpAngles","modPI2","radian","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_version","_xi","_yi","_x0","_y0","_saveData","increaseVersion","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_lineDash","_dashOffset","_pathSegLen","_pathLen","moveTo","addData","lineTo","exceedUnit","_needsDash","_dashedLineTo","bezierCurveTo","_dashedBezierTo","quadraticCurveTo","_dashedQuadraticTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setLineDash","lineDash","_dashIdx","lineDashSum","_dashSum","setLineDashOffset","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","dashSum","nDash","dash","bezierLen","tmpLen","Number","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","drawPart","accumLength","displayedLength","psi","isEllipse","breakBuild","ellipse","d_1","containStroke","lineWidth","_l","_a","_b","_s","containStroke$1","containStroke$2","PI2$2","normalizeRadian","PI2$3","containStroke$3","windingLine","dir","x_","CMD$1","PI2$4","EPSILON$2","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","containStroke$4","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBundle","pathUpdated","SHAPE_CHANGED_BIT","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectWithStroke","_rectWithStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","init","pathProto","subPixelOptimize","autoBatch","CMD$2","mathSqrt$2","mathAtan2","transformPath","nPoint","p_1","mathSqrt$3","mathSin$2","mathCos$2","PI$1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","cpx","cpy","subpathX","subpathY","prevCmd","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","replaceAt","index","old","removeAll","eachChild","stopped","includeChildren","tmpMat","childRect","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","size","imageSource","__image","otherDim","otherDimSize","CircleShape","Circle","r1","r2","r3","r4","total","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","EllipseShape","Ellipse","subPixelOptimizeOutputShape$1","LineShape","Line","pointAt","interpolate","smoothSpline","isLoop","distance$1","segs","w2","w3","smoothBezier","smooth","constraint","cps","prevPoint","nextPoint","point","cp0","cp1","shift","buildPath$1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","Gradient","addColorStop","LinearGradient","globalCoord","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","parseXML","svg","parser","DOMParser","parseFromString","svgNode","firstChild","PI$2","PI2$5","mathSin$3","mathCos$3","mathACos","mathATan2","mathAbs$1","mathSqrt$4","mathMax$3","mathMin$3","x10","y10","x32","y32","computeCornerTangents","cr","clockwise","x01","y01","x11","y11","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","buildPath$2","innerRadius","r0","hasRadius","hasInnerRadius","cornerRadius","innerCornerRadius","halfRd","icr","cr0","cr1","xrs","yrs","xire","yire","xre","yre","xirs","yirs","it_1","ct0","ct1","SectorShape","Sector","CompoundPath","_updatePathDirty","paths","dirtyPath","IncrementalDisplayble","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","onload","cbPayload","__zrImageSrc","pendingWrap","isImageReady","pending","Image","onerror","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","subLength","estimateLength","charCode","charCodeAt","parsePlainText","overflow","padding","truncate","calculatedLineHeight","lineHeight","truncateLineOverflow","lineOverflow","lines","wrapText","contentHeight","lineCount","outerHeight","outerWidth","truncateMinChar","maxWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","exec","matchedIndex","pushTokens","substring","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","isEmptyStr","newLine","strLines","linesWidths","tokenPadding","tokenPaddingH","outerWidth_1","parsePercent$1","isLineHolder","tokensLen","isLatin","ch","code","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","fontSize","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderColor","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","bgColorDrawn","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","hasShadow","fixedBoundingRect","subElStyle","xLeft","lineTop","xRight","tokenCount","remainedWidth","leftIndex","lineXLeft","lineXRight","rightIndex","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","textBorderWidth","textBorderColor","isPlainBg","textBorderRadius","rectEl","imgEl","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","fontFamily","fontWeight","fontStyle","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","bottom","middle","normalizeStyle","ArcShape","Arc","unitX","unitY","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","DropletShape","Droplet","HeartShape","Heart","PI$3","IsogonShape","Isogon","dStep","deg","RingShape","Ring","sin$1","cos$1","RoseShape","Rose","PI$4","cos$2","sin$2","StarShape","Star","xStart","yStart","ri","cos$3","sin$3","TrochoidShape","location","Trochoid","num","RadialGradient","extent","extent2","minTv$1","maxTv$1","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","axes","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","useVML","painterCtors","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","vml","useDirtyRect","handerProxy","getViewportRoot","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","flush","triggerRendered","refreshHoverImmediately","elapsedTime","setSleepAfterStill","stillFramesCount","addHover","removeHover","clearHover","getType","clearAnimation","pathToImage","eventHandler","registerPainter","RADIAN_EPSILON","_trim","linearMap","domain","clamp","subDomain","subRange","parsePercent$2","all","NaN","round$1","precision","returnStr","toFixed","getPrecisionSafe","eIndex","dotIndex","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentWithPrecision","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","remRadian","pi2","isRadianAroundZero","TIME_REG","parseDate","hour","UTC","quantity","quantityExponent","exp","nice","exponent","exp10","nf","numericToNumber","valFloat","isNumeric","getRandomIdBase","getGreatestCommonDividor","getLeastCommonMultiple","ECHARTS_PREFIX","storedLogs","hasConsole","deprecateLog","deprecateReplaceLog","oldOpt","newOpt","consoleLog","makePrintable","hintInfo","msg","makePrintableStringIfPossible_1","toISOString","arg","printableStr","JSON","err","throwError","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","mode","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","isValidIdOrName","warnInvalidateIdOrName","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","queryDataIndex","payload","dataIndexInside","dataIndex","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","finder","queryOptionMap","mainTypeSpecified","parsedKey","queryType","includeMainTypes","queryOption","defaultMainType","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","SINGLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","method","ExtendedClass","isESClass","ins","superCall","superApply","Function","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","registerClass","componentFullType","componentTypeInfo","container","makeContainer","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","registerWhenExtend","originalExtend_1","makeStyleMapper","ignoreParent","model","excludes","includes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","getECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","eachComponent","view","getViewOfSeriesModel","getViewOfComponentModel","group","toggleSeriesBlurState","targetSeriesIndex","focus","blurScope","isBlur","leaveBlurOfIndices","dataIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurSeries","toggleSeriesBlurStateFromPayload","isHighDownPayload","isHighlight","seriesIndex","dataType","count","current","ecData","focus_1","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","getHighlightDigit","highlightKey","payloadType","savePathStates","selectState","select","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","aspect","pathRect","animateOrSetProps","animationType","animatableModel","isFrom","removeOpt","isUpdate","isRemove","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","animationEasing","animationDelay","getAnimationDelayParams","updateProps","initProps","removeElement","isElementRemoved","fadeOutDisplayable","removeElementWithFadeOut","doRemove","isNotGroup","isPath","groupTransition","g1","g2","getElMap","elMap","anid","getAnimatableProps","elMap1","oldEl","newProp","EMPTY_OBJ","setLabelText","label","labelTexts","oldStates","normal","getLabelText","stateModels","overrideValue","labelFetcher","labelDataIndex","labelDimIndex","normalModel","baseText","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","globalTextStyle","option","richItemNames","getRichItemNames","richResult","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currentValue","labelText","PATH_COLOR","tmpRichText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","base","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","topologicalTravel","targetNameList","fullNameList","callback","makeDepndencyGraph","graph","noEntryList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","originalDeps","successor","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","entryCount","thisItem","createDependencyGraphItem","availableDeps","getAvailableDependencies","dependentName","predecessor","thatItem","dep","inheritDefaultOption","superOption","subOption","langEN","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","title","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","back","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","tree","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","langZH","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","documentElement","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","pad","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","q","dateGetterName","H","hoursGetterName","minutesGetterName","secondsGetterName","S","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults$1","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","normalizeCssArray$1","replaceReg","replaceMap","encodeHTML","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","encode","seriesLen","$vars","alias","convertToColorString","defaultColor","each$1","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","maxHeight","currentLineMaxSize","nextChild","nextChildRect","nextX","nextY","moveX","newline","moveY","vbox","hbox","getLayoutRect","positionInfo","containerRect","containerHeight","verticalMargin","horizontalMargin","fetchLayoutMode","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","hvIdx","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","uid","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","protoInitialize","componentIndex","getDependencies","deps","dependencies","unshift","platform","decalColor","globalDefault","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","dashLineOffset","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","useUTC","VISUAL_DIMENSIONS","SOURCE_FORMAT_ORIGINAL","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_OBJECT_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","inheritSourceMetaRawOption","upstream","newMetaRawOption","parentMetaRawOption","metaRawOption","seriesLayoutBy","sourceHeader","startIndex","dimensions","dimensionsDefine","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","encodeItemName","encodeSeriesName","baseCategoryDimIndex","categoryWayValueDimStart","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","coordDimName","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","sourceFormat","potentialNameDimIndex","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","maxLoop","dimName","dimType","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","reCreateSeriesIndices","assertSeriesInitialized","initBase","OPTION_INNER_KEY","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","componentOption","mainTypeInReplaceMerge","visitComponent","oldCmptList","mergeMode","optionsByMainType","cmptsByMainType","cmptsCountByMainType","ComponentModelClass","extraOpt","__requireNewView","_seriesIndices","getOption","optInMainType","realLen","metNonInner","getLocale","localePosition","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","components","component","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","seriesId","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","creater","getCoordinateSystems","register","creator","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","singleMedia","doPreprocess","preProcess","realMap","aspectratio","applicatable","matched","operator","realAttr","real","expect","indices1","indices2","each$2","isObject$1","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","nodes","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","hostModel","SourceImpl","dimensionsDetectedCount","encodeDefine","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","makeEncodeDefine","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","dimensions_1","nameMap","rawItem","displayName","exist","_c","providerMethods","mountMethods","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getProvider","dimInfo","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","rawValue","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","isSeries","userOutput","componentSubType","dimensionNames","status","extendParams","getItemModel","dimensionIndex","formatTooltip","multipleSeries","createTask","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","upTask","_upstream","skip","outputData","__pipeline","currentTask","planResult","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","forceFirstProgress","_doReset","_outputDueEnd","_dueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","parseDataValue","ordinalMeta","parseAndCollect","valueParserMap","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","__isBuiltIn","rawValueGetter","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","print","printStrArr","pipeIndexStr","datasetIndex","resultData","resultMetaRawOption","SourceManager","sourceHost","_sourceList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","resultSourceList","upSourceMgr","_getSourceMetaRawOption","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","upSrcMgr","sourceIndex","getSourceManager","disableTransformOptionMerge","createTooltipMarkup","retrieveVisualColorForTooltipMarker","visualDrawType","defaultSeriesFormatTooltip","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","markerColor","inlineValue","inlineValueType","subBlocks","sortParam","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","blocks","seriesNameSpecified","inlineName","header","noHeader","markerType","noName","valueType","isValueMultipleLine","dimItem","setEachItem","otherDims","inner$1","getSelectionKey","getId","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","selectedMode","lastDataIndex","hasItemOption","useColorPaletteOnData","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","param","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","inner$2","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","dataIdx","progressMethodMap","incrementalPrepareRender","incrementalRender","throttle","debounce","currCall","lastCall","lastExec","timer","debounceNextCall","cbArgs","thisDelay","thisDebounce","debounceDelay","inner$3","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","rawIdx","fromPalette","dataCount","PI$5","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","mask","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","needSetDirty","performArgs_1","setDirty","dirtyMap","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","cond","Clz","colorAll","lightTheme","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","colorPalette","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","DatasetModel","_sourceManager","DatasetView","mapDataStorage","registerMap","mapName","rawDef","rawSpecialAreas","records","specialAreas","geoSource","geoJson","geoJSON","features","parsers","retrieveMap","svgXML","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","check","filterForExposedEvent","host","propOnHost","seriesSymbolTask","legendSymbol","symbolType","keepAspect","symbolRotate","hasSymbolTypeCallback","hasSymbolSizeCallback","hasSymbolRotateCallback","hasCallback","seriesSymbol","seriesSymbolSize","seriesSymbolRotate","symbolKeepAspect","dataSymbolTask","itemSymbolType","itemSymbolSize","itemSymbolRotate","itemSymbolKeepAspect","getItemVisualFromData","getVisualFromData","PI2$6","CMD$3","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","minDist","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelLine","labelGuideConfig","textGuideLineConfig","searchSpace","candidates","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","tan","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","showAbove","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","priority","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","totalShifts","shiftList","first","last","minGap","maxGap","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","gaps","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","chartView","__model","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldOpacity","prevStates","oldLayoutSelect","oldLayoutEmphasis","layoutSelect","layoutEmphasis","newLayout","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","normalizeLineDash","lineType","pathProxyForDraw","styleHasStroke","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","matrix","rotateSelf","scaleSelf","translateSelf","setTransform","brushPath","inBatch","strokePart","firstDraw","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","ctxLineDash","lineScale_1","needsRebuild","brushImage","drawImage","brushText","hasLineDash","lineScale_2","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","returnFalse","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","domStyle","onselectstart","webkitUserSelect","userSelect","webkitTapHighlightColor","domBack","ctxBack","getElementCount","initContext","setUnpainted","createBackBuffer","createRepaintRects","prevList","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","hasIntersections","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearRect","clearColorGradientOrPattern","__canvasGradient","__painter","fillRect","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","parseInt10","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","innerHTML","zlevelList","layers","_width","_height","_domRoot","rootCanvas","mainLayer","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","self_1","eachLayer","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","startTime","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","getLayers","updatePrevLayer","incrementalLayerCount","prevZlevel","_clearLayer","layerConfig","_zlevel","delLayer","removeChild","display","clearLayer","getRenderedCanvas","imageLayer","pixelRatio","width_1","height_1","ctx_1","renderToCanvas","whIdx","wh","cwh","plt","prb","defaultView","getComputedStyle","canvas","shadowBlurSize","leftMargin","rightMargin","topMargin","bottomMargin","pathTransform","imgShape","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","WeakMap","_id","_guard","enumerable","configurable","has","TypeError","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","thickness","symbolBuildProxies","SymbolClz","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","createSymbol","symbolPath","setColor","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","svgElement","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","createSVGElement","pSize","getPatternSize","brushDecal","svgWidth","svgHeight","xlen","symbolRepeats","attrName","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","isAllString","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","assert$1","each$3","isFunction$1","isObject$2","zrender","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","OPTION_UPDATED_KEY","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","disposedWarning","toLowercaseNameAndCallEventful","createRegisterEventWithLowercaseMessageCenter","MessageCenter","messageCenterProto","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","performPostUpdateFuncs","createExtensionAPI","enableConnect","setTransitionOpt","markStatusToUpdate","applyChangedStates","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultUseDirtyRect","__ECHARTS__DEFAULT__RENDERER__","devUseDirtyRect","__ECHARTS__DEFAULT__USE_DIRTY_RECT__","_zr","_throttledZrFlush","_coordSysMgr","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_labelManager","_initEvents","_onframe","remainTime","_model","getDom","notMerge","lazyUpdate","transitionOpt","setTheme","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","url","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","instances","chart","getSvgDom","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","labelManager","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","viewId","classType","Clazz","__id","__ecComponentInfo","callView","excludeSeriesId","excludeSeriesIdMap","modelId","notBlur","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isStatusChange","batchItem","action","newObj","pendingActions","dispatcher","dirtyList","updateZ","updateStates","__transientTransitionOpt","updateBlend","updateHoverLayerStatus","postUpdateFuncs","applyElementStates","newStates","elCount","preventUsingHoverLayer","preventAutoZ","stateAnimationModel","enableAnimation","class_1","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","transOpt","fromOpt","toOpt","to","finderOpt","fromResult","toResult","toSeries","dimension","dividingMethod","echartsProto","one","wrapped","args2","postInitFuncs","idBase","groupIdBase","init$1","existInstance","getInstanceByDom","clientWidth","clientHeight","postInitFunc","connect","disConnect","disconnect","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","processor","normalizeRegister","registerPostInit","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","getDimensionsInfo","registerLayout","layoutTask","registerVisual","visualTask","targetList","defaultPriority","__raw","registerLoading","loadingFx","extendComponentModel","extendComponentView","extendSeriesModel","extendChartView","setCanvasCreator","getMap","registerTransform","dataTool","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_add","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dimArr","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","DataDimensionInfo","mathFloor","isObject$3","map$1","UNDEFINED","INDEX_NOT_FOUND","ID_PREFIX","dataCtors","Float64Array","Int32Array","CtorUint32Array","Uint32Array","CtorInt32Array","CtorUint16Array","Uint16Array","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","defaultDimValueGetters","prepareInvertedIndex","getIndicesCtor","prepareStorage","getRawIndexWithoutIndices","getRawIndexWithIndices","getIdNameFromStore","makeIdFromName","normalizeDimensions","validateDimensions","cloneListForMapAndSample","getInitialExtent","setItemDataAndSeriesIndex","transferProperties","List","_rawCount","_storage","_storageArr","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_rawExtent","_extent","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","dimensionInfos","invertedIndicesMap","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","_nameOrdinalMeta","itemId","_idDimIdx","_idOrdinalMeta","_dimensionInfos","_dimensionsSummary","_invertedIndicesMap","getDimension","getDimensionsOnCoord","mapDimension","dimensionsSummary","initData","nameList","dimValueGetter","notProvider","_rawData","_indices","_dontMakeIdFromName","_nameRepeatCount","defaultDimValueGetter","_dimValueGetter","_dimValueGetterArrayRows","arrayRows","_initDataFromProvider","appendValues","values","dimLen","rawExtent","rawExtentArr","storageArr","emptyDataItem","sourceIdx","dimIdx","dimRawExtent","append","dimensionInfoMap","idList","isFormatOriginal","dimStorage","getIndices","newIndices","thisCount","buffer","getByDimIdx","dimStore","getValues","getDataExtent","dimData","initialExtent","currEnd","useRaw","getApproximateExtent","setApproximateExtent","getSum","getMedian","dimDataArray","sortedDimDataArray","invertedIndices","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDiff","nearestIndicesLen","ctxCompat","fCtx","dimNames","dimIndices","filterSelf","dim0","selectRange","originalCount","quickFinished","dimStorage2","val2","dimk","mapArray","tmpRetValue","retValue","rawExtentOnDim","downSample","rate","sampleValue","sampleIndex","targetStorage","frameValues","frameSize","sampleFrameIdx","lttbDownSample","valueDimension","sampledIndex","currentRawIndex","maxArea","area","nextRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","dimensionInfoList","injectFunction","originalMethod","__wrappedMethods","getDimValueSimply","objectRows","keyedColumns","original","typedArray","chunk","DataCtor","oldStore","oldLen","newStore","excludeDimensions","allDimensions","originalStorage","cloneChunk","originalChunk","childECData","thisECData","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","completeDimensions","sysDims","dataDimNameMap","coordDimNameMap","getDimCount","dimDefItemRaw","userDimName","encodeDef","encodeDefaulter","encodeDefMap","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","genName","optDimCount","createDimensions","dimensionsCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","byIndex","stackedCoordDimension","mayStack","stackedByDimInfo","stackedDimInfo","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","isCalculationCoord","isDimensionStacked","stackedDim","getStackedDimension","targetDim","createListFromArray","registeredCoordSys","coordSysInfo","coordSysDimDefs","useEncodeDefaulter","dimInfoList","hasNameEncode","categoryAxisModel","getOrdinalMeta","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","LineSeriesModel","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","getDefaultLabel","labelDims","vals","getDefaultInterpolatedLabel","interpolatedValue","Symbol","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolPath","setZ","setDraggable","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","_seriesModel","emphasisItemStyle","blurItemStyle","selectItemStyle","symbolOffset","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","_getSymbolPoint","isPersistent","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","baseAxis","getOtherAxis","valueStart","getValueStart","baseAxisDim","valueAxisDim","valueDim","baseDim","baseDataOffset","stacked","stackResultDim","dataDimsForPoint","getExtent","getStackedOnPoint","dataCoordInfo","stackedData","dataToPoint","supportFloat32Array","Float32ArrayCtor","createFloat32Array","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldDataNewCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","oldDataDimsForPoint","newPt","newStackedOnPt","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","mathMin$4","mathMax$4","isPointNull","drawSegment","segLen","allLen","prevX","prevY","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","cartesian","hasAnimation","getArea","isHorizontal","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","stepPt2","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","toGlobalCoord","dataToCoord","stopLen","outerColors","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","getViewLabels","tickValue","axisExtent","availSize","isPointNull$1","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","nextIndex","createLineClipPath","lineView","endLabelModel_1","showEndLabel","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","expandSize","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","polyline","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_initSymbolLabelAnimation","_newPolyline","_newPolygon","_initOrUpdateEndLabel","_stackedOnPoints","_points","_doUpdateAnimation","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDalay","seriesDalayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimInfo0","dimInfo1","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","boundaryGap","deduplication","alignWithLabel","splitNumber","minorTick","primary","logBase","axisDefault","category","OrdinalMeta","_needCollect","needCollect","_deduplication","createByAxisModel","dedplication","getOrdinal","_getOrCreateMap","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","AxisModel","getAxisType","thisOption","__ordinalMeta","getCategories","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","extraOption","categorySortInfo","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","roundNumber","intervalScaleNiceTicks","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","contain$1","normalize$1","scale$2","OrdinalScale","_ordinalMeta","_categorySortInfo","getCategoryIndex","getTicks","ticks","getMinorTicks","setCategorySortInfo","getCategorySortInfo","beforeSortIndex","displayIndex","ordinalNumber","getLabel","cateogry","niceTicks","niceExtent","roundNumber$1","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","dataNum","fixMax","fixMin","STACK_PREFIX","LARGE_BAR_MIN_WIDTH","LargeArr","getSeriesStackId","getAxisKey","prepareLayoutBarSeries","isOnCartesian","isInLargeMode","getValueAxesMinGaps","barSeries","axisValues","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","bandWidth","getBandWidth","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","barGap","barCategoryGap","axisKey","stackId","doCalBarWidthAndOffset","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","widthSum","lastColumn","retrieveColumnLayout","barWidthAndOffset","lastStackCoords","columnLayoutInfo","columnOffset","columnWidth","barMinHeight","isValueAxisH","valueAxisStart","getValueAxisStart","baseValue","baseCoord","largeLayout","coordLayout","getRect","valueAxisHorizontal","valueDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","valuePair","pointsOffset","idxOffset","backgroundStart","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","getPrecisionSafe$1","roundingErrorFix","mathFloor$1","mathCeil","mathPow$1","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","frozen","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","createScaleByModel","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","PI$6","AxisBuilder","nameDirection","tickDirection","labelDirection","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","direction","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","gapSignal","isNameLocationCenter","labelLayout","nameRotation","axisNameAvailableWidth","endTextLayout","truncateOpt","nameTruncateMaxWidth","formatterParams","content","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","ticksCoords","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickCoord","tickEl","tickModel","getTicksCoords","minorTickModel","minorTicksCoords","getMinorTicksCoords","minorTickLineStyle","minorTicksEls","axisLabelShow","labelModel","labelMargin","labels","labelRotation","rawCategoryData","formattedLabel","rawLabel","itemLabelModel","rawCategoryItem","fixValue","axisInfo","getAxisInfo","axisPointerModel","useHandle","isHandleTrigger","coordSysAxesInfo","axesInfo","makeKey","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","layout$1","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","inner$4","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","gridRect","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","getCartesians","otherAxisType","axisElementBuilders","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","seriesModelMap","seriesRecords","axisRecordMap","prepareDataExtentOnAxis","calculateFilteredExtent","shrinkAxisExtent","axesModelMap","xAxis","yAxis","xRawExtentInfo","yRawExtentInfo","prepareAxisRecord","condExtent","seriesRecord","xAxisRecord","yAxisRecord","condDimMap","tarDimMap","condAxis","tarAxisRecord","addCondition","axisRecord","addTarget","condDims","tarDims","tarDimExtents","initExtent","condDimsLen","tarDimsLen","singleCondDim","singleTarDim","condVal","tarDimExtent","tarAxisExtent","tarExtent","GridModel","containLabel","GridView","Cartesian","_dimList","getAxes","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","containData","xVal","yVal","clampData","xScale","yScale","xAxisExtent","yAxisExtent","pointToData","coordToData","xExtent","getGlobalExtent","yExtent","inner$5","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","makeCategoryTicks","makeCategoryLabelsActually","labelCategoryInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","numericLabelInterval","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","ticksCache","optionTickInterval","tickCategoryInterval","labelsResult","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","dw","dh","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","onBand","fixExtentWithBands","getTickModel","tickVal","fixOnBandTicksCoords","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","littleThan","Axis2D","coordExtent","asc","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","axesList","adjustAxes","labelUnionRect","updateAxisTransform","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","getTooltipAxes","baseAxes","otherAxes","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","BaseBarSeriesModel","getMarkerPosition","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","selectors","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","unitStartX","unitStartY","unitEndX","unitEndY","lessThanCircle","BAR_BORDER_WIDTH_QUERY","BAR_BORDER_RADIUS_QUERY","_eventPos","mathMax$5","mathMin$5","getClipArea","coordSysClipArea","expandWidth","BarView","_isFirstFrame","removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","axis2DModel","_initSort","_onRendered","orderMap","_updateSort","needsClip","drawBackground","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","bgEl","createBackgroundEl","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dataSort","mappedValue","_isDataOrderChanged","oldOrder","oldCount","lastValue","isOrderChanged","newOrder","axisId","sortInfo","coordSysBoundingRect","signWidth","signHeight","clipped","signR","__dataIndex","animateProperty","ShapeClass","sector","sectorShape","animateTarget","seriesTarget","axisTarget","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","__startPoint","baseDimIdx","__baseDimIdx","backgroundStartPoint","__largeDataIndices","__barWidth","setLargeBackgroundStyle","setLargeStyle","largePathUpdateDataIndex","largePath","largePathFindDataIndex","barWidthHalf","startValueVal","pointerBaseVal","pointerValueVal","baseLowerBound","baseUpperBound","barBaseVal","barValueVal","ElementClz","createListSimply","dimensionsInfo","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","PieSeriesModel","legendVisualProvider","_defaultLabelLine","labelLineNormalOpt","labelLineEmphasisOpt","minAngle","minShowLabelAngle","selectedOffset","percentPrecision","stillShowZeroSum","bleedMargin","distanceToLabelLine","avoidLabelOverlap","animationTypeUpdate","RADIAN","adjustSingleSide","viewLeft","viewTop","farthestX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","recalculateX","items","topSemi","bottomSemi","labelAlignTo","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","isAlignToEdge","realTextWidth","targetTextWidth","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelLineLen","labelLineLen2","midAngle","nx","ny","isLabelInside","notShowLabel","getSectorCornerRadius","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","sectorGroup","_sectorGroup","piePiece","itemLayout","PI2$7","RADIAN$1","getViewRect","pieLayout","validDataCount","unitRadian","roseType","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","DEFAULT_OPTION","inner$6","decalPaletteScope","ariaVisual","ariaModel","setDecal","setLabel","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","enableAriaDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","paletteDecal","specifiedDecal","mergeDecal","resultDecal","labelLocale","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","ariaLabel","getTitle","seriesLabels_1","seriesCount","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","dataLabels","dataLabel","middleSeparator_1","endSeparator_1","separatorModel","middleSeparator","endSeparator","keyValues","RegExp","ariaPreprocessor","PRIORITY_VISUAL_ARIA$1"],"mappings":"AAAC,WAAUA,MAAV,EAAkBC,OAAlB,EAA2B;AACxB,SAAOC,OAAP,KAAmB,QAAnB,IAA+B,OAAOC,MAAP,KAAkB,WAAjD,GAA+DF,OAAO,CAACC,OAAD,CAAtE,GACA,OAAOE,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAAvC,GAA6CD,MAAM,CAAC,CAAC,SAAD,CAAD,EAAcH,OAAd,CAAnD,IACCD,MAAM,GAAGA,MAAM,IAAIM,IAAnB,EAAyBL,OAAO,CAACD,MAAM,CAACO,OAAP,GAAiB,EAAlB,CADjC,CADA;AAGH,CAJA,EAIC,IAJD,EAIQ,UAAUL,OAAV,EAAmB;AAAE;AAE1B;;;;;;;;;;;;;AAcA;;AAEA,MAAIM,aAAa,GAAG,UAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,IAAAA,aAAa,GAAGG,MAAM,CAACC,cAAP,IACX;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B;AAEArD,EAAAA,MAAM,CAAC4gC,cAAP,CAAsBrhC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEuH,IAAAA,KAAK,EAAE;AAAT,GAA7C;AAEH,CA3xiCA,CAAD","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.echarts = {}));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n }\n\n var Browser = (function () {\r\n function Browser() {\r\n this.firefox = false;\r\n this.ie = false;\r\n this.edge = false;\r\n this.weChat = false;\r\n }\r\n return Browser;\r\n }());\r\n var Env = (function () {\r\n function Env() {\r\n this.browser = new Browser();\r\n this.node = false;\r\n this.wxa = false;\r\n this.worker = false;\r\n this.canvasSupported = false;\r\n this.svgSupported = false;\r\n this.touchEventsSupported = false;\r\n this.pointerEventsSupported = false;\r\n this.domSupported = false;\r\n }\r\n return Env;\r\n }());\r\n var env = new Env();\r\n if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\r\n env.wxa = true;\r\n env.canvasSupported = true;\r\n env.touchEventsSupported = true;\r\n }\r\n else if (typeof document === 'undefined' && typeof self !== 'undefined') {\r\n env.worker = true;\r\n env.canvasSupported = true;\r\n }\r\n else if (typeof navigator === 'undefined') {\r\n env.node = true;\r\n env.canvasSupported = true;\r\n env.svgSupported = true;\r\n }\r\n else {\r\n detect(navigator.userAgent, env);\r\n }\r\n function detect(ua, env) {\r\n var browser = env.browser;\r\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\r\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\r\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\r\n var edge = ua.match(/Edge\\/([\\d.]+)/);\r\n var weChat = (/micromessenger/i).test(ua);\r\n if (firefox) {\r\n browser.firefox = true;\r\n browser.version = firefox[1];\r\n }\r\n if (ie) {\r\n browser.ie = true;\r\n browser.version = ie[1];\r\n }\r\n if (edge) {\r\n browser.edge = true;\r\n browser.version = edge[1];\r\n }\r\n if (weChat) {\r\n browser.weChat = true;\r\n }\r\n env.canvasSupported = !!document.createElement('canvas').getContext;\r\n env.svgSupported = typeof SVGRect !== 'undefined';\r\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\r\n env.pointerEventsSupported = 'onpointerdown' in window\r\n && (browser.edge || (browser.ie && +browser.version >= 11));\r\n env.domSupported = typeof document !== 'undefined';\r\n }\n\n var BUILTIN_OBJECT = {\r\n '[object Function]': true,\r\n '[object RegExp]': true,\r\n '[object Date]': true,\r\n '[object Error]': true,\r\n '[object CanvasGradient]': true,\r\n '[object CanvasPattern]': true,\r\n '[object Image]': true,\r\n '[object Canvas]': true\r\n };\r\n var TYPED_ARRAY = {\r\n '[object Int8Array]': true,\r\n '[object Uint8Array]': true,\r\n '[object Uint8ClampedArray]': true,\r\n '[object Int16Array]': true,\r\n '[object Uint16Array]': true,\r\n '[object Int32Array]': true,\r\n '[object Uint32Array]': true,\r\n '[object Float32Array]': true,\r\n '[object Float64Array]': true\r\n };\r\n var objToString = Object.prototype.toString;\r\n var arrayProto = Array.prototype;\r\n var nativeForEach = arrayProto.forEach;\r\n var nativeFilter = arrayProto.filter;\r\n var nativeSlice = arrayProto.slice;\r\n var nativeMap = arrayProto.map;\r\n var ctorFunction = (function () { }).constructor;\r\n var protoFunction = ctorFunction ? ctorFunction.prototype : null;\r\n var methods = {};\r\n function $override(name, fn) {\r\n methods[name] = fn;\r\n }\r\n var idStart = 0x0907;\r\n function guid() {\r\n return idStart++;\r\n }\r\n function logError() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (typeof console !== 'undefined') {\r\n console.error.apply(console, args);\r\n }\r\n }\r\n function clone(source) {\r\n if (source == null || typeof source !== 'object') {\r\n return source;\r\n }\r\n var result = source;\r\n var typeStr = objToString.call(source);\r\n if (typeStr === '[object Array]') {\r\n if (!isPrimitive(source)) {\r\n result = [];\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n else if (TYPED_ARRAY[typeStr]) {\r\n if (!isPrimitive(source)) {\r\n var Ctor = source.constructor;\r\n if (Ctor.from) {\r\n result = Ctor.from(source);\r\n }\r\n else {\r\n result = new Ctor(source.length);\r\n for (var i = 0, len = source.length; i < len; i++) {\r\n result[i] = clone(source[i]);\r\n }\r\n }\r\n }\r\n }\r\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\r\n result = {};\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n result[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function merge(target, source, overwrite) {\r\n if (!isObject(source) || !isObject(target)) {\r\n return overwrite ? clone(source) : target;\r\n }\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n var targetProp = target[key];\r\n var sourceProp = source[key];\r\n if (isObject(sourceProp)\r\n && isObject(targetProp)\r\n && !isArray(sourceProp)\r\n && !isArray(targetProp)\r\n && !isDom(sourceProp)\r\n && !isDom(targetProp)\r\n && !isBuiltInObject(sourceProp)\r\n && !isBuiltInObject(targetProp)\r\n && !isPrimitive(sourceProp)\r\n && !isPrimitive(targetProp)) {\r\n merge(targetProp, sourceProp, overwrite);\r\n }\r\n else if (overwrite || !(key in target)) {\r\n target[key] = clone(source[key]);\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function extend(target, source) {\r\n if (Object.assign) {\r\n Object.assign(target, source);\r\n }\r\n else {\r\n for (var key in source) {\r\n if (source.hasOwnProperty(key)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return target;\r\n }\r\n function defaults(target, source, overlay) {\r\n var keysArr = keys(source);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if ((overlay ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target;\r\n }\r\n var createCanvas = function () {\r\n return methods.createCanvas();\r\n };\r\n methods.createCanvas = function () {\r\n return document.createElement('canvas');\r\n };\r\n function indexOf(array, value) {\r\n if (array) {\r\n if (array.indexOf) {\r\n return array.indexOf(value);\r\n }\r\n for (var i = 0, len = array.length; i < len; i++) {\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n function inherits(clazz, baseClazz) {\r\n var clazzPrototype = clazz.prototype;\r\n function F() { }\r\n F.prototype = baseClazz.prototype;\r\n clazz.prototype = new F();\r\n for (var prop in clazzPrototype) {\r\n if (clazzPrototype.hasOwnProperty(prop)) {\r\n clazz.prototype[prop] = clazzPrototype[prop];\r\n }\r\n }\r\n clazz.prototype.constructor = clazz;\r\n clazz.superClass = baseClazz;\r\n }\r\n function mixin(target, source, override) {\r\n target = 'prototype' in target ? target.prototype : target;\r\n source = 'prototype' in source ? source.prototype : source;\r\n if (Object.getOwnPropertyNames) {\r\n var keyList = Object.getOwnPropertyNames(source);\r\n for (var i = 0; i < keyList.length; i++) {\r\n var key = keyList[i];\r\n if (key !== 'constructor') {\r\n if ((override ? source[key] != null : target[key] == null)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n defaults(target, source, override);\r\n }\r\n }\r\n function isArrayLike(data) {\r\n if (!data) {\r\n return false;\r\n }\r\n if (typeof data === 'string') {\r\n return false;\r\n }\r\n return typeof data.length === 'number';\r\n }\r\n function each(arr, cb, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n if (arr.forEach && arr.forEach === nativeForEach) {\r\n arr.forEach(cb, context);\r\n }\r\n else if (arr.length === +arr.length) {\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n cb.call(context, arr[i], i, arr);\r\n }\r\n }\r\n else {\r\n for (var key in arr) {\r\n if (arr.hasOwnProperty(key)) {\r\n cb.call(context, arr[key], key, arr);\r\n }\r\n }\r\n }\r\n }\r\n function map(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.map && arr.map === nativeMap) {\r\n return arr.map(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n result.push(cb.call(context, arr[i], i, arr));\r\n }\r\n return result;\r\n }\r\n }\r\n function reduce(arr, cb, memo, context) {\r\n if (!(arr && cb)) {\r\n return;\r\n }\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n memo = cb.call(context, memo, arr[i], i, arr);\r\n }\r\n return memo;\r\n }\r\n function filter(arr, cb, context) {\r\n if (!arr) {\r\n return [];\r\n }\r\n if (!cb) {\r\n return slice(arr);\r\n }\r\n if (arr.filter && arr.filter === nativeFilter) {\r\n return arr.filter(cb, context);\r\n }\r\n else {\r\n var result = [];\r\n for (var i = 0, len = arr.length; i < len; i++) {\r\n if (cb.call(context, arr[i], i, arr)) {\r\n result.push(arr[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n function keys(obj) {\r\n if (!obj) {\r\n return [];\r\n }\r\n if (Object.keys) {\r\n return Object.keys(obj);\r\n }\r\n var keyList = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n keyList.push(key);\r\n }\r\n }\r\n return keyList;\r\n }\r\n function bindPolyfill(func, context) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n var bind = (protoFunction && isFunction(protoFunction.bind))\r\n ? protoFunction.call.bind(protoFunction.bind)\r\n : bindPolyfill;\r\n function curry(func) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return function () {\r\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\r\n };\r\n }\r\n function isArray(value) {\r\n if (Array.isArray) {\r\n return Array.isArray(value);\r\n }\r\n return objToString.call(value) === '[object Array]';\r\n }\r\n function isFunction(value) {\r\n return typeof value === 'function';\r\n }\r\n function isString(value) {\r\n return typeof value === 'string';\r\n }\r\n function isStringSafe(value) {\r\n return objToString.call(value) === '[object String]';\r\n }\r\n function isNumber(value) {\r\n return typeof value === 'number';\r\n }\r\n function isObject(value) {\r\n var type = typeof value;\r\n return type === 'function' || (!!value && type === 'object');\r\n }\r\n function isBuiltInObject(value) {\r\n return !!BUILTIN_OBJECT[objToString.call(value)];\r\n }\r\n function isTypedArray(value) {\r\n return !!TYPED_ARRAY[objToString.call(value)];\r\n }\r\n function isDom(value) {\r\n return typeof value === 'object'\r\n && typeof value.nodeType === 'number'\r\n && typeof value.ownerDocument === 'object';\r\n }\r\n function isGradientObject(value) {\r\n return value.colorStops != null;\r\n }\r\n function isPatternObject(value) {\r\n return value.image != null;\r\n }\r\n function isRegExp(value) {\r\n return objToString.call(value) === '[object RegExp]';\r\n }\r\n function eqNaN(value) {\r\n return value !== value;\r\n }\r\n function retrieve() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0, len = args.length; i < len; i++) {\r\n if (args[i] != null) {\r\n return args[i];\r\n }\r\n }\r\n }\r\n function retrieve2(value0, value1) {\r\n return value0 != null\r\n ? value0\r\n : value1;\r\n }\r\n function retrieve3(value0, value1, value2) {\r\n return value0 != null\r\n ? value0\r\n : value1 != null\r\n ? value1\r\n : value2;\r\n }\r\n function slice(arr) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n return nativeSlice.apply(arr, args);\r\n }\r\n function normalizeCssArray(val) {\r\n if (typeof (val) === 'number') {\r\n return [val, val, val, val];\r\n }\r\n var len = val.length;\r\n if (len === 2) {\r\n return [val[0], val[1], val[0], val[1]];\r\n }\r\n else if (len === 3) {\r\n return [val[0], val[1], val[2], val[1]];\r\n }\r\n return val;\r\n }\r\n function assert(condition, message) {\r\n if (!condition) {\r\n throw new Error(message);\r\n }\r\n }\r\n function trim(str) {\r\n if (str == null) {\r\n return null;\r\n }\r\n else if (typeof str.trim === 'function') {\r\n return str.trim();\r\n }\r\n else {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\r\n }\r\n }\r\n var primitiveKey = '__ec_primitive__';\r\n function setAsPrimitive(obj) {\r\n obj[primitiveKey] = true;\r\n }\r\n function isPrimitive(obj) {\r\n return obj[primitiveKey];\r\n }\r\n var HashMap = (function () {\r\n function HashMap(obj) {\r\n this.data = {};\r\n var isArr = isArray(obj);\r\n this.data = {};\r\n var thisMap = this;\r\n (obj instanceof HashMap)\r\n ? obj.each(visit)\r\n : (obj && each(obj, visit));\r\n function visit(value, key) {\r\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\r\n }\r\n }\r\n HashMap.prototype.get = function (key) {\r\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\r\n };\r\n HashMap.prototype.set = function (key, value) {\r\n return (this.data[key] = value);\r\n };\r\n HashMap.prototype.each = function (cb, context) {\r\n for (var key in this.data) {\r\n if (this.data.hasOwnProperty(key)) {\r\n cb.call(context, this.data[key], key);\r\n }\r\n }\r\n };\r\n HashMap.prototype.keys = function () {\r\n return keys(this.data);\r\n };\r\n HashMap.prototype.removeKey = function (key) {\r\n delete this.data[key];\r\n };\r\n return HashMap;\r\n }());\r\n function createHashMap(obj) {\r\n return new HashMap(obj);\r\n }\r\n function createObject(proto, properties) {\r\n var obj;\r\n if (Object.create) {\r\n obj = Object.create(proto);\r\n }\r\n else {\r\n var StyleCtor = function () { };\r\n StyleCtor.prototype = proto;\r\n obj = new StyleCtor();\r\n }\r\n if (properties) {\r\n extend(obj, properties);\r\n }\r\n return obj;\r\n }\r\n function hasOwn(own, prop) {\r\n return own.hasOwnProperty(prop);\r\n }\r\n function noop() { }\n\n function create(x, y) {\r\n if (x == null) {\r\n x = 0;\r\n }\r\n if (y == null) {\r\n y = 0;\r\n }\r\n return [x, y];\r\n }\r\n function clone$1(v) {\r\n return [v[0], v[1]];\r\n }\r\n function add(out, v1, v2) {\r\n out[0] = v1[0] + v2[0];\r\n out[1] = v1[1] + v2[1];\r\n return out;\r\n }\r\n function sub(out, v1, v2) {\r\n out[0] = v1[0] - v2[0];\r\n out[1] = v1[1] - v2[1];\r\n return out;\r\n }\r\n function len(v) {\r\n return Math.sqrt(lenSquare(v));\r\n }\r\n function lenSquare(v) {\r\n return v[0] * v[0] + v[1] * v[1];\r\n }\r\n function scale(out, v, s) {\r\n out[0] = v[0] * s;\r\n out[1] = v[1] * s;\r\n return out;\r\n }\r\n function normalize(out, v) {\r\n var d = len(v);\r\n if (d === 0) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n }\r\n else {\r\n out[0] = v[0] / d;\r\n out[1] = v[1] / d;\r\n }\r\n return out;\r\n }\r\n function distance(v1, v2) {\r\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\r\n }\r\n var dist = distance;\r\n function distanceSquare(v1, v2) {\r\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\r\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\r\n }\r\n var distSquare = distanceSquare;\r\n function lerp(out, v1, v2, t) {\r\n out[0] = v1[0] + t * (v2[0] - v1[0]);\r\n out[1] = v1[1] + t * (v2[1] - v1[1]);\r\n return out;\r\n }\r\n function applyTransform(out, v, m) {\r\n var x = v[0];\r\n var y = v[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n function min(out, v1, v2) {\r\n out[0] = Math.min(v1[0], v2[0]);\r\n out[1] = Math.min(v1[1], v2[1]);\r\n return out;\r\n }\r\n function max(out, v1, v2) {\r\n out[0] = Math.max(v1[0], v2[0]);\r\n out[1] = Math.max(v1[1], v2[1]);\r\n return out;\r\n }\n\n var Param = (function () {\r\n function Param(target, e) {\r\n this.target = target;\r\n this.topTarget = e && e.topTarget;\r\n }\r\n return Param;\r\n }());\r\n var Draggable = (function () {\r\n function Draggable(handler) {\r\n this.handler = handler;\r\n handler.on('mousedown', this._dragStart, this);\r\n handler.on('mousemove', this._drag, this);\r\n handler.on('mouseup', this._dragEnd, this);\r\n }\r\n Draggable.prototype._dragStart = function (e) {\r\n var draggingTarget = e.target;\r\n while (draggingTarget && !draggingTarget.draggable) {\r\n draggingTarget = draggingTarget.parent;\r\n }\r\n if (draggingTarget) {\r\n this._draggingTarget = draggingTarget;\r\n draggingTarget.dragging = true;\r\n this._x = e.offsetX;\r\n this._y = e.offsetY;\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\r\n }\r\n };\r\n Draggable.prototype._drag = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n var x = e.offsetX;\r\n var y = e.offsetY;\r\n var dx = x - this._x;\r\n var dy = y - this._y;\r\n this._x = x;\r\n this._y = y;\r\n draggingTarget.drift(dx, dy, e);\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\r\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\r\n var lastDropTarget = this._dropTarget;\r\n this._dropTarget = dropTarget;\r\n if (draggingTarget !== dropTarget) {\r\n if (lastDropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\r\n }\r\n if (dropTarget && dropTarget !== lastDropTarget) {\r\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\r\n }\r\n }\r\n }\r\n };\r\n Draggable.prototype._dragEnd = function (e) {\r\n var draggingTarget = this._draggingTarget;\r\n if (draggingTarget) {\r\n draggingTarget.dragging = false;\r\n }\r\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\r\n if (this._dropTarget) {\r\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\r\n }\r\n this._draggingTarget = null;\r\n this._dropTarget = null;\r\n };\r\n return Draggable;\r\n }());\n\n var Eventful = (function () {\r\n function Eventful(eventProcessors) {\r\n if (eventProcessors) {\r\n this._$eventProcessor = eventProcessors;\r\n }\r\n }\r\n Eventful.prototype.on = function (event, query, handler, context) {\r\n if (!this._$handlers) {\r\n this._$handlers = {};\r\n }\r\n var _h = this._$handlers;\r\n if (typeof query === 'function') {\r\n context = handler;\r\n handler = query;\r\n query = null;\r\n }\r\n if (!handler || !event) {\r\n return this;\r\n }\r\n var eventProcessor = this._$eventProcessor;\r\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\r\n query = eventProcessor.normalizeQuery(query);\r\n }\r\n if (!_h[event]) {\r\n _h[event] = [];\r\n }\r\n for (var i = 0; i < _h[event].length; i++) {\r\n if (_h[event][i].h === handler) {\r\n return this;\r\n }\r\n }\r\n var wrap = {\r\n h: handler,\r\n query: query,\r\n ctx: (context || this),\r\n callAtLast: handler.zrEventfulCallAtLast\r\n };\r\n var lastIndex = _h[event].length - 1;\r\n var lastWrap = _h[event][lastIndex];\r\n (lastWrap && lastWrap.callAtLast)\r\n ? _h[event].splice(lastIndex, 0, wrap)\r\n : _h[event].push(wrap);\r\n return this;\r\n };\r\n Eventful.prototype.isSilent = function (eventName) {\r\n var _h = this._$handlers;\r\n return !_h || !_h[eventName] || !_h[eventName].length;\r\n };\r\n Eventful.prototype.off = function (eventType, handler) {\r\n var _h = this._$handlers;\r\n if (!_h) {\r\n return this;\r\n }\r\n if (!eventType) {\r\n this._$handlers = {};\r\n return this;\r\n }\r\n if (handler) {\r\n if (_h[eventType]) {\r\n var newList = [];\r\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\r\n if (_h[eventType][i].h !== handler) {\r\n newList.push(_h[eventType][i]);\r\n }\r\n }\r\n _h[eventType] = newList;\r\n }\r\n if (_h[eventType] && _h[eventType].length === 0) {\r\n delete _h[eventType];\r\n }\r\n }\r\n else {\r\n delete _h[eventType];\r\n }\r\n return this;\r\n };\r\n Eventful.prototype.trigger = function (eventType) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[eventType];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var argLen = args.length;\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(eventType, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(hItem.ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(hItem.ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(hItem.ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(hItem.ctx, args);\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(eventType);\r\n return this;\r\n };\r\n Eventful.prototype.triggerWithContext = function (type) {\r\n if (!this._$handlers) {\r\n return this;\r\n }\r\n var _h = this._$handlers[type];\r\n var eventProcessor = this._$eventProcessor;\r\n if (_h) {\r\n var args = arguments;\r\n var argLen = args.length;\r\n var ctx = args[argLen - 1];\r\n var len = _h.length;\r\n for (var i = 0; i < len; i++) {\r\n var hItem = _h[i];\r\n if (eventProcessor\r\n && eventProcessor.filter\r\n && hItem.query != null\r\n && !eventProcessor.filter(type, hItem.query)) {\r\n continue;\r\n }\r\n switch (argLen) {\r\n case 0:\r\n hItem.h.call(ctx);\r\n break;\r\n case 1:\r\n hItem.h.call(ctx, args[0]);\r\n break;\r\n case 2:\r\n hItem.h.call(ctx, args[0], args[1]);\r\n break;\r\n default:\r\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\r\n break;\r\n }\r\n }\r\n }\r\n eventProcessor && eventProcessor.afterTrigger\r\n && eventProcessor.afterTrigger(type);\r\n return this;\r\n };\r\n return Eventful;\r\n }());\n\n var LN2 = Math.log(2);\r\n function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\r\n var cacheKey = rowMask + '-' + colMask;\r\n var fullRank = rows.length;\r\n if (detCache.hasOwnProperty(cacheKey)) {\r\n return detCache[cacheKey];\r\n }\r\n if (rank === 1) {\r\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\r\n return rows[rowStart][colStart];\r\n }\r\n var subRowMask = rowMask | (1 << rowStart);\r\n var subRowStart = rowStart + 1;\r\n while (rowMask & (1 << subRowStart)) {\r\n subRowStart++;\r\n }\r\n var sum = 0;\r\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\r\n var colTag = 1 << j;\r\n if (!(colTag & colMask)) {\r\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\r\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\r\n colLocalIdx++;\r\n }\r\n }\r\n detCache[cacheKey] = sum;\r\n return sum;\r\n }\r\n function buildTransformer(src, dest) {\r\n var mA = [\r\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\r\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\r\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\r\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\r\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\r\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\r\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\r\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\r\n ];\r\n var detCache = {};\r\n var det = determinant(mA, 8, 0, 0, 0, detCache);\r\n if (det === 0) {\r\n return;\r\n }\r\n var vh = [];\r\n for (var i = 0; i < 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n vh[j] == null && (vh[j] = 0);\r\n vh[j] += ((i + j) % 2 ? -1 : 1)\r\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\r\n / det * dest[i];\r\n }\r\n }\r\n return function (out, srcPointX, srcPointY) {\r\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\r\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\r\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\r\n };\r\n }\n\n var EVENT_SAVED_PROP = '___zrEVENTSAVED';\r\n function transformCoordWithViewport(out, el, inX, inY, inverse) {\r\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\r\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\r\n var markers = prepareCoordMarkers(el, saved);\r\n var transformer = preparePointerTransformer(markers, saved, inverse);\r\n if (transformer) {\r\n transformer(out, inX, inY);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function prepareCoordMarkers(el, saved) {\r\n var markers = saved.markers;\r\n if (markers) {\r\n return markers;\r\n }\r\n markers = saved.markers = [];\r\n var propLR = ['left', 'right'];\r\n var propTB = ['top', 'bottom'];\r\n for (var i = 0; i < 4; i++) {\r\n var marker = document.createElement('div');\r\n var stl = marker.style;\r\n var idxLR = i % 2;\r\n var idxTB = (i >> 1) % 2;\r\n stl.cssText = [\r\n 'position: absolute',\r\n 'visibility: hidden',\r\n 'padding: 0',\r\n 'margin: 0',\r\n 'border-width: 0',\r\n 'user-select: none',\r\n 'width:0',\r\n 'height:0',\r\n propLR[idxLR] + ':0',\r\n propTB[idxTB] + ':0',\r\n propLR[1 - idxLR] + ':auto',\r\n propTB[1 - idxTB] + ':auto',\r\n ''\r\n ].join('!important;');\r\n el.appendChild(marker);\r\n markers.push(marker);\r\n }\r\n return markers;\r\n }\r\n function preparePointerTransformer(markers, saved, inverse) {\r\n var transformerName = inverse ? 'invTrans' : 'trans';\r\n var transformer = saved[transformerName];\r\n var oldSrcCoords = saved.srcCoords;\r\n var srcCoords = [];\r\n var destCoords = [];\r\n var oldCoordTheSame = true;\r\n for (var i = 0; i < 4; i++) {\r\n var rect = markers[i].getBoundingClientRect();\r\n var ii = 2 * i;\r\n var x = rect.left;\r\n var y = rect.top;\r\n srcCoords.push(x, y);\r\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\r\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\r\n }\r\n return (oldCoordTheSame && transformer)\r\n ? transformer\r\n : (saved.srcCoords = srcCoords,\r\n saved[transformerName] = inverse\r\n ? buildTransformer(destCoords, srcCoords)\r\n : buildTransformer(srcCoords, destCoords));\r\n }\r\n function isCanvasEl(el) {\r\n return el.nodeName.toUpperCase() === 'CANVAS';\r\n }\n\n var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;\r\n var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\r\n var _calcOut = [];\r\n function clientToLocal(el, e, out, calculate) {\r\n out = out || {};\r\n if (calculate || !env.canvasSupported) {\r\n calculateZrXY(el, e, out);\r\n }\r\n else if (env.browser.firefox\r\n && e.layerX != null\r\n && e.layerX !== e.offsetX) {\r\n out.zrX = e.layerX;\r\n out.zrY = e.layerY;\r\n }\r\n else if (e.offsetX != null) {\r\n out.zrX = e.offsetX;\r\n out.zrY = e.offsetY;\r\n }\r\n else {\r\n calculateZrXY(el, e, out);\r\n }\r\n return out;\r\n }\r\n function calculateZrXY(el, e, out) {\r\n if (env.domSupported && el.getBoundingClientRect) {\r\n var ex = e.clientX;\r\n var ey = e.clientY;\r\n if (isCanvasEl(el)) {\r\n var box = el.getBoundingClientRect();\r\n out.zrX = ex - box.left;\r\n out.zrY = ey - box.top;\r\n return;\r\n }\r\n else {\r\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\r\n out.zrX = _calcOut[0];\r\n out.zrY = _calcOut[1];\r\n return;\r\n }\r\n }\r\n }\r\n out.zrX = out.zrY = 0;\r\n }\r\n function getNativeEvent(e) {\r\n return e\r\n || window.event;\r\n }\r\n function normalizeEvent(el, e, calculate) {\r\n e = getNativeEvent(e);\r\n if (e.zrX != null) {\r\n return e;\r\n }\r\n var eventType = e.type;\r\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\r\n if (!isTouch) {\r\n clientToLocal(el, e, e, calculate);\r\n var wheelDelta = getWheelDeltaMayPolyfill(e);\r\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\r\n }\r\n else {\r\n var touch = eventType !== 'touchend'\r\n ? e.targetTouches[0]\r\n : e.changedTouches[0];\r\n touch && clientToLocal(el, touch, e, calculate);\r\n }\r\n var button = e.button;\r\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\r\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\r\n }\r\n return e;\r\n }\r\n function getWheelDeltaMayPolyfill(e) {\r\n var rawWheelDelta = e.wheelDelta;\r\n if (rawWheelDelta) {\r\n return rawWheelDelta;\r\n }\r\n var deltaX = e.deltaX;\r\n var deltaY = e.deltaY;\r\n if (deltaX == null || deltaY == null) {\r\n return rawWheelDelta;\r\n }\r\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\r\n var sign = deltaY > 0 ? -1\r\n : deltaY < 0 ? 1\r\n : deltaX > 0 ? -1\r\n : 1;\r\n return 3 * delta * sign;\r\n }\r\n function addEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.addEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.attachEvent('on' + name, handler);\r\n }\r\n }\r\n function removeEventListener(el, name, handler, opt) {\r\n if (isDomLevel2) {\r\n el.removeEventListener(name, handler, opt);\r\n }\r\n else {\r\n el.detachEvent('on' + name, handler);\r\n }\r\n }\r\n var stop = isDomLevel2\r\n ? function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n : function (e) {\r\n e.returnValue = false;\r\n e.cancelBubble = true;\r\n };\n\n var GestureMgr = (function () {\r\n function GestureMgr() {\r\n this._track = [];\r\n }\r\n GestureMgr.prototype.recognize = function (event, target, root) {\r\n this._doTrack(event, target, root);\r\n return this._recognize(event);\r\n };\r\n GestureMgr.prototype.clear = function () {\r\n this._track.length = 0;\r\n return this;\r\n };\r\n GestureMgr.prototype._doTrack = function (event, target, root) {\r\n var touches = event.touches;\r\n if (!touches) {\r\n return;\r\n }\r\n var trackItem = {\r\n points: [],\r\n touches: [],\r\n target: target,\r\n event: event\r\n };\r\n for (var i = 0, len = touches.length; i < len; i++) {\r\n var touch = touches[i];\r\n var pos = clientToLocal(root, touch, {});\r\n trackItem.points.push([pos.zrX, pos.zrY]);\r\n trackItem.touches.push(touch);\r\n }\r\n this._track.push(trackItem);\r\n };\r\n GestureMgr.prototype._recognize = function (event) {\r\n for (var eventName in recognizers) {\r\n if (recognizers.hasOwnProperty(eventName)) {\r\n var gestureInfo = recognizers[eventName](this._track, event);\r\n if (gestureInfo) {\r\n return gestureInfo;\r\n }\r\n }\r\n }\r\n };\r\n return GestureMgr;\r\n }());\r\n function dist$1(pointPair) {\r\n var dx = pointPair[1][0] - pointPair[0][0];\r\n var dy = pointPair[1][1] - pointPair[0][1];\r\n return Math.sqrt(dx * dx + dy * dy);\r\n }\r\n function center(pointPair) {\r\n return [\r\n (pointPair[0][0] + pointPair[1][0]) / 2,\r\n (pointPair[0][1] + pointPair[1][1]) / 2\r\n ];\r\n }\r\n var recognizers = {\r\n pinch: function (tracks, event) {\r\n var trackLen = tracks.length;\r\n if (!trackLen) {\r\n return;\r\n }\r\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\r\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\r\n if (pinchPre\r\n && pinchPre.length > 1\r\n && pinchEnd\r\n && pinchEnd.length > 1) {\r\n var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);\r\n !isFinite(pinchScale) && (pinchScale = 1);\r\n event.pinchScale = pinchScale;\r\n var pinchCenter = center(pinchEnd);\r\n event.pinchX = pinchCenter[0];\r\n event.pinchY = pinchCenter[1];\r\n return {\r\n type: 'pinch',\r\n target: tracks[0].target,\r\n event: event\r\n };\r\n }\r\n }\r\n };\n\n var SILENT = 'silent';\r\n function makeEventPacket(eveType, targetInfo, event) {\r\n return {\r\n type: eveType,\r\n event: event,\r\n target: targetInfo.target,\r\n topTarget: targetInfo.topTarget,\r\n cancelBubble: false,\r\n offsetX: event.zrX,\r\n offsetY: event.zrY,\r\n gestureEvent: event.gestureEvent,\r\n pinchX: event.pinchX,\r\n pinchY: event.pinchY,\r\n pinchScale: event.pinchScale,\r\n wheelDelta: event.zrDelta,\r\n zrByTouch: event.zrByTouch,\r\n which: event.which,\r\n stop: stopEvent\r\n };\r\n }\r\n function stopEvent() {\r\n stop(this.event);\r\n }\r\n var EmptyProxy = (function (_super) {\r\n __extends(EmptyProxy, _super);\r\n function EmptyProxy() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.handler = null;\r\n return _this;\r\n }\r\n EmptyProxy.prototype.dispose = function () { };\r\n EmptyProxy.prototype.setCursor = function () { };\r\n return EmptyProxy;\r\n }(Eventful));\r\n var HoveredResult = (function () {\r\n function HoveredResult(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return HoveredResult;\r\n }());\r\n var handlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var Handler = (function (_super) {\r\n __extends(Handler, _super);\r\n function Handler(storage, painter, proxy, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this._hovered = new HoveredResult(0, 0);\r\n _this.storage = storage;\r\n _this.painter = painter;\r\n _this.painterRoot = painterRoot;\r\n proxy = proxy || new EmptyProxy();\r\n _this.proxy = null;\r\n _this.setHandlerProxy(proxy);\r\n _this._draggingMgr = new Draggable(_this);\r\n return _this;\r\n }\r\n Handler.prototype.setHandlerProxy = function (proxy) {\r\n if (this.proxy) {\r\n this.proxy.dispose();\r\n }\r\n if (proxy) {\r\n each(handlerNames, function (name) {\r\n proxy.on && proxy.on(name, this[name], this);\r\n }, this);\r\n proxy.handler = this;\r\n }\r\n this.proxy = proxy;\r\n };\r\n Handler.prototype.mousemove = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var lastHovered = this._hovered;\r\n var lastHoveredTarget = lastHovered.target;\r\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\r\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\r\n lastHoveredTarget = lastHovered.target;\r\n }\r\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\r\n var hoveredTarget = hovered.target;\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\r\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(lastHovered, 'mouseout', event);\r\n }\r\n this.dispatchToElement(hovered, 'mousemove', event);\r\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\r\n this.dispatchToElement(hovered, 'mouseover', event);\r\n }\r\n };\r\n Handler.prototype.mouseout = function (event) {\r\n var eventControl = event.zrEventControl;\r\n var zrIsToLocalDOM = event.zrIsToLocalDOM;\r\n if (eventControl !== 'only_globalout') {\r\n this.dispatchToElement(this._hovered, 'mouseout', event);\r\n }\r\n if (eventControl !== 'no_globalout') {\r\n !zrIsToLocalDOM && this.trigger('globalout', { type: 'globalout', event: event });\r\n }\r\n };\r\n Handler.prototype.resize = function () {\r\n this._hovered = new HoveredResult(0, 0);\r\n };\r\n Handler.prototype.dispatch = function (eventName, eventArgs) {\r\n var handler = this[eventName];\r\n handler && handler.call(this, eventArgs);\r\n };\r\n Handler.prototype.dispose = function () {\r\n this.proxy.dispose();\r\n this.storage = null;\r\n this.proxy = null;\r\n this.painter = null;\r\n };\r\n Handler.prototype.setCursorStyle = function (cursorStyle) {\r\n var proxy = this.proxy;\r\n proxy.setCursor && proxy.setCursor(cursorStyle);\r\n };\r\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\r\n targetInfo = targetInfo || {};\r\n var el = targetInfo.target;\r\n if (el && el.silent) {\r\n return;\r\n }\r\n var eventKey = ('on' + eventName);\r\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\r\n while (el) {\r\n el[eventKey]\r\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\r\n el.trigger(eventName, eventPacket);\r\n el = el.__hostTarget ? el.__hostTarget : el.parent;\r\n if (eventPacket.cancelBubble) {\r\n break;\r\n }\r\n }\r\n if (!eventPacket.cancelBubble) {\r\n this.trigger(eventName, eventPacket);\r\n if (this.painter && this.painter.eachOtherLayer) {\r\n this.painter.eachOtherLayer(function (layer) {\r\n if (typeof (layer[eventKey]) === 'function') {\r\n layer[eventKey].call(layer, eventPacket);\r\n }\r\n if (layer.trigger) {\r\n layer.trigger(eventName, eventPacket);\r\n }\r\n });\r\n }\r\n }\r\n };\r\n Handler.prototype.findHover = function (x, y, exclude) {\r\n var list = this.storage.getDisplayList();\r\n var out = new HoveredResult(x, y);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n var hoverCheckResult = void 0;\r\n if (list[i] !== exclude\r\n && !list[i].ignore\r\n && (hoverCheckResult = isHover(list[i], x, y))) {\r\n !out.topTarget && (out.topTarget = list[i]);\r\n if (hoverCheckResult !== SILENT) {\r\n out.target = list[i];\r\n break;\r\n }\r\n }\r\n }\r\n return out;\r\n };\r\n Handler.prototype.processGesture = function (event, stage) {\r\n if (!this._gestureMgr) {\r\n this._gestureMgr = new GestureMgr();\r\n }\r\n var gestureMgr = this._gestureMgr;\r\n stage === 'start' && gestureMgr.clear();\r\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\r\n stage === 'end' && gestureMgr.clear();\r\n if (gestureInfo) {\r\n var type = gestureInfo.type;\r\n event.gestureEvent = type;\r\n var res = new HoveredResult();\r\n res.target = gestureInfo.target;\r\n this.dispatchToElement(res, type, gestureInfo.event);\r\n }\r\n };\r\n return Handler;\r\n }(Eventful));\r\n each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\r\n Handler.prototype[name] = function (event) {\r\n var x = event.zrX;\r\n var y = event.zrY;\r\n var isOutside = isOutsideBoundary(this, x, y);\r\n var hovered;\r\n var hoveredTarget;\r\n if (name !== 'mouseup' || !isOutside) {\r\n hovered = this.findHover(x, y);\r\n hoveredTarget = hovered.target;\r\n }\r\n if (name === 'mousedown') {\r\n this._downEl = hoveredTarget;\r\n this._downPoint = [event.zrX, event.zrY];\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'mouseup') {\r\n this._upEl = hoveredTarget;\r\n }\r\n else if (name === 'click') {\r\n if (this._downEl !== this._upEl\r\n || !this._downPoint\r\n || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\r\n return;\r\n }\r\n this._downPoint = null;\r\n }\r\n this.dispatchToElement(hovered, name, event);\r\n };\r\n });\r\n function isHover(displayable, x, y) {\r\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\r\n var el = displayable;\r\n var isSilent = void 0;\r\n var ignoreClip = false;\r\n while (el) {\r\n if (el.ignoreClip) {\r\n ignoreClip = true;\r\n }\r\n if (!ignoreClip) {\r\n var clipPath = el.getClipPath();\r\n if (clipPath && !clipPath.contain(x, y)) {\r\n return false;\r\n }\r\n if (el.silent) {\r\n isSilent = true;\r\n }\r\n }\r\n var hostEl = el.__hostTarget;\r\n el = hostEl ? hostEl : el.parent;\r\n }\r\n return isSilent ? SILENT : true;\r\n }\r\n return false;\r\n }\r\n function isOutsideBoundary(handlerInstance, x, y) {\r\n var painter = handlerInstance.painter;\r\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\r\n }\n\n function create$1() {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n function identity(out) {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n function copy(out, m) {\r\n out[0] = m[0];\r\n out[1] = m[1];\r\n out[2] = m[2];\r\n out[3] = m[3];\r\n out[4] = m[4];\r\n out[5] = m[5];\r\n return out;\r\n }\r\n function mul(out, m1, m2) {\r\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\r\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\r\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\r\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\r\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\r\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = out3;\r\n out[4] = out4;\r\n out[5] = out5;\r\n return out;\r\n }\r\n function translate(out, a, v) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4] + v[0];\r\n out[5] = a[5] + v[1];\r\n return out;\r\n }\r\n function rotate(out, a, rad) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var st = Math.sin(rad);\r\n var ct = Math.cos(rad);\r\n out[0] = aa * ct + ab * st;\r\n out[1] = -aa * st + ab * ct;\r\n out[2] = ac * ct + ad * st;\r\n out[3] = -ac * st + ct * ad;\r\n out[4] = ct * atx + st * aty;\r\n out[5] = ct * aty - st * atx;\r\n return out;\r\n }\r\n function scale$1(out, a, v) {\r\n var vx = v[0];\r\n var vy = v[1];\r\n out[0] = a[0] * vx;\r\n out[1] = a[1] * vy;\r\n out[2] = a[2] * vx;\r\n out[3] = a[3] * vy;\r\n out[4] = a[4] * vx;\r\n out[5] = a[5] * vy;\r\n return out;\r\n }\r\n function invert(out, a) {\r\n var aa = a[0];\r\n var ac = a[2];\r\n var atx = a[4];\r\n var ab = a[1];\r\n var ad = a[3];\r\n var aty = a[5];\r\n var det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\n\n var mIdentity = identity;\r\n var EPSILON = 5e-5;\r\n function isNotAroundZero(val) {\r\n return val > EPSILON || val < -EPSILON;\r\n }\r\n var scaleTmp = [];\r\n var tmpTransform = [];\r\n var originTransform = create$1();\r\n var abs = Math.abs;\r\n var Transformable = (function () {\r\n function Transformable() {\r\n }\r\n Transformable.prototype.setPosition = function (arr) {\r\n this.x = arr[0];\r\n this.y = arr[1];\r\n };\r\n Transformable.prototype.setScale = function (arr) {\r\n this.scaleX = arr[0];\r\n this.scaleY = arr[1];\r\n };\r\n Transformable.prototype.setOrigin = function (arr) {\r\n this.originX = arr[0];\r\n this.originY = arr[1];\r\n };\r\n Transformable.prototype.needLocalTransform = function () {\r\n return isNotAroundZero(this.rotation)\r\n || isNotAroundZero(this.x)\r\n || isNotAroundZero(this.y)\r\n || isNotAroundZero(this.scaleX - 1)\r\n || isNotAroundZero(this.scaleY - 1);\r\n };\r\n Transformable.prototype.updateTransform = function () {\r\n var parent = this.parent;\r\n var parentHasTransform = parent && parent.transform;\r\n var needLocalTransform = this.needLocalTransform();\r\n var m = this.transform;\r\n if (!(needLocalTransform || parentHasTransform)) {\r\n m && mIdentity(m);\r\n return;\r\n }\r\n m = m || create$1();\r\n if (needLocalTransform) {\r\n this.getLocalTransform(m);\r\n }\r\n else {\r\n mIdentity(m);\r\n }\r\n if (parentHasTransform) {\r\n if (needLocalTransform) {\r\n mul(m, parent.transform, m);\r\n }\r\n else {\r\n copy(m, parent.transform);\r\n }\r\n }\r\n this.transform = m;\r\n this._resolveGlobalScaleRatio(m);\r\n };\r\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\r\n var globalScaleRatio = this.globalScaleRatio;\r\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\r\n this.getGlobalScale(scaleTmp);\r\n var relX = scaleTmp[0] < 0 ? -1 : 1;\r\n var relY = scaleTmp[1] < 0 ? -1 : 1;\r\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\r\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\r\n m[0] *= sx;\r\n m[1] *= sx;\r\n m[2] *= sy;\r\n m[3] *= sy;\r\n }\r\n this.invTransform = this.invTransform || create$1();\r\n invert(this.invTransform, m);\r\n };\r\n Transformable.prototype.getLocalTransform = function (m) {\r\n return Transformable.getLocalTransform(this, m);\r\n };\r\n Transformable.prototype.getComputedTransform = function () {\r\n var transformNode = this;\r\n var ancestors = [];\r\n while (transformNode) {\r\n ancestors.push(transformNode);\r\n transformNode = transformNode.parent;\r\n }\r\n while (transformNode = ancestors.pop()) {\r\n transformNode.updateTransform();\r\n }\r\n return this.transform;\r\n };\r\n Transformable.prototype.setLocalTransform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var sx = m[0] * m[0] + m[1] * m[1];\r\n var sy = m[2] * m[2] + m[3] * m[3];\r\n if (isNotAroundZero(sx - 1)) {\r\n sx = Math.sqrt(sx);\r\n }\r\n if (isNotAroundZero(sy - 1)) {\r\n sy = Math.sqrt(sy);\r\n }\r\n if (m[0] < 0) {\r\n sx = -sx;\r\n }\r\n if (m[3] < 0) {\r\n sy = -sy;\r\n }\r\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\r\n if (sx < 0 && sy < 0) {\r\n this.rotation += Math.PI;\r\n sx = -sx;\r\n sy = -sy;\r\n }\r\n this.x = m[4];\r\n this.y = m[5];\r\n this.scaleX = sx;\r\n this.scaleY = sy;\r\n };\r\n Transformable.prototype.decomposeTransform = function () {\r\n if (!this.transform) {\r\n return;\r\n }\r\n var parent = this.parent;\r\n var m = this.transform;\r\n if (parent && parent.transform) {\r\n mul(tmpTransform, parent.invTransform, m);\r\n m = tmpTransform;\r\n }\r\n var ox = this.originX;\r\n var oy = this.originY;\r\n if (ox || oy) {\r\n originTransform[4] = ox;\r\n originTransform[5] = oy;\r\n mul(tmpTransform, m, originTransform);\r\n tmpTransform[4] -= ox;\r\n tmpTransform[5] -= oy;\r\n m = tmpTransform;\r\n }\r\n this.setLocalTransform(m);\r\n };\r\n Transformable.prototype.getGlobalScale = function (out) {\r\n var m = this.transform;\r\n out = out || [];\r\n if (!m) {\r\n out[0] = 1;\r\n out[1] = 1;\r\n return out;\r\n }\r\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\r\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\r\n if (m[0] < 0) {\r\n out[0] = -out[0];\r\n }\r\n if (m[3] < 0) {\r\n out[1] = -out[1];\r\n }\r\n return out;\r\n };\r\n Transformable.prototype.transformCoordToLocal = function (x, y) {\r\n var v2 = [x, y];\r\n var invTransform = this.invTransform;\r\n if (invTransform) {\r\n applyTransform(v2, v2, invTransform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\r\n var v2 = [x, y];\r\n var transform = this.transform;\r\n if (transform) {\r\n applyTransform(v2, v2, transform);\r\n }\r\n return v2;\r\n };\r\n Transformable.prototype.getLineScale = function () {\r\n var m = this.transform;\r\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\r\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\r\n : 1;\r\n };\r\n Transformable.getLocalTransform = function (target, m) {\r\n m = m || [];\r\n mIdentity(m);\r\n var ox = target.originX || 0;\r\n var oy = target.originY || 0;\r\n var sx = target.scaleX;\r\n var sy = target.scaleY;\r\n var rotation = target.rotation || 0;\r\n var x = target.x;\r\n var y = target.y;\r\n m[4] -= ox;\r\n m[5] -= oy;\r\n m[0] *= sx;\r\n m[1] *= sy;\r\n m[2] *= sx;\r\n m[3] *= sy;\r\n m[4] *= sx;\r\n m[5] *= sy;\r\n if (rotation) {\r\n rotate(m, m, rotation);\r\n }\r\n m[4] += ox;\r\n m[5] += oy;\r\n m[4] += x;\r\n m[5] += y;\r\n return m;\r\n };\r\n Transformable.initDefaultProps = (function () {\r\n var proto = Transformable.prototype;\r\n proto.x = 0;\r\n proto.y = 0;\r\n proto.scaleX = 1;\r\n proto.scaleY = 1;\r\n proto.originX = 0;\r\n proto.originY = 0;\r\n proto.rotation = 0;\r\n proto.globalScaleRatio = 1;\r\n })();\r\n return Transformable;\r\n }());\n\n var easing = {\r\n linear: function (k) {\r\n return k;\r\n },\r\n quadraticIn: function (k) {\r\n return k * k;\r\n },\r\n quadraticOut: function (k) {\r\n return k * (2 - k);\r\n },\r\n quadraticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k;\r\n }\r\n return -0.5 * (--k * (k - 2) - 1);\r\n },\r\n cubicIn: function (k) {\r\n return k * k * k;\r\n },\r\n cubicOut: function (k) {\r\n return --k * k * k + 1;\r\n },\r\n cubicInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k + 2);\r\n },\r\n quarticIn: function (k) {\r\n return k * k * k * k;\r\n },\r\n quarticOut: function (k) {\r\n return 1 - (--k * k * k * k);\r\n },\r\n quarticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k;\r\n }\r\n return -0.5 * ((k -= 2) * k * k * k - 2);\r\n },\r\n quinticIn: function (k) {\r\n return k * k * k * k * k;\r\n },\r\n quinticOut: function (k) {\r\n return --k * k * k * k * k + 1;\r\n },\r\n quinticInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return 0.5 * k * k * k * k * k;\r\n }\r\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\r\n },\r\n sinusoidalIn: function (k) {\r\n return 1 - Math.cos(k * Math.PI / 2);\r\n },\r\n sinusoidalOut: function (k) {\r\n return Math.sin(k * Math.PI / 2);\r\n },\r\n sinusoidalInOut: function (k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n },\r\n exponentialIn: function (k) {\r\n return k === 0 ? 0 : Math.pow(1024, k - 1);\r\n },\r\n exponentialOut: function (k) {\r\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\r\n },\r\n exponentialInOut: function (k) {\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if ((k *= 2) < 1) {\r\n return 0.5 * Math.pow(1024, k - 1);\r\n }\r\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\r\n },\r\n circularIn: function (k) {\r\n return 1 - Math.sqrt(1 - k * k);\r\n },\r\n circularOut: function (k) {\r\n return Math.sqrt(1 - (--k * k));\r\n },\r\n circularInOut: function (k) {\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\r\n }\r\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\r\n },\r\n elasticIn: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return -(a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n },\r\n elasticOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n return (a * Math.pow(2, -10 * k)\r\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\r\n },\r\n elasticInOut: function (k) {\r\n var s;\r\n var a = 0.1;\r\n var p = 0.4;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n if (k === 1) {\r\n return 1;\r\n }\r\n if (!a || a < 1) {\r\n a = 1;\r\n s = p / 4;\r\n }\r\n else {\r\n s = p * Math.asin(1 / a) / (2 * Math.PI);\r\n }\r\n if ((k *= 2) < 1) {\r\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p));\r\n }\r\n return a * Math.pow(2, -10 * (k -= 1))\r\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n },\r\n backIn: function (k) {\r\n var s = 1.70158;\r\n return k * k * ((s + 1) * k - s);\r\n },\r\n backOut: function (k) {\r\n var s = 1.70158;\r\n return --k * k * ((s + 1) * k + s) + 1;\r\n },\r\n backInOut: function (k) {\r\n var s = 1.70158 * 1.525;\r\n if ((k *= 2) < 1) {\r\n return 0.5 * (k * k * ((s + 1) * k - s));\r\n }\r\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\r\n },\r\n bounceIn: function (k) {\r\n return 1 - easing.bounceOut(1 - k);\r\n },\r\n bounceOut: function (k) {\r\n if (k < (1 / 2.75)) {\r\n return 7.5625 * k * k;\r\n }\r\n else if (k < (2 / 2.75)) {\r\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\r\n }\r\n else if (k < (2.5 / 2.75)) {\r\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\r\n }\r\n else {\r\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\r\n }\r\n },\r\n bounceInOut: function (k) {\r\n if (k < 0.5) {\r\n return easing.bounceIn(k * 2) * 0.5;\r\n }\r\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\r\n }\r\n };\n\n var Clip = (function () {\r\n function Clip(opts) {\r\n this._initialized = false;\r\n this._startTime = 0;\r\n this._pausedTime = 0;\r\n this._paused = false;\r\n this._life = opts.life || 1000;\r\n this._delay = opts.delay || 0;\r\n this.loop = opts.loop == null ? false : opts.loop;\r\n this.gap = opts.gap || 0;\r\n this.easing = opts.easing || 'linear';\r\n this.onframe = opts.onframe;\r\n this.ondestroy = opts.ondestroy;\r\n this.onrestart = opts.onrestart;\r\n }\r\n Clip.prototype.step = function (globalTime, deltaTime) {\r\n if (!this._initialized) {\r\n this._startTime = globalTime + this._delay;\r\n this._initialized = true;\r\n }\r\n if (this._paused) {\r\n this._pausedTime += deltaTime;\r\n return;\r\n }\r\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life;\r\n if (percent < 0) {\r\n percent = 0;\r\n }\r\n percent = Math.min(percent, 1);\r\n var easing$1 = this.easing;\r\n var easingFunc = typeof easing$1 === 'string'\r\n ? easing[easing$1] : easing$1;\r\n var schedule = typeof easingFunc === 'function'\r\n ? easingFunc(percent)\r\n : percent;\r\n this.onframe && this.onframe(schedule);\r\n if (percent === 1) {\r\n if (this.loop) {\r\n this._restart(globalTime);\r\n this.onrestart && this.onrestart();\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Clip.prototype._restart = function (globalTime) {\r\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\r\n this._startTime = globalTime - remainder + this.gap;\r\n this._pausedTime = 0;\r\n };\r\n Clip.prototype.pause = function () {\r\n this._paused = true;\r\n };\r\n Clip.prototype.resume = function () {\r\n this._paused = false;\r\n };\r\n return Clip;\r\n }());\n\n var Entry = (function () {\r\n function Entry(val) {\r\n this.value = val;\r\n }\r\n return Entry;\r\n }());\r\n var LinkedList = (function () {\r\n function LinkedList() {\r\n this._len = 0;\r\n }\r\n LinkedList.prototype.insert = function (val) {\r\n var entry = new Entry(val);\r\n this.insertEntry(entry);\r\n return entry;\r\n };\r\n LinkedList.prototype.insertEntry = function (entry) {\r\n if (!this.head) {\r\n this.head = this.tail = entry;\r\n }\r\n else {\r\n this.tail.next = entry;\r\n entry.prev = this.tail;\r\n entry.next = null;\r\n this.tail = entry;\r\n }\r\n this._len++;\r\n };\r\n LinkedList.prototype.remove = function (entry) {\r\n var prev = entry.prev;\r\n var next = entry.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this.head = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this.tail = prev;\r\n }\r\n entry.next = entry.prev = null;\r\n this._len--;\r\n };\r\n LinkedList.prototype.len = function () {\r\n return this._len;\r\n };\r\n LinkedList.prototype.clear = function () {\r\n this.head = this.tail = null;\r\n this._len = 0;\r\n };\r\n return LinkedList;\r\n }());\r\n var LRU = (function () {\r\n function LRU(maxSize) {\r\n this._list = new LinkedList();\r\n this._maxSize = 10;\r\n this._map = {};\r\n this._maxSize = maxSize;\r\n }\r\n LRU.prototype.put = function (key, value) {\r\n var list = this._list;\r\n var map = this._map;\r\n var removed = null;\r\n if (map[key] == null) {\r\n var len = list.len();\r\n var entry = this._lastRemovedEntry;\r\n if (len >= this._maxSize && len > 0) {\r\n var leastUsedEntry = list.head;\r\n list.remove(leastUsedEntry);\r\n delete map[leastUsedEntry.key];\r\n removed = leastUsedEntry.value;\r\n this._lastRemovedEntry = leastUsedEntry;\r\n }\r\n if (entry) {\r\n entry.value = value;\r\n }\r\n else {\r\n entry = new Entry(value);\r\n }\r\n entry.key = key;\r\n list.insertEntry(entry);\r\n map[key] = entry;\r\n }\r\n return removed;\r\n };\r\n LRU.prototype.get = function (key) {\r\n var entry = this._map[key];\r\n var list = this._list;\r\n if (entry != null) {\r\n if (entry !== list.tail) {\r\n list.remove(entry);\r\n list.insertEntry(entry);\r\n }\r\n return entry.value;\r\n }\r\n };\r\n LRU.prototype.clear = function () {\r\n this._list.clear();\r\n this._map = {};\r\n };\r\n LRU.prototype.len = function () {\r\n return this._list.len();\r\n };\r\n return LRU;\r\n }());\n\n var kCSSColorTable = {\r\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\r\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\r\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\r\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\r\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\r\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\r\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\r\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\r\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\r\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\r\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\r\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\r\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\r\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\r\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\r\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\r\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\r\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\r\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\r\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\r\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\r\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\r\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\r\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\r\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\r\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\r\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\r\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\r\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\r\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\r\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\r\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\r\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\r\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\r\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\r\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\r\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\r\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\r\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\r\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\r\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\r\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\r\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\r\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\r\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\r\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\r\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\r\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\r\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\r\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\r\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\r\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\r\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\r\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\r\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\r\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\r\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\r\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\r\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\r\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\r\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\r\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\r\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\r\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\r\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\r\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\r\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\r\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\r\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\r\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\r\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\r\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\r\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\r\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\r\n };\r\n function clampCssByte(i) {\r\n i = Math.round(i);\r\n return i < 0 ? 0 : i > 255 ? 255 : i;\r\n }\r\n function clampCssFloat(f) {\r\n return f < 0 ? 0 : f > 1 ? 1 : f;\r\n }\r\n function parseCssInt(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssByte(parseFloat(str) / 100 * 255);\r\n }\r\n return clampCssByte(parseInt(str, 10));\r\n }\r\n function parseCssFloat(val) {\r\n var str = val;\r\n if (str.length && str.charAt(str.length - 1) === '%') {\r\n return clampCssFloat(parseFloat(str) / 100);\r\n }\r\n return clampCssFloat(parseFloat(str));\r\n }\r\n function cssHueToRgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n else if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * h * 6;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n }\r\n function setRgba(out, r, g, b, a) {\r\n out[0] = r;\r\n out[1] = g;\r\n out[2] = b;\r\n out[3] = a;\r\n return out;\r\n }\r\n function copyRgba(out, a) {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n var colorCache = new LRU(20);\r\n var lastRemovedArr = null;\r\n function putToCache(colorStr, rgbaArr) {\r\n if (lastRemovedArr) {\r\n copyRgba(lastRemovedArr, rgbaArr);\r\n }\r\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\r\n }\r\n function parse(colorStr, rgbaArr) {\r\n if (!colorStr) {\r\n return;\r\n }\r\n rgbaArr = rgbaArr || [];\r\n var cached = colorCache.get(colorStr);\r\n if (cached) {\r\n return copyRgba(rgbaArr, cached);\r\n }\r\n colorStr = colorStr + '';\r\n var str = colorStr.replace(/ /g, '').toLowerCase();\r\n if (str in kCSSColorTable) {\r\n copyRgba(rgbaArr, kCSSColorTable[str]);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n var strLen = str.length;\r\n if (str.charAt(0) === '#') {\r\n if (strLen === 4 || strLen === 5) {\r\n var iv = parseInt(str.slice(1, 4), 16);\r\n if (!(iv >= 0 && iv <= 0xfff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n else if (strLen === 7 || strLen === 9) {\r\n var iv = parseInt(str.slice(1, 7), 16);\r\n if (!(iv >= 0 && iv <= 0xffffff)) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n }\r\n return;\r\n }\r\n var op = str.indexOf('(');\r\n var ep = str.indexOf(')');\r\n if (op !== -1 && ep + 1 === strLen) {\r\n var fname = str.substr(0, op);\r\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\r\n var alpha = 1;\r\n switch (fname) {\r\n case 'rgba':\r\n if (params.length !== 4) {\r\n return params.length === 3\r\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\r\n : setRgba(rgbaArr, 0, 0, 0, 1);\r\n }\r\n alpha = parseCssFloat(params.pop());\r\n case 'rgb':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsla':\r\n if (params.length !== 4) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n params[3] = parseCssFloat(params[3]);\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n case 'hsl':\r\n if (params.length !== 3) {\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n hsla2rgba(params, rgbaArr);\r\n putToCache(colorStr, rgbaArr);\r\n return rgbaArr;\r\n default:\r\n return;\r\n }\r\n }\r\n setRgba(rgbaArr, 0, 0, 0, 1);\r\n return;\r\n }\r\n function hsla2rgba(hsla, rgba) {\r\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\r\n var s = parseCssFloat(hsla[1]);\r\n var l = parseCssFloat(hsla[2]);\r\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var m1 = l * 2 - m2;\r\n rgba = rgba || [];\r\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\r\n if (hsla.length === 4) {\r\n rgba[3] = hsla[3];\r\n }\r\n return rgba;\r\n }\r\n function lift(color, level) {\r\n var colorArr = parse(color);\r\n if (colorArr) {\r\n for (var i = 0; i < 3; i++) {\r\n if (level < 0) {\r\n colorArr[i] = colorArr[i] * (1 - level) | 0;\r\n }\r\n else {\r\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\r\n }\r\n if (colorArr[i] > 255) {\r\n colorArr[i] = 255;\r\n }\r\n else if (colorArr[i] < 0) {\r\n colorArr[i] = 0;\r\n }\r\n }\r\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\r\n }\r\n }\r\n function stringify(arrColor, type) {\r\n if (!arrColor || !arrColor.length) {\r\n return;\r\n }\r\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\r\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\r\n colorStr += ',' + arrColor[3];\r\n }\r\n return type + '(' + colorStr + ')';\r\n }\r\n function lum(color, backgroundLum) {\r\n var arr = parse(color);\r\n return arr\r\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\r\n + (1 - arr[3]) * backgroundLum\r\n : 0;\r\n }\n\n var arraySlice = Array.prototype.slice;\r\n function interpolateNumber(p0, p1, percent) {\r\n return (p1 - p0) * percent + p0;\r\n }\r\n function step(p0, p1, percent) {\r\n return percent > 0.5 ? p1 : p0;\r\n }\r\n function interpolate1DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = interpolateNumber(p0[i], p1[i], percent);\r\n }\r\n }\r\n function interpolate2DArray(out, p0, p1, percent) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\r\n }\r\n }\r\n }\r\n function add1DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = p0[i] + p1[i] * sign;\r\n }\r\n return out;\r\n }\r\n function add2DArray(out, p0, p1, sign) {\r\n var len = p0.length;\r\n var len2 = len && p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[i] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = p0[i][j] + p1[i][j] * sign;\r\n }\r\n }\r\n return out;\r\n }\r\n function fillArray(val0, val1, arrDim) {\r\n var arr0 = val0;\r\n var arr1 = val1;\r\n if (!arr0.push || !arr1.push) {\r\n return;\r\n }\r\n var arr0Len = arr0.length;\r\n var arr1Len = arr1.length;\r\n if (arr0Len !== arr1Len) {\r\n var isPreviousLarger = arr0Len > arr1Len;\r\n if (isPreviousLarger) {\r\n arr0.length = arr1Len;\r\n }\r\n else {\r\n for (var i = arr0Len; i < arr1Len; i++) {\r\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\r\n }\r\n }\r\n }\r\n var len2 = arr0[0] && arr0[0].length;\r\n for (var i = 0; i < arr0.length; i++) {\r\n if (arrDim === 1) {\r\n if (isNaN(arr0[i])) {\r\n arr0[i] = arr1[i];\r\n }\r\n }\r\n else {\r\n for (var j = 0; j < len2; j++) {\r\n if (isNaN(arr0[i][j])) {\r\n arr0[i][j] = arr1[i][j];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function is1DArraySame(arr0, arr1) {\r\n var len = arr0.length;\r\n if (len !== arr1.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n if (arr0[i] !== arr1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function catmullRomInterpolate1DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n for (var i = 0; i < len; i++) {\r\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\r\n }\r\n }\r\n function catmullRomInterpolate2DArray(out, p0, p1, p2, p3, t, t2, t3) {\r\n var len = p0.length;\r\n var len2 = p0[0].length;\r\n for (var i = 0; i < len; i++) {\r\n if (!out[i]) {\r\n out[1] = [];\r\n }\r\n for (var j = 0; j < len2; j++) {\r\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\r\n }\r\n }\r\n }\r\n function cloneValue(value) {\r\n if (isArrayLike(value)) {\r\n var len = value.length;\r\n if (isArrayLike(value[0])) {\r\n var ret = [];\r\n for (var i = 0; i < len; i++) {\r\n ret.push(arraySlice.call(value[i]));\r\n }\r\n return ret;\r\n }\r\n return arraySlice.call(value);\r\n }\r\n return value;\r\n }\r\n function rgba2String(rgba) {\r\n rgba[0] = Math.floor(rgba[0]);\r\n rgba[1] = Math.floor(rgba[1]);\r\n rgba[2] = Math.floor(rgba[2]);\r\n return 'rgba(' + rgba.join(',') + ')';\r\n }\r\n function guessArrayDim(value) {\r\n return isArrayLike(value && value[0]) ? 2 : 1;\r\n }\r\n var tmpRgba = [0, 0, 0, 0];\r\n var Track = (function () {\r\n function Track(propName) {\r\n this.keyframes = [];\r\n this.maxTime = 0;\r\n this.arrDim = 0;\r\n this.interpolable = true;\r\n this._needsSort = false;\r\n this._isAllValueEqual = true;\r\n this._lastFrame = 0;\r\n this._lastFramePercent = 0;\r\n this.propName = propName;\r\n }\r\n Track.prototype.isFinished = function () {\r\n return this._finished;\r\n };\r\n Track.prototype.setFinished = function () {\r\n this._finished = true;\r\n if (this._additiveTrack) {\r\n this._additiveTrack.setFinished();\r\n }\r\n };\r\n Track.prototype.needsAnimate = function () {\r\n return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;\r\n };\r\n Track.prototype.getAdditiveTrack = function () {\r\n return this._additiveTrack;\r\n };\r\n Track.prototype.addKeyframe = function (time, value) {\r\n if (time >= this.maxTime) {\r\n this.maxTime = time;\r\n }\r\n else {\r\n this._needsSort = true;\r\n }\r\n var keyframes = this.keyframes;\r\n var len = keyframes.length;\r\n if (this.interpolable) {\r\n if (isArrayLike(value)) {\r\n var arrayDim = guessArrayDim(value);\r\n if (len > 0 && this.arrDim !== arrayDim) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (arrayDim === 1 && typeof value[0] !== 'number'\r\n || arrayDim === 2 && typeof value[0][0] !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this._isAllValueEqual) {\r\n if (arrayDim === 1) {\r\n if (!is1DArraySame(value, lastFrame.value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n else {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n this.arrDim = arrayDim;\r\n }\r\n else {\r\n if (this.arrDim > 0) {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (typeof value === 'string') {\r\n var colorArray = parse(value);\r\n if (colorArray) {\r\n value = colorArray;\r\n this.isValueColor = true;\r\n }\r\n else {\r\n this.interpolable = false;\r\n }\r\n }\r\n else if (typeof value !== 'number') {\r\n this.interpolable = false;\r\n return;\r\n }\r\n if (this._isAllValueEqual && len > 0) {\r\n var lastFrame = keyframes[len - 1];\r\n if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {\r\n this._isAllValueEqual = false;\r\n }\r\n else if (lastFrame.value !== value) {\r\n this._isAllValueEqual = false;\r\n }\r\n }\r\n }\r\n }\r\n var kf = {\r\n time: time,\r\n value: value,\r\n percent: 0\r\n };\r\n this.keyframes.push(kf);\r\n return kf;\r\n };\r\n Track.prototype.prepare = function (additiveTrack) {\r\n var kfs = this.keyframes;\r\n if (this._needsSort) {\r\n kfs.sort(function (a, b) {\r\n return a.time - b.time;\r\n });\r\n }\r\n var arrDim = this.arrDim;\r\n var kfsLen = kfs.length;\r\n var lastKf = kfs[kfsLen - 1];\r\n for (var i = 0; i < kfsLen; i++) {\r\n kfs[i].percent = kfs[i].time / this.maxTime;\r\n if (arrDim > 0 && i !== kfsLen - 1) {\r\n fillArray(kfs[i].value, lastKf.value, arrDim);\r\n }\r\n }\r\n if (additiveTrack\r\n && this.needsAnimate()\r\n && additiveTrack.needsAnimate()\r\n && arrDim === additiveTrack.arrDim\r\n && this.isValueColor === additiveTrack.isValueColor\r\n && !additiveTrack._finished) {\r\n this._additiveTrack = additiveTrack;\r\n var startValue = kfs[0].value;\r\n for (var i = 0; i < kfsLen; i++) {\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n kfs[i].additiveValue\r\n = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else {\r\n kfs[i].additiveValue = kfs[i].value - startValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);\r\n }\r\n else if (arrDim === 2) {\r\n kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);\r\n }\r\n }\r\n }\r\n };\r\n Track.prototype.step = function (target, percent) {\r\n if (this._finished) {\r\n return;\r\n }\r\n if (this._additiveTrack && this._additiveTrack._finished) {\r\n this._additiveTrack = null;\r\n }\r\n var isAdditive = this._additiveTrack != null;\r\n var valueKey = isAdditive ? 'additiveValue' : 'value';\r\n var keyframes = this.keyframes;\r\n var kfsNum = this.keyframes.length;\r\n var propName = this.propName;\r\n var arrDim = this.arrDim;\r\n var isValueColor = this.isValueColor;\r\n var frameIdx;\r\n if (percent < 0) {\r\n frameIdx = 0;\r\n }\r\n else if (percent < this._lastFramePercent) {\r\n var start = Math.min(this._lastFrame + 1, kfsNum - 1);\r\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\r\n if (keyframes[frameIdx].percent <= percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx, kfsNum - 2);\r\n }\r\n else {\r\n for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {\r\n if (keyframes[frameIdx].percent > percent) {\r\n break;\r\n }\r\n }\r\n frameIdx = Math.min(frameIdx - 1, kfsNum - 2);\r\n }\r\n var nextFrame = keyframes[frameIdx + 1];\r\n var frame = keyframes[frameIdx];\r\n if (!(frame && nextFrame)) {\r\n return;\r\n }\r\n this._lastFrame = frameIdx;\r\n this._lastFramePercent = percent;\r\n var range = (nextFrame.percent - frame.percent);\r\n if (range === 0) {\r\n return;\r\n }\r\n var w = (percent - frame.percent) / range;\r\n var targetArr = isAdditive ? this._additiveValue\r\n : (isValueColor ? tmpRgba : target[propName]);\r\n if ((arrDim > 0 || isValueColor) && !targetArr) {\r\n targetArr = this._additiveValue = [];\r\n }\r\n if (this.useSpline) {\r\n var p1 = keyframes[frameIdx][valueKey];\r\n var p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];\r\n var p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];\r\n var p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w)\r\n : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n else if (isValueColor) {\r\n catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = p2;\r\n }\r\n else {\r\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n else {\r\n if (arrDim > 0) {\r\n arrDim === 1\r\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\r\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else if (isValueColor) {\r\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\r\n if (!isAdditive) {\r\n target[propName] = rgba2String(targetArr);\r\n }\r\n }\r\n else {\r\n var value = void 0;\r\n if (!this.interpolable) {\r\n value = step(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n else {\r\n value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\r\n }\r\n if (isAdditive) {\r\n this._additiveValue = value;\r\n }\r\n else {\r\n target[propName] = value;\r\n }\r\n }\r\n }\r\n if (isAdditive) {\r\n this._addToTarget(target);\r\n }\r\n };\r\n Track.prototype._addToTarget = function (target) {\r\n var arrDim = this.arrDim;\r\n var propName = this.propName;\r\n var additiveValue = this._additiveValue;\r\n if (arrDim === 0) {\r\n if (this.isValueColor) {\r\n parse(target[propName], tmpRgba);\r\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\r\n target[propName] = rgba2String(tmpRgba);\r\n }\r\n else {\r\n target[propName] = target[propName] + additiveValue;\r\n }\r\n }\r\n else if (arrDim === 1) {\r\n add1DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n else if (arrDim === 2) {\r\n add2DArray(target[propName], target[propName], additiveValue, 1);\r\n }\r\n };\r\n return Track;\r\n }());\r\n var Animator = (function () {\r\n function Animator(target, loop, additiveTo) {\r\n this._tracks = {};\r\n this._trackKeys = [];\r\n this._delay = 0;\r\n this._maxTime = 0;\r\n this._paused = false;\r\n this._started = 0;\r\n this._clip = null;\r\n this._target = target;\r\n this._loop = loop;\r\n if (loop && additiveTo) {\r\n logError('Can\\' use additive animation on looped animation.');\r\n return;\r\n }\r\n this._additiveAnimators = additiveTo;\r\n }\r\n Animator.prototype.getTarget = function () {\r\n return this._target;\r\n };\r\n Animator.prototype.changeTarget = function (target) {\r\n this._target = target;\r\n };\r\n Animator.prototype.when = function (time, props) {\r\n return this.whenWithKeys(time, props, keys(props));\r\n };\r\n Animator.prototype.whenWithKeys = function (time, props, propNames) {\r\n var tracks = this._tracks;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var propName = propNames[i];\r\n var track = tracks[propName];\r\n if (!track) {\r\n track = tracks[propName] = new Track(propName);\r\n var initialValue = void 0;\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n if (additiveTrack) {\r\n var lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];\r\n initialValue = lastFinalKf && lastFinalKf.value;\r\n if (additiveTrack.isValueColor && initialValue) {\r\n initialValue = rgba2String(initialValue);\r\n }\r\n }\r\n else {\r\n initialValue = this._target[propName];\r\n }\r\n if (initialValue == null) {\r\n continue;\r\n }\r\n if (time !== 0) {\r\n track.addKeyframe(0, cloneValue(initialValue));\r\n }\r\n this._trackKeys.push(propName);\r\n }\r\n track.addKeyframe(time, cloneValue(props[propName]));\r\n }\r\n this._maxTime = Math.max(this._maxTime, time);\r\n return this;\r\n };\r\n Animator.prototype.pause = function () {\r\n this._clip.pause();\r\n this._paused = true;\r\n };\r\n Animator.prototype.resume = function () {\r\n this._clip.resume();\r\n this._paused = false;\r\n };\r\n Animator.prototype.isPaused = function () {\r\n return !!this._paused;\r\n };\r\n Animator.prototype._doneCallback = function () {\r\n this._setTracksFinished();\r\n this._clip = null;\r\n var doneList = this._doneList;\r\n if (doneList) {\r\n var len = doneList.length;\r\n for (var i = 0; i < len; i++) {\r\n doneList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._abortedCallback = function () {\r\n this._setTracksFinished();\r\n var animation = this.animation;\r\n var abortedList = this._abortedList;\r\n if (animation) {\r\n animation.removeClip(this._clip);\r\n }\r\n this._clip = null;\r\n if (abortedList) {\r\n for (var i = 0; i < abortedList.length; i++) {\r\n abortedList[i].call(this);\r\n }\r\n }\r\n };\r\n Animator.prototype._setTracksFinished = function () {\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n tracks[tracksKeys[i]].setFinished();\r\n }\r\n };\r\n Animator.prototype._getAdditiveTrack = function (trackName) {\r\n var additiveTrack;\r\n var additiveAnimators = this._additiveAnimators;\r\n if (additiveAnimators) {\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n var track = additiveAnimators[i].getTrack(trackName);\r\n if (track) {\r\n additiveTrack = track;\r\n }\r\n }\r\n }\r\n return additiveTrack;\r\n };\r\n Animator.prototype.start = function (easing, forceAnimate) {\r\n if (this._started > 0) {\r\n return;\r\n }\r\n this._started = 1;\r\n var self = this;\r\n var tracks = [];\r\n for (var i = 0; i < this._trackKeys.length; i++) {\r\n var propName = this._trackKeys[i];\r\n var track = this._tracks[propName];\r\n var additiveTrack = this._getAdditiveTrack(propName);\r\n var kfs = track.keyframes;\r\n track.prepare(additiveTrack);\r\n if (track.needsAnimate()) {\r\n tracks.push(track);\r\n }\r\n else if (!track.interpolable) {\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n self._target[track.propName] = lastKf.value;\r\n }\r\n }\r\n }\r\n if (tracks.length || forceAnimate) {\r\n var clip = new Clip({\r\n life: this._maxTime,\r\n loop: this._loop,\r\n delay: this._delay,\r\n onframe: function (percent) {\r\n self._started = 2;\r\n var additiveAnimators = self._additiveAnimators;\r\n if (additiveAnimators) {\r\n var stillHasAdditiveAnimator = false;\r\n for (var i = 0; i < additiveAnimators.length; i++) {\r\n if (additiveAnimators[i]._clip) {\r\n stillHasAdditiveAnimator = true;\r\n break;\r\n }\r\n }\r\n if (!stillHasAdditiveAnimator) {\r\n self._additiveAnimators = null;\r\n }\r\n }\r\n for (var i = 0; i < tracks.length; i++) {\r\n tracks[i].step(self._target, percent);\r\n }\r\n var onframeList = self._onframeList;\r\n if (onframeList) {\r\n for (var i = 0; i < onframeList.length; i++) {\r\n onframeList[i](self._target, percent);\r\n }\r\n }\r\n },\r\n ondestroy: function () {\r\n self._doneCallback();\r\n }\r\n });\r\n this._clip = clip;\r\n if (this.animation) {\r\n this.animation.addClip(clip);\r\n }\r\n if (easing && easing !== 'spline') {\r\n clip.easing = easing;\r\n }\r\n }\r\n else {\r\n this._doneCallback();\r\n }\r\n return this;\r\n };\r\n Animator.prototype.stop = function (forwardToLast) {\r\n if (!this._clip) {\r\n return;\r\n }\r\n var clip = this._clip;\r\n if (forwardToLast) {\r\n clip.onframe(1);\r\n }\r\n this._abortedCallback();\r\n };\r\n Animator.prototype.delay = function (time) {\r\n this._delay = time;\r\n return this;\r\n };\r\n Animator.prototype.during = function (cb) {\r\n if (cb) {\r\n if (!this._onframeList) {\r\n this._onframeList = [];\r\n }\r\n this._onframeList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.done = function (cb) {\r\n if (cb) {\r\n if (!this._doneList) {\r\n this._doneList = [];\r\n }\r\n this._doneList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.aborted = function (cb) {\r\n if (cb) {\r\n if (!this._abortedList) {\r\n this._abortedList = [];\r\n }\r\n this._abortedList.push(cb);\r\n }\r\n return this;\r\n };\r\n Animator.prototype.getClip = function () {\r\n return this._clip;\r\n };\r\n Animator.prototype.getTrack = function (propName) {\r\n return this._tracks[propName];\r\n };\r\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\r\n if (!propNames.length || !this._clip) {\r\n return true;\r\n }\r\n var tracks = this._tracks;\r\n var tracksKeys = this._trackKeys;\r\n for (var i = 0; i < propNames.length; i++) {\r\n var track = tracks[propNames[i]];\r\n if (track) {\r\n if (forwardToLast) {\r\n track.step(this._target, 1);\r\n }\r\n else if (this._started === 1) {\r\n track.step(this._target, 0);\r\n }\r\n track.setFinished();\r\n }\r\n }\r\n var allAborted = true;\r\n for (var i = 0; i < tracksKeys.length; i++) {\r\n if (!tracks[tracksKeys[i]].isFinished()) {\r\n allAborted = false;\r\n break;\r\n }\r\n }\r\n if (allAborted) {\r\n this._abortedCallback();\r\n }\r\n return allAborted;\r\n };\r\n Animator.prototype.saveFinalToTarget = function (target, trackKeys) {\r\n if (!target) {\r\n return;\r\n }\r\n trackKeys = trackKeys || this._trackKeys;\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track || track.isFinished()) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n var lastKf = kfs[kfs.length - 1];\r\n if (lastKf) {\r\n var val = cloneValue(lastKf.value);\r\n if (track.isValueColor) {\r\n val = rgba2String(val);\r\n }\r\n target[propName] = val;\r\n }\r\n }\r\n };\r\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\r\n trackKeys = trackKeys || keys(finalProps);\r\n for (var i = 0; i < trackKeys.length; i++) {\r\n var propName = trackKeys[i];\r\n var track = this._tracks[propName];\r\n if (!track) {\r\n continue;\r\n }\r\n var kfs = track.keyframes;\r\n if (kfs.length > 1) {\r\n var lastKf = kfs.pop();\r\n track.addKeyframe(lastKf.time, finalProps[propName]);\r\n track.prepare(track.getAdditiveTrack());\r\n }\r\n }\r\n };\r\n return Animator;\r\n }());\n\n var Point = (function () {\r\n function Point(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n Point.prototype.copy = function (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n return this;\r\n };\r\n Point.prototype.clone = function () {\r\n return new Point(this.x, this.y);\r\n };\r\n Point.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Point.prototype.equal = function (other) {\r\n return other.x === this.x && other.y === this.y;\r\n };\r\n Point.prototype.add = function (other) {\r\n this.x += other.x;\r\n this.y += other.y;\r\n return this;\r\n };\r\n Point.prototype.scale = function (scalar) {\r\n this.x *= scalar;\r\n this.y *= scalar;\r\n };\r\n Point.prototype.scaleAndAdd = function (other, scalar) {\r\n this.x += other.x * scalar;\r\n this.y += other.y * scalar;\r\n };\r\n Point.prototype.sub = function (other) {\r\n this.x -= other.x;\r\n this.y -= other.y;\r\n return this;\r\n };\r\n Point.prototype.dot = function (other) {\r\n return this.x * other.x + this.y * other.y;\r\n };\r\n Point.prototype.len = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n };\r\n Point.prototype.lenSquare = function () {\r\n return this.x * this.x + this.y * this.y;\r\n };\r\n Point.prototype.normalize = function () {\r\n var len = this.len();\r\n this.x /= len;\r\n this.y /= len;\r\n return this;\r\n };\r\n Point.prototype.distance = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n };\r\n Point.prototype.distanceSquare = function (other) {\r\n var dx = this.x - other.x;\r\n var dy = this.y - other.y;\r\n return dx * dx + dy * dy;\r\n };\r\n Point.prototype.negate = function () {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n return this;\r\n };\r\n Point.prototype.transform = function (m) {\r\n if (!m) {\r\n return;\r\n }\r\n var x = this.x;\r\n var y = this.y;\r\n this.x = m[0] * x + m[2] * y + m[4];\r\n this.y = m[1] * x + m[3] * y + m[5];\r\n return this;\r\n };\r\n Point.prototype.toArray = function (out) {\r\n out[0] = this.x;\r\n out[1] = this.y;\r\n return out;\r\n };\r\n Point.prototype.fromArray = function (input) {\r\n this.x = input[0];\r\n this.y = input[1];\r\n };\r\n Point.set = function (p, x, y) {\r\n p.x = x;\r\n p.y = y;\r\n };\r\n Point.copy = function (p, p2) {\r\n p.x = p2.x;\r\n p.y = p2.y;\r\n };\r\n Point.len = function (p) {\r\n return Math.sqrt(p.x * p.x + p.y * p.y);\r\n };\r\n Point.lenSquare = function (p) {\r\n return p.x * p.x + p.y * p.y;\r\n };\r\n Point.dot = function (p0, p1) {\r\n return p0.x * p1.x + p0.y * p1.y;\r\n };\r\n Point.add = function (out, p0, p1) {\r\n out.x = p0.x + p1.x;\r\n out.y = p0.y + p1.y;\r\n };\r\n Point.sub = function (out, p0, p1) {\r\n out.x = p0.x - p1.x;\r\n out.y = p0.y - p1.y;\r\n };\r\n Point.scale = function (out, p0, scalar) {\r\n out.x = p0.x * scalar;\r\n out.y = p0.y * scalar;\r\n };\r\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\r\n out.x = p0.x + p1.x * scalar;\r\n out.y = p0.y + p1.y * scalar;\r\n };\r\n Point.lerp = function (out, p0, p1, t) {\r\n var onet = 1 - t;\r\n out.x = onet * p0.x + t * p1.x;\r\n out.y = onet * p0.y + t * p1.y;\r\n };\r\n return Point;\r\n }());\n\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var lt = new Point();\r\n var rb = new Point();\r\n var lb = new Point();\r\n var rt = new Point();\r\n var minTv = new Point();\r\n var maxTv = new Point();\r\n var BoundingRect = (function () {\r\n function BoundingRect(x, y, width, height) {\r\n if (width < 0 && isFinite(width)) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0 && isFinite(height)) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n BoundingRect.prototype.union = function (other) {\r\n var x = mathMin(other.x, this.x);\r\n var y = mathMin(other.y, this.y);\r\n if (isFinite(this.x) && isFinite(this.width)) {\r\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\r\n }\r\n else {\r\n this.width = other.width;\r\n }\r\n if (isFinite(this.y) && isFinite(this.height)) {\r\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\r\n }\r\n else {\r\n this.height = other.height;\r\n }\r\n this.x = x;\r\n this.y = y;\r\n };\r\n BoundingRect.prototype.applyTransform = function (m) {\r\n BoundingRect.applyTransform(this, this, m);\r\n };\r\n BoundingRect.prototype.calculateTransform = function (b) {\r\n var a = this;\r\n var sx = b.width / a.width;\r\n var sy = b.height / a.height;\r\n var m = create$1();\r\n translate(m, m, [-a.x, -a.y]);\r\n scale$1(m, m, [sx, sy]);\r\n translate(m, m, [b.x, b.y]);\r\n return m;\r\n };\r\n BoundingRect.prototype.intersect = function (b, mtv) {\r\n if (!b) {\r\n return false;\r\n }\r\n if (!(b instanceof BoundingRect)) {\r\n b = BoundingRect.create(b);\r\n }\r\n var a = this;\r\n var ax0 = a.x;\r\n var ax1 = a.x + a.width;\r\n var ay0 = a.y;\r\n var ay1 = a.y + a.height;\r\n var bx0 = b.x;\r\n var bx1 = b.x + b.width;\r\n var by0 = b.y;\r\n var by1 = b.y + b.height;\r\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\r\n if (mtv) {\r\n var dMin = Infinity;\r\n var dMax = 0;\r\n var d0 = Math.abs(ax1 - bx0);\r\n var d1 = Math.abs(bx1 - ax0);\r\n var d2 = Math.abs(ay1 - by0);\r\n var d3 = Math.abs(by1 - ay0);\r\n var dx = Math.min(d0, d1);\r\n var dy = Math.min(d2, d3);\r\n if (ax1 < bx0 || bx1 < ax0) {\r\n if (dx > dMax) {\r\n dMax = dx;\r\n if (d0 < d1) {\r\n Point.set(maxTv, -d0, 0);\r\n }\r\n else {\r\n Point.set(maxTv, d1, 0);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d0 < d1) {\r\n Point.set(minTv, d0, 0);\r\n }\r\n else {\r\n Point.set(minTv, -d1, 0);\r\n }\r\n }\r\n }\r\n if (ay1 < by0 || by1 < ay0) {\r\n if (dy > dMax) {\r\n dMax = dy;\r\n if (d2 < d3) {\r\n Point.set(maxTv, 0, -d2);\r\n }\r\n else {\r\n Point.set(maxTv, 0, d3);\r\n }\r\n }\r\n }\r\n else {\r\n if (dx < dMin) {\r\n dMin = dx;\r\n if (d2 < d3) {\r\n Point.set(minTv, 0, d2);\r\n }\r\n else {\r\n Point.set(minTv, 0, -d3);\r\n }\r\n }\r\n }\r\n }\r\n if (mtv) {\r\n Point.copy(mtv, overlap ? minTv : maxTv);\r\n }\r\n return overlap;\r\n };\r\n BoundingRect.prototype.contain = function (x, y) {\r\n var rect = this;\r\n return x >= rect.x\r\n && x <= (rect.x + rect.width)\r\n && y >= rect.y\r\n && y <= (rect.y + rect.height);\r\n };\r\n BoundingRect.prototype.clone = function () {\r\n return new BoundingRect(this.x, this.y, this.width, this.height);\r\n };\r\n BoundingRect.prototype.copy = function (other) {\r\n BoundingRect.copy(this, other);\r\n };\r\n BoundingRect.prototype.plain = function () {\r\n return {\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height\r\n };\r\n };\r\n BoundingRect.prototype.isFinite = function () {\r\n return isFinite(this.x)\r\n && isFinite(this.y)\r\n && isFinite(this.width)\r\n && isFinite(this.height);\r\n };\r\n BoundingRect.prototype.isZero = function () {\r\n return this.width === 0 || this.height === 0;\r\n };\r\n BoundingRect.create = function (rect) {\r\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\r\n };\r\n BoundingRect.copy = function (target, source) {\r\n target.x = source.x;\r\n target.y = source.y;\r\n target.width = source.width;\r\n target.height = source.height;\r\n };\r\n BoundingRect.applyTransform = function (target, source, m) {\r\n if (!m) {\r\n if (target !== source) {\r\n BoundingRect.copy(target, source);\r\n }\r\n return;\r\n }\r\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\r\n var sx = m[0];\r\n var sy = m[3];\r\n var tx = m[4];\r\n var ty = m[5];\r\n target.x = source.x * sx + tx;\r\n target.y = source.y * sy + ty;\r\n target.width = source.width * sx;\r\n target.height = source.height * sy;\r\n if (target.width < 0) {\r\n target.x += target.width;\r\n target.width = -target.width;\r\n }\r\n if (target.height < 0) {\r\n target.y += target.height;\r\n target.height = -target.height;\r\n }\r\n return;\r\n }\r\n lt.x = lb.x = source.x;\r\n lt.y = rt.y = source.y;\r\n rb.x = rt.x = source.x + source.width;\r\n rb.y = lb.y = source.y + source.height;\r\n lt.transform(m);\r\n rt.transform(m);\r\n rb.transform(m);\r\n lb.transform(m);\r\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\r\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\r\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\r\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\r\n target.width = maxX - target.x;\r\n target.height = maxY - target.y;\r\n };\r\n return BoundingRect;\r\n }());\n\n var textWidthCache = {};\r\n var DEFAULT_FONT = '12px sans-serif';\r\n var _ctx;\r\n var _cachedFont;\r\n function defaultMeasureText(text, font) {\r\n if (!_ctx) {\r\n _ctx = createCanvas().getContext('2d');\r\n }\r\n if (_cachedFont !== font) {\r\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\r\n }\r\n return _ctx.measureText(text);\r\n }\r\n var methods$1 = {\r\n measureText: defaultMeasureText\r\n };\r\n function getWidth(text, font) {\r\n font = font || DEFAULT_FONT;\r\n var cacheOfFont = textWidthCache[font];\r\n if (!cacheOfFont) {\r\n cacheOfFont = textWidthCache[font] = new LRU(500);\r\n }\r\n var width = cacheOfFont.get(text);\r\n if (width == null) {\r\n width = methods$1.measureText(text, font).width;\r\n cacheOfFont.put(text, width);\r\n }\r\n return width;\r\n }\r\n function innerGetBoundingRect(text, font, textAlign, textBaseline) {\r\n var width = getWidth(text, font);\r\n var height = getLineHeight(font);\r\n var x = adjustTextX(0, width, textAlign);\r\n var y = adjustTextY(0, height, textBaseline);\r\n var rect = new BoundingRect(x, y, width, height);\r\n return rect;\r\n }\r\n function getBoundingRect(text, font, textAlign, textBaseline) {\r\n var textLines = ((text || '') + '').split('\\n');\r\n var len = textLines.length;\r\n if (len === 1) {\r\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\r\n }\r\n else {\r\n var uniondRect = new BoundingRect(0, 0, 0, 0);\r\n for (var i = 0; i < textLines.length; i++) {\r\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\r\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\r\n }\r\n return uniondRect;\r\n }\r\n }\r\n function adjustTextX(x, width, textAlign) {\r\n if (textAlign === 'right') {\r\n x -= width;\r\n }\r\n else if (textAlign === 'center') {\r\n x -= width / 2;\r\n }\r\n return x;\r\n }\r\n function adjustTextY(y, height, verticalAlign) {\r\n if (verticalAlign === 'middle') {\r\n y -= height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y -= height;\r\n }\r\n return y;\r\n }\r\n function getLineHeight(font) {\r\n return getWidth('国', font);\r\n }\r\n function parsePercent(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\r\n function calculateTextPosition(out, opts, rect) {\r\n var textPosition = opts.position || 'inside';\r\n var distance = opts.distance != null ? opts.distance : 5;\r\n var height = rect.height;\r\n var width = rect.width;\r\n var halfHeight = height / 2;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var textAlign = 'left';\r\n var textVerticalAlign = 'top';\r\n if (textPosition instanceof Array) {\r\n x += parsePercent(textPosition[0], rect.width);\r\n y += parsePercent(textPosition[1], rect.height);\r\n textAlign = null;\r\n textVerticalAlign = null;\r\n }\r\n else {\r\n switch (textPosition) {\r\n case 'left':\r\n x -= distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'right':\r\n x += distance + width;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'top':\r\n x += width / 2;\r\n y -= distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'bottom':\r\n x += width / 2;\r\n y += height + distance;\r\n textAlign = 'center';\r\n break;\r\n case 'inside':\r\n x += width / 2;\r\n y += halfHeight;\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideLeft':\r\n x += distance;\r\n y += halfHeight;\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideRight':\r\n x += width - distance;\r\n y += halfHeight;\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n case 'insideTop':\r\n x += width / 2;\r\n y += distance;\r\n textAlign = 'center';\r\n break;\r\n case 'insideBottom':\r\n x += width / 2;\r\n y += height - distance;\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideTopLeft':\r\n x += distance;\r\n y += distance;\r\n break;\r\n case 'insideTopRight':\r\n x += width - distance;\r\n y += distance;\r\n textAlign = 'right';\r\n break;\r\n case 'insideBottomLeft':\r\n x += distance;\r\n y += height - distance;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n case 'insideBottomRight':\r\n x += width - distance;\r\n y += height - distance;\r\n textAlign = 'right';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n }\r\n }\r\n out = out || {};\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n return out;\r\n }\n\n var dpr = 1;\r\n if (typeof window !== 'undefined') {\r\n dpr = Math.max(window.devicePixelRatio\r\n || (window.screen.deviceXDPI / window.screen.logicalXDPI)\r\n || 1, 1);\r\n }\r\n var devicePixelRatio = dpr;\r\n var DARK_MODE_THRESHOLD = 0.4;\r\n var DARK_LABEL_COLOR = '#333';\r\n var LIGHT_LABEL_COLOR = '#ccc';\r\n var LIGHTER_LABEL_COLOR = '#eee';\n\n var PRESERVED_NORMAL_STATE = '__zr_normal__';\r\n var PRIMARY_STATES_KEYS = ['x', 'y', 'scaleX', 'scaleY', 'originX', 'originY', 'rotation', 'ignore'];\r\n var DEFAULT_ANIMATABLE_MAP = {\r\n x: true,\r\n y: true,\r\n scaleX: true,\r\n scaleY: true,\r\n originX: true,\r\n originY: true,\r\n rotation: true,\r\n ignore: false\r\n };\r\n var tmpTextPosCalcRes = {};\r\n var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\r\n var Element = (function () {\r\n function Element(props) {\r\n this.id = guid();\r\n this.animators = [];\r\n this.currentStates = [];\r\n this.states = {};\r\n this._init(props);\r\n }\r\n Element.prototype._init = function (props) {\r\n this.attr(props);\r\n };\r\n Element.prototype.drift = function (dx, dy, e) {\r\n switch (this.draggable) {\r\n case 'horizontal':\r\n dy = 0;\r\n break;\r\n case 'vertical':\r\n dx = 0;\r\n break;\r\n }\r\n var m = this.transform;\r\n if (!m) {\r\n m = this.transform = [1, 0, 0, 1, 0, 0];\r\n }\r\n m[4] += dx;\r\n m[5] += dy;\r\n this.decomposeTransform();\r\n this.markRedraw();\r\n };\r\n Element.prototype.beforeUpdate = function () { };\r\n Element.prototype.afterUpdate = function () { };\r\n Element.prototype.update = function () {\r\n this.updateTransform();\r\n if (this.__dirty) {\r\n this.updateInnerText();\r\n }\r\n };\r\n Element.prototype.updateInnerText = function (forceUpdate) {\r\n var textEl = this._textContent;\r\n if (textEl && (!textEl.ignore || forceUpdate)) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n var textConfig = this.textConfig;\r\n var isLocal = textConfig.local;\r\n var attachedTransform = textEl.attachedTransform;\r\n var textAlign = void 0;\r\n var textVerticalAlign = void 0;\r\n var textStyleChanged = false;\r\n if (isLocal) {\r\n attachedTransform.parent = this;\r\n }\r\n else {\r\n attachedTransform.parent = null;\r\n }\r\n var innerOrigin = false;\r\n attachedTransform.x = textEl.x;\r\n attachedTransform.y = textEl.y;\r\n attachedTransform.originX = textEl.originX;\r\n attachedTransform.originY = textEl.originY;\r\n attachedTransform.rotation = textEl.rotation;\r\n attachedTransform.scaleX = textEl.scaleX;\r\n attachedTransform.scaleY = textEl.scaleY;\r\n if (textConfig.position != null) {\r\n var layoutRect = tmpBoundingRect;\r\n if (textConfig.layoutRect) {\r\n layoutRect.copy(textConfig.layoutRect);\r\n }\r\n else {\r\n layoutRect.copy(this.getBoundingRect());\r\n }\r\n if (!isLocal) {\r\n layoutRect.applyTransform(this.transform);\r\n }\r\n if (this.calculateTextPosition) {\r\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n else {\r\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\r\n }\r\n attachedTransform.x = tmpTextPosCalcRes.x;\r\n attachedTransform.y = tmpTextPosCalcRes.y;\r\n textAlign = tmpTextPosCalcRes.align;\r\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\r\n var textOrigin = textConfig.origin;\r\n if (textOrigin && textConfig.rotation != null) {\r\n var relOriginX = void 0;\r\n var relOriginY = void 0;\r\n if (textOrigin === 'center') {\r\n relOriginX = layoutRect.width * 0.5;\r\n relOriginY = layoutRect.height * 0.5;\r\n }\r\n else {\r\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\r\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\r\n }\r\n innerOrigin = true;\r\n attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);\r\n attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);\r\n }\r\n }\r\n if (textConfig.rotation != null) {\r\n attachedTransform.rotation = textConfig.rotation;\r\n }\r\n var textOffset = textConfig.offset;\r\n if (textOffset) {\r\n attachedTransform.x += textOffset[0];\r\n attachedTransform.y += textOffset[1];\r\n if (!innerOrigin) {\r\n attachedTransform.originX = -textOffset[0];\r\n attachedTransform.originY = -textOffset[1];\r\n }\r\n }\r\n var isInside = textConfig.inside == null\r\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\r\n : textConfig.inside;\r\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\r\n var textFill = void 0;\r\n var textStroke = void 0;\r\n var autoStroke = void 0;\r\n if (isInside && this.canBeInsideText()) {\r\n textFill = textConfig.insideFill;\r\n textStroke = textConfig.insideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getInsideTextFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getInsideTextStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n else {\r\n textFill = textConfig.outsideFill;\r\n textStroke = textConfig.outsideStroke;\r\n if (textFill == null || textFill === 'auto') {\r\n textFill = this.getOutsideFill();\r\n }\r\n if (textStroke == null || textStroke === 'auto') {\r\n textStroke = this.getOutsideStroke(textFill);\r\n autoStroke = true;\r\n }\r\n }\r\n textFill = textFill || '#000';\r\n if (textFill !== innerTextDefaultStyle.fill\r\n || textStroke !== innerTextDefaultStyle.stroke\r\n || autoStroke !== innerTextDefaultStyle.autoStroke\r\n || textAlign !== innerTextDefaultStyle.align\r\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\r\n textStyleChanged = true;\r\n innerTextDefaultStyle.fill = textFill;\r\n innerTextDefaultStyle.stroke = textStroke;\r\n innerTextDefaultStyle.autoStroke = autoStroke;\r\n innerTextDefaultStyle.align = textAlign;\r\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\r\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\r\n }\r\n if (textStyleChanged) {\r\n textEl.dirtyStyle();\r\n }\r\n textEl.markRedraw();\r\n }\r\n };\r\n Element.prototype.canBeInsideText = function () {\r\n return true;\r\n };\r\n Element.prototype.getInsideTextFill = function () {\r\n return '#fff';\r\n };\r\n Element.prototype.getInsideTextStroke = function (textFill) {\r\n return '#000';\r\n };\r\n Element.prototype.getOutsideFill = function () {\r\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\r\n };\r\n Element.prototype.getOutsideStroke = function (textFill) {\r\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\r\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\r\n if (!colorArr) {\r\n colorArr = [255, 255, 255, 1];\r\n }\r\n var alpha = colorArr[3];\r\n var isDark = this.__zr.isDarkMode();\r\n for (var i = 0; i < 3; i++) {\r\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\r\n }\r\n colorArr[3] = 1;\r\n return stringify(colorArr, 'rgba');\r\n };\r\n Element.prototype.traverse = function (cb, context) { };\r\n Element.prototype.attrKV = function (key, value) {\r\n if (key === 'textConfig') {\r\n this.setTextConfig(value);\r\n }\r\n else if (key === 'textContent') {\r\n this.setTextContent(value);\r\n }\r\n else if (key === 'clipPath') {\r\n this.setClipPath(value);\r\n }\r\n else if (key === 'extra') {\r\n this.extra = this.extra || {};\r\n extend(this.extra, value);\r\n }\r\n else {\r\n this[key] = value;\r\n }\r\n };\r\n Element.prototype.hide = function () {\r\n this.ignore = true;\r\n this.markRedraw();\r\n };\r\n Element.prototype.show = function () {\r\n this.ignore = false;\r\n this.markRedraw();\r\n };\r\n Element.prototype.attr = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.attrKV(keyOrObj, value);\r\n }\r\n else if (isObject(keyOrObj)) {\r\n var obj = keyOrObj;\r\n var keysArr = keys(obj);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n this.attrKV(key, keyOrObj[key]);\r\n }\r\n }\r\n this.markRedraw();\r\n return this;\r\n };\r\n Element.prototype.saveCurrentToNormalState = function (toState) {\r\n this._innerSaveToNormal(toState);\r\n var normalState = this._normalState;\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var fromStateTransition = animator.__fromStateTransition;\r\n if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\r\n continue;\r\n }\r\n var targetName = animator.targetName;\r\n var target = targetName\r\n ? normalState[targetName] : normalState;\r\n animator.saveFinalToTarget(target);\r\n }\r\n };\r\n Element.prototype._innerSaveToNormal = function (toState) {\r\n var normalState = this._normalState;\r\n if (!normalState) {\r\n normalState = this._normalState = {};\r\n }\r\n if (toState.textConfig && !normalState.textConfig) {\r\n normalState.textConfig = this.textConfig;\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\r\n };\r\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\r\n for (var i = 0; i < primaryKeys.length; i++) {\r\n var key = primaryKeys[i];\r\n if (toState[key] != null && !(key in normalState)) {\r\n normalState[key] = this[key];\r\n }\r\n }\r\n };\r\n Element.prototype.hasState = function () {\r\n return this.currentStates.length > 0;\r\n };\r\n Element.prototype.getState = function (name) {\r\n return this.states[name];\r\n };\r\n Element.prototype.ensureState = function (name) {\r\n var states = this.states;\r\n if (!states[name]) {\r\n states[name] = {};\r\n }\r\n return states[name];\r\n };\r\n Element.prototype.clearStates = function (noAnimation) {\r\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\r\n };\r\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation) {\r\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\r\n var hasStates = this.hasState();\r\n if (!hasStates && toNormalState) {\r\n return;\r\n }\r\n var currentStates = this.currentStates;\r\n var animationCfg = this.stateTransition;\r\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\r\n return;\r\n }\r\n var state;\r\n if (this.stateProxy && !toNormalState) {\r\n state = this.stateProxy(stateName);\r\n }\r\n if (!state) {\r\n state = (this.states && this.states[stateName]);\r\n }\r\n if (!state && !toNormalState) {\r\n logError(\"State \" + stateName + \" not exists.\");\r\n return;\r\n }\r\n if (!toNormalState) {\r\n this.saveCurrentToNormalState(state);\r\n }\r\n var useHoverLayer = !!(state && state.hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useState(stateName, keepCurrentStates);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useState(stateName, keepCurrentStates);\r\n }\r\n if (toNormalState) {\r\n this.currentStates = [];\r\n this._normalState = {};\r\n }\r\n else {\r\n if (!keepCurrentStates) {\r\n this.currentStates = [stateName];\r\n }\r\n else {\r\n this.currentStates.push(stateName);\r\n }\r\n }\r\n this._updateAnimationTargets();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n return state;\r\n };\r\n Element.prototype.useStates = function (states, noAnimation) {\r\n if (!states.length) {\r\n this.clearStates();\r\n }\r\n else {\r\n var stateObjects = [];\r\n var currentStates = this.currentStates;\r\n var len = states.length;\r\n var notChange = len === currentStates.length;\r\n if (notChange) {\r\n for (var i = 0; i < len; i++) {\r\n if (states[i] !== currentStates[i]) {\r\n notChange = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (notChange) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var stateName = states[i];\r\n var stateObj = void 0;\r\n if (this.stateProxy) {\r\n stateObj = this.stateProxy(stateName, states);\r\n }\r\n if (!stateObj) {\r\n stateObj = this.states[stateName];\r\n }\r\n if (stateObj) {\r\n stateObjects.push(stateObj);\r\n }\r\n }\r\n var useHoverLayer = !!(stateObjects[len - 1] && stateObjects[len - 1].hoverLayer);\r\n if (useHoverLayer) {\r\n this._toggleHoverLayerFlag(true);\r\n }\r\n var mergedState = this._mergeStates(stateObjects);\r\n var animationCfg = this.stateTransition;\r\n this.saveCurrentToNormalState(mergedState);\r\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\r\n if (this._textContent) {\r\n this._textContent.useStates(states);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.useStates(states);\r\n }\r\n this._updateAnimationTargets();\r\n this.currentStates = states.slice();\r\n this.markRedraw();\r\n if (!useHoverLayer && this.__inHover) {\r\n this._toggleHoverLayerFlag(false);\r\n this.__dirty &= ~Element.REDARAW_BIT;\r\n }\r\n }\r\n };\r\n Element.prototype._updateAnimationTargets = function () {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n if (animator.targetName) {\r\n animator.changeTarget(this[animator.targetName]);\r\n }\r\n }\r\n };\r\n Element.prototype.removeState = function (state) {\r\n var idx = indexOf(this.currentStates, state);\r\n if (idx >= 0) {\r\n var currentStates = this.currentStates.slice();\r\n currentStates.splice(idx, 1);\r\n this.useStates(currentStates);\r\n }\r\n };\r\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\r\n var currentStates = this.currentStates.slice();\r\n var idx = indexOf(currentStates, oldState);\r\n var newStateExists = indexOf(currentStates, newState) >= 0;\r\n if (idx >= 0) {\r\n if (!newStateExists) {\r\n currentStates[idx] = newState;\r\n }\r\n else {\r\n currentStates.splice(idx, 1);\r\n }\r\n }\r\n else if (forceAdd && !newStateExists) {\r\n currentStates.push(newState);\r\n }\r\n this.useStates(currentStates);\r\n };\r\n Element.prototype.toggleState = function (state, enable) {\r\n if (enable) {\r\n this.useState(state, true);\r\n }\r\n else {\r\n this.removeState(state);\r\n }\r\n };\r\n Element.prototype._mergeStates = function (states) {\r\n var mergedState = {};\r\n var mergedTextConfig;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n extend(mergedState, state);\r\n if (state.textConfig) {\r\n mergedTextConfig = mergedTextConfig || {};\r\n extend(mergedTextConfig, state.textConfig);\r\n }\r\n }\r\n if (mergedTextConfig) {\r\n mergedState.textConfig = mergedTextConfig;\r\n }\r\n return mergedState;\r\n };\r\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n if (state && state.textConfig) {\r\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\r\n extend(this.textConfig, state.textConfig);\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState.textConfig) {\r\n this.textConfig = normalState.textConfig;\r\n }\r\n }\r\n var transitionTarget = {};\r\n var hasTransition = false;\r\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\r\n var key = PRIMARY_STATES_KEYS[i];\r\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\r\n if (state && state[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = state[key];\r\n }\r\n else {\r\n this[key] = state[key];\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n if (propNeedsTransition) {\r\n hasTransition = true;\r\n transitionTarget[key] = normalState[key];\r\n }\r\n else {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n }\r\n if (!transition) {\r\n for (var i = 0; i < this.animators.length; i++) {\r\n var animator = this.animators[i];\r\n var targetName = animator.targetName;\r\n animator.__changeFinalValue(targetName\r\n ? (state || normalState)[targetName]\r\n : (state || normalState));\r\n }\r\n }\r\n if (hasTransition) {\r\n this._transitionState(stateName, transitionTarget, animationCfg);\r\n }\r\n };\r\n Element.prototype._attachComponent = function (componentEl) {\r\n if (componentEl.__zr && !componentEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n if (componentEl === this) {\r\n throw new Error('Recursive component attachment.');\r\n }\r\n var zr = this.__zr;\r\n if (zr) {\r\n componentEl.addSelfToZr(zr);\r\n }\r\n componentEl.__zr = zr;\r\n componentEl.__hostTarget = this;\r\n };\r\n Element.prototype._detachComponent = function (componentEl) {\r\n if (componentEl.__zr) {\r\n componentEl.removeSelfFromZr(componentEl.__zr);\r\n }\r\n componentEl.__zr = null;\r\n componentEl.__hostTarget = null;\r\n };\r\n Element.prototype.getClipPath = function () {\r\n return this._clipPath;\r\n };\r\n Element.prototype.setClipPath = function (clipPath) {\r\n if (this._clipPath && this._clipPath !== clipPath) {\r\n this.removeClipPath();\r\n }\r\n this._attachComponent(clipPath);\r\n this._clipPath = clipPath;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeClipPath = function () {\r\n var clipPath = this._clipPath;\r\n if (clipPath) {\r\n this._detachComponent(clipPath);\r\n this._clipPath = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextContent = function () {\r\n return this._textContent;\r\n };\r\n Element.prototype.setTextContent = function (textEl) {\r\n var previousTextContent = this._textContent;\r\n if (previousTextContent === textEl) {\r\n return;\r\n }\r\n if (previousTextContent && previousTextContent !== textEl) {\r\n this.removeTextContent();\r\n }\r\n if (textEl.__zr && !textEl.__hostTarget) {\r\n throw new Error('Text element has been added to zrender.');\r\n }\r\n textEl.attachedTransform = new Transformable();\r\n this._attachComponent(textEl);\r\n this._textContent = textEl;\r\n this.markRedraw();\r\n };\r\n Element.prototype.setTextConfig = function (cfg) {\r\n if (!this.textConfig) {\r\n this.textConfig = {};\r\n }\r\n extend(this.textConfig, cfg);\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextContent = function () {\r\n var textEl = this._textContent;\r\n if (textEl) {\r\n textEl.attachedTransform = null;\r\n this._detachComponent(textEl);\r\n this._textContent = null;\r\n this._innerTextDefaultStyle = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.getTextGuideLine = function () {\r\n return this._textGuide;\r\n };\r\n Element.prototype.setTextGuideLine = function (guideLine) {\r\n if (this._textGuide && this._textGuide !== guideLine) {\r\n this.removeTextGuideLine();\r\n }\r\n this._attachComponent(guideLine);\r\n this._textGuide = guideLine;\r\n this.markRedraw();\r\n };\r\n Element.prototype.removeTextGuideLine = function () {\r\n var textGuide = this._textGuide;\r\n if (textGuide) {\r\n this._detachComponent(textGuide);\r\n this._textGuide = null;\r\n this.markRedraw();\r\n }\r\n };\r\n Element.prototype.markRedraw = function () {\r\n this.__dirty |= Element.REDARAW_BIT;\r\n var zr = this.__zr;\r\n if (zr) {\r\n if (this.__inHover) {\r\n zr.refreshHover();\r\n }\r\n else {\r\n zr.refresh();\r\n }\r\n }\r\n if (this.__hostTarget) {\r\n this.__hostTarget.markRedraw();\r\n }\r\n };\r\n Element.prototype.dirty = function () {\r\n this.markRedraw();\r\n };\r\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\r\n this.__inHover = inHover;\r\n var textContent = this._textContent;\r\n var textGuide = this._textGuide;\r\n if (textContent) {\r\n textContent.__inHover = inHover;\r\n }\r\n if (textGuide) {\r\n textGuide.__inHover = inHover;\r\n }\r\n };\r\n Element.prototype.addSelfToZr = function (zr) {\r\n this.__zr = zr;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.addAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.addSelfToZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.addSelfToZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.addSelfToZr(zr);\r\n }\r\n };\r\n Element.prototype.removeSelfFromZr = function (zr) {\r\n this.__zr = null;\r\n var animators = this.animators;\r\n if (animators) {\r\n for (var i = 0; i < animators.length; i++) {\r\n zr.animation.removeAnimator(animators[i]);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this._clipPath.removeSelfFromZr(zr);\r\n }\r\n if (this._textContent) {\r\n this._textContent.removeSelfFromZr(zr);\r\n }\r\n if (this._textGuide) {\r\n this._textGuide.removeSelfFromZr(zr);\r\n }\r\n };\r\n Element.prototype.animate = function (key, loop) {\r\n var target = key ? this[key] : this;\r\n if (!target) {\r\n logError('Property \"'\r\n + key\r\n + '\" is not existed in element '\r\n + this.id);\r\n return;\r\n }\r\n var animator = new Animator(target, loop);\r\n this.addAnimator(animator, key);\r\n return animator;\r\n };\r\n Element.prototype.addAnimator = function (animator, key) {\r\n var zr = this.__zr;\r\n var el = this;\r\n animator.during(function () {\r\n el.updateDuringAnimation(key);\r\n }).done(function () {\r\n var animators = el.animators;\r\n var idx = indexOf(animators, animator);\r\n if (idx >= 0) {\r\n animators.splice(idx, 1);\r\n }\r\n });\r\n this.animators.push(animator);\r\n if (zr) {\r\n zr.animation.addAnimator(animator);\r\n }\r\n zr && zr.wakeUp();\r\n };\r\n Element.prototype.updateDuringAnimation = function (key) {\r\n this.markRedraw();\r\n };\r\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\r\n var animators = this.animators;\r\n var len = animators.length;\r\n var leftAnimators = [];\r\n for (var i = 0; i < len; i++) {\r\n var animator = animators[i];\r\n if (!scope || scope === animator.scope) {\r\n animator.stop(forwardToLast);\r\n }\r\n else {\r\n leftAnimators.push(animator);\r\n }\r\n }\r\n this.animators = leftAnimators;\r\n return this;\r\n };\r\n Element.prototype.animateTo = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps);\r\n };\r\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\r\n animateTo(this, target, cfg, animationProps, true);\r\n };\r\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\r\n var animators = animateTo(this, target, cfg, animationProps);\r\n for (var i = 0; i < animators.length; i++) {\r\n animators[i].__fromStateTransition = stateName;\r\n }\r\n };\r\n Element.prototype.getBoundingRect = function () {\r\n return null;\r\n };\r\n Element.prototype.getPaintRect = function () {\r\n return null;\r\n };\r\n Element.REDARAW_BIT = 1;\r\n Element.initDefaultProps = (function () {\r\n var elProto = Element.prototype;\r\n elProto.type = 'element';\r\n elProto.name = '';\r\n elProto.ignore = false;\r\n elProto.silent = false;\r\n elProto.isGroup = false;\r\n elProto.draggable = false;\r\n elProto.dragging = false;\r\n elProto.ignoreClip = false;\r\n elProto.__inHover = false;\r\n elProto.__dirty = Element.REDARAW_BIT;\r\n var logs = {};\r\n function logDeprecatedError(key, xKey, yKey) {\r\n if (!logs[key + xKey + yKey]) {\r\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\r\n logs[key + xKey + yKey] = true;\r\n }\r\n }\r\n function createLegacyProperty(key, privateKey, xKey, yKey) {\r\n Object.defineProperty(elProto, key, {\r\n get: function () {\r\n logDeprecatedError(key, xKey, yKey);\r\n if (!this[privateKey]) {\r\n var pos = this[privateKey] = [];\r\n enhanceArray(this, pos);\r\n }\r\n return this[privateKey];\r\n },\r\n set: function (pos) {\r\n logDeprecatedError(key, xKey, yKey);\r\n this[xKey] = pos[0];\r\n this[yKey] = pos[1];\r\n this[privateKey] = pos;\r\n enhanceArray(this, pos);\r\n }\r\n });\r\n function enhanceArray(self, pos) {\r\n Object.defineProperty(pos, 0, {\r\n get: function () {\r\n return self[xKey];\r\n },\r\n set: function (val) {\r\n self[xKey] = val;\r\n }\r\n });\r\n Object.defineProperty(pos, 1, {\r\n get: function () {\r\n return self[yKey];\r\n },\r\n set: function (val) {\r\n self[yKey] = val;\r\n }\r\n });\r\n }\r\n }\r\n if (Object.defineProperty && (!env.browser.ie || env.browser.version > 8)) {\r\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\r\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\r\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\r\n }\r\n })();\r\n return Element;\r\n }());\r\n mixin(Element, Eventful);\r\n mixin(Element, Transformable);\r\n function animateTo(animatable, target, cfg, animationProps, reverse) {\r\n cfg = cfg || {};\r\n var animators = [];\r\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\r\n var finishCount = animators.length;\r\n var doneHappened = false;\r\n var cfgDone = cfg.done;\r\n var cfgAborted = cfg.aborted;\r\n var doneCb = function () {\r\n doneHappened = true;\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n var abortedCb = function () {\r\n finishCount--;\r\n if (finishCount <= 0) {\r\n doneHappened\r\n ? (cfgDone && cfgDone())\r\n : (cfgAborted && cfgAborted());\r\n }\r\n };\r\n if (!finishCount) {\r\n cfgDone && cfgDone();\r\n }\r\n if (animators.length > 0 && cfg.during) {\r\n animators[0].during(function (target, percent) {\r\n cfg.during(percent);\r\n });\r\n }\r\n for (var i = 0; i < animators.length; i++) {\r\n var animator = animators[i];\r\n if (doneCb) {\r\n animator.done(doneCb);\r\n }\r\n if (abortedCb) {\r\n animator.aborted(abortedCb);\r\n }\r\n animator.start(cfg.easing, cfg.force);\r\n }\r\n return animators;\r\n }\r\n function copyArrShallow(source, target, len) {\r\n for (var i = 0; i < len; i++) {\r\n source[i] = target[i];\r\n }\r\n }\r\n function is2DArray(value) {\r\n return isArrayLike(value[0]);\r\n }\r\n function copyValue(target, source, key) {\r\n if (isArrayLike(source[key])) {\r\n if (!isArrayLike(target[key])) {\r\n target[key] = [];\r\n }\r\n if (isTypedArray(source[key])) {\r\n var len = source[key].length;\r\n if (target[key].length !== len) {\r\n target[key] = new (source[key].constructor)(len);\r\n copyArrShallow(target[key], source[key], len);\r\n }\r\n }\r\n else {\r\n var sourceArr = source[key];\r\n var targetArr = target[key];\r\n var len0 = sourceArr.length;\r\n if (is2DArray(sourceArr)) {\r\n var len1 = sourceArr[0].length;\r\n for (var i = 0; i < len0; i++) {\r\n if (!targetArr[i]) {\r\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\r\n }\r\n else {\r\n copyArrShallow(targetArr[i], sourceArr[i], len1);\r\n }\r\n }\r\n }\r\n else {\r\n copyArrShallow(targetArr, sourceArr, len0);\r\n }\r\n targetArr.length = sourceArr.length;\r\n }\r\n }\r\n else {\r\n target[key] = source[key];\r\n }\r\n }\r\n function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {\r\n var animatableKeys = [];\r\n var changedKeys = [];\r\n var targetKeys = keys(target);\r\n var duration = cfg.duration;\r\n var delay = cfg.delay;\r\n var additive = cfg.additive;\r\n var setToFinal = cfg.setToFinal;\r\n var animateAll = !isObject(animationProps);\r\n for (var k = 0; k < targetKeys.length; k++) {\r\n var innerKey = targetKeys[k];\r\n if (source[innerKey] != null\r\n && target[innerKey] != null\r\n && (animateAll || animationProps[innerKey])) {\r\n if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {\r\n if (topKey) {\r\n if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n }\r\n continue;\r\n }\r\n animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse);\r\n }\r\n else {\r\n animatableKeys.push(innerKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n else if (!reverse) {\r\n source[innerKey] = target[innerKey];\r\n animatable.updateDuringAnimation(topKey);\r\n changedKeys.push(innerKey);\r\n }\r\n }\r\n var keyLen = animatableKeys.length;\r\n if (keyLen > 0\r\n || (cfg.force && !animators.length)) {\r\n var existsAnimators = animatable.animators;\r\n var existsAnimatorsOnSameTarget = [];\r\n for (var i = 0; i < existsAnimators.length; i++) {\r\n if (existsAnimators[i].targetName === topKey) {\r\n existsAnimatorsOnSameTarget.push(existsAnimators[i]);\r\n }\r\n }\r\n if (!additive && existsAnimatorsOnSameTarget.length) {\r\n for (var i = 0; i < existsAnimatorsOnSameTarget.length; i++) {\r\n var allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);\r\n if (allAborted) {\r\n var idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);\r\n existsAnimators.splice(idx, 1);\r\n }\r\n }\r\n }\r\n var revertedSource = void 0;\r\n var reversedTarget = void 0;\r\n var sourceClone = void 0;\r\n if (reverse) {\r\n reversedTarget = {};\r\n if (setToFinal) {\r\n revertedSource = {};\r\n }\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n reversedTarget[innerKey] = source[innerKey];\r\n if (setToFinal) {\r\n revertedSource[innerKey] = target[innerKey];\r\n }\r\n else {\r\n source[innerKey] = target[innerKey];\r\n }\r\n }\r\n }\r\n else if (setToFinal) {\r\n sourceClone = {};\r\n for (var i = 0; i < keyLen; i++) {\r\n var innerKey = animatableKeys[i];\r\n sourceClone[innerKey] = cloneValue(source[innerKey]);\r\n copyValue(source, target, innerKey);\r\n }\r\n }\r\n var animator = new Animator(source, false, additive ? existsAnimatorsOnSameTarget : null);\r\n animator.targetName = topKey;\r\n if (cfg.scope) {\r\n animator.scope = cfg.scope;\r\n }\r\n if (setToFinal && revertedSource) {\r\n animator.whenWithKeys(0, revertedSource, animatableKeys);\r\n }\r\n if (sourceClone) {\r\n animator.whenWithKeys(0, sourceClone, animatableKeys);\r\n }\r\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animatableKeys).delay(delay || 0);\r\n animatable.addAnimator(animator, topKey);\r\n animators.push(animator);\r\n }\r\n }\n\n var DEFAULT_MIN_MERGE = 32;\r\n var DEFAULT_MIN_GALLOPING = 7;\r\n function minRunLength(n) {\r\n var r = 0;\r\n while (n >= DEFAULT_MIN_MERGE) {\r\n r |= n & 1;\r\n n >>= 1;\r\n }\r\n return n + r;\r\n }\r\n function makeAscendingRun(array, lo, hi, compare) {\r\n var runHi = lo + 1;\r\n if (runHi === hi) {\r\n return 1;\r\n }\r\n if (compare(array[runHi++], array[lo]) < 0) {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\r\n runHi++;\r\n }\r\n reverseRun(array, lo, runHi);\r\n }\r\n else {\r\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\r\n runHi++;\r\n }\r\n }\r\n return runHi - lo;\r\n }\r\n function reverseRun(array, lo, hi) {\r\n hi--;\r\n while (lo < hi) {\r\n var t = array[lo];\r\n array[lo++] = array[hi];\r\n array[hi--] = t;\r\n }\r\n }\r\n function binaryInsertionSort(array, lo, hi, start, compare) {\r\n if (start === lo) {\r\n start++;\r\n }\r\n for (; start < hi; start++) {\r\n var pivot = array[start];\r\n var left = lo;\r\n var right = start;\r\n var mid;\r\n while (left < right) {\r\n mid = left + right >>> 1;\r\n if (compare(pivot, array[mid]) < 0) {\r\n right = mid;\r\n }\r\n else {\r\n left = mid + 1;\r\n }\r\n }\r\n var n = start - left;\r\n switch (n) {\r\n case 3:\r\n array[left + 3] = array[left + 2];\r\n case 2:\r\n array[left + 2] = array[left + 1];\r\n case 1:\r\n array[left + 1] = array[left];\r\n break;\r\n default:\r\n while (n > 0) {\r\n array[left + n] = array[left + n - 1];\r\n n--;\r\n }\r\n }\r\n array[left] = pivot;\r\n }\r\n }\r\n function gallopLeft(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) > 0) {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n else {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) > 0) {\r\n lastOffset = m + 1;\r\n }\r\n else {\r\n offset = m;\r\n }\r\n }\r\n return offset;\r\n }\r\n function gallopRight(value, array, start, length, hint, compare) {\r\n var lastOffset = 0;\r\n var maxOffset = 0;\r\n var offset = 1;\r\n if (compare(value, array[start + hint]) < 0) {\r\n maxOffset = hint + 1;\r\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n var tmp = lastOffset;\r\n lastOffset = hint - offset;\r\n offset = hint - tmp;\r\n }\r\n else {\r\n maxOffset = length - hint;\r\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\r\n lastOffset = offset;\r\n offset = (offset << 1) + 1;\r\n if (offset <= 0) {\r\n offset = maxOffset;\r\n }\r\n }\r\n if (offset > maxOffset) {\r\n offset = maxOffset;\r\n }\r\n lastOffset += hint;\r\n offset += hint;\r\n }\r\n lastOffset++;\r\n while (lastOffset < offset) {\r\n var m = lastOffset + (offset - lastOffset >>> 1);\r\n if (compare(value, array[start + m]) < 0) {\r\n offset = m;\r\n }\r\n else {\r\n lastOffset = m + 1;\r\n }\r\n }\r\n return offset;\r\n }\r\n function TimSort(array, compare) {\r\n var minGallop = DEFAULT_MIN_GALLOPING;\r\n var length = 0;\r\n var runStart;\r\n var runLength;\r\n var stackSize = 0;\r\n length = array.length;\r\n var tmp = [];\r\n runStart = [];\r\n runLength = [];\r\n function pushRun(_runStart, _runLength) {\r\n runStart[stackSize] = _runStart;\r\n runLength[stackSize] = _runLength;\r\n stackSize += 1;\r\n }\r\n function mergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\r\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\r\n if (runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n }\r\n else if (runLength[n] > runLength[n + 1]) {\r\n break;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function forceMergeRuns() {\r\n while (stackSize > 1) {\r\n var n = stackSize - 2;\r\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\r\n n--;\r\n }\r\n mergeAt(n);\r\n }\r\n }\r\n function mergeAt(i) {\r\n var start1 = runStart[i];\r\n var length1 = runLength[i];\r\n var start2 = runStart[i + 1];\r\n var length2 = runLength[i + 1];\r\n runLength[i] = length1 + length2;\r\n if (i === stackSize - 3) {\r\n runStart[i + 1] = runStart[i + 2];\r\n runLength[i + 1] = runLength[i + 2];\r\n }\r\n stackSize--;\r\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\r\n start1 += k;\r\n length1 -= k;\r\n if (length1 === 0) {\r\n return;\r\n }\r\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\r\n if (length2 === 0) {\r\n return;\r\n }\r\n if (length1 <= length2) {\r\n mergeLow(start1, length1, start2, length2);\r\n }\r\n else {\r\n mergeHigh(start1, length1, start2, length2);\r\n }\r\n }\r\n function mergeLow(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length1; i++) {\r\n tmp[i] = array[start1 + i];\r\n }\r\n var cursor1 = 0;\r\n var cursor2 = start2;\r\n var dest = start1;\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n return;\r\n }\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n var count1;\r\n var count2;\r\n var exit;\r\n while (1) {\r\n count1 = 0;\r\n count2 = 0;\r\n exit = false;\r\n do {\r\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\r\n array[dest++] = array[cursor2++];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest++] = tmp[cursor1++];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\r\n if (count1 !== 0) {\r\n for (i = 0; i < count1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n dest += count1;\r\n cursor1 += count1;\r\n length1 -= count1;\r\n if (length1 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = array[cursor2++];\r\n if (--length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\r\n if (count2 !== 0) {\r\n for (i = 0; i < count2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n dest += count2;\r\n cursor2 += count2;\r\n length2 -= count2;\r\n if (length2 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest++] = tmp[cursor1++];\r\n if (--length1 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n minGallop < 1 && (minGallop = 1);\r\n if (length1 === 1) {\r\n for (i = 0; i < length2; i++) {\r\n array[dest + i] = array[cursor2 + i];\r\n }\r\n array[dest + length2] = tmp[cursor1];\r\n }\r\n else if (length1 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n for (i = 0; i < length1; i++) {\r\n array[dest + i] = tmp[cursor1 + i];\r\n }\r\n }\r\n }\r\n function mergeHigh(start1, length1, start2, length2) {\r\n var i = 0;\r\n for (i = 0; i < length2; i++) {\r\n tmp[i] = array[start2 + i];\r\n }\r\n var cursor1 = start1 + length1 - 1;\r\n var cursor2 = length2 - 1;\r\n var dest = start2 + length2 - 1;\r\n var customCursor = 0;\r\n var customDest = 0;\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n return;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n return;\r\n }\r\n var _minGallop = minGallop;\r\n while (true) {\r\n var count1 = 0;\r\n var count2 = 0;\r\n var exit = false;\r\n do {\r\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\r\n array[dest--] = array[cursor1--];\r\n count1++;\r\n count2 = 0;\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n else {\r\n array[dest--] = tmp[cursor2--];\r\n count2++;\r\n count1 = 0;\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n } while ((count1 | count2) < _minGallop);\r\n if (exit) {\r\n break;\r\n }\r\n do {\r\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\r\n if (count1 !== 0) {\r\n dest -= count1;\r\n cursor1 -= count1;\r\n length1 -= count1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = count1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n if (length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = tmp[cursor2--];\r\n if (--length2 === 1) {\r\n exit = true;\r\n break;\r\n }\r\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\r\n if (count2 !== 0) {\r\n dest -= count2;\r\n cursor2 -= count2;\r\n length2 -= count2;\r\n customDest = dest + 1;\r\n customCursor = cursor2 + 1;\r\n for (i = 0; i < count2; i++) {\r\n array[customDest + i] = tmp[customCursor + i];\r\n }\r\n if (length2 <= 1) {\r\n exit = true;\r\n break;\r\n }\r\n }\r\n array[dest--] = array[cursor1--];\r\n if (--length1 === 0) {\r\n exit = true;\r\n break;\r\n }\r\n _minGallop--;\r\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\r\n if (exit) {\r\n break;\r\n }\r\n if (_minGallop < 0) {\r\n _minGallop = 0;\r\n }\r\n _minGallop += 2;\r\n }\r\n minGallop = _minGallop;\r\n if (minGallop < 1) {\r\n minGallop = 1;\r\n }\r\n if (length2 === 1) {\r\n dest -= length1;\r\n cursor1 -= length1;\r\n customDest = dest + 1;\r\n customCursor = cursor1 + 1;\r\n for (i = length1 - 1; i >= 0; i--) {\r\n array[customDest + i] = array[customCursor + i];\r\n }\r\n array[dest] = tmp[cursor2];\r\n }\r\n else if (length2 === 0) {\r\n throw new Error();\r\n }\r\n else {\r\n customCursor = dest - (length2 - 1);\r\n for (i = 0; i < length2; i++) {\r\n array[customCursor + i] = tmp[i];\r\n }\r\n }\r\n }\r\n return {\r\n mergeRuns: mergeRuns,\r\n forceMergeRuns: forceMergeRuns,\r\n pushRun: pushRun\r\n };\r\n }\r\n function sort(array, compare, lo, hi) {\r\n if (!lo) {\r\n lo = 0;\r\n }\r\n if (!hi) {\r\n hi = array.length;\r\n }\r\n var remaining = hi - lo;\r\n if (remaining < 2) {\r\n return;\r\n }\r\n var runLength = 0;\r\n if (remaining < DEFAULT_MIN_MERGE) {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\r\n return;\r\n }\r\n var ts = TimSort(array, compare);\r\n var minRun = minRunLength(remaining);\r\n do {\r\n runLength = makeAscendingRun(array, lo, hi, compare);\r\n if (runLength < minRun) {\r\n var force = remaining;\r\n if (force > minRun) {\r\n force = minRun;\r\n }\r\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\r\n runLength = force;\r\n }\r\n ts.pushRun(lo, runLength);\r\n ts.mergeRuns();\r\n remaining -= runLength;\r\n lo += runLength;\r\n } while (remaining !== 0);\r\n ts.forceMergeRuns();\r\n }\n\n var invalidZErrorLogged = false;\r\n function logInvalidZError() {\r\n if (invalidZErrorLogged) {\r\n return;\r\n }\r\n invalidZErrorLogged = true;\r\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\r\n }\r\n function shapeCompareFunc(a, b) {\r\n if (a.zlevel === b.zlevel) {\r\n if (a.z === b.z) {\r\n return a.z2 - b.z2;\r\n }\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n }\r\n var Storage = (function () {\r\n function Storage() {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n this.displayableSortFunc = shapeCompareFunc;\r\n }\r\n Storage.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._roots.length; i++) {\r\n this._roots[i].traverse(cb, context);\r\n }\r\n };\r\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\r\n includeIgnore = includeIgnore || false;\r\n var displayList = this._displayList;\r\n if (update || !displayList.length) {\r\n this.updateDisplayList(includeIgnore);\r\n }\r\n return displayList;\r\n };\r\n Storage.prototype.updateDisplayList = function (includeIgnore) {\r\n this._displayListLen = 0;\r\n var roots = this._roots;\r\n var displayList = this._displayList;\r\n for (var i = 0, len = roots.length; i < len; i++) {\r\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\r\n }\r\n displayList.length = this._displayListLen;\r\n env.canvasSupported && sort(displayList, shapeCompareFunc);\r\n };\r\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\r\n if (el.ignore && !includeIgnore) {\r\n return;\r\n }\r\n el.beforeUpdate();\r\n el.update();\r\n el.afterUpdate();\r\n var userSetClipPath = el.getClipPath();\r\n if (el.ignoreClip) {\r\n clipPaths = null;\r\n }\r\n else if (userSetClipPath) {\r\n if (clipPaths) {\r\n clipPaths = clipPaths.slice();\r\n }\r\n else {\r\n clipPaths = [];\r\n }\r\n var currentClipPath = userSetClipPath;\r\n var parentClipPath = el;\r\n while (currentClipPath) {\r\n currentClipPath.parent = parentClipPath;\r\n currentClipPath.updateTransform();\r\n clipPaths.push(currentClipPath);\r\n parentClipPath = currentClipPath;\r\n currentClipPath = currentClipPath.getClipPath();\r\n }\r\n }\r\n if (el.childrenRef) {\r\n var children = el.childrenRef();\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (el.__dirty) {\r\n child.__dirty |= Element.REDARAW_BIT;\r\n }\r\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\r\n }\r\n el.__dirty = 0;\r\n }\r\n else {\r\n var disp = el;\r\n if (clipPaths && clipPaths.length) {\r\n disp.__clipPaths = clipPaths;\r\n }\r\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\r\n disp.__clipPaths = [];\r\n }\r\n if (isNaN(disp.z)) {\r\n logInvalidZError();\r\n disp.z = 0;\r\n }\r\n if (isNaN(disp.z2)) {\r\n logInvalidZError();\r\n disp.z2 = 0;\r\n }\r\n if (isNaN(disp.zlevel)) {\r\n logInvalidZError();\r\n disp.zlevel = 0;\r\n }\r\n this._displayList[this._displayListLen++] = disp;\r\n }\r\n var decalEl = el.getDecalElement && el.getDecalElement();\r\n if (decalEl) {\r\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\r\n }\r\n var textGuide = el.getTextGuideLine();\r\n if (textGuide) {\r\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\r\n }\r\n var textEl = el.getTextContent();\r\n if (textEl) {\r\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\r\n }\r\n };\r\n Storage.prototype.addRoot = function (el) {\r\n if (el.__zr && el.__zr.storage === this) {\r\n return;\r\n }\r\n this._roots.push(el);\r\n };\r\n Storage.prototype.delRoot = function (el) {\r\n if (el instanceof Array) {\r\n for (var i = 0, l = el.length; i < l; i++) {\r\n this.delRoot(el[i]);\r\n }\r\n return;\r\n }\r\n var idx = indexOf(this._roots, el);\r\n if (idx >= 0) {\r\n this._roots.splice(idx, 1);\r\n }\r\n };\r\n Storage.prototype.delAllRoots = function () {\r\n this._roots = [];\r\n this._displayList = [];\r\n this._displayListLen = 0;\r\n return;\r\n };\r\n Storage.prototype.getRoots = function () {\r\n return this._roots;\r\n };\r\n Storage.prototype.dispose = function () {\r\n this._displayList = null;\r\n this._roots = null;\r\n };\r\n return Storage;\r\n }());\n\n var requestAnimationFrame;\r\n requestAnimationFrame = (typeof window !== 'undefined'\r\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\r\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\r\n || window.mozRequestAnimationFrame\r\n || window.webkitRequestAnimationFrame)) || function (func) {\r\n return setTimeout(func, 16);\r\n };\r\n var requestAnimationFrame$1 = requestAnimationFrame;\n\n var Animation = (function (_super) {\r\n __extends(Animation, _super);\r\n function Animation(opts) {\r\n var _this = _super.call(this) || this;\r\n _this._running = false;\r\n _this._time = 0;\r\n _this._pausedTime = 0;\r\n _this._pauseStart = 0;\r\n _this._paused = false;\r\n opts = opts || {};\r\n _this.stage = opts.stage || {};\r\n _this.onframe = opts.onframe || function () { };\r\n return _this;\r\n }\r\n Animation.prototype.addClip = function (clip) {\r\n if (clip.animation) {\r\n this.removeClip(clip);\r\n }\r\n if (!this._clipsHead) {\r\n this._clipsHead = this._clipsTail = clip;\r\n }\r\n else {\r\n this._clipsTail.next = clip;\r\n clip.prev = this._clipsTail;\r\n clip.next = null;\r\n this._clipsTail = clip;\r\n }\r\n clip.animation = this;\r\n };\r\n Animation.prototype.addAnimator = function (animator) {\r\n animator.animation = this;\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.addClip(clip);\r\n }\r\n };\r\n Animation.prototype.removeClip = function (clip) {\r\n if (!clip.animation) {\r\n return;\r\n }\r\n var prev = clip.prev;\r\n var next = clip.next;\r\n if (prev) {\r\n prev.next = next;\r\n }\r\n else {\r\n this._clipsHead = next;\r\n }\r\n if (next) {\r\n next.prev = prev;\r\n }\r\n else {\r\n this._clipsTail = prev;\r\n }\r\n clip.next = clip.prev = clip.animation = null;\r\n };\r\n Animation.prototype.removeAnimator = function (animator) {\r\n var clip = animator.getClip();\r\n if (clip) {\r\n this.removeClip(clip);\r\n }\r\n animator.animation = null;\r\n };\r\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\r\n var time = new Date().getTime() - this._pausedTime;\r\n var delta = time - this._time;\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n var finished = clip.step(time, delta);\r\n if (finished) {\r\n clip.ondestroy && clip.ondestroy();\r\n this.removeClip(clip);\r\n clip = nextClip;\r\n }\r\n else {\r\n clip = nextClip;\r\n }\r\n }\r\n this._time = time;\r\n if (!notTriggerFrameAndStageUpdate) {\r\n this.onframe(delta);\r\n this.trigger('frame', delta);\r\n this.stage.update && this.stage.update();\r\n }\r\n };\r\n Animation.prototype._startLoop = function () {\r\n var self = this;\r\n this._running = true;\r\n function step() {\r\n if (self._running) {\r\n requestAnimationFrame$1(step);\r\n !self._paused && self.update();\r\n }\r\n }\r\n requestAnimationFrame$1(step);\r\n };\r\n Animation.prototype.start = function () {\r\n if (this._running) {\r\n return;\r\n }\r\n this._time = new Date().getTime();\r\n this._pausedTime = 0;\r\n this._startLoop();\r\n };\r\n Animation.prototype.stop = function () {\r\n this._running = false;\r\n };\r\n Animation.prototype.pause = function () {\r\n if (!this._paused) {\r\n this._pauseStart = new Date().getTime();\r\n this._paused = true;\r\n }\r\n };\r\n Animation.prototype.resume = function () {\r\n if (this._paused) {\r\n this._pausedTime += (new Date().getTime()) - this._pauseStart;\r\n this._paused = false;\r\n }\r\n };\r\n Animation.prototype.clear = function () {\r\n var clip = this._clipsHead;\r\n while (clip) {\r\n var nextClip = clip.next;\r\n clip.prev = clip.next = clip.animation = null;\r\n clip = nextClip;\r\n }\r\n this._clipsHead = this._clipsTail = null;\r\n };\r\n Animation.prototype.isFinished = function () {\r\n return this._clipsHead == null;\r\n };\r\n Animation.prototype.animate = function (target, options) {\r\n options = options || {};\r\n this.start();\r\n var animator = new Animator(target, options.loop);\r\n this.addAnimator(animator);\r\n return animator;\r\n };\r\n return Animation;\r\n }(Eventful));\n\n var TOUCH_CLICK_DELAY = 300;\r\n var globalEventSupported = env.domSupported;\r\n var localNativeListenerNames = (function () {\r\n var mouseHandlerNames = [\r\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\r\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\r\n ];\r\n var touchHandlerNames = [\r\n 'touchstart', 'touchend', 'touchmove'\r\n ];\r\n var pointerEventNameMap = {\r\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\r\n };\r\n var pointerHandlerNames = map(mouseHandlerNames, function (name) {\r\n var nm = name.replace('mouse', 'pointer');\r\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\r\n });\r\n return {\r\n mouse: mouseHandlerNames,\r\n touch: touchHandlerNames,\r\n pointer: pointerHandlerNames\r\n };\r\n })();\r\n var globalNativeListenerNames = {\r\n mouse: ['mousemove', 'mouseup'],\r\n pointer: ['pointermove', 'pointerup']\r\n };\r\n var wheelEventSupported = false;\r\n function isPointerFromTouch(event) {\r\n var pointerType = event.pointerType;\r\n return pointerType === 'pen' || pointerType === 'touch';\r\n }\r\n function setTouchTimer(scope) {\r\n scope.touching = true;\r\n if (scope.touchTimer != null) {\r\n clearTimeout(scope.touchTimer);\r\n scope.touchTimer = null;\r\n }\r\n scope.touchTimer = setTimeout(function () {\r\n scope.touching = false;\r\n scope.touchTimer = null;\r\n }, 700);\r\n }\r\n function markTouch(event) {\r\n event && (event.zrByTouch = true);\r\n }\r\n function normalizeGlobalEvent(instance, event) {\r\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\r\n }\r\n function isLocalEl(instance, el) {\r\n var elTmp = el;\r\n var isLocal = false;\r\n while (elTmp && elTmp.nodeType !== 9\r\n && !(isLocal = elTmp.domBelongToZr\r\n || (elTmp !== el && elTmp === instance.painterRoot))) {\r\n elTmp = elTmp.parentNode;\r\n }\r\n return isLocal;\r\n }\r\n var FakeGlobalEvent = (function () {\r\n function FakeGlobalEvent(instance, event) {\r\n this.stopPropagation = noop;\r\n this.stopImmediatePropagation = noop;\r\n this.preventDefault = noop;\r\n this.type = event.type;\r\n this.target = this.currentTarget = instance.dom;\r\n this.pointerType = event.pointerType;\r\n this.clientX = event.clientX;\r\n this.clientY = event.clientY;\r\n }\r\n return FakeGlobalEvent;\r\n }());\r\n var localDOMHandlers = {\r\n mousedown: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__mayPointerCapture = [event.zrX, event.zrY];\r\n this.trigger('mousedown', event);\r\n },\r\n mousemove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n var downPoint = this.__mayPointerCapture;\r\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\r\n this.__togglePointerCapture(true);\r\n }\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n },\r\n mouseout: function (event) {\r\n if (event.target !== this.dom) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n if (this.__pointerCapturing) {\r\n event.zrEventControl = 'no_globalout';\r\n }\r\n var element = event.toElement || event.relatedTarget;\r\n event.zrIsToLocalDOM = isLocalEl(this, element);\r\n this.trigger('mouseout', event);\r\n },\r\n wheel: function (event) {\r\n wheelEventSupported = true;\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n mousewheel: function (event) {\r\n if (wheelEventSupported) {\r\n return;\r\n }\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger('mousewheel', event);\r\n },\r\n touchstart: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.__lastTouchMoment = new Date();\r\n this.handler.processGesture(event, 'start');\r\n localDOMHandlers.mousemove.call(this, event);\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n touchmove: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'change');\r\n localDOMHandlers.mousemove.call(this, event);\r\n },\r\n touchend: function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n markTouch(event);\r\n this.handler.processGesture(event, 'end');\r\n localDOMHandlers.mouseup.call(this, event);\r\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\r\n localDOMHandlers.click.call(this, event);\r\n }\r\n },\r\n pointerdown: function (event) {\r\n localDOMHandlers.mousedown.call(this, event);\r\n },\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n localDOMHandlers.mouseup.call(this, event);\r\n },\r\n pointerout: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n localDOMHandlers.mouseout.call(this, event);\r\n }\r\n }\r\n };\r\n each(['click', 'dblclick', 'contextmenu'], function (name) {\r\n localDOMHandlers[name] = function (event) {\r\n event = normalizeEvent(this.dom, event);\r\n this.trigger(name, event);\r\n };\r\n });\r\n var globalDOMHandlers = {\r\n pointermove: function (event) {\r\n if (!isPointerFromTouch(event)) {\r\n globalDOMHandlers.mousemove.call(this, event);\r\n }\r\n },\r\n pointerup: function (event) {\r\n globalDOMHandlers.mouseup.call(this, event);\r\n },\r\n mousemove: function (event) {\r\n this.trigger('mousemove', event);\r\n },\r\n mouseup: function (event) {\r\n var pointerCaptureReleasing = this.__pointerCapturing;\r\n this.__togglePointerCapture(false);\r\n this.trigger('mouseup', event);\r\n if (pointerCaptureReleasing) {\r\n event.zrEventControl = 'only_globalout';\r\n this.trigger('mouseout', event);\r\n }\r\n }\r\n };\r\n function mountLocalDOMEventListeners(instance, scope) {\r\n var domHandlers = scope.domHandlers;\r\n if (env.pointerEventsSupported) {\r\n each(localNativeListenerNames.pointer, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n });\r\n });\r\n }\r\n else {\r\n if (env.touchEventsSupported) {\r\n each(localNativeListenerNames.touch, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n setTouchTimer(scope);\r\n });\r\n });\r\n }\r\n each(localNativeListenerNames.mouse, function (nativeEventName) {\r\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\r\n event = getNativeEvent(event);\r\n if (!scope.touching) {\r\n domHandlers[nativeEventName].call(instance, event);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n function mountGlobalDOMEventListeners(instance, scope) {\r\n if (env.pointerEventsSupported) {\r\n each(globalNativeListenerNames.pointer, mount);\r\n }\r\n else if (!env.touchEventsSupported) {\r\n each(globalNativeListenerNames.mouse, mount);\r\n }\r\n function mount(nativeEventName) {\r\n function nativeEventListener(event) {\r\n event = getNativeEvent(event);\r\n if (!isLocalEl(instance, event.target)) {\r\n event = normalizeGlobalEvent(instance, event);\r\n scope.domHandlers[nativeEventName].call(instance, event);\r\n }\r\n }\r\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\r\n }\r\n }\r\n function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\r\n scope.mounted[nativeEventName] = listener;\r\n scope.listenerOpts[nativeEventName] = opt;\r\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\r\n }\r\n function unmountDOMEventListeners(scope) {\r\n var mounted = scope.mounted;\r\n for (var nativeEventName in mounted) {\r\n if (mounted.hasOwnProperty(nativeEventName)) {\r\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\r\n }\r\n }\r\n scope.mounted = {};\r\n }\r\n var DOMHandlerScope = (function () {\r\n function DOMHandlerScope(domTarget, domHandlers) {\r\n this.mounted = {};\r\n this.listenerOpts = {};\r\n this.touching = false;\r\n this.domTarget = domTarget;\r\n this.domHandlers = domHandlers;\r\n }\r\n return DOMHandlerScope;\r\n }());\r\n var HandlerDomProxy = (function (_super) {\r\n __extends(HandlerDomProxy, _super);\r\n function HandlerDomProxy(dom, painterRoot) {\r\n var _this = _super.call(this) || this;\r\n _this.__pointerCapturing = false;\r\n _this.dom = dom;\r\n _this.painterRoot = painterRoot;\r\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\r\n if (globalEventSupported) {\r\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\r\n }\r\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\r\n return _this;\r\n }\r\n HandlerDomProxy.prototype.dispose = function () {\r\n unmountDOMEventListeners(this._localHandlerScope);\r\n if (globalEventSupported) {\r\n unmountDOMEventListeners(this._globalHandlerScope);\r\n }\r\n };\r\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\r\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\r\n };\r\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\r\n this.__mayPointerCapture = null;\r\n if (globalEventSupported\r\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\r\n this.__pointerCapturing = isPointerCapturing;\r\n var globalHandlerScope = this._globalHandlerScope;\r\n isPointerCapturing\r\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\r\n : unmountDOMEventListeners(globalHandlerScope);\r\n }\r\n };\r\n return HandlerDomProxy;\r\n }(Eventful));\n\n var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\r\n var DEFAULT_COMMON_STYLE = {\r\n shadowBlur: 0,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n shadowColor: '#000',\r\n opacity: 1,\r\n blend: 'source-over'\r\n };\r\n var DEFAULT_COMMON_ANIMATION_PROPS = {\r\n style: {\r\n shadowBlur: true,\r\n shadowOffsetX: true,\r\n shadowOffsetY: true,\r\n shadowColor: true,\r\n opacity: true\r\n }\r\n };\r\n DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\r\n var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible'];\r\n var Displayable = (function (_super) {\r\n __extends(Displayable, _super);\r\n function Displayable(props) {\r\n return _super.call(this, props) || this;\r\n }\r\n Displayable.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n if (key === 'style') {\r\n this.useStyle(props[key]);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, props[key]);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Displayable.prototype.beforeBrush = function () { };\r\n Displayable.prototype.afterBrush = function () { };\r\n Displayable.prototype.innerBeforeBrush = function () { };\r\n Displayable.prototype.innerAfterBrush = function () { };\r\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\r\n var m = this.transform;\r\n if (this.ignore\r\n || this.invisible\r\n || this.style.opacity === 0\r\n || (this.culling\r\n && isDisplayableCulled(this, viewWidth, viewHeight))\r\n || (m && !m[0] && !m[3])) {\r\n return false;\r\n }\r\n if (considerClipPath && this.__clipPaths) {\r\n for (var i = 0; i < this.__clipPaths.length; ++i) {\r\n if (this.__clipPaths[i].isZeroArea()) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (considerAncestors && this.parent) {\r\n var parent_1 = this.parent;\r\n while (parent_1) {\r\n if (parent_1.ignore) {\r\n return false;\r\n }\r\n parent_1 = parent_1.parent;\r\n }\r\n }\r\n return true;\r\n };\r\n Displayable.prototype.contain = function (x, y) {\r\n return this.rectContain(x, y);\r\n };\r\n Displayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n Displayable.prototype.rectContain = function (x, y) {\r\n var coord = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n return rect.contain(coord[0], coord[1]);\r\n };\r\n Displayable.prototype.getPaintRect = function () {\r\n var rect = this._paintRect;\r\n if (!this._paintRect || this.__dirty) {\r\n var transform = this.transform;\r\n var elRect = this.getBoundingRect();\r\n var style = this.style;\r\n var shadowSize = style.shadowBlur || 0;\r\n var shadowOffsetX = style.shadowOffsetX || 0;\r\n var shadowOffsetY = style.shadowOffsetY || 0;\r\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\r\n if (transform) {\r\n BoundingRect.applyTransform(rect, elRect, transform);\r\n }\r\n else {\r\n rect.copy(elRect);\r\n }\r\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\r\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\r\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\r\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\r\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\r\n }\r\n var tolerance = this.dirtyRectTolerance;\r\n if (!rect.isZero()) {\r\n rect.x = Math.floor(rect.x - tolerance);\r\n rect.y = Math.floor(rect.y - tolerance);\r\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\r\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\r\n }\r\n }\r\n return rect;\r\n };\r\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\r\n if (paintRect) {\r\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\r\n this._prevPaintRect.copy(paintRect);\r\n }\r\n else {\r\n this._prevPaintRect = null;\r\n }\r\n };\r\n Displayable.prototype.getPrevPaintRect = function () {\r\n return this._prevPaintRect;\r\n };\r\n Displayable.prototype.animateStyle = function (loop) {\r\n return this.animate('style', loop);\r\n };\r\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Displayable.prototype.attrKV = function (key, value) {\r\n if (key !== 'style') {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n else {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n this.setStyle(value);\r\n }\r\n }\r\n };\r\n Displayable.prototype.setStyle = function (keyOrObj, value) {\r\n if (typeof keyOrObj === 'string') {\r\n this.style[keyOrObj] = value;\r\n }\r\n else {\r\n extend(this.style, keyOrObj);\r\n }\r\n this.dirtyStyle();\r\n return this;\r\n };\r\n Displayable.prototype.dirtyStyle = function () {\r\n this.markRedraw();\r\n this.__dirty |= Displayable.STYLE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n };\r\n Displayable.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.styleChanged = function () {\r\n return !!(this.__dirty & Displayable.STYLE_CHANGED_BIT);\r\n };\r\n Displayable.prototype.styleUpdated = function () {\r\n this.__dirty &= ~Displayable.STYLE_CHANGED_BIT;\r\n };\r\n Displayable.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_COMMON_STYLE, obj);\r\n };\r\n Displayable.prototype.useStyle = function (obj) {\r\n if (!obj[STYLE_MAGIC_KEY]) {\r\n obj = this.createStyle(obj);\r\n }\r\n if (this.__inHover) {\r\n this.__hoverStyle = obj;\r\n }\r\n else {\r\n this.style = obj;\r\n }\r\n this.dirtyStyle();\r\n };\r\n Displayable.prototype.isStyleObject = function (obj) {\r\n return obj[STYLE_MAGIC_KEY];\r\n };\r\n Displayable.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.style && !normalState.style) {\r\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\r\n }\r\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);\r\n };\r\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetStyle;\r\n if (state && state.style) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetStyle = state.style;\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else {\r\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\r\n this._mergeStyle(targetStyle, state.style);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetStyle = normalState.style;\r\n }\r\n if (targetStyle) {\r\n if (transition) {\r\n var sourceStyle = this.style;\r\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\r\n if (needsRestoreToNormal) {\r\n var changedKeys = keys(sourceStyle);\r\n for (var i = 0; i < changedKeys.length; i++) {\r\n var key = changedKeys[i];\r\n if (key in targetStyle) {\r\n targetStyle[key] = targetStyle[key];\r\n this.style[key] = sourceStyle[key];\r\n }\r\n }\r\n }\r\n var targetKeys = keys(targetStyle);\r\n for (var i = 0; i < targetKeys.length; i++) {\r\n var key = targetKeys[i];\r\n this.style[key] = this.style[key];\r\n }\r\n this._transitionState(stateName, {\r\n style: targetStyle\r\n }, animationCfg, this.getAnimationStyleProps());\r\n }\r\n else {\r\n this.useStyle(targetStyle);\r\n }\r\n }\r\n for (var i = 0; i < PRIMARY_STATES_KEYS$1.length; i++) {\r\n var key = PRIMARY_STATES_KEYS$1[i];\r\n if (state && state[key] != null) {\r\n this[key] = state[key];\r\n }\r\n else if (needsRestoreToNormal) {\r\n if (normalState[key] != null) {\r\n this[key] = normalState[key];\r\n }\r\n }\r\n }\r\n };\r\n Displayable.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedStyle;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.style) {\r\n mergedStyle = mergedStyle || {};\r\n this._mergeStyle(mergedStyle, state.style);\r\n }\r\n }\r\n if (mergedStyle) {\r\n mergedState.style = mergedStyle;\r\n }\r\n return mergedState;\r\n };\r\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n extend(targetStyle, sourceStyle);\r\n return targetStyle;\r\n };\r\n Displayable.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_COMMON_ANIMATION_PROPS;\r\n };\r\n Displayable.STYLE_CHANGED_BIT = 2;\r\n Displayable.initDefaultProps = (function () {\r\n var dispProto = Displayable.prototype;\r\n dispProto.type = 'displayable';\r\n dispProto.invisible = false;\r\n dispProto.z = 0;\r\n dispProto.z2 = 0;\r\n dispProto.zlevel = 0;\r\n dispProto.culling = false;\r\n dispProto.cursor = 'pointer';\r\n dispProto.rectHover = false;\r\n dispProto.incremental = false;\r\n dispProto._rect = null;\r\n dispProto.dirtyRectTolerance = 0;\r\n dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT;\r\n })();\r\n return Displayable;\r\n }(Element));\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var viewRect = new BoundingRect(0, 0, 0, 0);\r\n function isDisplayableCulled(el, width, height) {\r\n tmpRect.copy(el.getBoundingRect());\r\n if (el.transform) {\r\n tmpRect.applyTransform(el.transform);\r\n }\r\n viewRect.width = width;\r\n viewRect.height = height;\r\n return !tmpRect.intersect(viewRect);\r\n }\n\n var mathPow = Math.pow;\r\n var mathSqrt = Math.sqrt;\r\n var EPSILON$1 = 1e-8;\r\n var EPSILON_NUMERIC = 1e-4;\r\n var THREE_SQRT = mathSqrt(3);\r\n var ONE_THIRD = 1 / 3;\r\n var _v0 = create();\r\n var _v1 = create();\r\n var _v2 = create();\r\n function isAroundZero(val) {\r\n return val > -EPSILON$1 && val < EPSILON$1;\r\n }\r\n function isNotAroundZero$1(val) {\r\n return val > EPSILON$1 || val < -EPSILON$1;\r\n }\r\n function cubicAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return onet * onet * (onet * p0 + 3 * t * p1)\r\n + t * t * (t * p3 + 3 * onet * p2);\r\n }\r\n function cubicDerivativeAt(p0, p1, p2, p3, t) {\r\n var onet = 1 - t;\r\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\r\n + (p3 - p2) * t * t);\r\n }\r\n function cubicRootAt(p0, p1, p2, p3, val, roots) {\r\n var a = p3 + 3 * (p1 - p2) - p0;\r\n var b = 3 * (p2 - p1 * 2 + p0);\r\n var c = 3 * (p1 - p0);\r\n var d = p0 - val;\r\n var A = b * b - 3 * a * c;\r\n var B = b * c - 9 * a * d;\r\n var C = c * c - 3 * b * d;\r\n var n = 0;\r\n if (isAroundZero(A) && isAroundZero(B)) {\r\n if (isAroundZero(b)) {\r\n roots[0] = 0;\r\n }\r\n else {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = B * B - 4 * A * C;\r\n if (isAroundZero(disc)) {\r\n var K = B / A;\r\n var t1 = -b / a + K;\r\n var t2 = -K / 2;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\r\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\r\n if (Y1 < 0) {\r\n Y1 = -mathPow(-Y1, ONE_THIRD);\r\n }\r\n else {\r\n Y1 = mathPow(Y1, ONE_THIRD);\r\n }\r\n if (Y2 < 0) {\r\n Y2 = -mathPow(-Y2, ONE_THIRD);\r\n }\r\n else {\r\n Y2 = mathPow(Y2, ONE_THIRD);\r\n }\r\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else {\r\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\r\n var theta = Math.acos(T) / 3;\r\n var ASqrt = mathSqrt(A);\r\n var tmp = Math.cos(theta);\r\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\r\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n if (t3 >= 0 && t3 <= 1) {\r\n roots[n++] = t3;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicExtrema(p0, p1, p2, p3, extrema) {\r\n var b = 6 * p2 - 12 * p1 + 6 * p0;\r\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\r\n var c = 3 * p1 - 3 * p0;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n extrema[0] = -b / (2 * a);\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n extrema[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n extrema[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function cubicSubdivide(p0, p1, p2, p3, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p23 = (p3 - p2) * t + p2;\r\n var p012 = (p12 - p01) * t + p01;\r\n var p123 = (p23 - p12) * t + p12;\r\n var p0123 = (p123 - p012) * t + p012;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p0123;\r\n out[4] = p0123;\r\n out[5] = p123;\r\n out[6] = p23;\r\n out[7] = p3;\r\n }\r\n function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n var prev;\r\n var next;\r\n var d1;\r\n var d2;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\r\n d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n prev = t - interval;\r\n next = t + interval;\r\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\r\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\r\n d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\r\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\r\n d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = cubicAt(x0, x1, x2, x3, t);\r\n out[1] = cubicAt(y0, y1, y2, y3, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = cubicAt(x0, x1, x2, x3, t);\r\n var y = cubicAt(y0, y1, y2, y3, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\r\n function quadraticAt(p0, p1, p2, t) {\r\n var onet = 1 - t;\r\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\r\n }\r\n function quadraticDerivativeAt(p0, p1, p2, t) {\r\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\r\n }\r\n function quadraticRootAt(p0, p1, p2, val, roots) {\r\n var a = p0 - 2 * p1 + p2;\r\n var b = 2 * (p1 - p0);\r\n var c = p0 - val;\r\n var n = 0;\r\n if (isAroundZero(a)) {\r\n if (isNotAroundZero$1(b)) {\r\n var t1 = -c / b;\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n }\r\n else {\r\n var disc = b * b - 4 * a * c;\r\n if (isAroundZero(disc)) {\r\n var t1 = -b / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n }\r\n else if (disc > 0) {\r\n var discSqrt = mathSqrt(disc);\r\n var t1 = (-b + discSqrt) / (2 * a);\r\n var t2 = (-b - discSqrt) / (2 * a);\r\n if (t1 >= 0 && t1 <= 1) {\r\n roots[n++] = t1;\r\n }\r\n if (t2 >= 0 && t2 <= 1) {\r\n roots[n++] = t2;\r\n }\r\n }\r\n }\r\n return n;\r\n }\r\n function quadraticExtremum(p0, p1, p2) {\r\n var divider = p0 + p2 - 2 * p1;\r\n if (divider === 0) {\r\n return 0.5;\r\n }\r\n else {\r\n return (p0 - p1) / divider;\r\n }\r\n }\r\n function quadraticSubdivide(p0, p1, p2, t, out) {\r\n var p01 = (p1 - p0) * t + p0;\r\n var p12 = (p2 - p1) * t + p1;\r\n var p012 = (p12 - p01) * t + p01;\r\n out[0] = p0;\r\n out[1] = p01;\r\n out[2] = p012;\r\n out[3] = p012;\r\n out[4] = p12;\r\n out[5] = p2;\r\n }\r\n function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\r\n var t;\r\n var interval = 0.005;\r\n var d = Infinity;\r\n _v0[0] = x;\r\n _v0[1] = y;\r\n for (var _t = 0; _t < 1; _t += 0.05) {\r\n _v1[0] = quadraticAt(x0, x1, x2, _t);\r\n _v1[1] = quadraticAt(y0, y1, y2, _t);\r\n var d1 = distSquare(_v0, _v1);\r\n if (d1 < d) {\r\n t = _t;\r\n d = d1;\r\n }\r\n }\r\n d = Infinity;\r\n for (var i = 0; i < 32; i++) {\r\n if (interval < EPSILON_NUMERIC) {\r\n break;\r\n }\r\n var prev = t - interval;\r\n var next = t + interval;\r\n _v1[0] = quadraticAt(x0, x1, x2, prev);\r\n _v1[1] = quadraticAt(y0, y1, y2, prev);\r\n var d1 = distSquare(_v1, _v0);\r\n if (prev >= 0 && d1 < d) {\r\n t = prev;\r\n d = d1;\r\n }\r\n else {\r\n _v2[0] = quadraticAt(x0, x1, x2, next);\r\n _v2[1] = quadraticAt(y0, y1, y2, next);\r\n var d2 = distSquare(_v2, _v0);\r\n if (next <= 1 && d2 < d) {\r\n t = next;\r\n d = d2;\r\n }\r\n else {\r\n interval *= 0.5;\r\n }\r\n }\r\n }\r\n if (out) {\r\n out[0] = quadraticAt(x0, x1, x2, t);\r\n out[1] = quadraticAt(y0, y1, y2, t);\r\n }\r\n return mathSqrt(d);\r\n }\r\n function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\r\n var px = x0;\r\n var py = y0;\r\n var d = 0;\r\n var step = 1 / iteration;\r\n for (var i = 1; i <= iteration; i++) {\r\n var t = i * step;\r\n var x = quadraticAt(x0, x1, x2, t);\r\n var y = quadraticAt(y0, y1, y2, t);\r\n var dx = x - px;\r\n var dy = y - py;\r\n d += Math.sqrt(dx * dx + dy * dy);\r\n px = x;\r\n py = y;\r\n }\r\n return d;\r\n }\n\n var mathMin$1 = Math.min;\r\n var mathMax$1 = Math.max;\r\n var mathSin = Math.sin;\r\n var mathCos = Math.cos;\r\n var PI2 = Math.PI * 2;\r\n var start = create();\r\n var end = create();\r\n var extremity = create();\r\n function fromLine(x0, y0, x1, y1, min, max) {\r\n min[0] = mathMin$1(x0, x1);\r\n min[1] = mathMin$1(y0, y1);\r\n max[0] = mathMax$1(x0, x1);\r\n max[1] = mathMax$1(y0, y1);\r\n }\r\n var xDim = [];\r\n var yDim = [];\r\n function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\r\n var cubicExtrema$1 = cubicExtrema;\r\n var cubicAt$1 = cubicAt;\r\n var n = cubicExtrema$1(x0, x1, x2, x3, xDim);\r\n min[0] = Infinity;\r\n min[1] = Infinity;\r\n max[0] = -Infinity;\r\n max[1] = -Infinity;\r\n for (var i = 0; i < n; i++) {\r\n var x = cubicAt$1(x0, x1, x2, x3, xDim[i]);\r\n min[0] = mathMin$1(x, min[0]);\r\n max[0] = mathMax$1(x, max[0]);\r\n }\r\n n = cubicExtrema$1(y0, y1, y2, y3, yDim);\r\n for (var i = 0; i < n; i++) {\r\n var y = cubicAt$1(y0, y1, y2, y3, yDim[i]);\r\n min[1] = mathMin$1(y, min[1]);\r\n max[1] = mathMax$1(y, max[1]);\r\n }\r\n min[0] = mathMin$1(x0, min[0]);\r\n max[0] = mathMax$1(x0, max[0]);\r\n min[0] = mathMin$1(x3, min[0]);\r\n max[0] = mathMax$1(x3, max[0]);\r\n min[1] = mathMin$1(y0, min[1]);\r\n max[1] = mathMax$1(y0, max[1]);\r\n min[1] = mathMin$1(y3, min[1]);\r\n max[1] = mathMax$1(y3, max[1]);\r\n }\r\n function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\r\n var quadraticExtremum$1 = quadraticExtremum;\r\n var quadraticAt$1 = quadraticAt;\r\n var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0);\r\n var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0);\r\n var x = quadraticAt$1(x0, x1, x2, tx);\r\n var y = quadraticAt$1(y0, y1, y2, ty);\r\n min[0] = mathMin$1(x0, x2, x);\r\n min[1] = mathMin$1(y0, y2, y);\r\n max[0] = mathMax$1(x0, x2, x);\r\n max[1] = mathMax$1(y0, y2, y);\r\n }\r\n function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) {\r\n var vec2Min = min;\r\n var vec2Max = max;\r\n var diff = Math.abs(startAngle - endAngle);\r\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\r\n min$1[0] = x - rx;\r\n min$1[1] = y - ry;\r\n max$1[0] = x + rx;\r\n max$1[1] = y + ry;\r\n return;\r\n }\r\n start[0] = mathCos(startAngle) * rx + x;\r\n start[1] = mathSin(startAngle) * ry + y;\r\n end[0] = mathCos(endAngle) * rx + x;\r\n end[1] = mathSin(endAngle) * ry + y;\r\n vec2Min(min$1, start, end);\r\n vec2Max(max$1, start, end);\r\n startAngle = startAngle % (PI2);\r\n if (startAngle < 0) {\r\n startAngle = startAngle + PI2;\r\n }\r\n endAngle = endAngle % (PI2);\r\n if (endAngle < 0) {\r\n endAngle = endAngle + PI2;\r\n }\r\n if (startAngle > endAngle && !anticlockwise) {\r\n endAngle += PI2;\r\n }\r\n else if (startAngle < endAngle && anticlockwise) {\r\n startAngle += PI2;\r\n }\r\n if (anticlockwise) {\r\n var tmp = endAngle;\r\n endAngle = startAngle;\r\n startAngle = tmp;\r\n }\r\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\r\n if (angle > startAngle) {\r\n extremity[0] = mathCos(angle) * rx + x;\r\n extremity[1] = mathSin(angle) * ry + y;\r\n vec2Min(min$1, extremity, min$1);\r\n vec2Max(max$1, extremity, max$1);\r\n }\r\n }\r\n }\n\n var CMD = {\r\n M: 1,\r\n L: 2,\r\n C: 3,\r\n Q: 4,\r\n A: 5,\r\n Z: 6,\r\n R: 7\r\n };\r\n var tmpOutX = [];\r\n var tmpOutY = [];\r\n var min$1 = [];\r\n var max$1 = [];\r\n var min2 = [];\r\n var max2 = [];\r\n var mathMin$2 = Math.min;\r\n var mathMax$2 = Math.max;\r\n var mathCos$1 = Math.cos;\r\n var mathSin$1 = Math.sin;\r\n var mathSqrt$1 = Math.sqrt;\r\n var mathAbs = Math.abs;\r\n var PI = Math.PI;\r\n var PI2$1 = PI * 2;\r\n var hasTypedArray = typeof Float32Array !== 'undefined';\r\n var tmpAngles = [];\r\n function modPI2(radian) {\r\n var n = Math.round(radian / PI * 1e8) / 1e8;\r\n return (n % 2) * PI;\r\n }\r\n function normalizeArcAngles(angles, anticlockwise) {\r\n var newStartAngle = modPI2(angles[0]);\r\n if (newStartAngle < 0) {\r\n newStartAngle += PI2$1;\r\n }\r\n var delta = newStartAngle - angles[0];\r\n var newEndAngle = angles[1];\r\n newEndAngle += delta;\r\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) {\r\n newEndAngle = newStartAngle + PI2$1;\r\n }\r\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) {\r\n newEndAngle = newStartAngle - PI2$1;\r\n }\r\n else if (!anticlockwise && newStartAngle > newEndAngle) {\r\n newEndAngle = newStartAngle +\r\n (PI2$1 - modPI2(newStartAngle - newEndAngle));\r\n }\r\n else if (anticlockwise && newStartAngle < newEndAngle) {\r\n newEndAngle = newStartAngle -\r\n (PI2$1 - modPI2(newEndAngle - newStartAngle));\r\n }\r\n angles[0] = newStartAngle;\r\n angles[1] = newEndAngle;\r\n }\r\n var PathProxy = (function () {\r\n function PathProxy(notSaveData) {\r\n this.dpr = 1;\r\n this._version = 0;\r\n this._xi = 0;\r\n this._yi = 0;\r\n this._x0 = 0;\r\n this._y0 = 0;\r\n this._len = 0;\r\n if (notSaveData) {\r\n this._saveData = false;\r\n }\r\n if (this._saveData) {\r\n this.data = [];\r\n }\r\n }\r\n PathProxy.prototype.increaseVersion = function () {\r\n this._version++;\r\n };\r\n PathProxy.prototype.getVersion = function () {\r\n return this._version;\r\n };\r\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\r\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\r\n if (segmentIgnoreThreshold > 0) {\r\n this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;\r\n this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;\r\n }\r\n };\r\n PathProxy.prototype.setDPR = function (dpr) {\r\n this.dpr = dpr;\r\n };\r\n PathProxy.prototype.setContext = function (ctx) {\r\n this._ctx = ctx;\r\n };\r\n PathProxy.prototype.getContext = function () {\r\n return this._ctx;\r\n };\r\n PathProxy.prototype.beginPath = function () {\r\n this._ctx && this._ctx.beginPath();\r\n this.reset();\r\n return this;\r\n };\r\n PathProxy.prototype.reset = function () {\r\n if (this._saveData) {\r\n this._len = 0;\r\n }\r\n if (this._lineDash) {\r\n this._lineDash = null;\r\n this._dashOffset = 0;\r\n }\r\n if (this._pathSegLen) {\r\n this._pathSegLen = null;\r\n this._pathLen = 0;\r\n }\r\n this._version++;\r\n };\r\n PathProxy.prototype.moveTo = function (x, y) {\r\n this.addData(CMD.M, x, y);\r\n this._ctx && this._ctx.moveTo(x, y);\r\n this._x0 = x;\r\n this._y0 = y;\r\n this._xi = x;\r\n this._yi = y;\r\n return this;\r\n };\r\n PathProxy.prototype.lineTo = function (x, y) {\r\n var exceedUnit = mathAbs(x - this._xi) > this._ux\r\n || mathAbs(y - this._yi) > this._uy\r\n || this._len < 5;\r\n this.addData(CMD.L, x, y);\r\n if (this._ctx && exceedUnit) {\r\n this._needsDash ? this._dashedLineTo(x, y)\r\n : this._ctx.lineTo(x, y);\r\n }\r\n if (exceedUnit) {\r\n this._xi = x;\r\n this._yi = y;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\r\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)\r\n : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n }\r\n this._xi = x3;\r\n this._yi = y3;\r\n return this;\r\n };\r\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\r\n this.addData(CMD.Q, x1, y1, x2, y2);\r\n if (this._ctx) {\r\n this._needsDash ? this._dashedQuadraticTo(x1, y1, x2, y2)\r\n : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n }\r\n this._xi = x2;\r\n this._yi = y2;\r\n return this;\r\n };\r\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\r\n tmpAngles[0] = startAngle;\r\n tmpAngles[1] = endAngle;\r\n normalizeArcAngles(tmpAngles, anticlockwise);\r\n startAngle = tmpAngles[0];\r\n endAngle = tmpAngles[1];\r\n var delta = endAngle - startAngle;\r\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\r\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n this._xi = mathCos$1(endAngle) * r + cx;\r\n this._yi = mathSin$1(endAngle) * r + cy;\r\n return this;\r\n };\r\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\r\n if (this._ctx) {\r\n this._ctx.arcTo(x1, y1, x2, y2, radius);\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.rect = function (x, y, w, h) {\r\n this._ctx && this._ctx.rect(x, y, w, h);\r\n this.addData(CMD.R, x, y, w, h);\r\n return this;\r\n };\r\n PathProxy.prototype.closePath = function () {\r\n this.addData(CMD.Z);\r\n var ctx = this._ctx;\r\n var x0 = this._x0;\r\n var y0 = this._y0;\r\n if (ctx) {\r\n this._needsDash && this._dashedLineTo(x0, y0);\r\n ctx.closePath();\r\n }\r\n this._xi = x0;\r\n this._yi = y0;\r\n return this;\r\n };\r\n PathProxy.prototype.fill = function (ctx) {\r\n ctx && ctx.fill();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.stroke = function (ctx) {\r\n ctx && ctx.stroke();\r\n this.toStatic();\r\n };\r\n PathProxy.prototype.setLineDash = function (lineDash) {\r\n if (lineDash instanceof Array) {\r\n this._lineDash = lineDash;\r\n this._dashIdx = 0;\r\n var lineDashSum = 0;\r\n for (var i = 0; i < lineDash.length; i++) {\r\n lineDashSum += lineDash[i];\r\n }\r\n this._dashSum = lineDashSum;\r\n this._needsDash = true;\r\n }\r\n else {\r\n this._lineDash = null;\r\n this._needsDash = false;\r\n }\r\n return this;\r\n };\r\n PathProxy.prototype.setLineDashOffset = function (offset) {\r\n this._dashOffset = offset;\r\n return this;\r\n };\r\n PathProxy.prototype.len = function () {\r\n return this._len;\r\n };\r\n PathProxy.prototype.setData = function (data) {\r\n var len = data.length;\r\n if (!(this.data && this.data.length === len) && hasTypedArray) {\r\n this.data = new Float32Array(len);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n this.data[i] = data[i];\r\n }\r\n this._len = len;\r\n };\r\n PathProxy.prototype.appendPath = function (path) {\r\n if (!(path instanceof Array)) {\r\n path = [path];\r\n }\r\n var len = path.length;\r\n var appendSize = 0;\r\n var offset = this._len;\r\n for (var i = 0; i < len; i++) {\r\n appendSize += path[i].len();\r\n }\r\n if (hasTypedArray && (this.data instanceof Float32Array)) {\r\n this.data = new Float32Array(offset + appendSize);\r\n }\r\n for (var i = 0; i < len; i++) {\r\n var appendPathData = path[i].data;\r\n for (var k = 0; k < appendPathData.length; k++) {\r\n this.data[offset++] = appendPathData[k];\r\n }\r\n }\r\n this._len = offset;\r\n };\r\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (this._len + arguments.length > data.length) {\r\n this._expandData();\r\n data = this.data;\r\n }\r\n for (var i = 0; i < arguments.length; i++) {\r\n data[this._len++] = arguments[i];\r\n }\r\n };\r\n PathProxy.prototype._expandData = function () {\r\n if (!(this.data instanceof Array)) {\r\n var newData = [];\r\n for (var i = 0; i < this._len; i++) {\r\n newData[i] = this.data[i];\r\n }\r\n this.data = newData;\r\n }\r\n };\r\n PathProxy.prototype._dashedLineTo = function (x1, y1) {\r\n var dashSum = this._dashSum;\r\n var lineDash = this._lineDash;\r\n var ctx = this._ctx;\r\n var offset = this._dashOffset;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var dx = x1 - x0;\r\n var dy = y1 - y0;\r\n var dist = mathSqrt$1(dx * dx + dy * dy);\r\n var x = x0;\r\n var y = y0;\r\n var nDash = lineDash.length;\r\n var dash;\r\n var idx;\r\n dx /= dist;\r\n dy /= dist;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n x -= offset * dx;\r\n y -= offset * dy;\r\n while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1)\r\n || (dx === 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) {\r\n idx = this._dashIdx;\r\n dash = lineDash[idx];\r\n x += dx * dash;\r\n y += dy * dash;\r\n this._dashIdx = (idx + 1) % nDash;\r\n if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) {\r\n continue;\r\n }\r\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1));\r\n }\r\n dx = x - x1;\r\n dy = y - y1;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedBezierTo = function (x1, y1, x2, y2, x3, y3) {\r\n var ctx = this._ctx;\r\n var dashSum = this._dashSum;\r\n var offset = this._dashOffset;\r\n var lineDash = this._lineDash;\r\n var x0 = this._xi;\r\n var y0 = this._yi;\r\n var bezierLen = 0;\r\n var idx = this._dashIdx;\r\n var nDash = lineDash.length;\r\n var t;\r\n var dx;\r\n var dy;\r\n var x;\r\n var y;\r\n var tmpLen = 0;\r\n if (offset < 0) {\r\n offset = dashSum + offset;\r\n }\r\n offset %= dashSum;\r\n for (t = 0; t < 1; t += 0.1) {\r\n dx = cubicAt(x0, x1, x2, x3, t + 0.1)\r\n - cubicAt(x0, x1, x2, x3, t);\r\n dy = cubicAt(y0, y1, y2, y3, t + 0.1)\r\n - cubicAt(y0, y1, y2, y3, t);\r\n bezierLen += mathSqrt$1(dx * dx + dy * dy);\r\n }\r\n for (; idx < nDash; idx++) {\r\n tmpLen += lineDash[idx];\r\n if (tmpLen > offset) {\r\n break;\r\n }\r\n }\r\n t = (tmpLen - offset) / bezierLen;\r\n while (t <= 1) {\r\n x = cubicAt(x0, x1, x2, x3, t);\r\n y = cubicAt(y0, y1, y2, y3, t);\r\n idx % 2 ? ctx.moveTo(x, y)\r\n : ctx.lineTo(x, y);\r\n t += lineDash[idx] / bezierLen;\r\n idx = (idx + 1) % nDash;\r\n }\r\n (idx % 2 !== 0) && ctx.lineTo(x3, y3);\r\n dx = x3 - x;\r\n dy = y3 - y;\r\n this._dashOffset = -mathSqrt$1(dx * dx + dy * dy);\r\n };\r\n PathProxy.prototype._dashedQuadraticTo = function (x1, y1, x2, y2) {\r\n var x3 = x2;\r\n var y3 = y2;\r\n x2 = (x2 + 2 * x1) / 3;\r\n y2 = (y2 + 2 * y1) / 3;\r\n x1 = (this._xi + 2 * x1) / 3;\r\n y1 = (this._yi + 2 * y1) / 3;\r\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\r\n };\r\n PathProxy.prototype.toStatic = function () {\r\n if (!this._saveData) {\r\n return;\r\n }\r\n var data = this.data;\r\n if (data instanceof Array) {\r\n data.length = this._len;\r\n if (hasTypedArray && this._len > 11) {\r\n this.data = new Float32Array(data);\r\n }\r\n }\r\n };\r\n PathProxy.prototype.getBoundingRect = function () {\r\n min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE;\r\n max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\r\n var data = this.data;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var i;\r\n for (i = 0; i < this._len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n min2[0] = x0;\r\n min2[1] = y0;\r\n max2[0] = x0;\r\n max2[1] = y0;\r\n break;\r\n case CMD.L:\r\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var endAngle = data[i++] + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\r\n break;\r\n case CMD.Z:\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n min(min$1, min$1, min2);\r\n max(max$1, max$1, max2);\r\n }\r\n if (i === 0) {\r\n min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0;\r\n }\r\n return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]);\r\n };\r\n PathProxy.prototype._calculateLength = function () {\r\n var data = this.data;\r\n var len = this._len;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n if (!this._pathSegLen) {\r\n this._pathSegLen = [];\r\n }\r\n var pathSegLen = this._pathSegLen;\r\n var pathTotalLen = 0;\r\n var segCount = 0;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var l = -1;\r\n switch (cmd) {\r\n case CMD.M:\r\n xi = x0 = data[i++];\r\n yi = y0 = data[i++];\r\n break;\r\n case CMD.L: {\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var dx = x2 - xi;\r\n var dy = y2 - yi;\r\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x2;\r\n yi = y2;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n var x3 = data[i++];\r\n var y3 = data[i++];\r\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = data[i++];\r\n var y1 = data[i++];\r\n var x2 = data[i++];\r\n var y2 = data[i++];\r\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var startAngle = data[i++];\r\n var delta = data[i++];\r\n var endAngle = delta + startAngle;\r\n i += 1;\r\n var anticlockwise = !data[i++];\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta));\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R: {\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n l = width * 2 + height * 2;\r\n break;\r\n }\r\n case CMD.Z: {\r\n var dx = x0 - xi;\r\n var dy = y0 - yi;\r\n l = Math.sqrt(dx * dx + dy * dy);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (l >= 0) {\r\n pathSegLen[segCount++] = l;\r\n pathTotalLen += l;\r\n }\r\n }\r\n this._pathLen = pathTotalLen;\r\n return pathTotalLen;\r\n };\r\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\r\n var d = this.data;\r\n var ux = this._ux;\r\n var uy = this._uy;\r\n var len = this._len;\r\n var x0;\r\n var y0;\r\n var xi;\r\n var yi;\r\n var x;\r\n var y;\r\n var drawPart = percent < 1;\r\n var pathSegLen;\r\n var pathTotalLen;\r\n var accumLength = 0;\r\n var segCount = 0;\r\n var displayedLength;\r\n if (drawPart) {\r\n if (!this._pathSegLen) {\r\n this._calculateLength();\r\n }\r\n pathSegLen = this._pathSegLen;\r\n pathTotalLen = this._pathLen;\r\n displayedLength = percent * pathTotalLen;\r\n if (!displayedLength) {\r\n return;\r\n }\r\n }\r\n lo: for (var i = 0; i < len;) {\r\n var cmd = d[i++];\r\n var isFirst = i === 1;\r\n if (isFirst) {\r\n xi = d[i];\r\n yi = d[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = xi = d[i++];\r\n y0 = yi = d[i++];\r\n ctx.moveTo(xi, yi);\r\n break;\r\n case CMD.L: {\r\n x = d[i++];\r\n y = d[i++];\r\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.lineTo(x, y);\r\n xi = x;\r\n yi = y;\r\n }\r\n break;\r\n }\r\n case CMD.C: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n var x3 = d[i++];\r\n var y3 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\r\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\r\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\r\n xi = x3;\r\n yi = y3;\r\n break;\r\n }\r\n case CMD.Q: {\r\n var x1 = d[i++];\r\n var y1 = d[i++];\r\n var x2 = d[i++];\r\n var y2 = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\r\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\r\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.quadraticCurveTo(x1, y1, x2, y2);\r\n xi = x2;\r\n yi = y2;\r\n break;\r\n }\r\n case CMD.A:\r\n var cx = d[i++];\r\n var cy = d[i++];\r\n var rx = d[i++];\r\n var ry = d[i++];\r\n var startAngle = d[i++];\r\n var delta = d[i++];\r\n var psi = d[i++];\r\n var anticlockwise = !d[i++];\r\n var r = (rx > ry) ? rx : ry;\r\n var isEllipse = mathAbs(rx - ry) > 1e-3;\r\n var endAngle = startAngle + delta;\r\n var breakBuild = false;\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\r\n breakBuild = true;\r\n }\r\n accumLength += l;\r\n }\r\n if (isEllipse && ctx.ellipse) {\r\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\r\n }\r\n else {\r\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\r\n }\r\n if (breakBuild) {\r\n break lo;\r\n }\r\n if (isFirst) {\r\n x0 = mathCos$1(startAngle) * rx + cx;\r\n y0 = mathSin$1(startAngle) * ry + cy;\r\n }\r\n xi = mathCos$1(endAngle) * rx + cx;\r\n yi = mathSin$1(endAngle) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = d[i];\r\n y0 = yi = d[i + 1];\r\n x = d[i++];\r\n y = d[i++];\r\n var width = d[i++];\r\n var height = d[i++];\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var d_1 = displayedLength - accumLength;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + mathMin$2(d_1, width), y);\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + width, y + mathMin$2(d_1, height));\r\n }\r\n d_1 -= height;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height);\r\n }\r\n d_1 -= width;\r\n if (d_1 > 0) {\r\n ctx.lineTo(x, y + mathMax$2(height - d_1, 0));\r\n }\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.rect(x, y, width, height);\r\n break;\r\n case CMD.Z:\r\n if (drawPart) {\r\n var l = pathSegLen[segCount++];\r\n if (accumLength + l > displayedLength) {\r\n var t = (displayedLength - accumLength) / l;\r\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\r\n break lo;\r\n }\r\n accumLength += l;\r\n }\r\n ctx.closePath();\r\n xi = x0;\r\n yi = y0;\r\n }\r\n }\r\n };\r\n PathProxy.CMD = CMD;\r\n PathProxy.initDefaultProps = (function () {\r\n var proto = PathProxy.prototype;\r\n proto._saveData = true;\r\n proto._needsDash = false;\r\n proto._dashOffset = 0;\r\n proto._dashIdx = 0;\r\n proto._dashSum = 0;\r\n proto._ux = 0;\r\n proto._uy = 0;\r\n })();\r\n return PathProxy;\r\n }());\n\n function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n var _a = 0;\r\n var _b = x0;\r\n if ((y > y0 + _l && y > y1 + _l)\r\n || (y < y0 - _l && y < y1 - _l)\r\n || (x > x0 + _l && x > x1 + _l)\r\n || (x < x0 - _l && x < x1 - _l)) {\r\n return false;\r\n }\r\n if (x0 !== x1) {\r\n _a = (y0 - y1) / (x0 - x1);\r\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\r\n }\r\n else {\r\n return Math.abs(x - x0) <= _l / 2;\r\n }\r\n var tmp = _a * x - y + _b;\r\n var _s = tmp * tmp / (_a * _a + 1);\r\n return _s <= _l / 2 * _l / 2;\r\n }\n\n function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\r\n return false;\r\n }\r\n var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\r\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\r\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\r\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\r\n return false;\r\n }\r\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\r\n return d <= _l / 2;\r\n }\n\n var PI2$2 = Math.PI * 2;\r\n function normalizeRadian(angle) {\r\n angle %= PI2$2;\r\n if (angle < 0) {\r\n angle += PI2$2;\r\n }\r\n return angle;\r\n }\n\n var PI2$3 = Math.PI * 2;\r\n function containStroke$3(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\r\n if (lineWidth === 0) {\r\n return false;\r\n }\r\n var _l = lineWidth;\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n if ((d - _l > r) || (d + _l < r)) {\r\n return false;\r\n }\r\n if (Math.abs(startAngle - endAngle) % PI2$3 < 1e-4) {\r\n return true;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$3;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$3;\r\n }\r\n return (angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle);\r\n }\n\n function windingLine(x0, y0, x1, y1, x, y) {\r\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\r\n return 0;\r\n }\r\n if (y1 === y0) {\r\n return 0;\r\n }\r\n var t = (y - y0) / (y1 - y0);\r\n var dir = y1 < y0 ? 1 : -1;\r\n if (t === 1 || t === 0) {\r\n dir = y1 < y0 ? 0.5 : -0.5;\r\n }\r\n var x_ = t * (x1 - x0) + x0;\r\n return x_ === x ? Infinity : x_ > x ? dir : 0;\r\n }\n\n var CMD$1 = PathProxy.CMD;\r\n var PI2$4 = Math.PI * 2;\r\n var EPSILON$2 = 1e-4;\r\n function isAroundEqual(a, b) {\r\n return Math.abs(a - b) < EPSILON$2;\r\n }\r\n var roots = [-1, -1, -1];\r\n var extrema = [-1, -1];\r\n function swapExtrema() {\r\n var tmp = extrema[0];\r\n extrema[0] = extrema[1];\r\n extrema[1] = tmp;\r\n }\r\n function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\r\n if ((y > y0 && y > y1 && y > y2 && y > y3)\r\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\r\n return 0;\r\n }\r\n var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var w = 0;\r\n var nExtrema = -1;\r\n var y0_ = void 0;\r\n var y1_ = void 0;\r\n for (var i = 0; i < nRoots; i++) {\r\n var t = roots[i];\r\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\r\n var x_ = cubicAt(x0, x1, x2, x3, t);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (nExtrema < 0) {\r\n nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);\r\n if (extrema[1] < extrema[0] && nExtrema > 1) {\r\n swapExtrema();\r\n }\r\n y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);\r\n if (nExtrema > 1) {\r\n y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);\r\n }\r\n }\r\n if (nExtrema === 2) {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else if (t < extrema[1]) {\r\n w += y1_ < y0_ ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y1_ ? unit : -unit;\r\n }\r\n }\r\n else {\r\n if (t < extrema[0]) {\r\n w += y0_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y3 < y0_ ? unit : -unit;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n }\r\n function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\r\n if ((y > y0 && y > y1 && y > y2)\r\n || (y < y0 && y < y1 && y < y2)) {\r\n return 0;\r\n }\r\n var nRoots = quadraticRootAt(y0, y1, y2, y, roots);\r\n if (nRoots === 0) {\r\n return 0;\r\n }\r\n else {\r\n var t = quadraticExtremum(y0, y1, y2);\r\n if (t >= 0 && t <= 1) {\r\n var w = 0;\r\n var y_ = quadraticAt(y0, y1, y2, t);\r\n for (var i = 0; i < nRoots; i++) {\r\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[i]);\r\n if (x_ < x) {\r\n continue;\r\n }\r\n if (roots[i] < t) {\r\n w += y_ < y0 ? unit : -unit;\r\n }\r\n else {\r\n w += y2 < y_ ? unit : -unit;\r\n }\r\n }\r\n return w;\r\n }\r\n else {\r\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\r\n var x_ = quadraticAt(x0, x1, x2, roots[0]);\r\n if (x_ < x) {\r\n return 0;\r\n }\r\n return y2 < y0 ? unit : -unit;\r\n }\r\n }\r\n }\r\n function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\r\n y -= cy;\r\n if (y > r || y < -r) {\r\n return 0;\r\n }\r\n var tmp = Math.sqrt(r * r - y * y);\r\n roots[0] = -tmp;\r\n roots[1] = tmp;\r\n var dTheta = Math.abs(startAngle - endAngle);\r\n if (dTheta < 1e-4) {\r\n return 0;\r\n }\r\n if (dTheta >= PI2$4 - 1e-4) {\r\n startAngle = 0;\r\n endAngle = PI2$4;\r\n var dir = anticlockwise ? 1 : -1;\r\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\r\n return dir;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n if (startAngle > endAngle) {\r\n var tmp_1 = startAngle;\r\n startAngle = endAngle;\r\n endAngle = tmp_1;\r\n }\r\n if (startAngle < 0) {\r\n startAngle += PI2$4;\r\n endAngle += PI2$4;\r\n }\r\n var w = 0;\r\n for (var i = 0; i < 2; i++) {\r\n var x_ = roots[i];\r\n if (x_ + cx > x) {\r\n var angle = Math.atan2(y, x_);\r\n var dir = anticlockwise ? 1 : -1;\r\n if (angle < 0) {\r\n angle = PI2$4 + angle;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) {\r\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\r\n dir = -dir;\r\n }\r\n w += dir;\r\n }\r\n }\r\n }\r\n return w;\r\n }\r\n function containPath(path, lineWidth, isStroke, x, y) {\r\n var data = path.data;\r\n var len = path.len();\r\n var w = 0;\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n for (var i = 0; i < len;) {\r\n var cmd = data[i++];\r\n var isFirst = i === 1;\r\n if (cmd === CMD$1.M && i > 1) {\r\n if (!isStroke) {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n }\r\n if (isFirst) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n switch (cmd) {\r\n case CMD$1.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$1.L:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.C:\r\n if (isStroke) {\r\n if (containStroke$1(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.Q:\r\n if (isStroke) {\r\n if (containStroke$2(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\r\n }\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$1.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (!isFirst) {\r\n w += windingLine(xi, yi, x1, y1, x, y);\r\n }\r\n else {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n if (isStroke) {\r\n if (containStroke$3(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\r\n }\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$1.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n x1 = x0 + width;\r\n y1 = y0 + height;\r\n if (isStroke) {\r\n if (containStroke(x0, y0, x1, y0, lineWidth, x, y)\r\n || containStroke(x1, y0, x1, y1, lineWidth, x, y)\r\n || containStroke(x1, y1, x0, y1, lineWidth, x, y)\r\n || containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(x1, y0, x1, y1, x, y);\r\n w += windingLine(x0, y1, x0, y0, x, y);\r\n }\r\n break;\r\n case CMD$1.Z:\r\n if (isStroke) {\r\n if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n w += windingLine(xi, yi, x0, y0, x, y);\r\n }\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n }\r\n if (!isStroke && !isAroundEqual(yi, y0)) {\r\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\r\n }\r\n return w !== 0;\r\n }\r\n function contain(pathProxy, x, y) {\r\n return containPath(pathProxy, 0, false, x, y);\r\n }\r\n function containStroke$4(pathProxy, lineWidth, x, y) {\r\n return containPath(pathProxy, lineWidth, true, x, y);\r\n }\n\n var DEFAULT_PATH_STYLE = defaults({\r\n fill: '#000',\r\n stroke: null,\r\n strokePercent: 1,\r\n fillOpacity: 1,\r\n strokeOpacity: 1,\r\n lineDashOffset: 0,\r\n lineWidth: 1,\r\n lineCap: 'butt',\r\n miterLimit: 10,\r\n strokeNoScale: false,\r\n strokeFirst: false\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_PATH_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n strokePercent: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineDashOffset: true,\r\n lineWidth: true,\r\n miterLimit: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var pathCopyParams = [\r\n 'x', 'y', 'rotation', 'scaleX', 'scaleY', 'originX', 'originY', 'invisible',\r\n 'culling', 'z', 'z2', 'zlevel', 'parent'\r\n ];\r\n var Path = (function (_super) {\r\n __extends(Path, _super);\r\n function Path(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Path.prototype.update = function () {\r\n var _this = this;\r\n _super.prototype.update.call(this);\r\n var style = this.style;\r\n if (style.decal) {\r\n var decalEl = this._decalEl\r\n = this._decalEl || new Path();\r\n if (decalEl.buildPath === Path.prototype.buildPath) {\r\n decalEl.buildPath = function (ctx) {\r\n _this.buildPath(ctx, _this.shape);\r\n };\r\n }\r\n decalEl.silent = true;\r\n var decalElStyle = decalEl.style;\r\n for (var key in style) {\r\n if (decalElStyle[key] !== style[key]) {\r\n decalElStyle[key] = style[key];\r\n }\r\n }\r\n decalElStyle.fill = style.fill ? style.decal : null;\r\n decalElStyle.decal = null;\r\n decalElStyle.shadowColor = null;\r\n style.strokeFirst && (decalElStyle.stroke = null);\r\n for (var i = 0; i < pathCopyParams.length; ++i) {\r\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\r\n }\r\n decalEl.__dirty |= Element.REDARAW_BIT;\r\n }\r\n else if (this._decalEl) {\r\n this._decalEl = null;\r\n }\r\n };\r\n Path.prototype.getDecalElement = function () {\r\n return this._decalEl;\r\n };\r\n Path.prototype._init = function (props) {\r\n var keysArr = keys(props);\r\n this.shape = this.getDefaultShape();\r\n var defaultStyle = this.getDefaultStyle();\r\n if (defaultStyle) {\r\n this.useStyle(defaultStyle);\r\n }\r\n for (var i = 0; i < keysArr.length; i++) {\r\n var key = keysArr[i];\r\n var value = props[key];\r\n if (key === 'style') {\r\n if (!this.style) {\r\n this.useStyle(value);\r\n }\r\n else {\r\n extend(this.style, value);\r\n }\r\n }\r\n else if (key === 'shape') {\r\n extend(this.shape, value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n }\r\n if (!this.style) {\r\n this.useStyle({});\r\n }\r\n };\r\n Path.prototype.getDefaultStyle = function () {\r\n return null;\r\n };\r\n Path.prototype.getDefaultShape = function () {\r\n return {};\r\n };\r\n Path.prototype.canBeInsideText = function () {\r\n return this.hasFill();\r\n };\r\n Path.prototype.getInsideTextFill = function () {\r\n var pathFill = this.style.fill;\r\n if (pathFill !== 'none') {\r\n if (isString(pathFill)) {\r\n var fillLum = lum(pathFill, 0);\r\n if (fillLum > 0.5) {\r\n return DARK_LABEL_COLOR;\r\n }\r\n else if (fillLum > 0.2) {\r\n return LIGHTER_LABEL_COLOR;\r\n }\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n else if (pathFill) {\r\n return LIGHT_LABEL_COLOR;\r\n }\r\n }\r\n return DARK_LABEL_COLOR;\r\n };\r\n Path.prototype.getInsideTextStroke = function (textFill) {\r\n var pathFill = this.style.fill;\r\n if (isString(pathFill)) {\r\n var zr = this.__zr;\r\n var isDarkMode = !!(zr && zr.isDarkMode());\r\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\r\n if (isDarkMode === isDarkLabel) {\r\n return pathFill;\r\n }\r\n }\r\n };\r\n Path.prototype.buildPath = function (ctx, shapeCfg, inBundle) { };\r\n Path.prototype.pathUpdated = function () {\r\n this.__dirty &= ~Path.SHAPE_CHANGED_BIT;\r\n };\r\n Path.prototype.createPathProxy = function () {\r\n this.path = new PathProxy(false);\r\n };\r\n Path.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n };\r\n Path.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n Path.prototype.getBoundingRect = function () {\r\n var rect = this._rect;\r\n var style = this.style;\r\n var needsUpdateRect = !rect;\r\n if (needsUpdateRect) {\r\n var firstInvoke = false;\r\n if (!this.path) {\r\n firstInvoke = true;\r\n this.createPathProxy();\r\n }\r\n var path = this.path;\r\n if (firstInvoke || (this.__dirty & Path.SHAPE_CHANGED_BIT)) {\r\n path.beginPath();\r\n this.buildPath(path, this.shape, false);\r\n this.pathUpdated();\r\n }\r\n rect = path.getBoundingRect();\r\n }\r\n this._rect = rect;\r\n if (this.hasStroke() && this.path && this.path.len() > 0) {\r\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\r\n if (this.__dirty || needsUpdateRect) {\r\n rectWithStroke.copy(rect);\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n var w = style.lineWidth;\r\n if (!this.hasFill()) {\r\n var strokeContainThreshold = this.strokeContainThreshold;\r\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\r\n }\r\n if (lineScale > 1e-10) {\r\n rectWithStroke.width += w / lineScale;\r\n rectWithStroke.height += w / lineScale;\r\n rectWithStroke.x -= w / lineScale / 2;\r\n rectWithStroke.y -= w / lineScale / 2;\r\n }\r\n }\r\n return rectWithStroke;\r\n }\r\n return rect;\r\n };\r\n Path.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n var style = this.style;\r\n x = localPos[0];\r\n y = localPos[1];\r\n if (rect.contain(x, y)) {\r\n var pathProxy = this.path;\r\n if (this.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\r\n if (lineScale > 1e-10) {\r\n if (!this.hasFill()) {\r\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\r\n }\r\n if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (this.hasFill()) {\r\n return contain(pathProxy, x, y);\r\n }\r\n }\r\n return false;\r\n };\r\n Path.prototype.dirtyShape = function () {\r\n this.__dirty |= Path.SHAPE_CHANGED_BIT;\r\n if (this._rect) {\r\n this._rect = null;\r\n }\r\n if (this._decalEl) {\r\n this._decalEl.dirtyShape();\r\n }\r\n this.markRedraw();\r\n };\r\n Path.prototype.dirty = function () {\r\n this.dirtyStyle();\r\n this.dirtyShape();\r\n };\r\n Path.prototype.animateShape = function (loop) {\r\n return this.animate('shape', loop);\r\n };\r\n Path.prototype.updateDuringAnimation = function (targetKey) {\r\n if (targetKey === 'style') {\r\n this.dirtyStyle();\r\n }\r\n else if (targetKey === 'shape') {\r\n this.dirtyShape();\r\n }\r\n else {\r\n this.markRedraw();\r\n }\r\n };\r\n Path.prototype.attrKV = function (key, value) {\r\n if (key === 'shape') {\r\n this.setShape(value);\r\n }\r\n else {\r\n _super.prototype.attrKV.call(this, key, value);\r\n }\r\n };\r\n Path.prototype.setShape = function (keyOrObj, value) {\r\n var shape = this.shape;\r\n if (!shape) {\r\n shape = this.shape = {};\r\n }\r\n if (typeof keyOrObj === 'string') {\r\n shape[keyOrObj] = value;\r\n }\r\n else {\r\n extend(shape, keyOrObj);\r\n }\r\n this.dirtyShape();\r\n return this;\r\n };\r\n Path.prototype.shapeChanged = function () {\r\n return !!(this.__dirty & Path.SHAPE_CHANGED_BIT);\r\n };\r\n Path.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_PATH_STYLE, obj);\r\n };\r\n Path.prototype._innerSaveToNormal = function (toState) {\r\n _super.prototype._innerSaveToNormal.call(this, toState);\r\n var normalState = this._normalState;\r\n if (toState.shape && !normalState.shape) {\r\n normalState.shape = extend({}, this.shape);\r\n }\r\n };\r\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\r\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\r\n var needsRestoreToNormal = !(state && keepCurrentStates);\r\n var targetShape;\r\n if (state && state.shape) {\r\n if (transition) {\r\n if (keepCurrentStates) {\r\n targetShape = state.shape;\r\n }\r\n else {\r\n targetShape = extend({}, normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else {\r\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\r\n extend(targetShape, state.shape);\r\n }\r\n }\r\n else if (needsRestoreToNormal) {\r\n targetShape = normalState.shape;\r\n }\r\n if (targetShape) {\r\n if (transition) {\r\n this.shape = extend({}, this.shape);\r\n var targetShapePrimaryProps = {};\r\n var shapeKeys = keys(targetShape);\r\n for (var i = 0; i < shapeKeys.length; i++) {\r\n var key = shapeKeys[i];\r\n if (typeof targetShape[key] === 'object') {\r\n this.shape[key] = targetShape[key];\r\n }\r\n else {\r\n targetShapePrimaryProps[key] = targetShape[key];\r\n }\r\n }\r\n this._transitionState(stateName, {\r\n shape: targetShapePrimaryProps\r\n }, animationCfg);\r\n }\r\n else {\r\n this.shape = targetShape;\r\n this.dirtyShape();\r\n }\r\n }\r\n };\r\n Path.prototype._mergeStates = function (states) {\r\n var mergedState = _super.prototype._mergeStates.call(this, states);\r\n var mergedShape;\r\n for (var i = 0; i < states.length; i++) {\r\n var state = states[i];\r\n if (state.shape) {\r\n mergedShape = mergedShape || {};\r\n this._mergeStyle(mergedShape, state.shape);\r\n }\r\n }\r\n if (mergedShape) {\r\n mergedState.shape = mergedShape;\r\n }\r\n return mergedState;\r\n };\r\n Path.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_PATH_ANIMATION_PROPS;\r\n };\r\n Path.prototype.isZeroArea = function () {\r\n return false;\r\n };\r\n Path.extend = function (defaultProps) {\r\n var Sub = (function (_super) {\r\n __extends(Sub, _super);\r\n function Sub(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n defaultProps.init && defaultProps.init.call(_this, opts);\r\n return _this;\r\n }\r\n Sub.prototype.getDefaultStyle = function () {\r\n return clone(defaultProps.style);\r\n };\r\n Sub.prototype.getDefaultShape = function () {\r\n return clone(defaultProps.shape);\r\n };\r\n return Sub;\r\n }(Path));\r\n for (var key in defaultProps) {\r\n if (typeof defaultProps[key] === 'function') {\r\n Sub.prototype[key] = defaultProps[key];\r\n }\r\n }\r\n return Sub;\r\n };\r\n Path.SHAPE_CHANGED_BIT = 4;\r\n Path.initDefaultProps = (function () {\r\n var pathProto = Path.prototype;\r\n pathProto.type = 'path';\r\n pathProto.strokeContainThreshold = 5;\r\n pathProto.segmentIgnoreThreshold = 0;\r\n pathProto.subPixelOptimize = false;\r\n pathProto.autoBatch = false;\r\n pathProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT | Path.SHAPE_CHANGED_BIT;\r\n })();\r\n return Path;\r\n }(Displayable));\n\n var CMD$2 = PathProxy.CMD;\r\n var points = [[], [], []];\r\n var mathSqrt$2 = Math.sqrt;\r\n var mathAtan2 = Math.atan2;\r\n function transformPath(path, m) {\r\n var data = path.data;\r\n var len = path.len();\r\n var cmd;\r\n var nPoint;\r\n var i;\r\n var j;\r\n var k;\r\n var p;\r\n var M = CMD$2.M;\r\n var C = CMD$2.C;\r\n var L = CMD$2.L;\r\n var R = CMD$2.R;\r\n var A = CMD$2.A;\r\n var Q = CMD$2.Q;\r\n for (i = 0, j = 0; i < len;) {\r\n cmd = data[i++];\r\n j = i;\r\n nPoint = 0;\r\n switch (cmd) {\r\n case M:\r\n nPoint = 1;\r\n break;\r\n case L:\r\n nPoint = 1;\r\n break;\r\n case C:\r\n nPoint = 3;\r\n break;\r\n case Q:\r\n nPoint = 2;\r\n break;\r\n case A:\r\n var x = m[4];\r\n var y = m[5];\r\n var sx = mathSqrt$2(m[0] * m[0] + m[1] * m[1]);\r\n var sy = mathSqrt$2(m[2] * m[2] + m[3] * m[3]);\r\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\r\n data[i] *= sx;\r\n data[i++] += x;\r\n data[i] *= sy;\r\n data[i++] += y;\r\n data[i++] *= sx;\r\n data[i++] *= sy;\r\n data[i++] += angle;\r\n data[i++] += angle;\r\n i += 2;\r\n j = i;\r\n break;\r\n case R:\r\n p[0] = data[i++];\r\n p[1] = data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n p[0] += data[i++];\r\n p[1] += data[i++];\r\n applyTransform(p, p, m);\r\n data[j++] = p[0];\r\n data[j++] = p[1];\r\n }\r\n for (k = 0; k < nPoint; k++) {\r\n var p_1 = points[k];\r\n p_1[0] = data[i++];\r\n p_1[1] = data[i++];\r\n applyTransform(p_1, p_1, m);\r\n data[j++] = p_1[0];\r\n data[j++] = p_1[1];\r\n }\r\n }\r\n path.increaseVersion();\r\n }\n\n var mathSqrt$3 = Math.sqrt;\r\n var mathSin$2 = Math.sin;\r\n var mathCos$2 = Math.cos;\r\n var PI$1 = Math.PI;\r\n function vMag(v) {\r\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\r\n }\r\n function vRatio(u, v) {\r\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\r\n }\r\n function vAngle(u, v) {\r\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\r\n * Math.acos(vRatio(u, v));\r\n }\r\n function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\r\n var psi = psiDeg * (PI$1 / 180.0);\r\n var xp = mathCos$2(psi) * (x1 - x2) / 2.0\r\n + mathSin$2(psi) * (y1 - y2) / 2.0;\r\n var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0\r\n + mathCos$2(psi) * (y1 - y2) / 2.0;\r\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\r\n if (lambda > 1) {\r\n rx *= mathSqrt$3(lambda);\r\n ry *= mathSqrt$3(lambda);\r\n }\r\n var f = (fa === fs ? -1 : 1)\r\n * mathSqrt$3((((rx * rx) * (ry * ry))\r\n - ((rx * rx) * (yp * yp))\r\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\r\n + (ry * ry) * (xp * xp))) || 0;\r\n var cxp = f * rx * yp / ry;\r\n var cyp = f * -ry * xp / rx;\r\n var cx = (x1 + x2) / 2.0\r\n + mathCos$2(psi) * cxp\r\n - mathSin$2(psi) * cyp;\r\n var cy = (y1 + y2) / 2.0\r\n + mathSin$2(psi) * cxp\r\n + mathCos$2(psi) * cyp;\r\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\r\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\r\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\r\n var dTheta = vAngle(u, v);\r\n if (vRatio(u, v) <= -1) {\r\n dTheta = PI$1;\r\n }\r\n if (vRatio(u, v) >= 1) {\r\n dTheta = 0;\r\n }\r\n if (dTheta < 0) {\r\n var n = Math.round(dTheta / PI$1 * 1e6) / 1e6;\r\n dTheta = PI$1 * 2 + (n % 2) * PI$1;\r\n }\r\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\r\n }\r\n var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\r\n var numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\r\n function createPathProxyFromString(data) {\r\n if (!data) {\r\n return new PathProxy();\r\n }\r\n var cpx = 0;\r\n var cpy = 0;\r\n var subpathX = cpx;\r\n var subpathY = cpy;\r\n var prevCmd;\r\n var path = new PathProxy();\r\n var CMD = PathProxy.CMD;\r\n var cmdList = data.match(commandReg);\r\n for (var l = 0; l < cmdList.length; l++) {\r\n var cmdText = cmdList[l];\r\n var cmdStr = cmdText.charAt(0);\r\n var cmd = void 0;\r\n var p = cmdText.match(numberReg) || [];\r\n var pLen = p.length;\r\n for (var i = 0; i < pLen; i++) {\r\n p[i] = parseFloat(p[i]);\r\n }\r\n var off = 0;\r\n while (off < pLen) {\r\n var ctlPtx = void 0;\r\n var ctlPty = void 0;\r\n var rx = void 0;\r\n var ry = void 0;\r\n var psi = void 0;\r\n var fa = void 0;\r\n var fs = void 0;\r\n var x1 = cpx;\r\n var y1 = cpy;\r\n var len = void 0;\r\n var pathData = void 0;\r\n switch (cmdStr) {\r\n case 'l':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'L':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'm':\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'l';\r\n break;\r\n case 'M':\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.M;\r\n path.addData(cmd, cpx, cpy);\r\n subpathX = cpx;\r\n subpathY = cpy;\r\n cmdStr = 'L';\r\n break;\r\n case 'h':\r\n cpx += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'H':\r\n cpx = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'v':\r\n cpy += p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'V':\r\n cpy = p[off++];\r\n cmd = CMD.L;\r\n path.addData(cmd, cpx, cpy);\r\n break;\r\n case 'C':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\r\n cpx = p[off - 2];\r\n cpy = p[off - 1];\r\n break;\r\n case 'c':\r\n cmd = CMD.C;\r\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\r\n cpx += p[off - 2];\r\n cpy += p[off - 1];\r\n break;\r\n case 'S':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 's':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.C) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cmd = CMD.C;\r\n x1 = cpx + p[off++];\r\n y1 = cpy + p[off++];\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\r\n break;\r\n case 'Q':\r\n x1 = p[off++];\r\n y1 = p[off++];\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'q':\r\n x1 = p[off++] + cpx;\r\n y1 = p[off++] + cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, x1, y1, cpx, cpy);\r\n break;\r\n case 'T':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 't':\r\n ctlPtx = cpx;\r\n ctlPty = cpy;\r\n len = path.len();\r\n pathData = path.data;\r\n if (prevCmd === CMD.Q) {\r\n ctlPtx += cpx - pathData[len - 4];\r\n ctlPty += cpy - pathData[len - 3];\r\n }\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.Q;\r\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\r\n break;\r\n case 'A':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx = p[off++];\r\n cpy = p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n case 'a':\r\n rx = p[off++];\r\n ry = p[off++];\r\n psi = p[off++];\r\n fa = p[off++];\r\n fs = p[off++];\r\n x1 = cpx, y1 = cpy;\r\n cpx += p[off++];\r\n cpy += p[off++];\r\n cmd = CMD.A;\r\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\r\n break;\r\n }\r\n }\r\n if (cmdStr === 'z' || cmdStr === 'Z') {\r\n cmd = CMD.Z;\r\n path.addData(cmd);\r\n cpx = subpathX;\r\n cpy = subpathY;\r\n }\r\n prevCmd = cmd;\r\n }\r\n path.toStatic();\r\n return path;\r\n }\r\n var SVGPath = (function (_super) {\r\n __extends(SVGPath, _super);\r\n function SVGPath() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SVGPath.prototype.applyTransform = function (m) { };\r\n return SVGPath;\r\n }(Path));\r\n function isPathProxy(path) {\r\n return path.setData != null;\r\n }\r\n function createPathOptions(str, opts) {\r\n var pathProxy = createPathProxyFromString(str);\r\n var innerOpts = extend({}, opts);\r\n innerOpts.buildPath = function (path) {\r\n if (isPathProxy(path)) {\r\n path.setData(pathProxy.data);\r\n var ctx = path.getContext();\r\n if (ctx) {\r\n path.rebuildPath(ctx, 1);\r\n }\r\n }\r\n else {\r\n var ctx = path;\r\n pathProxy.rebuildPath(ctx, 1);\r\n }\r\n };\r\n innerOpts.applyTransform = function (m) {\r\n transformPath(pathProxy, m);\r\n this.dirtyShape();\r\n };\r\n return innerOpts;\r\n }\r\n function createFromString(str, opts) {\r\n return new SVGPath(createPathOptions(str, opts));\r\n }\n\n var Group = (function (_super) {\r\n __extends(Group, _super);\r\n function Group(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.isGroup = true;\r\n _this._children = [];\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n Group.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n Group.prototype.children = function () {\r\n return this._children.slice();\r\n };\r\n Group.prototype.childAt = function (idx) {\r\n return this._children[idx];\r\n };\r\n Group.prototype.childOfName = function (name) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n if (children[i].name === name) {\r\n return children[i];\r\n }\r\n }\r\n };\r\n Group.prototype.childCount = function () {\r\n return this._children.length;\r\n };\r\n Group.prototype.add = function (child) {\r\n if (child) {\r\n if (child !== this && child.parent !== this) {\r\n this._children.push(child);\r\n this._doAdd(child);\r\n }\r\n if (child.__hostTarget) {\r\n throw 'This elemenet has been used as an attachment';\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addBefore = function (child, nextSibling) {\r\n if (child && child !== this && child.parent !== this\r\n && nextSibling && nextSibling.parent === this) {\r\n var children = this._children;\r\n var idx = children.indexOf(nextSibling);\r\n if (idx >= 0) {\r\n children.splice(idx, 0, child);\r\n this._doAdd(child);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.replaceAt = function (child, index) {\r\n var children = this._children;\r\n var old = children[index];\r\n if (child && child !== this && child.parent !== this && child !== old) {\r\n children[index] = child;\r\n old.parent = null;\r\n var zr = this.__zr;\r\n if (zr) {\r\n old.removeSelfFromZr(zr);\r\n }\r\n this._doAdd(child);\r\n }\r\n return this;\r\n };\r\n Group.prototype._doAdd = function (child) {\r\n if (child.parent) {\r\n child.parent.remove(child);\r\n }\r\n child.parent = this;\r\n var zr = this.__zr;\r\n if (zr && zr !== child.__zr) {\r\n child.addSelfToZr(zr);\r\n }\r\n zr && zr.refresh();\r\n };\r\n Group.prototype.remove = function (child) {\r\n var zr = this.__zr;\r\n var children = this._children;\r\n var idx = indexOf(children, child);\r\n if (idx < 0) {\r\n return this;\r\n }\r\n children.splice(idx, 1);\r\n child.parent = null;\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n zr && zr.refresh();\r\n return this;\r\n };\r\n Group.prototype.removeAll = function () {\r\n var children = this._children;\r\n var zr = this.__zr;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (zr) {\r\n child.removeSelfFromZr(zr);\r\n }\r\n child.parent = null;\r\n }\r\n children.length = 0;\r\n return this;\r\n };\r\n Group.prototype.eachChild = function (cb, context) {\r\n var children = this._children;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n cb.call(context, child, i);\r\n }\r\n return this;\r\n };\r\n Group.prototype.traverse = function (cb, context) {\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n var stopped = cb.call(context, child);\r\n if (child.isGroup && !stopped) {\r\n child.traverse(cb, context);\r\n }\r\n }\r\n return this;\r\n };\r\n Group.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.addSelfToZr(zr);\r\n }\r\n };\r\n Group.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.removeSelfFromZr(zr);\r\n }\r\n };\r\n Group.prototype.getBoundingRect = function (includeChildren) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = includeChildren || this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n if (child.ignore || child.invisible) {\r\n continue;\r\n }\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n BoundingRect.applyTransform(tmpRect, childRect, transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n return rect || tmpRect;\r\n };\r\n return Group;\r\n }(Element));\r\n Group.prototype.type = 'group';\n\n var DEFAULT_IMAGE_STYLE = defaults({\r\n x: 0,\r\n y: 0\r\n }, DEFAULT_COMMON_STYLE);\r\n var DEFAULT_IMAGE_ANIMATION_PROPS = {\r\n style: defaults({\r\n x: true,\r\n y: true,\r\n width: true,\r\n height: true,\r\n sx: true,\r\n sy: true,\r\n sWidth: true,\r\n sHeight: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n function isImageLike(source) {\r\n return !!(source\r\n && typeof source !== 'string'\r\n && source.width && source.height);\r\n }\r\n var ZRImage = (function (_super) {\r\n __extends(ZRImage, _super);\r\n function ZRImage() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ZRImage.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_IMAGE_STYLE, obj);\r\n };\r\n ZRImage.prototype._getSize = function (dim) {\r\n var style = this.style;\r\n var size = style[dim];\r\n if (size != null) {\r\n return size;\r\n }\r\n var imageSource = isImageLike(style.image)\r\n ? style.image : this.__image;\r\n if (!imageSource) {\r\n return 0;\r\n }\r\n var otherDim = dim === 'width' ? 'height' : 'width';\r\n var otherDimSize = style[otherDim];\r\n if (otherDimSize == null) {\r\n return imageSource[dim];\r\n }\r\n else {\r\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\r\n }\r\n };\r\n ZRImage.prototype.getWidth = function () {\r\n return this._getSize('width');\r\n };\r\n ZRImage.prototype.getHeight = function () {\r\n return this._getSize('height');\r\n };\r\n ZRImage.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_IMAGE_ANIMATION_PROPS;\r\n };\r\n ZRImage.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\r\n }\r\n return this._rect;\r\n };\r\n return ZRImage;\r\n }(Displayable));\r\n ZRImage.prototype.type = 'image';\n\n var CircleShape = (function () {\r\n function CircleShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n }\r\n return CircleShape;\r\n }());\r\n var Circle = (function (_super) {\r\n __extends(Circle, _super);\r\n function Circle(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Circle.prototype.getDefaultShape = function () {\r\n return new CircleShape();\r\n };\r\n Circle.prototype.buildPath = function (ctx, shape, inBundle) {\r\n if (inBundle) {\r\n ctx.moveTo(shape.cx + shape.r, shape.cy);\r\n }\r\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\r\n };\r\n return Circle;\r\n }(Path));\r\n Circle.prototype.type = 'circle';\n\n function buildPath(ctx, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var width = shape.width;\r\n var height = shape.height;\r\n var r = shape.r;\r\n var r1;\r\n var r2;\r\n var r3;\r\n var r4;\r\n if (width < 0) {\r\n x = x + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y = y + height;\r\n height = -height;\r\n }\r\n if (typeof r === 'number') {\r\n r1 = r2 = r3 = r4 = r;\r\n }\r\n else if (r instanceof Array) {\r\n if (r.length === 1) {\r\n r1 = r2 = r3 = r4 = r[0];\r\n }\r\n else if (r.length === 2) {\r\n r1 = r3 = r[0];\r\n r2 = r4 = r[1];\r\n }\r\n else if (r.length === 3) {\r\n r1 = r[0];\r\n r2 = r4 = r[1];\r\n r3 = r[2];\r\n }\r\n else {\r\n r1 = r[0];\r\n r2 = r[1];\r\n r3 = r[2];\r\n r4 = r[3];\r\n }\r\n }\r\n else {\r\n r1 = r2 = r3 = r4 = 0;\r\n }\r\n var total;\r\n if (r1 + r2 > width) {\r\n total = r1 + r2;\r\n r1 *= width / total;\r\n r2 *= width / total;\r\n }\r\n if (r3 + r4 > width) {\r\n total = r3 + r4;\r\n r3 *= width / total;\r\n r4 *= width / total;\r\n }\r\n if (r2 + r3 > height) {\r\n total = r2 + r3;\r\n r2 *= height / total;\r\n r3 *= height / total;\r\n }\r\n if (r1 + r4 > height) {\r\n total = r1 + r4;\r\n r1 *= height / total;\r\n r4 *= height / total;\r\n }\r\n ctx.moveTo(x + r1, y);\r\n ctx.lineTo(x + width - r2, y);\r\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\r\n ctx.lineTo(x + width, y + height - r3);\r\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\r\n ctx.lineTo(x + r4, y + height);\r\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\r\n ctx.lineTo(x, y + r1);\r\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\r\n }\n\n var round = Math.round;\r\n function subPixelOptimizeLine(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var x1 = inputShape.x1;\r\n var x2 = inputShape.x2;\r\n var y1 = inputShape.y1;\r\n var y2 = inputShape.y2;\r\n outputShape.x1 = x1;\r\n outputShape.x2 = x2;\r\n outputShape.y1 = y1;\r\n outputShape.y2 = y2;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n if (round(x1 * 2) === round(x2 * 2)) {\r\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\r\n }\r\n if (round(y1 * 2) === round(y2 * 2)) {\r\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\r\n }\r\n return outputShape;\r\n }\r\n function subPixelOptimizeRect(outputShape, inputShape, style) {\r\n if (!inputShape) {\r\n return;\r\n }\r\n var originX = inputShape.x;\r\n var originY = inputShape.y;\r\n var originWidth = inputShape.width;\r\n var originHeight = inputShape.height;\r\n outputShape.x = originX;\r\n outputShape.y = originY;\r\n outputShape.width = originWidth;\r\n outputShape.height = originHeight;\r\n var lineWidth = style && style.lineWidth;\r\n if (!lineWidth) {\r\n return outputShape;\r\n }\r\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\r\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\r\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\r\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\r\n return outputShape;\r\n }\r\n function subPixelOptimize(position, lineWidth, positiveOrNegative) {\r\n if (!lineWidth) {\r\n return position;\r\n }\r\n var doubledPosition = round(position * 2);\r\n return (doubledPosition + round(lineWidth)) % 2 === 0\r\n ? doubledPosition / 2\r\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\r\n }\n\n var RectShape = (function () {\r\n function RectShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return RectShape;\r\n }());\r\n var subPixelOptimizeOutputShape = {};\r\n var Rect = (function (_super) {\r\n __extends(Rect, _super);\r\n function Rect(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rect.prototype.getDefaultShape = function () {\r\n return new RectShape();\r\n };\r\n Rect.prototype.buildPath = function (ctx, shape) {\r\n var x;\r\n var y;\r\n var width;\r\n var height;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\r\n x = optimizedShape.x;\r\n y = optimizedShape.y;\r\n width = optimizedShape.width;\r\n height = optimizedShape.height;\r\n optimizedShape.r = shape.r;\r\n shape = optimizedShape;\r\n }\r\n else {\r\n x = shape.x;\r\n y = shape.y;\r\n width = shape.width;\r\n height = shape.height;\r\n }\r\n if (!shape.r) {\r\n ctx.rect(x, y, width, height);\r\n }\r\n else {\r\n buildPath(ctx, shape);\r\n }\r\n };\r\n Rect.prototype.isZeroArea = function () {\r\n return !this.shape.width || !this.shape.height;\r\n };\r\n return Rect;\r\n }(Path));\r\n Rect.prototype.type = 'rect';\n\n var EllipseShape = (function () {\r\n function EllipseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.rx = 0;\r\n this.ry = 0;\r\n }\r\n return EllipseShape;\r\n }());\r\n var Ellipse = (function (_super) {\r\n __extends(Ellipse, _super);\r\n function Ellipse(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ellipse.prototype.getDefaultShape = function () {\r\n return new EllipseShape();\r\n };\r\n Ellipse.prototype.buildPath = function (ctx, shape) {\r\n var k = 0.5522848;\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.rx;\r\n var b = shape.ry;\r\n var ox = a * k;\r\n var oy = b * k;\r\n ctx.moveTo(x - a, y);\r\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\r\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\r\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\r\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\r\n ctx.closePath();\r\n };\r\n return Ellipse;\r\n }(Path));\r\n Ellipse.prototype.type = 'ellipse';\n\n var subPixelOptimizeOutputShape$1 = {};\r\n var LineShape = (function () {\r\n function LineShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.percent = 1;\r\n }\r\n return LineShape;\r\n }());\r\n var Line = (function (_super) {\r\n __extends(Line, _super);\r\n function Line(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Line.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Line.prototype.getDefaultShape = function () {\r\n return new LineShape();\r\n };\r\n Line.prototype.buildPath = function (ctx, shape) {\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (this.subPixelOptimize) {\r\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style);\r\n x1 = optimizedShape.x1;\r\n y1 = optimizedShape.y1;\r\n x2 = optimizedShape.x2;\r\n y2 = optimizedShape.y2;\r\n }\r\n else {\r\n x1 = shape.x1;\r\n y1 = shape.y1;\r\n x2 = shape.x2;\r\n y2 = shape.y2;\r\n }\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (percent < 1) {\r\n x2 = x1 * (1 - percent) + x2 * percent;\r\n y2 = y1 * (1 - percent) + y2 * percent;\r\n }\r\n ctx.lineTo(x2, y2);\r\n };\r\n Line.prototype.pointAt = function (p) {\r\n var shape = this.shape;\r\n return [\r\n shape.x1 * (1 - p) + shape.x2 * p,\r\n shape.y1 * (1 - p) + shape.y2 * p\r\n ];\r\n };\r\n return Line;\r\n }(Path));\r\n Line.prototype.type = 'line';\n\n function interpolate(p0, p1, p2, p3, t, t2, t3) {\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n return (2 * (p1 - p2) + v0 + v1) * t3\r\n + (-3 * (p1 - p2) - 2 * v0 - v1) * t2\r\n + v0 * t + p1;\r\n }\r\n function smoothSpline(points, isLoop) {\r\n var len = points.length;\r\n var ret = [];\r\n var distance$1 = 0;\r\n for (var i = 1; i < len; i++) {\r\n distance$1 += distance(points[i - 1], points[i]);\r\n }\r\n var segs = distance$1 / 2;\r\n segs = segs < len ? len : segs;\r\n for (var i = 0; i < segs; i++) {\r\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\r\n var idx = Math.floor(pos);\r\n var w = pos - idx;\r\n var p0 = void 0;\r\n var p1 = points[idx % len];\r\n var p2 = void 0;\r\n var p3 = void 0;\r\n if (!isLoop) {\r\n p0 = points[idx === 0 ? idx : idx - 1];\r\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\r\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\r\n }\r\n else {\r\n p0 = points[(idx - 1 + len) % len];\r\n p2 = points[(idx + 1) % len];\r\n p3 = points[(idx + 2) % len];\r\n }\r\n var w2 = w * w;\r\n var w3 = w * w2;\r\n ret.push([\r\n interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),\r\n interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)\r\n ]);\r\n }\r\n return ret;\r\n }\n\n function smoothBezier(points, smooth, isLoop, constraint) {\r\n var cps = [];\r\n var v = [];\r\n var v1 = [];\r\n var v2 = [];\r\n var prevPoint;\r\n var nextPoint;\r\n var min$1;\r\n var max$1;\r\n if (constraint) {\r\n min$1 = [Infinity, Infinity];\r\n max$1 = [-Infinity, -Infinity];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n min(min$1, min$1, points[i]);\r\n max(max$1, max$1, points[i]);\r\n }\r\n min(min$1, min$1, constraint[0]);\r\n max(max$1, max$1, constraint[1]);\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if (isLoop) {\r\n prevPoint = points[i ? i - 1 : len - 1];\r\n nextPoint = points[(i + 1) % len];\r\n }\r\n else {\r\n if (i === 0 || i === len - 1) {\r\n cps.push(clone$1(points[i]));\r\n continue;\r\n }\r\n else {\r\n prevPoint = points[i - 1];\r\n nextPoint = points[i + 1];\r\n }\r\n }\r\n sub(v, nextPoint, prevPoint);\r\n scale(v, v, smooth);\r\n var d0 = distance(point, prevPoint);\r\n var d1 = distance(point, nextPoint);\r\n var sum = d0 + d1;\r\n if (sum !== 0) {\r\n d0 /= sum;\r\n d1 /= sum;\r\n }\r\n scale(v1, v, -d0);\r\n scale(v2, v, d1);\r\n var cp0 = add([], point, v1);\r\n var cp1 = add([], point, v2);\r\n if (constraint) {\r\n max(cp0, cp0, min$1);\r\n min(cp0, cp0, max$1);\r\n max(cp1, cp1, min$1);\r\n min(cp1, cp1, max$1);\r\n }\r\n cps.push(cp0);\r\n cps.push(cp1);\r\n }\r\n if (isLoop) {\r\n cps.push(cps.shift());\r\n }\r\n return cps;\r\n }\n\n function buildPath$1(ctx, shape, closePath) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (points && points.length >= 2) {\r\n if (smooth && smooth !== 'spline') {\r\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n var len = points.length;\r\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\r\n var cp1 = controlPoints[i * 2];\r\n var cp2 = controlPoints[i * 2 + 1];\r\n var p = points[(i + 1) % len];\r\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\r\n }\r\n }\r\n else {\r\n if (smooth === 'spline') {\r\n points = smoothSpline(points, closePath);\r\n }\r\n ctx.moveTo(points[0][0], points[0][1]);\r\n for (var i = 1, l = points.length; i < l; i++) {\r\n ctx.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n closePath && ctx.closePath();\r\n }\r\n }\n\n var PolygonShape = (function () {\r\n function PolygonShape() {\r\n this.points = null;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolygonShape;\r\n }());\r\n var Polygon = (function (_super) {\r\n __extends(Polygon, _super);\r\n function Polygon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polygon.prototype.getDefaultShape = function () {\r\n return new PolygonShape();\r\n };\r\n Polygon.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, true);\r\n };\r\n return Polygon;\r\n }(Path));\r\n Polygon.prototype.type = 'polygon';\n\n var PolylineShape = (function () {\r\n function PolylineShape() {\r\n this.points = null;\r\n this.percent = 1;\r\n this.smooth = 0;\r\n this.smoothConstraint = null;\r\n }\r\n return PolylineShape;\r\n }());\r\n var Polyline = (function (_super) {\r\n __extends(Polyline, _super);\r\n function Polyline(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Polyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Polyline.prototype.getDefaultShape = function () {\r\n return new PolylineShape();\r\n };\r\n Polyline.prototype.buildPath = function (ctx, shape) {\r\n buildPath$1(ctx, shape, false);\r\n };\r\n return Polyline;\r\n }(Path));\r\n Polyline.prototype.type = 'polyline';\n\n var Gradient = (function () {\r\n function Gradient(colorStops) {\r\n this.colorStops = colorStops || [];\r\n }\r\n Gradient.prototype.addColorStop = function (offset, color) {\r\n this.colorStops.push({\r\n offset: offset,\r\n color: color\r\n });\r\n };\r\n return Gradient;\r\n }());\n\n var LinearGradient = (function (_super) {\r\n __extends(LinearGradient, _super);\r\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0 : x;\r\n _this.y = y == null ? 0 : y;\r\n _this.x2 = x2 == null ? 1 : x2;\r\n _this.y2 = y2 == null ? 0 : y2;\r\n _this.type = 'linear';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return LinearGradient;\r\n }(Gradient));\n\n var DEFAULT_TSPAN_STYLE = defaults({\r\n strokeFirst: true,\r\n font: DEFAULT_FONT,\r\n x: 0,\r\n y: 0,\r\n textAlign: 'left',\r\n textBaseline: 'top',\r\n miterLimit: 2\r\n }, DEFAULT_PATH_STYLE);\r\n var TSpan = (function (_super) {\r\n __extends(TSpan, _super);\r\n function TSpan() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TSpan.prototype.hasStroke = function () {\r\n var style = this.style;\r\n var stroke = style.stroke;\r\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\r\n };\r\n TSpan.prototype.hasFill = function () {\r\n var style = this.style;\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n };\r\n TSpan.prototype.createStyle = function (obj) {\r\n return createObject(DEFAULT_TSPAN_STYLE, obj);\r\n };\r\n TSpan.prototype.setBoundingRect = function (rect) {\r\n this._rect = rect;\r\n };\r\n TSpan.prototype.getBoundingRect = function () {\r\n var style = this.style;\r\n if (!this._rect) {\r\n var text = style.text;\r\n text != null ? (text += '') : (text = '');\r\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\r\n rect.x += style.x || 0;\r\n rect.y += style.y || 0;\r\n if (this.hasStroke()) {\r\n var w = style.lineWidth;\r\n rect.x -= w / 2;\r\n rect.y -= w / 2;\r\n rect.width += w;\r\n rect.height += w;\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n TSpan.initDefaultProps = (function () {\r\n var tspanProto = TSpan.prototype;\r\n tspanProto.dirtyRectTolerance = 10;\r\n })();\r\n return TSpan;\r\n }(Displayable));\r\n TSpan.prototype.type = 'tspan';\n\n function parseXML(svg) {\r\n if (isString(svg)) {\r\n var parser = new DOMParser();\r\n svg = parser.parseFromString(svg, 'text/xml');\r\n }\r\n var svgNode = svg;\r\n if (svgNode.nodeType === 9) {\r\n svgNode = svgNode.firstChild;\r\n }\r\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\r\n svgNode = svgNode.nextSibling;\r\n }\r\n return svgNode;\r\n }\n\n var PI$2 = Math.PI;\r\n var PI2$5 = PI$2 * 2;\r\n var mathSin$3 = Math.sin;\r\n var mathCos$3 = Math.cos;\r\n var mathACos = Math.acos;\r\n var mathATan2 = Math.atan2;\r\n var mathAbs$1 = Math.abs;\r\n var mathSqrt$4 = Math.sqrt;\r\n var mathMax$3 = Math.max;\r\n var mathMin$3 = Math.min;\r\n var e = 1e-4;\r\n function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\r\n var x10 = x1 - x0;\r\n var y10 = y1 - y0;\r\n var x32 = x3 - x2;\r\n var y32 = y3 - y2;\r\n var t = y32 * x10 - x32 * y10;\r\n if (t * t < e) {\r\n return;\r\n }\r\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\r\n return [x0 + t * x10, y0 + t * y10];\r\n }\r\n function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\r\n var x01 = x0 - x1;\r\n var y01 = y0 - y1;\r\n var lo = (clockwise ? cr : -cr) / mathSqrt$4(x01 * x01 + y01 * y01);\r\n var ox = lo * y01;\r\n var oy = -lo * x01;\r\n var x11 = x0 + ox;\r\n var y11 = y0 + oy;\r\n var x10 = x1 + ox;\r\n var y10 = y1 + oy;\r\n var x00 = (x11 + x10) / 2;\r\n var y00 = (y11 + y10) / 2;\r\n var dx = x10 - x11;\r\n var dy = y10 - y11;\r\n var d2 = dx * dx + dy * dy;\r\n var r = radius - cr;\r\n var s = x11 * y10 - x10 * y11;\r\n var d = (dy < 0 ? -1 : 1) * mathSqrt$4(mathMax$3(0, r * r * d2 - s * s));\r\n var cx0 = (s * dy - dx * d) / d2;\r\n var cy0 = (-s * dx - dy * d) / d2;\r\n var cx1 = (s * dy + dx * d) / d2;\r\n var cy1 = (-s * dx + dy * d) / d2;\r\n var dx0 = cx0 - x00;\r\n var dy0 = cy0 - y00;\r\n var dx1 = cx1 - x00;\r\n var dy1 = cy1 - y00;\r\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\r\n cx0 = cx1;\r\n cy0 = cy1;\r\n }\r\n return {\r\n cx: cx0,\r\n cy: cy0,\r\n x01: -ox,\r\n y01: -oy,\r\n x11: cx0 * (radius / r - 1),\r\n y11: cy0 * (radius / r - 1)\r\n };\r\n }\r\n function buildPath$2(ctx, shape) {\r\n var radius = mathMax$3(shape.r, 0);\r\n var innerRadius = mathMax$3(shape.r0 || 0, 0);\r\n var hasRadius = radius > 0;\r\n var hasInnerRadius = innerRadius > 0;\r\n if (!hasRadius && !hasInnerRadius) {\r\n return;\r\n }\r\n if (!hasRadius) {\r\n radius = innerRadius;\r\n innerRadius = 0;\r\n }\r\n if (innerRadius > radius) {\r\n var tmp = radius;\r\n radius = innerRadius;\r\n innerRadius = tmp;\r\n }\r\n var clockwise = !!shape.clockwise;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var tmpAngles = [startAngle, endAngle];\r\n normalizeArcAngles(tmpAngles, !clockwise);\r\n var arc = mathAbs$1(tmpAngles[0] - tmpAngles[1]);\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var cornerRadius = shape.cornerRadius || 0;\r\n var innerCornerRadius = shape.innerCornerRadius || 0;\r\n if (!(radius > e)) {\r\n ctx.moveTo(x, y);\r\n }\r\n else if (arc > PI2$5 - e) {\r\n ctx.moveTo(x + radius * mathCos$3(startAngle), y + radius * mathSin$3(startAngle));\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n if (innerRadius > e) {\r\n ctx.moveTo(x + innerRadius * mathCos$3(endAngle), y + innerRadius * mathSin$3(endAngle));\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n else {\r\n var halfRd = mathAbs$1(radius - innerRadius) / 2;\r\n var cr = mathMin$3(halfRd, cornerRadius);\r\n var icr = mathMin$3(halfRd, innerCornerRadius);\r\n var cr0 = icr;\r\n var cr1 = cr;\r\n var xrs = radius * mathCos$3(startAngle);\r\n var yrs = radius * mathSin$3(startAngle);\r\n var xire = innerRadius * mathCos$3(endAngle);\r\n var yire = innerRadius * mathSin$3(endAngle);\r\n var xre = void 0;\r\n var yre = void 0;\r\n var xirs = void 0;\r\n var yirs = void 0;\r\n if (cr > e || icr > e) {\r\n xre = radius * mathCos$3(endAngle);\r\n yre = radius * mathSin$3(endAngle);\r\n xirs = innerRadius * mathCos$3(startAngle);\r\n yirs = innerRadius * mathSin$3(startAngle);\r\n if (arc < PI$2) {\r\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\r\n if (it_1) {\r\n var x0 = xrs - it_1[0];\r\n var y0 = yrs - it_1[1];\r\n var x1 = xre - it_1[0];\r\n var y1 = yre - it_1[1];\r\n var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$4(x0 * x0 + y0 * y0) * mathSqrt$4(x1 * x1 + y1 * y1))) / 2);\r\n var b = mathSqrt$4(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\r\n cr0 = mathMin$3(icr, (innerRadius - b) / (a - 1));\r\n cr1 = mathMin$3(cr, (radius - b) / (a + 1));\r\n }\r\n }\r\n }\r\n if (!(arc > e)) {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n }\r\n else if (cr1 > e) {\r\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, cr1, clockwise);\r\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, cr1, clockwise);\r\n ctx.moveTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr1 < cr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr1, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, radius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), !clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr1, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.moveTo(x + xrs, y + yrs);\r\n ctx.arc(x, y, radius, startAngle, endAngle, !clockwise);\r\n }\r\n if (!(innerRadius > e) || !(arc > e)) {\r\n ctx.lineTo(x + xire, y + yire);\r\n }\r\n else if (cr0 > e) {\r\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -cr0, clockwise);\r\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -cr0, clockwise);\r\n ctx.lineTo(x + ct0.cx + ct0.x01, y + ct0.cy + ct0.y01);\r\n if (cr0 < icr) {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n else {\r\n ctx.arc(x + ct0.cx, y + ct0.cy, cr0, mathATan2(ct0.y01, ct0.x01), mathATan2(ct0.y11, ct0.x11), !clockwise);\r\n ctx.arc(x, y, innerRadius, mathATan2(ct0.cy + ct0.y11, ct0.cx + ct0.x11), mathATan2(ct1.cy + ct1.y11, ct1.cx + ct1.x11), clockwise);\r\n ctx.arc(x + ct1.cx, y + ct1.cy, cr0, mathATan2(ct1.y11, ct1.x11), mathATan2(ct1.y01, ct1.x01), !clockwise);\r\n }\r\n }\r\n else {\r\n ctx.lineTo(x + xire, y + yire);\r\n ctx.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\r\n }\r\n }\r\n ctx.closePath();\r\n }\n\n var SectorShape = (function () {\r\n function SectorShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n }\r\n return SectorShape;\r\n }());\r\n var Sector = (function (_super) {\r\n __extends(Sector, _super);\r\n function Sector(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Sector.prototype.getDefaultShape = function () {\r\n return new SectorShape();\r\n };\r\n Sector.prototype.buildPath = function (ctx, shape) {\r\n buildPath$2(ctx, shape);\r\n };\r\n Sector.prototype.isZeroArea = function () {\r\n return this.shape.startAngle === this.shape.endAngle\r\n || this.shape.r === this.shape.r0;\r\n };\r\n return Sector;\r\n }(Path));\r\n Sector.prototype.type = 'sector';\n\n var CompoundPath = (function (_super) {\r\n __extends(CompoundPath, _super);\r\n function CompoundPath() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'compound';\r\n return _this;\r\n }\r\n CompoundPath.prototype._updatePathDirty = function () {\r\n var paths = this.shape.paths;\r\n var dirtyPath = this.shapeChanged();\r\n for (var i = 0; i < paths.length; i++) {\r\n dirtyPath = dirtyPath || paths[i].shapeChanged();\r\n }\r\n if (dirtyPath) {\r\n this.dirtyShape();\r\n }\r\n };\r\n CompoundPath.prototype.beforeBrush = function () {\r\n this._updatePathDirty();\r\n var paths = this.shape.paths || [];\r\n var scale = this.getGlobalScale();\r\n for (var i = 0; i < paths.length; i++) {\r\n if (!paths[i].path) {\r\n paths[i].createPathProxy();\r\n }\r\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\r\n }\r\n };\r\n CompoundPath.prototype.buildPath = function (ctx, shape) {\r\n var paths = shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].buildPath(ctx, paths[i].shape, true);\r\n }\r\n };\r\n CompoundPath.prototype.afterBrush = function () {\r\n var paths = this.shape.paths || [];\r\n for (var i = 0; i < paths.length; i++) {\r\n paths[i].pathUpdated();\r\n }\r\n };\r\n CompoundPath.prototype.getBoundingRect = function () {\r\n this._updatePathDirty.call(this);\r\n return Path.prototype.getBoundingRect.call(this);\r\n };\r\n return CompoundPath;\r\n }(Path));\n\n var m = [];\r\n var IncrementalDisplayble = (function (_super) {\r\n __extends(IncrementalDisplayble, _super);\r\n function IncrementalDisplayble() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayble.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayble.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayble.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayble.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayble.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayble.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayble.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayble.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayble.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayble.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayble;\r\n }(Displayable));\n\n var globalImageCache = new LRU(50);\r\n function findExistImage(newImageOrSrc) {\r\n if (typeof newImageOrSrc === 'string') {\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n return cachedImgObj && cachedImgObj.image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\r\n if (!newImageOrSrc) {\r\n return image;\r\n }\r\n else if (typeof newImageOrSrc === 'string') {\r\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\r\n return image;\r\n }\r\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\r\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\r\n if (cachedImgObj) {\r\n image = cachedImgObj.image;\r\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\r\n }\r\n else {\r\n image = new Image();\r\n image.onload = image.onerror = imageOnLoad;\r\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\r\n image: image,\r\n pending: [pendingWrap]\r\n });\r\n image.src = image.__zrImageSrc = newImageOrSrc;\r\n }\r\n return image;\r\n }\r\n else {\r\n return newImageOrSrc;\r\n }\r\n }\r\n function imageOnLoad() {\r\n var cachedImgObj = this.__cachedImgObj;\r\n this.onload = this.onerror = this.__cachedImgObj = null;\r\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\r\n var pendingWrap = cachedImgObj.pending[i];\r\n var cb = pendingWrap.cb;\r\n cb && cb(this, pendingWrap.cbPayload);\r\n pendingWrap.hostEl.dirty();\r\n }\r\n cachedImgObj.pending.length = 0;\r\n }\r\n function isImageReady(image) {\r\n return image && image.width && image.height;\r\n }\n\n var STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\r\n function truncateText(text, containerWidth, font, ellipsis, options) {\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var textLines = (text + '').split('\\n');\r\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\r\n for (var i = 0, len = textLines.length; i < len; i++) {\r\n textLines[i] = truncateSingleLine(textLines[i], options);\r\n }\r\n return textLines.join('\\n');\r\n }\r\n function prepareTruncateOptions(containerWidth, font, ellipsis, options) {\r\n options = options || {};\r\n var preparedOpts = extend({}, options);\r\n preparedOpts.font = font;\r\n ellipsis = retrieve2(ellipsis, '...');\r\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\r\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\r\n preparedOpts.cnCharWidth = getWidth('国', font);\r\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\r\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\r\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\r\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\r\n contentWidth -= ascCharWidth;\r\n }\r\n var ellipsisWidth = getWidth(ellipsis, font);\r\n if (ellipsisWidth > contentWidth) {\r\n ellipsis = '';\r\n ellipsisWidth = 0;\r\n }\r\n contentWidth = containerWidth - ellipsisWidth;\r\n preparedOpts.ellipsis = ellipsis;\r\n preparedOpts.ellipsisWidth = ellipsisWidth;\r\n preparedOpts.contentWidth = contentWidth;\r\n preparedOpts.containerWidth = containerWidth;\r\n return preparedOpts;\r\n }\r\n function truncateSingleLine(textLine, options) {\r\n var containerWidth = options.containerWidth;\r\n var font = options.font;\r\n var contentWidth = options.contentWidth;\r\n if (!containerWidth) {\r\n return '';\r\n }\r\n var lineWidth = getWidth(textLine, font);\r\n if (lineWidth <= containerWidth) {\r\n return textLine;\r\n }\r\n for (var j = 0;; j++) {\r\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\r\n textLine += options.ellipsis;\r\n break;\r\n }\r\n var subLength = j === 0\r\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\r\n : lineWidth > 0\r\n ? Math.floor(textLine.length * contentWidth / lineWidth)\r\n : 0;\r\n textLine = textLine.substr(0, subLength);\r\n lineWidth = getWidth(textLine, font);\r\n }\r\n if (textLine === '') {\r\n textLine = options.placeholder;\r\n }\r\n return textLine;\r\n }\r\n function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\r\n var width = 0;\r\n var i = 0;\r\n for (var len = text.length; i < len && width < contentWidth; i++) {\r\n var charCode = text.charCodeAt(i);\r\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\r\n }\r\n return i;\r\n }\r\n function parsePlainText(text, style) {\r\n text != null && (text += '');\r\n var overflow = style.overflow;\r\n var padding = style.padding;\r\n var font = style.font;\r\n var truncate = overflow === 'truncate';\r\n var calculatedLineHeight = getLineHeight(font);\r\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\r\n var truncateLineOverflow = style.lineOverflow === 'truncate';\r\n var width = style.width;\r\n var lines;\r\n if (width != null && overflow === 'break' || overflow === 'breakAll') {\r\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\r\n }\r\n else {\r\n lines = text ? text.split('\\n') : [];\r\n }\r\n var contentHeight = lines.length * lineHeight;\r\n var height = retrieve2(style.height, contentHeight);\r\n if (contentHeight > height && truncateLineOverflow) {\r\n var lineCount = Math.floor(height / lineHeight);\r\n lines = lines.slice(0, lineCount);\r\n }\r\n var outerHeight = height;\r\n var outerWidth = width;\r\n if (padding) {\r\n outerHeight += padding[0] + padding[2];\r\n if (outerWidth != null) {\r\n outerWidth += padding[1] + padding[3];\r\n }\r\n }\r\n if (text && truncate && outerWidth != null) {\r\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\r\n minChar: style.truncateMinChar,\r\n placeholder: style.placeholder\r\n });\r\n for (var i = 0; i < lines.length; i++) {\r\n lines[i] = truncateSingleLine(lines[i], options);\r\n }\r\n }\r\n if (width == null) {\r\n var maxWidth = 0;\r\n for (var i = 0; i < lines.length; i++) {\r\n maxWidth = Math.max(getWidth(lines[i], font), maxWidth);\r\n }\r\n width = maxWidth;\r\n }\r\n return {\r\n lines: lines,\r\n height: height,\r\n outerHeight: outerHeight,\r\n lineHeight: lineHeight,\r\n calculatedLineHeight: calculatedLineHeight,\r\n contentHeight: contentHeight,\r\n width: width\r\n };\r\n }\r\n var RichTextToken = (function () {\r\n function RichTextToken() {\r\n }\r\n return RichTextToken;\r\n }());\r\n var RichTextLine = (function () {\r\n function RichTextLine(tokens) {\r\n this.tokens = [];\r\n if (tokens) {\r\n this.tokens = tokens;\r\n }\r\n }\r\n return RichTextLine;\r\n }());\r\n var RichTextContentBlock = (function () {\r\n function RichTextContentBlock() {\r\n this.width = 0;\r\n this.height = 0;\r\n this.contentWidth = 0;\r\n this.contentHeight = 0;\r\n this.outerWidth = 0;\r\n this.outerHeight = 0;\r\n this.lines = [];\r\n }\r\n return RichTextContentBlock;\r\n }());\r\n function parseRichText(text, style) {\r\n var contentBlock = new RichTextContentBlock();\r\n text != null && (text += '');\r\n if (!text) {\r\n return contentBlock;\r\n }\r\n var topWidth = style.width;\r\n var topHeight = style.height;\r\n var overflow = style.overflow;\r\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\r\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\r\n : null;\r\n var lastIndex = STYLE_REG.lastIndex = 0;\r\n var result;\r\n while ((result = STYLE_REG.exec(text)) != null) {\r\n var matchedIndex = result.index;\r\n if (matchedIndex > lastIndex) {\r\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\r\n }\r\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\r\n lastIndex = STYLE_REG.lastIndex;\r\n }\r\n if (lastIndex < text.length) {\r\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\r\n }\r\n var pendingList = [];\r\n var calculatedHeight = 0;\r\n var calculatedWidth = 0;\r\n var stlPadding = style.padding;\r\n var truncate = overflow === 'truncate';\r\n var truncateLine = style.lineOverflow === 'truncate';\r\n function finishLine(line, lineWidth, lineHeight) {\r\n line.width = lineWidth;\r\n line.lineHeight = lineHeight;\r\n calculatedHeight += lineHeight;\r\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\r\n }\r\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var lineHeight = 0;\r\n var lineWidth = 0;\r\n for (var j = 0; j < line.tokens.length; j++) {\r\n var token = line.tokens[j];\r\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\r\n var textPadding = token.textPadding = tokenStyle.padding;\r\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\r\n var font = token.font = tokenStyle.font || style.font;\r\n token.contentHeight = getLineHeight(font);\r\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\r\n token.innerHeight = tokenHeight;\r\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\r\n token.height = tokenHeight;\r\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\r\n token.align = tokenStyle && tokenStyle.align || style.align;\r\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\r\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\r\n if (j > 0) {\r\n line.tokens = line.tokens.slice(0, j);\r\n finishLine(line, lineWidth, lineHeight);\r\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\r\n }\r\n else {\r\n contentBlock.lines = contentBlock.lines.slice(0, i);\r\n }\r\n break outer;\r\n }\r\n var styleTokenWidth = tokenStyle.width;\r\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\r\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\r\n token.percentWidth = styleTokenWidth;\r\n pendingList.push(token);\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n else {\r\n if (tokenWidthNotSpecified) {\r\n var textBackgroundColor = tokenStyle.backgroundColor;\r\n var bgImg = textBackgroundColor && textBackgroundColor.image;\r\n if (bgImg) {\r\n bgImg = findExistImage(bgImg);\r\n if (isImageReady(bgImg)) {\r\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\r\n }\r\n }\r\n }\r\n var remainTruncWidth = truncate && topWidth != null\r\n ? topWidth - lineWidth : null;\r\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\r\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\r\n token.text = '';\r\n token.width = token.contentWidth = 0;\r\n }\r\n else {\r\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\r\n token.width = token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n else {\r\n token.contentWidth = getWidth(token.text, font);\r\n }\r\n }\r\n token.width += paddingH;\r\n lineWidth += token.width;\r\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\r\n }\r\n finishLine(line, lineWidth, lineHeight);\r\n }\r\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\r\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\r\n contentBlock.contentHeight = calculatedHeight;\r\n contentBlock.contentWidth = calculatedWidth;\r\n if (stlPadding) {\r\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\r\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\r\n }\r\n for (var i = 0; i < pendingList.length; i++) {\r\n var token = pendingList[i];\r\n var percentWidth = token.percentWidth;\r\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\r\n }\r\n return contentBlock;\r\n }\r\n function pushTokens(block, str, style, wrapInfo, styleName) {\r\n var isEmptyStr = str === '';\r\n var tokenStyle = styleName && style.rich[styleName] || {};\r\n var lines = block.lines;\r\n var font = tokenStyle.font || style.font;\r\n var newLine = false;\r\n var strLines;\r\n var linesWidths;\r\n if (wrapInfo) {\r\n var tokenPadding = tokenStyle.padding;\r\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\r\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\r\n var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\r\n if (lines.length > 0) {\r\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\r\n strLines = str.split('\\n');\r\n newLine = true;\r\n }\r\n }\r\n wrapInfo.accumWidth = outerWidth_1;\r\n }\r\n else {\r\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\r\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\r\n linesWidths = res.linesWidths;\r\n strLines = res.lines;\r\n }\r\n }\r\n else {\r\n strLines = str.split('\\n');\r\n }\r\n for (var i = 0; i < strLines.length; i++) {\r\n var text = strLines[i];\r\n var token = new RichTextToken();\r\n token.styleName = styleName;\r\n token.text = text;\r\n token.isLineHolder = !text && !isEmptyStr;\r\n if (typeof tokenStyle.width === 'number') {\r\n token.width = tokenStyle.width;\r\n }\r\n else {\r\n token.width = linesWidths\r\n ? linesWidths[i]\r\n : getWidth(text, font);\r\n }\r\n if (!i && !newLine) {\r\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\r\n var tokensLen = tokens.length;\r\n (tokensLen === 1 && tokens[0].isLineHolder)\r\n ? (tokens[0] = token)\r\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\r\n }\r\n else {\r\n lines.push(new RichTextLine([token]));\r\n }\r\n }\r\n }\r\n function isLatin(ch) {\r\n var code = ch.charCodeAt(0);\r\n return code >= 0x21 && code <= 0xFF;\r\n }\r\n var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\r\n obj[ch] = true;\r\n return obj;\r\n }, {});\r\n function isWordBreakChar(ch) {\r\n if (isLatin(ch)) {\r\n if (breakCharMap[ch]) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\r\n var lines = [];\r\n var linesWidths = [];\r\n var line = '';\r\n var currentWord = '';\r\n var currentWordWidth = 0;\r\n var accumWidth = 0;\r\n for (var i = 0; i < text.length; i++) {\r\n var ch = text.charAt(i);\r\n if (ch === '\\n') {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = '';\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = 0;\r\n continue;\r\n }\r\n var chWidth = getWidth(ch, font);\r\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\r\n if (!lines.length\r\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\r\n : accumWidth + chWidth > lineWidth) {\r\n if (!accumWidth) {\r\n if (inWord) {\r\n lines.push(currentWord);\r\n linesWidths.push(currentWordWidth);\r\n currentWord = ch;\r\n currentWordWidth = chWidth;\r\n }\r\n else {\r\n lines.push(ch);\r\n linesWidths.push(chWidth);\r\n }\r\n }\r\n else if (line || currentWord) {\r\n if (inWord) {\r\n if (!line) {\r\n line = currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n accumWidth = currentWordWidth;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth - currentWordWidth);\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n line = '';\r\n accumWidth = currentWordWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n accumWidth += currentWordWidth;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n line = ch;\r\n accumWidth = chWidth;\r\n }\r\n }\r\n continue;\r\n }\r\n accumWidth += chWidth;\r\n if (inWord) {\r\n currentWord += ch;\r\n currentWordWidth += chWidth;\r\n }\r\n else {\r\n if (currentWord) {\r\n line += currentWord;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n line += ch;\r\n }\r\n }\r\n if (!lines.length && !line) {\r\n line = text;\r\n currentWord = '';\r\n currentWordWidth = 0;\r\n }\r\n if (currentWord) {\r\n line += currentWord;\r\n }\r\n if (line) {\r\n lines.push(line);\r\n linesWidths.push(accumWidth);\r\n }\r\n if (lines.length === 1) {\r\n accumWidth += lastAccumWidth;\r\n }\r\n return {\r\n accumWidth: accumWidth,\r\n lines: lines,\r\n linesWidths: linesWidths\r\n };\r\n }\r\n function parsePercent$1(value, maxValue) {\r\n if (typeof value === 'string') {\r\n if (value.lastIndexOf('%') >= 0) {\r\n return parseFloat(value) / 100 * maxValue;\r\n }\r\n return parseFloat(value);\r\n }\r\n return value;\r\n }\n\n var DEFAULT_RICH_TEXT_COLOR = {\r\n fill: '#000'\r\n };\r\n var DEFAULT_STROKE_LINE_WIDTH = 2;\r\n var DEFAULT_TEXT_ANIMATION_PROPS = {\r\n style: defaults({\r\n fill: true,\r\n stroke: true,\r\n fillOpacity: true,\r\n strokeOpacity: true,\r\n lineWidth: true,\r\n fontSize: true,\r\n lineHeight: true,\r\n width: true,\r\n height: true,\r\n textShadowColor: true,\r\n textShadowBlur: true,\r\n textShadowOffsetX: true,\r\n textShadowOffsetY: true,\r\n backgroundColor: true,\r\n padding: true,\r\n borderColor: true,\r\n borderWidth: true,\r\n borderRadius: true\r\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\r\n };\r\n var ZRText = (function (_super) {\r\n __extends(ZRText, _super);\r\n function ZRText(opts) {\r\n var _this = _super.call(this) || this;\r\n _this.type = 'text';\r\n _this._children = [];\r\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\r\n _this.attr(opts);\r\n return _this;\r\n }\r\n ZRText.prototype.childrenRef = function () {\r\n return this._children;\r\n };\r\n ZRText.prototype.update = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n for (var i = 0; i < this._children.length; i++) {\r\n var child = this._children[i];\r\n child.zlevel = this.zlevel;\r\n child.z = this.z;\r\n child.z2 = this.z2;\r\n child.culling = this.culling;\r\n child.cursor = this.cursor;\r\n child.invisible = this.invisible;\r\n }\r\n var attachedTransform = this.attachedTransform;\r\n if (attachedTransform) {\r\n attachedTransform.updateTransform();\r\n var m = attachedTransform.transform;\r\n if (m) {\r\n this.transform = this.transform || [];\r\n copy(this.transform, m);\r\n }\r\n else {\r\n this.transform = null;\r\n }\r\n }\r\n else {\r\n _super.prototype.update.call(this);\r\n }\r\n };\r\n ZRText.prototype.getComputedTransform = function () {\r\n if (this.__hostTarget) {\r\n this.__hostTarget.getComputedTransform();\r\n this.__hostTarget.updateInnerText(true);\r\n }\r\n return this.attachedTransform ? this.attachedTransform.getComputedTransform()\r\n : _super.prototype.getComputedTransform.call(this);\r\n };\r\n ZRText.prototype._updateSubTexts = function () {\r\n this._childCursor = 0;\r\n normalizeTextStyle(this.style);\r\n this.style.rich\r\n ? this._updateRichTexts()\r\n : this._updatePlainTexts();\r\n this._children.length = this._childCursor;\r\n this.styleUpdated();\r\n };\r\n ZRText.prototype.addSelfToZr = function (zr) {\r\n _super.prototype.addSelfToZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = zr;\r\n }\r\n };\r\n ZRText.prototype.removeSelfFromZr = function (zr) {\r\n _super.prototype.removeSelfFromZr.call(this, zr);\r\n for (var i = 0; i < this._children.length; i++) {\r\n this._children[i].__zr = null;\r\n }\r\n };\r\n ZRText.prototype.getBoundingRect = function () {\r\n if (this.styleChanged()) {\r\n this._updateSubTexts();\r\n }\r\n if (!this._rect) {\r\n var tmpRect = new BoundingRect(0, 0, 0, 0);\r\n var children = this._children;\r\n var tmpMat = [];\r\n var rect = null;\r\n for (var i = 0; i < children.length; i++) {\r\n var child = children[i];\r\n var childRect = child.getBoundingRect();\r\n var transform = child.getLocalTransform(tmpMat);\r\n if (transform) {\r\n tmpRect.copy(childRect);\r\n tmpRect.applyTransform(transform);\r\n rect = rect || tmpRect.clone();\r\n rect.union(tmpRect);\r\n }\r\n else {\r\n rect = rect || childRect.clone();\r\n rect.union(childRect);\r\n }\r\n }\r\n this._rect = rect || tmpRect;\r\n }\r\n return this._rect;\r\n };\r\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\r\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\r\n };\r\n ZRText.prototype.setTextContent = function (textContent) {\r\n throw new Error('Can\\'t attach text on another text');\r\n };\r\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\r\n if (!sourceStyle) {\r\n return targetStyle;\r\n }\r\n var sourceRich = sourceStyle.rich;\r\n var targetRich = targetStyle.rich || (sourceRich && {});\r\n extend(targetStyle, sourceStyle);\r\n if (sourceRich && targetRich) {\r\n this._mergeRich(targetRich, sourceRich);\r\n targetStyle.rich = targetRich;\r\n }\r\n else if (targetRich) {\r\n targetStyle.rich = targetRich;\r\n }\r\n return targetStyle;\r\n };\r\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\r\n var richNames = keys(sourceRich);\r\n for (var i = 0; i < richNames.length; i++) {\r\n var richName = richNames[i];\r\n targetRich[richName] = targetRich[richName] || {};\r\n extend(targetRich[richName], sourceRich[richName]);\r\n }\r\n };\r\n ZRText.prototype.getAnimationStyleProps = function () {\r\n return DEFAULT_TEXT_ANIMATION_PROPS;\r\n };\r\n ZRText.prototype._getOrCreateChild = function (Ctor) {\r\n var child = this._children[this._childCursor];\r\n if (!child || !(child instanceof Ctor)) {\r\n child = new Ctor();\r\n }\r\n this._children[this._childCursor++] = child;\r\n child.__zr = this.__zr;\r\n child.parent = this;\r\n return child;\r\n };\r\n ZRText.prototype._updatePlainTexts = function () {\r\n var style = this.style;\r\n var textFont = style.font || DEFAULT_FONT;\r\n var textPadding = style.padding;\r\n var text = getStyleText(style);\r\n var contentBlock = parsePlainText(text, style);\r\n var needDrawBg = needDrawBackground(style);\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n var outerHeight = contentBlock.outerHeight;\r\n var textLines = contentBlock.lines;\r\n var lineHeight = contentBlock.lineHeight;\r\n var defaultStyle = this._defaultStyle;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var textAlign = style.align || defaultStyle.align || 'left';\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\r\n var textX = baseX;\r\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\r\n if (needDrawBg || textPadding) {\r\n var outerWidth_1 = contentBlock.width;\r\n textPadding && (outerWidth_1 += textPadding[1] + textPadding[3]);\r\n var boxX = adjustTextX(baseX, outerWidth_1, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth_1, outerHeight);\r\n }\r\n textY += lineHeight / 2;\r\n if (textPadding) {\r\n textX = getTextXForPadding(baseX, textAlign, textPadding);\r\n if (verticalAlign === 'top') {\r\n textY += textPadding[0];\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n textY -= textPadding[2];\r\n }\r\n }\r\n var defaultLineWidth = 0;\r\n var useDefaultFill = false;\r\n var textFill = getFill('fill' in style\r\n ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in style\r\n ? style.stroke\r\n : (!bgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill))\r\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = style.textShadowBlur > 0;\r\n var fixedBoundingRect = style.width != null\r\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\r\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\r\n for (var i = 0; i < textLines.length; i++) {\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n subElStyle.text = textLines[i];\r\n subElStyle.x = textX;\r\n subElStyle.y = textY;\r\n if (textAlign) {\r\n subElStyle.textAlign = textAlign;\r\n }\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.opacity = style.opacity;\r\n subElStyle.strokeFirst = true;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = style.textShadowBlur || 0;\r\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\r\n }\r\n if (textStroke) {\r\n subElStyle.stroke = textStroke;\r\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\r\n subElStyle.lineDash = style.lineDash;\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n subElStyle.font = textFont;\r\n textY += lineHeight;\r\n if (fixedBoundingRect) {\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), style.width, calculatedLineHeight));\r\n }\r\n }\r\n };\r\n ZRText.prototype._updateRichTexts = function () {\r\n var style = this.style;\r\n var text = getStyleText(style);\r\n var contentBlock = parseRichText(text, style);\r\n var contentWidth = contentBlock.width;\r\n var outerWidth = contentBlock.outerWidth;\r\n var outerHeight = contentBlock.outerHeight;\r\n var textPadding = style.padding;\r\n var baseX = style.x || 0;\r\n var baseY = style.y || 0;\r\n var defaultStyle = this._defaultStyle;\r\n var textAlign = style.align || defaultStyle.align;\r\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\r\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\r\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\r\n var xLeft = boxX;\r\n var lineTop = boxY;\r\n if (textPadding) {\r\n xLeft += textPadding[3];\r\n lineTop += textPadding[0];\r\n }\r\n var xRight = xLeft + contentWidth;\r\n if (needDrawBackground(style)) {\r\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\r\n }\r\n var bgColorDrawn = !!(style.backgroundColor);\r\n for (var i = 0; i < contentBlock.lines.length; i++) {\r\n var line = contentBlock.lines[i];\r\n var tokens = line.tokens;\r\n var tokenCount = tokens.length;\r\n var lineHeight = line.lineHeight;\r\n var remainedWidth = line.width;\r\n var leftIndex = 0;\r\n var lineXLeft = xLeft;\r\n var lineXRight = xRight;\r\n var rightIndex = tokenCount - 1;\r\n var token = void 0;\r\n while (leftIndex < tokenCount\r\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n while (rightIndex >= 0\r\n && (token = tokens[rightIndex], token.align === 'right')) {\r\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\r\n remainedWidth -= token.width;\r\n lineXRight -= token.width;\r\n rightIndex--;\r\n }\r\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\r\n while (leftIndex <= rightIndex) {\r\n token = tokens[leftIndex];\r\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\r\n lineXLeft += token.width;\r\n leftIndex++;\r\n }\r\n lineTop += lineHeight;\r\n }\r\n };\r\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\r\n var tokenStyle = style.rich[token.styleName] || {};\r\n tokenStyle.text = token.text;\r\n var verticalAlign = token.verticalAlign;\r\n var y = lineTop + lineHeight / 2;\r\n if (verticalAlign === 'top') {\r\n y = lineTop + token.height / 2;\r\n }\r\n else if (verticalAlign === 'bottom') {\r\n y = lineTop + lineHeight - token.height / 2;\r\n }\r\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\r\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\r\n ? x - token.width\r\n : textAlign === 'center'\r\n ? x - token.width / 2\r\n : x, y - token.height / 2, token.width, token.height);\r\n var bgColorDrawn = !!tokenStyle.backgroundColor;\r\n var textPadding = token.textPadding;\r\n if (textPadding) {\r\n x = getTextXForPadding(x, textAlign, textPadding);\r\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\r\n }\r\n var el = this._getOrCreateChild(TSpan);\r\n var subElStyle = el.createStyle();\r\n el.useStyle(subElStyle);\r\n var defaultStyle = this._defaultStyle;\r\n var useDefaultFill = false;\r\n var defaultLineWidth = 0;\r\n var textFill = getStroke('fill' in tokenStyle ? tokenStyle.fill\r\n : 'fill' in style ? style.fill\r\n : (useDefaultFill = true, defaultStyle.fill));\r\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\r\n : 'stroke' in style ? style.stroke\r\n : (!bgColorDrawn\r\n && !parentBgColorDrawn\r\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\r\n : null);\r\n var hasShadow = tokenStyle.textShadowBlur > 0\r\n || style.textShadowBlur > 0;\r\n subElStyle.text = token.text;\r\n subElStyle.x = x;\r\n subElStyle.y = y;\r\n if (hasShadow) {\r\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\r\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\r\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\r\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\r\n }\r\n subElStyle.textAlign = textAlign;\r\n subElStyle.textBaseline = 'middle';\r\n subElStyle.font = token.font || DEFAULT_FONT;\r\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\r\n if (textStroke) {\r\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\r\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\r\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\r\n subElStyle.stroke = textStroke;\r\n }\r\n if (textFill) {\r\n subElStyle.fill = textFill;\r\n }\r\n var textWidth = token.contentWidth;\r\n var textHeight = token.contentHeight;\r\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\r\n };\r\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\r\n var textBackgroundColor = style.backgroundColor;\r\n var textBorderWidth = style.borderWidth;\r\n var textBorderColor = style.borderColor;\r\n var isPlainBg = isString(textBackgroundColor);\r\n var textBorderRadius = style.borderRadius;\r\n var self = this;\r\n var rectEl;\r\n var imgEl;\r\n if (isPlainBg || (textBorderWidth && textBorderColor)) {\r\n rectEl = this._getOrCreateChild(Rect);\r\n rectEl.useStyle(rectEl.createStyle());\r\n rectEl.style.fill = null;\r\n var rectShape = rectEl.shape;\r\n rectShape.x = x;\r\n rectShape.y = y;\r\n rectShape.width = width;\r\n rectShape.height = height;\r\n rectShape.r = textBorderRadius;\r\n rectEl.dirtyShape();\r\n }\r\n if (isPlainBg) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.fill = textBackgroundColor || null;\r\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\r\n }\r\n else if (textBackgroundColor && textBackgroundColor.image) {\r\n imgEl = this._getOrCreateChild(ZRImage);\r\n imgEl.onload = function () {\r\n self.dirtyStyle();\r\n };\r\n var imgStyle = imgEl.style;\r\n imgStyle.image = textBackgroundColor.image;\r\n imgStyle.x = x;\r\n imgStyle.y = y;\r\n imgStyle.width = width;\r\n imgStyle.height = height;\r\n }\r\n if (textBorderWidth && textBorderColor) {\r\n var rectStyle = rectEl.style;\r\n rectStyle.lineWidth = textBorderWidth;\r\n rectStyle.stroke = textBorderColor;\r\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\r\n rectStyle.lineDash = style.borderDash;\r\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\r\n rectEl.strokeContainThreshold = 0;\r\n if (rectEl.hasFill() && rectEl.hasStroke()) {\r\n rectStyle.strokeFirst = true;\r\n rectStyle.lineWidth *= 2;\r\n }\r\n }\r\n var commonStyle = (rectEl || imgEl).style;\r\n commonStyle.shadowBlur = style.shadowBlur || 0;\r\n commonStyle.shadowColor = style.shadowColor || 'transparent';\r\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\r\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\r\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\r\n };\r\n ZRText.makeFont = function (style) {\r\n var font = '';\r\n if (style.fontSize || style.fontFamily || style.fontWeight) {\r\n var fontSize = '';\r\n if (typeof style.fontSize === 'string'\r\n && (style.fontSize.indexOf('px') !== -1\r\n || style.fontSize.indexOf('rem') !== -1\r\n || style.fontSize.indexOf('em') !== -1)) {\r\n fontSize = style.fontSize;\r\n }\r\n else if (!isNaN(+style.fontSize)) {\r\n fontSize = style.fontSize + 'px';\r\n }\r\n else {\r\n fontSize = '12px';\r\n }\r\n font = [\r\n style.fontStyle,\r\n style.fontWeight,\r\n fontSize,\r\n style.fontFamily || 'sans-serif'\r\n ].join(' ');\r\n }\r\n return font && trim(font) || style.textFont || style.font;\r\n };\r\n return ZRText;\r\n }(Displayable));\r\n var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\r\n var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\r\n function normalizeTextStyle(style) {\r\n normalizeStyle(style);\r\n each(style.rich, normalizeStyle);\r\n return style;\r\n }\r\n function normalizeStyle(style) {\r\n if (style) {\r\n style.font = ZRText.makeFont(style);\r\n var textAlign = style.align;\r\n textAlign === 'middle' && (textAlign = 'center');\r\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\r\n var verticalAlign = style.verticalAlign;\r\n verticalAlign === 'center' && (verticalAlign = 'middle');\r\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\r\n var textPadding = style.padding;\r\n if (textPadding) {\r\n style.padding = normalizeCssArray(style.padding);\r\n }\r\n }\r\n }\r\n function getStroke(stroke, lineWidth) {\r\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\r\n ? null\r\n : (stroke.image || stroke.colorStops)\r\n ? '#000'\r\n : stroke;\r\n }\r\n function getFill(fill) {\r\n return (fill == null || fill === 'none')\r\n ? null\r\n : (fill.image || fill.colorStops)\r\n ? '#000'\r\n : fill;\r\n }\r\n function getTextXForPadding(x, textAlign, textPadding) {\r\n return textAlign === 'right'\r\n ? (x - textPadding[1])\r\n : textAlign === 'center'\r\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\r\n : (x + textPadding[3]);\r\n }\r\n function getStyleText(style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n return text;\r\n }\r\n function needDrawBackground(style) {\r\n return !!(style.backgroundColor\r\n || (style.borderWidth && style.borderColor));\r\n }\n\n var ArcShape = (function () {\r\n function ArcShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return ArcShape;\r\n }());\r\n var Arc = (function (_super) {\r\n __extends(Arc, _super);\r\n function Arc(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Arc.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Arc.prototype.getDefaultShape = function () {\r\n return new ArcShape();\r\n };\r\n Arc.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = Math.max(shape.r, 0);\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitX = Math.cos(startAngle);\r\n var unitY = Math.sin(startAngle);\r\n ctx.moveTo(unitX * r + x, unitY * r + y);\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n };\r\n return Arc;\r\n }(Path));\r\n Arc.prototype.type = 'arc';\n\n var out = [];\r\n var BezierCurveShape = (function () {\r\n function BezierCurveShape() {\r\n this.x1 = 0;\r\n this.y1 = 0;\r\n this.x2 = 0;\r\n this.y2 = 0;\r\n this.cpx1 = 0;\r\n this.cpy1 = 0;\r\n this.percent = 1;\r\n }\r\n return BezierCurveShape;\r\n }());\r\n function someVectorAt(shape, t, isTangent) {\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n if (cpx2 === null || cpy2 === null) {\r\n return [\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\r\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\r\n ];\r\n }\r\n else {\r\n return [\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\r\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\r\n ];\r\n }\r\n }\r\n var BezierCurve = (function (_super) {\r\n __extends(BezierCurve, _super);\r\n function BezierCurve(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n BezierCurve.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n BezierCurve.prototype.getDefaultShape = function () {\r\n return new BezierCurveShape();\r\n };\r\n BezierCurve.prototype.buildPath = function (ctx, shape) {\r\n var x1 = shape.x1;\r\n var y1 = shape.y1;\r\n var x2 = shape.x2;\r\n var y2 = shape.y2;\r\n var cpx1 = shape.cpx1;\r\n var cpy1 = shape.cpy1;\r\n var cpx2 = shape.cpx2;\r\n var cpy2 = shape.cpy2;\r\n var percent = shape.percent;\r\n if (percent === 0) {\r\n return;\r\n }\r\n ctx.moveTo(x1, y1);\r\n if (cpx2 == null || cpy2 == null) {\r\n if (percent < 1) {\r\n quadraticSubdivide(x1, cpx1, x2, percent, out);\r\n cpx1 = out[1];\r\n x2 = out[2];\r\n quadraticSubdivide(y1, cpy1, y2, percent, out);\r\n cpy1 = out[1];\r\n y2 = out[2];\r\n }\r\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\r\n }\r\n else {\r\n if (percent < 1) {\r\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\r\n cpx1 = out[1];\r\n cpx2 = out[2];\r\n x2 = out[3];\r\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\r\n cpy1 = out[1];\r\n cpy2 = out[2];\r\n y2 = out[3];\r\n }\r\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\r\n }\r\n };\r\n BezierCurve.prototype.pointAt = function (t) {\r\n return someVectorAt(this.shape, t, false);\r\n };\r\n BezierCurve.prototype.tangentAt = function (t) {\r\n var p = someVectorAt(this.shape, t, true);\r\n return normalize(p, p);\r\n };\r\n return BezierCurve;\r\n }(Path));\r\n BezierCurve.prototype.type = 'bezier-curve';\n\n var DropletShape = (function () {\r\n function DropletShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return DropletShape;\r\n }());\r\n var Droplet = (function (_super) {\r\n __extends(Droplet, _super);\r\n function Droplet(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Droplet.prototype.getDefaultShape = function () {\r\n return new DropletShape();\r\n };\r\n Droplet.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y + a);\r\n ctx.bezierCurveTo(x + a, y + a, x + a * 3 / 2, y - a / 3, x, y - b);\r\n ctx.bezierCurveTo(x - a * 3 / 2, y - a / 3, x - a, y + a, x, y + a);\r\n ctx.closePath();\r\n };\r\n return Droplet;\r\n }(Path));\r\n Droplet.prototype.type = 'droplet';\n\n var HeartShape = (function () {\r\n function HeartShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n return HeartShape;\r\n }());\r\n var Heart = (function (_super) {\r\n __extends(Heart, _super);\r\n function Heart(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Heart.prototype.getDefaultShape = function () {\r\n return new HeartShape();\r\n };\r\n Heart.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var a = shape.width;\r\n var b = shape.height;\r\n ctx.moveTo(x, y);\r\n ctx.bezierCurveTo(x + a / 2, y - b * 2 / 3, x + a * 2, y + b / 3, x, y + b);\r\n ctx.bezierCurveTo(x - a * 2, y + b / 3, x - a / 2, y - b * 2 / 3, x, y);\r\n };\r\n return Heart;\r\n }(Path));\r\n Heart.prototype.type = 'heart';\n\n var PI$3 = Math.PI;\r\n var sin = Math.sin;\r\n var cos = Math.cos;\r\n var IsogonShape = (function () {\r\n function IsogonShape() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.r = 0;\r\n this.n = 0;\r\n }\r\n return IsogonShape;\r\n }());\r\n var Isogon = (function (_super) {\r\n __extends(Isogon, _super);\r\n function Isogon(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Isogon.prototype.getDefaultShape = function () {\r\n return new IsogonShape();\r\n };\r\n Isogon.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.x;\r\n var y = shape.y;\r\n var r = shape.r;\r\n var dStep = 2 * PI$3 / n;\r\n var deg = -PI$3 / 2;\r\n ctx.moveTo(x + r * cos(deg), y + r * sin(deg));\r\n for (var i = 0, end = n - 1; i < end; i++) {\r\n deg += dStep;\r\n ctx.lineTo(x + r * cos(deg), y + r * sin(deg));\r\n }\r\n ctx.closePath();\r\n return;\r\n };\r\n return Isogon;\r\n }(Path));\r\n Isogon.prototype.type = 'isogon';\n\n var RingShape = (function () {\r\n function RingShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n }\r\n return RingShape;\r\n }());\r\n var Ring = (function (_super) {\r\n __extends(Ring, _super);\r\n function Ring(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Ring.prototype.getDefaultShape = function () {\r\n return new RingShape();\r\n };\r\n Ring.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var PI2 = Math.PI * 2;\r\n ctx.moveTo(x + shape.r, y);\r\n ctx.arc(x, y, shape.r, 0, PI2, false);\r\n ctx.moveTo(x + shape.r0, y);\r\n ctx.arc(x, y, shape.r0, 0, PI2, true);\r\n };\r\n return Ring;\r\n }(Path));\r\n Ring.prototype.type = 'ring';\n\n var sin$1 = Math.sin;\r\n var cos$1 = Math.cos;\r\n var radian = Math.PI / 180;\r\n var RoseShape = (function () {\r\n function RoseShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = [];\r\n this.k = 0;\r\n this.n = 1;\r\n }\r\n return RoseShape;\r\n }());\r\n var Rose = (function (_super) {\r\n __extends(Rose, _super);\r\n function Rose(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Rose.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Rose.prototype.getDefaultShape = function () {\r\n return new RoseShape();\r\n };\r\n Rose.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var k = shape.k;\r\n var n = shape.n;\r\n var x0 = shape.cx;\r\n var y0 = shape.cy;\r\n var x;\r\n var y;\r\n var r;\r\n ctx.moveTo(x0, y0);\r\n for (var i = 0, len = R.length; i < len; i++) {\r\n r = R[i];\r\n for (var j = 0; j <= 360 * n; j++) {\r\n x = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * cos$1(j * radian)\r\n + x0;\r\n y = r\r\n * sin$1(k / n * j % 360 * radian)\r\n * sin$1(j * radian)\r\n + y0;\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n };\r\n return Rose;\r\n }(Path));\r\n Rose.prototype.type = 'rose';\n\n var PI$4 = Math.PI;\r\n var cos$2 = Math.cos;\r\n var sin$2 = Math.sin;\r\n var StarShape = (function () {\r\n function StarShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.n = 3;\r\n this.r = 0;\r\n }\r\n return StarShape;\r\n }());\r\n var Star = (function (_super) {\r\n __extends(Star, _super);\r\n function Star(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Star.prototype.getDefaultShape = function () {\r\n return new StarShape();\r\n };\r\n Star.prototype.buildPath = function (ctx, shape) {\r\n var n = shape.n;\r\n if (!n || n < 2) {\r\n return;\r\n }\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r = shape.r;\r\n var r0 = shape.r0;\r\n if (r0 == null) {\r\n r0 = n > 4\r\n ? r * cos$2(2 * PI$4 / n) / cos$2(PI$4 / n)\r\n : r / 3;\r\n }\r\n var dStep = PI$4 / n;\r\n var deg = -PI$4 / 2;\r\n var xStart = x + r * cos$2(deg);\r\n var yStart = y + r * sin$2(deg);\r\n deg += dStep;\r\n ctx.moveTo(xStart, yStart);\r\n for (var i = 0, end = n * 2 - 1, ri = void 0; i < end; i++) {\r\n ri = i % 2 === 0 ? r0 : r;\r\n ctx.lineTo(x + ri * cos$2(deg), y + ri * sin$2(deg));\r\n deg += dStep;\r\n }\r\n ctx.closePath();\r\n };\r\n return Star;\r\n }(Path));\r\n Star.prototype.type = 'star';\n\n var cos$3 = Math.cos;\r\n var sin$3 = Math.sin;\r\n var TrochoidShape = (function () {\r\n function TrochoidShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r = 0;\r\n this.r0 = 0;\r\n this.d = 0;\r\n this.location = 'out';\r\n }\r\n return TrochoidShape;\r\n }());\r\n var Trochoid = (function (_super) {\r\n __extends(Trochoid, _super);\r\n function Trochoid(opts) {\r\n return _super.call(this, opts) || this;\r\n }\r\n Trochoid.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n Trochoid.prototype.getDefaultShape = function () {\r\n return new TrochoidShape();\r\n };\r\n Trochoid.prototype.buildPath = function (ctx, shape) {\r\n var R = shape.r;\r\n var r = shape.r0;\r\n var d = shape.d;\r\n var offsetX = shape.cx;\r\n var offsetY = shape.cy;\r\n var delta = shape.location === 'out' ? 1 : -1;\r\n var x1;\r\n var y1;\r\n var x2;\r\n var y2;\r\n if (shape.location && R <= r) {\r\n return;\r\n }\r\n var num = 0;\r\n var i = 1;\r\n var theta;\r\n x1 = (R + delta * r) * cos$3(0)\r\n - delta * d * cos$3(0) + offsetX;\r\n y1 = (R + delta * r) * sin$3(0)\r\n - d * sin$3(0) + offsetY;\r\n ctx.moveTo(x1, y1);\r\n do {\r\n num++;\r\n } while ((r * num) % (R + delta * r) !== 0);\r\n do {\r\n theta = Math.PI / 180 * i;\r\n x2 = (R + delta * r) * cos$3(theta)\r\n - delta * d * cos$3((R / r + delta) * theta)\r\n + offsetX;\r\n y2 = (R + delta * r) * sin$3(theta)\r\n - d * sin$3((R / r + delta) * theta)\r\n + offsetY;\r\n ctx.lineTo(x2, y2);\r\n i++;\r\n } while (i <= (r * num) / (R + delta * r) * 360);\r\n };\r\n return Trochoid;\r\n }(Path));\r\n Trochoid.prototype.type = 'trochoid';\n\n var RadialGradient = (function (_super) {\r\n __extends(RadialGradient, _super);\r\n function RadialGradient(x, y, r, colorStops, globalCoord) {\r\n var _this = _super.call(this, colorStops) || this;\r\n _this.x = x == null ? 0.5 : x;\r\n _this.y = y == null ? 0.5 : y;\r\n _this.r = r == null ? 0.5 : r;\r\n _this.type = 'radial';\r\n _this.global = globalCoord || false;\r\n return _this;\r\n }\r\n return RadialGradient;\r\n }(Gradient));\n\n var extent = [0, 0];\r\n var extent2 = [0, 0];\r\n var minTv$1 = new Point();\r\n var maxTv$1 = new Point();\r\n var OrientedBoundingRect = (function () {\r\n function OrientedBoundingRect(rect, transform) {\r\n this._corners = [];\r\n this._axes = [];\r\n this._origin = [0, 0];\r\n for (var i = 0; i < 4; i++) {\r\n this._corners[i] = new Point();\r\n }\r\n for (var i = 0; i < 2; i++) {\r\n this._axes[i] = new Point();\r\n }\r\n if (rect) {\r\n this.fromBoundingRect(rect, transform);\r\n }\r\n }\r\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\r\n var corners = this._corners;\r\n var axes = this._axes;\r\n var x = rect.x;\r\n var y = rect.y;\r\n var x2 = x + rect.width;\r\n var y2 = y + rect.height;\r\n corners[0].set(x, y);\r\n corners[1].set(x2, y);\r\n corners[2].set(x2, y2);\r\n corners[3].set(x, y2);\r\n if (transform) {\r\n for (var i = 0; i < 4; i++) {\r\n corners[i].transform(transform);\r\n }\r\n }\r\n Point.sub(axes[0], corners[1], corners[0]);\r\n Point.sub(axes[1], corners[3], corners[0]);\r\n axes[0].normalize();\r\n axes[1].normalize();\r\n for (var i = 0; i < 2; i++) {\r\n this._origin[i] = axes[i].dot(corners[0]);\r\n }\r\n };\r\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\r\n var overlapped = true;\r\n var noMtv = !mtv;\r\n minTv$1.set(Infinity, Infinity);\r\n maxTv$1.set(0, 0);\r\n if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n }\r\n if (!noMtv) {\r\n Point.copy(mtv, overlapped ? minTv$1 : maxTv$1);\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\r\n var overlapped = true;\r\n for (var i = 0; i < 2; i++) {\r\n var axis = this._axes[i];\r\n this._getProjMinMaxOnAxis(i, self._corners, extent);\r\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\r\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\r\n overlapped = false;\r\n if (noMtv) {\r\n return overlapped;\r\n }\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) > maxTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(maxTv, axis, -dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(maxTv, axis, dist1 * inverse);\r\n }\r\n }\r\n }\r\n else if (minTv) {\r\n var dist0 = Math.abs(extent2[0] - extent[1]);\r\n var dist1 = Math.abs(extent[0] - extent2[1]);\r\n if (Math.min(dist0, dist1) < minTv.len()) {\r\n if (dist0 < dist1) {\r\n Point.scale(minTv, axis, dist0 * inverse);\r\n }\r\n else {\r\n Point.scale(minTv, axis, -dist1 * inverse);\r\n }\r\n }\r\n }\r\n }\r\n return overlapped;\r\n };\r\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\r\n var axis = this._axes[dim];\r\n var origin = this._origin;\r\n var proj = corners[0].dot(axis) + origin[dim];\r\n var min = proj;\r\n var max = proj;\r\n for (var i = 1; i < corners.length; i++) {\r\n var proj_1 = corners[i].dot(axis) + origin[dim];\r\n min = Math.min(proj_1, min);\r\n max = Math.max(proj_1, max);\r\n }\r\n out[0] = min;\r\n out[1] = max;\r\n };\r\n return OrientedBoundingRect;\r\n }());\n\n /*!\r\n * ZRender, a high performance 2d drawing library.\r\n *\r\n * Copyright (c) 2013, Baidu Inc.\r\n * All rights reserved.\r\n *\r\n * LICENSE\r\n * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\r\n */\r\n var useVML = !env.canvasSupported;\r\n var painterCtors = {};\r\n function delInstance(id) {\r\n }\r\n function isDarkMode(backgroundColor) {\r\n if (!backgroundColor) {\r\n return false;\r\n }\r\n if (typeof backgroundColor === 'string') {\r\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\r\n }\r\n else if (backgroundColor.colorStops) {\r\n var colorStops = backgroundColor.colorStops;\r\n var totalLum = 0;\r\n var len = colorStops.length;\r\n for (var i = 0; i < len; i++) {\r\n totalLum += lum(colorStops[i].color, 1);\r\n }\r\n totalLum /= len;\r\n return totalLum < DARK_MODE_THRESHOLD;\r\n }\r\n return false;\r\n }\r\n var ZRender = (function () {\r\n function ZRender(id, dom, opts) {\r\n var _this = this;\r\n this._sleepAfterStill = 10;\r\n this._stillFrameAccum = 0;\r\n this._needsRefresh = true;\r\n this._needsRefreshHover = true;\r\n this._darkMode = false;\r\n opts = opts || {};\r\n this.dom = dom;\r\n this.id = id;\r\n var storage = new Storage();\r\n var rendererType = opts.renderer;\r\n if (useVML) {\r\n if (!painterCtors.vml) {\r\n throw new Error('You need to require \\'zrender/vml/vml\\' to support IE8');\r\n }\r\n rendererType = 'vml';\r\n }\r\n else if (!rendererType) {\r\n rendererType = 'canvas';\r\n }\r\n if (!painterCtors[rendererType]) {\r\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\r\n }\r\n opts.useDirtyRect = opts.useDirtyRect == null\r\n ? false\r\n : opts.useDirtyRect;\r\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\r\n this.storage = storage;\r\n this.painter = painter;\r\n var handerProxy = (!env.node && !env.worker)\r\n ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)\r\n : null;\r\n this.handler = new Handler(storage, painter, handerProxy, painter.root);\r\n this.animation = new Animation({\r\n stage: {\r\n update: function () { return _this._flush(true); }\r\n }\r\n });\r\n this.animation.start();\r\n }\r\n ZRender.prototype.add = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.addRoot(el);\r\n el.addSelfToZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.remove = function (el) {\r\n if (!el) {\r\n return;\r\n }\r\n this.storage.delRoot(el);\r\n el.removeSelfFromZr(this);\r\n this.refresh();\r\n };\r\n ZRender.prototype.configLayer = function (zLevel, config) {\r\n if (this.painter.configLayer) {\r\n this.painter.configLayer(zLevel, config);\r\n }\r\n this.refresh();\r\n };\r\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\r\n if (this.painter.setBackgroundColor) {\r\n this.painter.setBackgroundColor(backgroundColor);\r\n }\r\n this.refresh();\r\n this._backgroundColor = backgroundColor;\r\n this._darkMode = isDarkMode(backgroundColor);\r\n };\r\n ZRender.prototype.getBackgroundColor = function () {\r\n return this._backgroundColor;\r\n };\r\n ZRender.prototype.setDarkMode = function (darkMode) {\r\n this._darkMode = darkMode;\r\n };\r\n ZRender.prototype.isDarkMode = function () {\r\n return this._darkMode;\r\n };\r\n ZRender.prototype.refreshImmediately = function (fromInside) {\r\n if (!fromInside) {\r\n this.animation.update(true);\r\n }\r\n this._needsRefresh = false;\r\n this.painter.refresh();\r\n this._needsRefresh = false;\r\n };\r\n ZRender.prototype.refresh = function () {\r\n this._needsRefresh = true;\r\n this.animation.start();\r\n };\r\n ZRender.prototype.flush = function () {\r\n this._flush(false);\r\n };\r\n ZRender.prototype._flush = function (fromInside) {\r\n var triggerRendered;\r\n var start = new Date().getTime();\r\n if (this._needsRefresh) {\r\n triggerRendered = true;\r\n this.refreshImmediately(fromInside);\r\n }\r\n if (this._needsRefreshHover) {\r\n triggerRendered = true;\r\n this.refreshHoverImmediately();\r\n }\r\n var end = new Date().getTime();\r\n if (triggerRendered) {\r\n this._stillFrameAccum = 0;\r\n this.trigger('rendered', {\r\n elapsedTime: end - start\r\n });\r\n }\r\n else if (this._sleepAfterStill > 0) {\r\n this._stillFrameAccum++;\r\n if (this._stillFrameAccum > this._sleepAfterStill) {\r\n this.animation.stop();\r\n }\r\n }\r\n };\r\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\r\n this._sleepAfterStill = stillFramesCount;\r\n };\r\n ZRender.prototype.wakeUp = function () {\r\n this.animation.start();\r\n this._stillFrameAccum = 0;\r\n };\r\n ZRender.prototype.addHover = function (el) {\r\n };\r\n ZRender.prototype.removeHover = function (el) {\r\n };\r\n ZRender.prototype.clearHover = function () {\r\n };\r\n ZRender.prototype.refreshHover = function () {\r\n this._needsRefreshHover = true;\r\n };\r\n ZRender.prototype.refreshHoverImmediately = function () {\r\n this._needsRefreshHover = false;\r\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\r\n this.painter.refreshHover();\r\n }\r\n };\r\n ZRender.prototype.resize = function (opts) {\r\n opts = opts || {};\r\n this.painter.resize(opts.width, opts.height);\r\n this.handler.resize();\r\n };\r\n ZRender.prototype.clearAnimation = function () {\r\n this.animation.clear();\r\n };\r\n ZRender.prototype.getWidth = function () {\r\n return this.painter.getWidth();\r\n };\r\n ZRender.prototype.getHeight = function () {\r\n return this.painter.getHeight();\r\n };\r\n ZRender.prototype.pathToImage = function (e, dpr) {\r\n if (this.painter.pathToImage) {\r\n return this.painter.pathToImage(e, dpr);\r\n }\r\n };\r\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\r\n this.handler.setCursorStyle(cursorStyle);\r\n };\r\n ZRender.prototype.findHover = function (x, y) {\r\n return this.handler.findHover(x, y);\r\n };\r\n ZRender.prototype.on = function (eventName, eventHandler, context) {\r\n this.handler.on(eventName, eventHandler, context);\r\n return this;\r\n };\r\n ZRender.prototype.off = function (eventName, eventHandler) {\r\n this.handler.off(eventName, eventHandler);\r\n };\r\n ZRender.prototype.trigger = function (eventName, event) {\r\n this.handler.trigger(eventName, event);\r\n };\r\n ZRender.prototype.clear = function () {\r\n var roots = this.storage.getRoots();\r\n for (var i = 0; i < roots.length; i++) {\r\n if (roots[i] instanceof Group) {\r\n roots[i].removeSelfFromZr(this);\r\n }\r\n }\r\n this.storage.delAllRoots();\r\n this.painter.clear();\r\n };\r\n ZRender.prototype.dispose = function () {\r\n this.animation.stop();\r\n this.clear();\r\n this.storage.dispose();\r\n this.painter.dispose();\r\n this.handler.dispose();\r\n this.animation =\r\n this.storage =\r\n this.painter =\r\n this.handler = null;\r\n delInstance(this.id);\r\n };\r\n return ZRender;\r\n }());\r\n function init(dom, opts) {\r\n var zr = new ZRender(guid(), dom, opts);\r\n return zr;\r\n }\r\n function registerPainter(name, Ctor) {\r\n painterCtors[name] = Ctor;\r\n }\n\n var RADIAN_EPSILON = 1e-4;\r\n function _trim(str) {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n function linearMap(val, domain, range, clamp) {\r\n var subDomain = domain[1] - domain[0];\r\n var subRange = range[1] - range[0];\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? range[0]\r\n : (range[0] + range[1]) / 2;\r\n }\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val >= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n else {\r\n if (val >= domain[0]) {\r\n return range[0];\r\n }\r\n else if (val <= domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n }\r\n else {\r\n if (val === domain[0]) {\r\n return range[0];\r\n }\r\n if (val === domain[1]) {\r\n return range[1];\r\n }\r\n }\r\n return (val - domain[0]) / subDomain * subRange + range[0];\r\n }\r\n function parsePercent$2(percent, all) {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (typeof percent === 'string') {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n return parseFloat(percent);\r\n }\r\n return percent == null ? NaN : +percent;\r\n }\r\n function round$1(x, precision, returnStr) {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n precision = Math.min(Math.max(0, precision), 20);\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n }\r\n function getPrecisionSafe(val) {\r\n var str = val.toString();\r\n var eIndex = str.indexOf('e');\r\n if (eIndex > 0) {\r\n var precision = +str.slice(eIndex + 1);\r\n return precision < 0 ? -precision : 0;\r\n }\r\n else {\r\n var dotIndex = str.indexOf('.');\r\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex;\r\n }\r\n }\r\n function getPixelPrecision(dataExtent, pixelExtent) {\r\n var log = Math.log;\r\n var LN10 = Math.LN10;\r\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n }\r\n function getPercentWithPrecision(valueList, idx, precision) {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n var sum = reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return 0;\r\n }\r\n var digits = Math.pow(10, precision);\r\n var votesPerQuota = map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n var targetSeats = digits * 100;\r\n var seats = map(votesPerQuota, function (votes) {\r\n return Math.floor(votes);\r\n });\r\n var currentSum = reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n var remainder = map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n while (currentSum < targetSeats) {\r\n var max = Number.NEGATIVE_INFINITY;\r\n var maxId = null;\r\n for (var i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return seats[idx] / digits;\r\n }\r\n function remRadian(radian) {\r\n var pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n }\r\n function isRadianAroundZero(val) {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n }\r\n var TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/;\r\n function parseDate(value) {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n var match = TIME_REG.exec(value);\r\n if (!match) {\r\n return new Date(NaN);\r\n }\r\n if (!match[8]) {\r\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0);\r\n }\r\n else {\r\n var hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n return new Date(Math.round(value));\r\n }\r\n function quantity(val) {\r\n return Math.pow(10, quantityExponent(val));\r\n }\r\n function quantityExponent(val) {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n var exp = Math.floor(Math.log(val) / Math.LN10);\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n }\r\n function nice(val, round) {\r\n var exponent = quantityExponent(val);\r\n var exp10 = Math.pow(10, exponent);\r\n var f = val / exp10;\r\n var nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n }\r\n function numericToNumber(val) {\r\n var valFloat = parseFloat(val);\r\n return (valFloat == val\r\n && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0)) ? valFloat : NaN;\r\n }\r\n function isNumeric(val) {\r\n return !isNaN(numericToNumber(val));\r\n }\r\n function getRandomIdBase() {\r\n return Math.round(Math.random() * 9);\r\n }\r\n function getGreatestCommonDividor(a, b) {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n }\r\n function getLeastCommonMultiple(a, b) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n }\n\n var ECHARTS_PREFIX = '[ECharts] ';\r\n var storedLogs = {};\r\n var hasConsole = typeof console !== 'undefined'\r\n && console.warn && console.log;\r\n function warn(str) {\r\n if (hasConsole) {\r\n console.warn(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function error(str) {\r\n if (hasConsole) {\r\n console.error(ECHARTS_PREFIX + str);\r\n }\r\n }\r\n function deprecateLog(str) {\r\n if (__DEV__) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n if (hasConsole) {\r\n storedLogs[str] = true;\r\n console.warn(ECHARTS_PREFIX + 'DEPRECATED: ' + str);\r\n }\r\n }\r\n }\r\n function deprecateReplaceLog(oldOpt, newOpt, scope) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\r\n }\r\n }\r\n function consoleLog() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (__DEV__) {\r\n if (typeof console !== 'undefined' && console.log) {\r\n console.log.apply(console, args);\r\n }\r\n }\r\n }\r\n function makePrintable() {\r\n var hintInfo = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n hintInfo[_i] = arguments[_i];\r\n }\r\n var msg = '';\r\n if (__DEV__) {\r\n var makePrintableStringIfPossible_1 = function (val) {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, function (arg) {\r\n if (isString(arg)) {\r\n return arg;\r\n }\r\n else {\r\n var printableStr = makePrintableStringIfPossible_1(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n var printableStr = makePrintableStringIfPossible_1(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n return msg;\r\n }\r\n function throwError(msg) {\r\n throw new Error(msg);\r\n }\n\n var DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n var INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n function normalizeToArray(value) {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n }\r\n function defaultEmphasis(opt, key, subOpts) {\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n for (var i = 0, len = subOpts.length; i < len; i++) {\r\n var subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n }\r\n var TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n ];\r\n function getDataItemValue(dataItem) {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? dataItem.value : dataItem;\r\n }\r\n function isDataItemOption(dataItem) {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n }\r\n function mappingToExists(existings, newCmptOptions, mode) {\r\n var isNormalMergeMode = mode === 'normalMerge';\r\n var isReplaceMergeMode = mode === 'replaceMerge';\r\n var isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n var existingIdIdxMap = createHashMap();\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n if (__DEV__) {\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n var result = prepareResult(existings, existingIdIdxMap, mode);\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n makeIdAndName(result);\r\n return result;\r\n }\r\n function prepareResult(existings, existingIdIdxMap, mode) {\r\n var result = [];\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n for (var index = 0; index < existings.length; index++) {\r\n var existing = existings[index];\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n }\r\n function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n var optionId = makeComparableKey(cmptOption.id);\r\n var existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n var resultItem = result[existingIdx];\r\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\r\n resultItem.newOption = cmptOption;\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n }\r\n function mappingByName(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (var i = 0; i < result.length; i++) {\r\n var existing = result[i].existing;\r\n if (!result[i].newOption\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n }\r\n function mappingByIndex(result, newCmptOptions, brandNew) {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n var resultItem;\r\n var nextIdx = 0;\r\n while ((resultItem = result[nextIdx])\r\n && (resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)))) {\r\n nextIdx++;\r\n }\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n }\r\n function mappingInReplaceAllMode(result, newCmptOptions) {\r\n each(newCmptOptions, function (cmptOption) {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n }\r\n function makeIdAndName(mapResult) {\r\n var idMap = createHashMap();\r\n each(mapResult, function (item) {\r\n var existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n each(mapResult, function (item) {\r\n var opt = item.newOption;\r\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {});\r\n });\r\n each(mapResult, function (item, index) {\r\n var existing = item.existing;\r\n var opt = item.newOption;\r\n var keyInfo = item.keyInfo;\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n var idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n } while (idMap.get(keyInfo.id));\r\n }\r\n idMap.set(keyInfo.id, item);\r\n });\r\n }\r\n function keyExistAndEqual(attr, obj1, obj2) {\r\n var key1 = convertOptionIdName(obj1[attr], null);\r\n var key2 = convertOptionIdName(obj2[attr], null);\r\n return key1 != null && key2 != null && key1 === key2;\r\n }\r\n function makeComparableKey(val) {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n }\r\n function convertOptionIdName(idOrName, defaultValue) {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n var type = typeof idOrName;\r\n return type === 'string'\r\n ? idOrName\r\n : (type === 'number' || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n }\r\n function warnInvalidateIdOrName(idOrName) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n }\r\n function isValidIdOrName(idOrName) {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n }\r\n function isNameSpecified(componentModel) {\r\n var name = componentModel.name;\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n }\r\n function isComponentIdInternal(cmptOption) {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n }\r\n function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\r\n each(mappingResult, function (item) {\r\n var newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n }\r\n function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\r\n var subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n : componentModelCtor.determineSubType(mainType, newCmptOption);\r\n return subType;\r\n }\r\n function queryDataIndex(data, payload) {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n }\r\n function makeInner() {\r\n var key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj) {\r\n return hostObj[key] || (hostObj[key] = {});\r\n };\r\n }\r\n var innerUniqueIndex = getRandomIdBase();\r\n function parseFinder(ecModel, finderInput, opt) {\r\n var finder;\r\n if (isString(finderInput)) {\r\n var obj = {};\r\n obj[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n var queryOptionMap = createHashMap();\r\n var result = {};\r\n var mainTypeSpecified = false;\r\n each(finder, function (value, key) {\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n result[key] = value;\r\n return;\r\n }\r\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n var mainType = parsedKey[1];\r\n var queryType = (parsedKey[2] || '').toLowerCase();\r\n if (!mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)) {\r\n return;\r\n }\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value;\r\n });\r\n var defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n });\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n return result;\r\n }\r\n var SINGLE_REFERRING = { useDefault: true, enableAll: false, enableNone: false };\r\n function queryReferringComponents(ecModel, mainType, userOption, opt) {\r\n opt = opt || SINGLE_REFERRING;\r\n var indexOption = userOption.index;\r\n var idOption = userOption.id;\r\n var nameOption = userOption.name;\r\n var result = {\r\n models: null,\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n if (!result.specified) {\r\n var firstCmpt = void 0;\r\n result.models = (opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption,\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n }\r\n function setAttribute(dom, key, value) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : (dom[key] = value);\r\n }\r\n function getAttribute(dom, key) {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : dom[key];\r\n }\r\n function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\r\n var isAutoPrecision = precision == null || precision === 'auto';\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n if (typeof targetValue === 'number') {\r\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\r\n return round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(sourceValue || 0), getPrecisionSafe(targetValue))\r\n : precision);\r\n }\r\n else if (typeof targetValue === 'string') {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n var interpolated = [];\r\n var leftArr = sourceValue || [];\r\n var rightArr = targetValue;\r\n var length_1 = Math.max(leftArr.length, rightArr.length);\r\n for (var i = 0; i < length_1; ++i) {\r\n var info = data.getDimensionInfo(i);\r\n if (info.type === 'ordinal') {\r\n interpolated[i] = (percent < 1 ? leftArr : rightArr)[i];\r\n }\r\n else {\r\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\r\n var rightVal = rightArr[i];\r\n var value = leftArr == null\r\n ? targetValue[i]\r\n : interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round$1(value, isAutoPrecision ? Math.max(getPrecisionSafe(leftVal), getPrecisionSafe(rightVal))\r\n : precision);\r\n }\r\n }\r\n return interpolated;\r\n }\r\n }\n\n var TYPE_DELIMITER = '.';\r\n var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\r\n var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\r\n function parseClassType(componentType) {\r\n var ret = { main: '', sub: '' };\r\n if (componentType) {\r\n var typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n }\r\n function checkClassType(componentType) {\r\n assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\r\n }\r\n function isExtendedClass(clz) {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n }\r\n function enableClassExtend(rootClz, mandatoryMethods) {\r\n rootClz.$constructor = rootClz;\r\n rootClz.extend = function (proto) {\r\n if (__DEV__) {\r\n each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn('Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.');\r\n }\r\n });\r\n }\r\n var superClass = this;\r\n function ExtendedClass() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (!proto.$constructor) {\r\n if (!isESClass(superClass)) {\r\n superClass.apply(this, arguments);\r\n }\r\n else {\r\n var ins = createObject(ExtendedClass.prototype, new (superClass.bind.apply(superClass, __spreadArrays([void 0], args)))());\r\n return ins;\r\n }\r\n }\r\n else {\r\n proto.$constructor.apply(this, arguments);\r\n }\r\n }\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n extend(ExtendedClass.prototype, proto);\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n inherits(ExtendedClass, this);\r\n ExtendedClass.superClass = superClass;\r\n return ExtendedClass;\r\n };\r\n }\r\n function isESClass(fn) {\r\n return typeof fn === 'function'\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n }\r\n function mountExtend(SubClz, SupperClz) {\r\n SubClz.extend = SupperClz.extend;\r\n }\r\n var classBase = Math.round(Math.random() * 10);\r\n function enableClassCheck(target) {\r\n var classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n if (__DEV__) {\r\n assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n }\r\n function superCall(context, methodName) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function superApply(context, methodName, args) {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n }\r\n function enableClassManagement(target, options) {\r\n options = options || {};\r\n var storage = {};\r\n target.registerClass = function (clz) {\r\n var componentFullType = clz.type || clz.prototype.type;\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n clz.prototype.type = componentFullType;\r\n var componentTypeInfo = parseClassType(componentFullType);\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n var container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n target.getClass = function (mainType, subType, throwWhenNotFound) {\r\n var clz = storage[mainType];\r\n if (clz && clz[IS_CONTAINER]) {\r\n clz = subType ? clz[subType] : null;\r\n }\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(!subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' not exists. Load it first.');\r\n }\r\n return clz;\r\n };\r\n target.getClassesByMainType = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var result = [];\r\n var obj = storage[componentTypeInfo.main];\r\n if (obj && obj[IS_CONTAINER]) {\r\n each(obj, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o);\r\n });\r\n }\r\n else {\r\n result.push(obj);\r\n }\r\n return result;\r\n };\r\n target.hasClass = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n target.getAllClassMainTypes = function () {\r\n var types = [];\r\n each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n target.hasSubTypes = function (componentType) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n var obj = storage[componentTypeInfo.main];\r\n return obj && obj[IS_CONTAINER];\r\n };\r\n function makeContainer(componentTypeInfo) {\r\n var container = storage[componentTypeInfo.main];\r\n if (!container || !container[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container;\r\n }\r\n if (options.registerWhenExtend) {\r\n var originalExtend_1 = target.extend;\r\n if (originalExtend_1) {\r\n target.extend = function (proto) {\r\n var ExtendedClass = originalExtend_1.call(this, proto);\r\n return target.registerClass(ExtendedClass);\r\n };\r\n }\r\n }\r\n }\n\n function makeStyleMapper(properties, ignoreParent) {\r\n for (var i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n ignoreParent = ignoreParent || false;\r\n return function (model, excludes, includes) {\r\n var style = {};\r\n for (var i = 0; i < properties.length; i++) {\r\n var propName = properties[i][1];\r\n if ((excludes && indexOf(excludes, propName) >= 0)\r\n || (includes && indexOf(includes, propName) < 0)) {\r\n continue;\r\n }\r\n var val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n return style;\r\n };\r\n }\n\n var AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n ];\r\n var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n var AreaStyleMixin = (function () {\r\n function AreaStyleMixin() {\r\n }\r\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\r\n return getAreaStyle(this, excludes, includes);\r\n };\r\n return AreaStyleMixin;\r\n }());\n\n var getECData = makeInner();\n\n var _highlightNextDigit = 1;\r\n var _highlightKeyMap = {};\r\n var getSavedStates = makeInner();\r\n var HOVER_STATE_NORMAL = 0;\r\n var HOVER_STATE_BLUR = 1;\r\n var HOVER_STATE_EMPHASIS = 2;\r\n var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\r\n var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\r\n var Z2_EMPHASIS_LIFT = 10;\r\n var Z2_SELECT_LIFT = 9;\r\n var HIGHLIGHT_ACTION_TYPE = 'highlight';\r\n var DOWNPLAY_ACTION_TYPE = 'downplay';\r\n var SELECT_ACTION_TYPE = 'select';\r\n var UNSELECT_ACTION_TYPE = 'unselect';\r\n var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n function hasFillOrStroke(fillOrStroke) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n }\r\n var liftedColorCache = new LRU(100);\r\n function liftColor(color) {\r\n if (typeof color !== 'string') {\r\n return color;\r\n }\r\n var liftedColor = liftedColorCache.get(color);\r\n if (!liftedColor) {\r\n liftedColor = lift(color, -0.1);\r\n liftedColorCache.put(color, liftedColor);\r\n }\r\n return liftedColor;\r\n }\r\n function doChangeHoverState(el, stateName, hoverStateEnum) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n }\r\n function singleEnterEmphasis(el) {\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n }\r\n function singleLeaveEmphasis(el) {\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterBlur(el) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n }\r\n function singleLeaveBlur(el) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n }\r\n function singleEnterSelect(el) {\r\n el.selected = true;\r\n }\r\n function singleLeaveSelect(el) {\r\n el.selected = false;\r\n }\r\n function updateElementState(el, updater, commonParam) {\r\n updater(el, commonParam);\r\n }\r\n function traverseUpdateState(el, updater, commonParam) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n }\r\n function setStatesFlag(el, stateName) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n }\r\n function getFromStateStyle(el, props, toStateName, defaultValue) {\r\n var style = el.style;\r\n var fromState = {};\r\n for (var i = 0; i < props.length; i++) {\r\n var propName = props[i];\r\n var val = style[propName];\r\n fromState[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveFinalToTarget(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n }\r\n function createEmphasisDefaultState(el, stateName, targetStates, state) {\r\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n var cloned = false;\r\n if (el instanceof Path) {\r\n var store = getSavedStates(el);\r\n var fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n var fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n var emphasisStyle = state.style || {};\r\n if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = liftColor(fromFill);\r\n }\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n var z2EmphasisLift = el.z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createSelectDefaultState(el, stateName, state) {\r\n if (state) {\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n var z2SelectLift = el.z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n }\r\n function createBlurDefaultState(el, stateName, state) {\r\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n var currentOpacity = el.style.opacity;\r\n var fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n state = state || {};\r\n var blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n return state;\r\n }\r\n function elementStateProxy(stateName, targetStates) {\r\n var state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n }\r\n function setDefaultStateProxy(el) {\r\n el.stateProxy = elementStateProxy;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n }\r\n function enterEmphasisWhenMouseOver(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasisWhenMouseOut(el, e) {\r\n !shouldSilent(el, e)\r\n && !el.__highByOuter\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterEmphasis(el, highlightDigit) {\r\n el.__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState(el, singleEnterEmphasis);\r\n }\r\n function leaveEmphasis(el, highlightDigit) {\r\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState(el, singleLeaveEmphasis);\r\n }\r\n function enterBlur(el) {\r\n traverseUpdateState(el, singleEnterBlur);\r\n }\r\n function leaveBlur(el) {\r\n traverseUpdateState(el, singleLeaveBlur);\r\n }\r\n function enterSelect(el) {\r\n traverseUpdateState(el, singleEnterSelect);\r\n }\r\n function leaveSelect(el) {\r\n traverseUpdateState(el, singleLeaveSelect);\r\n }\r\n function shouldSilent(el, e) {\r\n return el.__highDownSilentOnTouch && e.zrByTouch;\r\n }\r\n function allLeaveBlur(api) {\r\n var model = api.getModel();\r\n model.eachComponent(function (componentType, componentModel) {\r\n var view = componentType === 'series'\r\n ? api.getViewOfSeriesModel(componentModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n });\r\n }\r\n function toggleSeriesBlurState(targetSeriesIndex, focus, blurScope, api, isBlur) {\r\n var ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n function leaveBlurOfIndices(data, dataIndices) {\r\n for (var i = 0; i < dataIndices.length; i++) {\r\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n if (!isBlur) {\r\n allLeaveBlur(api);\r\n return;\r\n }\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n var targetCoordSys = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && targetCoordSys.master) {\r\n targetCoordSys = targetCoordSys.master;\r\n }\r\n var blurredSeries = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var sameSeries = targetSeriesModel === seriesModel;\r\n var coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.master) {\r\n coordSys = coordSys.master;\r\n }\r\n var sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries;\r\n if (!(blurScope === 'series' && !sameSeries\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n || focus === 'series' && sameSeries)) {\r\n var view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus);\r\n }\r\n else if (isObject(focus)) {\r\n var dataTypes = keys(focus);\r\n for (var d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\r\n }\r\n }\r\n blurredSeries.push(seriesModel);\r\n }\r\n });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.blurSeries) {\r\n view.blurSeries(blurredSeries, ecModel);\r\n }\r\n });\r\n }\r\n function toggleSeriesBlurStateFromPayload(seriesModel, payload, api) {\r\n if (!isHighDownPayload(payload)) {\r\n return;\r\n }\r\n var isHighlight = payload.type === HIGHLIGHT_ACTION_TYPE;\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var data = seriesModel.getData(payload.dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n var el = data.getItemGraphicEl(dataIndex);\r\n if (!el) {\r\n var count = data.count();\r\n var current = 0;\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n if (el) {\r\n var ecData = getECData(el);\r\n toggleSeriesBlurState(seriesIndex, ecData.focus, ecData.blurScope, api, isHighlight);\r\n }\r\n else {\r\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus_1 != null) {\r\n toggleSeriesBlurState(seriesIndex, focus_1, blurScope, api, isHighlight);\r\n }\r\n }\r\n }\r\n function toggleSelectionFromPayload(seriesModel, payload, api) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n var dataType = payload.dataType;\r\n var data = seriesModel.getData(dataType);\r\n var dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\r\n }\r\n function updateSeriesElementSelection(seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n }\r\n function getAllSelectedIndices(ecModel) {\r\n var ret = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n var allData = seriesModel.getAllData();\r\n each(allData, function (_a) {\r\n var data = _a.data, type = _a.type;\r\n var dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n var item = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n }\r\n });\r\n });\r\n return ret;\r\n }\r\n function enableHoverEmphasis(el, focus, blurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el, setDefaultStateProxy);\r\n enableHoverFocus(el, focus, blurScope);\r\n }\r\n function enableHoverFocus(el, focus, blurScope) {\r\n var ecData = getECData(el);\r\n if (focus != null) {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n }\r\n var OTHER_STATES = ['emphasis', 'blur', 'select'];\r\n var defaultStyleGetterMap = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n };\r\n function setStatesStylesFromModel(el, itemModel, styleType, getter) {\r\n styleType = styleType || 'itemStyle';\r\n for (var i = 0; i < OTHER_STATES.length; i++) {\r\n var stateName = OTHER_STATES[i];\r\n var model = itemModel.getModel([stateName, styleType]);\r\n var state = el.ensureState(stateName);\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n }\r\n function setAsHighDownDispatcher(el, asDispatcher) {\r\n var disable = asDispatcher === false;\r\n var extendedEl = el;\r\n if (el.highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\r\n }\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n }\r\n function isHighDownDispatcher(el) {\r\n return !!(el && el.__highDownDispatcher);\r\n }\r\n function getHighlightDigit(highlightKey) {\r\n var highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n }\r\n function isSelectChangePayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n }\r\n function isHighDownPayload(payload) {\r\n var payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n }\r\n function savePathStates(el) {\r\n var store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n var selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n }\n\n function makePath(pathData, opts, rect, layout) {\r\n var path = createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n }\r\n function makeImage(imageUrl, rect, layout) {\r\n var zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload: function (img) {\r\n if (layout === 'center') {\r\n var boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n }\r\n function centerGraphic(rect, boundingRect) {\r\n var aspect = boundingRect.width / boundingRect.height;\r\n var width = rect.height * aspect;\r\n var height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n var cx = rect.x + rect.width / 2;\r\n var cy = rect.y + rect.height / 2;\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n }\r\n function resizePath(path, rect) {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n var pathRect = path.getBoundingRect();\r\n var m = pathRect.calculateTransform(rect);\r\n path.applyTransform(m);\r\n }\r\n function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\r\n var isFrom = false;\r\n var removeOpt;\r\n if (typeof dataIndex === 'function') {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n var isUpdate = animationType === 'update';\r\n var isRemove = animationType === 'remove';\r\n var animationPayload;\r\n if (animatableModel && animatableModel.ecModel) {\r\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation);\r\n }\r\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n if (!isRemove) {\r\n el.stopAnimation('remove');\r\n }\r\n if (animationEnabled) {\r\n var duration = void 0;\r\n var animationEasing = void 0;\r\n var animationDelay = void 0;\r\n if (animationPayload) {\r\n duration = animationPayload.duration || 0;\r\n animationEasing = animationPayload.easing || 'cubicOut';\r\n animationDelay = animationPayload.delay || 0;\r\n }\r\n else if (isRemove) {\r\n removeOpt = removeOpt || {};\r\n duration = retrieve2(removeOpt.duration, 200);\r\n animationEasing = retrieve2(removeOpt.easing, 'cubicOut');\r\n animationDelay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\r\n animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\r\n animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\r\n }\r\n if (typeof animationDelay === 'function') {\r\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex)\r\n : null);\r\n }\r\n if (typeof duration === 'function') {\r\n duration = duration(dataIndex);\r\n }\r\n duration > 0\r\n ? (isFrom\r\n ? el.animateFrom(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n scope: animationType,\r\n during: during\r\n })\r\n : el.animateTo(props, {\r\n duration: duration,\r\n delay: animationDelay || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n setToFinal: true,\r\n scope: animationType,\r\n during: during\r\n }))\r\n : (el.stopAnimation(),\r\n !isFrom && el.attr(props),\r\n cb && cb());\r\n }\r\n else {\r\n el.stopAnimation();\r\n !isFrom && el.attr(props);\r\n during && during(1);\r\n cb && cb();\r\n }\r\n }\r\n function updateProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function initProps(el, props, animatableModel, dataIndex, cb, during) {\r\n animateOrSetProps('init', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function removeElement(el, props, animatableModel, dataIndex, cb, during) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n animateOrSetProps('remove', el, props, animatableModel, dataIndex, cb, during);\r\n }\r\n function fadeOutDisplayable(el, animatableModel, dataIndex, done) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n }\r\n function removeElementWithFadeOut(el, animatableModel, dataIndex) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n el.traverse(function (disp) {\r\n if (!disp.isGroup) {\r\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n }\r\n function isElementRemoved(el) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (var i = 0; i < el.animators.length; i++) {\r\n var animator = el.animators[i];\r\n if (animator.scope === 'remove') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function isNotGroup(el) {\r\n return !el.isGroup;\r\n }\r\n function isPath(el) {\r\n return el.shape != null;\r\n }\r\n function groupTransition(g1, g2, animatableModel) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n function getElMap(g) {\r\n var elMap = {};\r\n g.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el) {\r\n var obj = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n var elMap1 = getElMap(g1);\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n var oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n var newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n }\n\n var EMPTY_OBJ = {};\r\n function setLabelText(label, labelTexts) {\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var text = labelTexts[stateName];\r\n var state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n var oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n }\r\n function getLabelText(opt, stateModels, overrideValue) {\r\n var labelFetcher = opt.labelFetcher;\r\n var labelDataIndex = opt.labelDataIndex;\r\n var labelDimIndex = opt.labelDimIndex;\r\n var normalModel = stateModels.normal;\r\n var baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), overrideValue != null ? {\r\n value: overrideValue\r\n } : null);\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, overrideValue) : opt.defaultText;\r\n }\r\n var statesText = {\r\n normal: baseText\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter'))\r\n : null, baseText);\r\n }\r\n return statesText;\r\n }\r\n function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {\r\n opt = opt || EMPTY_OBJ;\r\n var isSetOnText = targetEl instanceof ZRText;\r\n var needsCreateText = false;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n var normalModel = labelStatesModels.normal;\r\n var showNormal = !!normalModel.getShallow('show');\r\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n var stateModel = labelStatesModels[stateName];\r\n if (stateModel) {\r\n var stateObj = textContent.ensureState(stateName);\r\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n if (!isSetOnText) {\r\n var targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (overrideValue) {\r\n var labelStatesTexts = getLabelText(opt, labelStatesModels, overrideValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n }\r\n function getLabelStatesModels(itemModel, labelName) {\r\n labelName = (labelName || 'label');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n }\r\n function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {\r\n var textStyle = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n return textStyle;\r\n }\r\n function createTextConfig(textStyleModel, opt, isNotNormal) {\r\n opt = opt || {};\r\n var textConfig = {};\r\n var labelPosition;\r\n var labelRotate = textStyleModel.getShallow('rotate');\r\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n var labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n }\r\n function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\r\n opt = opt || EMPTY_OBJ;\r\n var ecModel = textStyleModel.ecModel;\r\n var globalTextStyle = ecModel && ecModel.option.textStyle;\r\n var richItemNames = getRichItemNames(textStyleModel);\r\n var richResult;\r\n if (richItemNames) {\r\n richResult = {};\r\n for (var name_1 in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name_1)) {\r\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\r\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n var overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n var margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n }\r\n function getRichItemNames(textStyleModel) {\r\n var richItemNameMap;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n var richKeys = keys(rich);\r\n for (var i = 0; i < richKeys.length; i++) {\r\n var richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n }\r\n var TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ];\r\n var TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign'\r\n ];\r\n var TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ];\r\n function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n var inheritColor = opt && opt.inheritColor;\r\n var fillColor = textStyleModel.getShallow('color');\r\n var strokeColor = textStyleModel.getShallow('textBorderColor');\r\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType;\r\n }\r\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n if (!isNotNormal && !isAttached) {\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n var key = TEXT_PROPS_WITH_GLOBAL[i];\r\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n var key = TEXT_PROPS_SELF[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n var baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n var key = TEXT_PROPS_BOX[i];\r\n var val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n textStyle[key] = val;\r\n }\r\n }\r\n var borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType;\r\n }\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n }\r\n function getFont(opt, ecModel) {\r\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n }\r\n var labelInner = makeInner();\r\n function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\r\n if (!label) {\r\n return;\r\n }\r\n var obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n var normalLabelModel = labelStatesModels.normal;\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n }\r\n function animateLabelValue(textEl, dataIndex, data, seriesModel) {\r\n var labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation) {\r\n return;\r\n }\r\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n var prevValue = labelInnerStore.prevValue;\r\n var currentValue = labelInnerStore.value;\r\n function during(percent) {\r\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, prevValue, currentValue, percent);\r\n var labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n setLabelText(textEl, labelText);\r\n }\r\n (prevValue == null ? initProps\r\n : updateProps)(textEl, {}, seriesModel, dataIndex, null, during);\r\n }\n\n var PATH_COLOR = ['textStyle', 'color'];\r\n var tmpRichText = new ZRText();\r\n var TextStyleMixin = (function () {\r\n function TextStyleMixin() {\r\n }\r\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\r\n var ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || ((!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null);\r\n };\r\n TextStyleMixin.prototype.getFont = function () {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n };\r\n TextStyleMixin.prototype.getTextRect = function (text) {\r\n tmpRichText.useStyle({\r\n text: text,\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily'),\r\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline'),\r\n padding: this.getShallow('padding'),\r\n lineHeight: this.getShallow('lineHeight'),\r\n rich: this.getShallow('rich')\r\n });\r\n tmpRichText.update();\r\n return tmpRichText.getBoundingRect();\r\n };\r\n return TextStyleMixin;\r\n }());\n\n var LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n ];\r\n var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n var LineStyleMixin = (function () {\r\n function LineStyleMixin() {\r\n }\r\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\r\n return getLineStyle(this, excludes);\r\n };\r\n return LineStyleMixin;\r\n }());\n\n var ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n ];\r\n var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n var ItemStyleMixin = (function () {\r\n function ItemStyleMixin() {\r\n }\r\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\r\n return getItemStyle(this, excludes, includes);\r\n };\r\n return ItemStyleMixin;\r\n }());\n\n var Model = (function () {\r\n function Model(option, parentModel, ecModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n }\r\n Model.prototype.init = function (option, parentModel, ecModel) {\r\n var rest = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n rest[_i - 3] = arguments[_i];\r\n }\r\n };\r\n Model.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n };\r\n Model.prototype.get = function (path, ignoreParent) {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\r\n };\r\n Model.prototype.getShallow = function (key, ignoreParent) {\r\n var option = this.option;\r\n var val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n var parentModel = this.parentModel;\r\n if (parentModel) {\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val;\r\n };\r\n Model.prototype.getModel = function (path, parentModel) {\r\n var hasPath = path != null;\r\n var pathFinal = hasPath ? this.parsePath(path) : null;\r\n var obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n parentModel = parentModel || (this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal)));\r\n return new Model(obj, parentModel, this.ecModel);\r\n };\r\n Model.prototype.isEmpty = function () {\r\n return this.option == null;\r\n };\r\n Model.prototype.restoreData = function () { };\r\n Model.prototype.clone = function () {\r\n var Ctor = this.constructor;\r\n return new Ctor(clone(this.option));\r\n };\r\n Model.prototype.parsePath = function (path) {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n };\r\n Model.prototype.resolveParentPath = function (path) {\r\n return path;\r\n };\r\n Model.prototype.isAnimationEnabled = function () {\r\n if (!env.node && this.option) {\r\n if (this.option.animation != null) {\r\n return !!this.option.animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n };\r\n Model.prototype._doGet = function (pathArr, parentModel) {\r\n var obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n for (var i = 0; i < pathArr.length; i++) {\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\r\n }\r\n return obj;\r\n };\r\n return Model;\r\n }());\r\n enableClassExtend(Model);\r\n enableClassCheck(Model);\r\n mixin(Model, LineStyleMixin);\r\n mixin(Model, ItemStyleMixin);\r\n mixin(Model, AreaStyleMixin);\r\n mixin(Model, TextStyleMixin);\n\n var base = Math.round(Math.random() * 10);\r\n function getUID(type) {\r\n return [(type || ''), base++].join('_');\r\n }\r\n function enableSubTypeDefaulter(target) {\r\n var subTypeDefaulters = {};\r\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\r\n var componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n target.determineSubType = function (componentType, option) {\r\n var type = option.type;\r\n if (!type) {\r\n var componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n }\r\n function enableTopologicalTravel(entity, dependencyGetter) {\r\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n var result = makeDepndencyGraph(fullNameList);\r\n var graph = result.graph;\r\n var noEntryList = result.noEntryList;\r\n var targetNameSet = {};\r\n each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n while (noEntryList.length) {\r\n var currComponentType = noEntryList.pop();\r\n var currVertex = graph[currComponentType];\r\n var isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\r\n }\r\n each(targetNameSet, function () {\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circle dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n function removeEdge(succComponentType) {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n function removeEdgeAndAdd(succComponentType) {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n function makeDepndencyGraph(fullNameList) {\r\n var graph = {};\r\n var noEntryList = [];\r\n each(fullNameList, function (name) {\r\n var thisItem = createDependencyGraphItem(graph, name);\r\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n each(availableDeps, function (dependentName) {\r\n if (indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n var thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n return { graph: graph, noEntryList: noEntryList };\r\n }\r\n function createDependencyGraphItem(graph, name) {\r\n if (!graph[name]) {\r\n graph[name] = { predecessor: [], successor: [] };\r\n }\r\n return graph[name];\r\n }\r\n function getAvailableDependencies(originalDeps, fullNameList) {\r\n var availableDeps = [];\r\n each(originalDeps, function (dep) {\r\n indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n }\r\n function inheritDefaultOption(superOption, subOption) {\r\n return merge(merge({}, superOption, true), subOption, true);\r\n }\n\n var langEN = {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Guage',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n };\n\n var langZH = {\r\n time: {\r\n month: [\r\n '一月', '二月', '三月', '四月', '五月', '六月',\r\n '七月', '八月', '九月', '十月', '十一月', '十二月'\r\n ],\r\n monthAbbr: [\r\n '1月', '2月', '3月', '4月', '5月', '6月',\r\n '7月', '8月', '9月', '10月', '11月', '12月'\r\n ],\r\n dayOfWeek: [\r\n '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'\r\n ],\r\n dayOfWeekAbbr: [\r\n '日', '一', '二', '三', '四', '五', '六'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '全选',\r\n inverse: '反选'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '矩形选择',\r\n polygon: '圈选',\r\n lineX: '横向选择',\r\n lineY: '纵向选择',\r\n keep: '保持选择',\r\n clear: '清除选择'\r\n }\r\n },\r\n dataView: {\r\n title: '数据视图',\r\n lang: ['数据视图', '关闭', '刷新']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '区域缩放',\r\n back: '区域缩放还原'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '切换为折线图',\r\n bar: '切换为柱状图',\r\n stack: '切换为堆叠',\r\n tiled: '切换为平铺'\r\n }\r\n },\r\n restore: {\r\n title: '还原'\r\n },\r\n saveAsImage: {\r\n title: '保存为图片',\r\n lang: ['右键另存为图片']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '饼图',\r\n bar: '柱状图',\r\n line: '折线图',\r\n scatter: '散点图',\r\n effectScatter: '涟漪散点图',\r\n radar: '雷达图',\r\n tree: '树图',\r\n treemap: '矩形树图',\r\n boxplot: '箱型图',\r\n candlestick: 'K线图',\r\n k: 'K线图',\r\n heatmap: '热力图',\r\n map: '地图',\r\n parallel: '平行坐标图',\r\n lines: '线图',\r\n graph: '关系图',\r\n sankey: '桑基图',\r\n funnel: '漏斗图',\r\n gauge: '仪表盘图',\r\n pictorialBar: '象形柱图',\r\n themeRiver: '主题河流图',\r\n sunburst: '旭日图'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '这是一个关于“{title}”的图表。',\r\n withoutTitle: '这是一个图表,'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '图表类型是{seriesType},表示{seriesName}。',\r\n withoutName: '图表类型是{seriesType}。'\r\n },\r\n multiple: {\r\n prefix: '它由{seriesCount}个图表系列组成。',\r\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\r\n withoutName: '第{seriesId}个系列是一个{seriesType},',\r\n separator: {\r\n middle: ';',\r\n end: '。'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '其数据是——',\r\n partialData: '其中,前{displayCnt}项是——',\r\n withName: '{name}的数据是{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ',',\r\n end: ''\r\n }\r\n }\r\n }\r\n };\n\n var LOCALE_ZH = 'ZH';\r\n var LOCALE_EN = 'EN';\r\n var DEFAULT_LOCALE = LOCALE_EN;\r\n var localeStorage = {};\r\n var localeModels = {};\r\n var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n })();\r\n function registerLocale(locale, localeObj) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n }\r\n function createLocaleObject(locale) {\r\n if (isString(locale)) {\r\n var localeObj = localeStorage[locale.toUpperCase()] || {};\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n function getLocaleModel(lang) {\r\n return localeModels[lang];\r\n }\r\n function getDefaultLocaleModel() {\r\n return localeModels[DEFAULT_LOCALE];\r\n }\r\n registerLocale(LOCALE_EN, langEN);\r\n registerLocale(LOCALE_ZH, langZH);\n\n var ONE_SECOND = 1000;\r\n var ONE_MINUTE = ONE_SECOND * 60;\r\n var ONE_HOUR = ONE_MINUTE * 60;\r\n var ONE_DAY = ONE_HOUR * 24;\r\n var ONE_YEAR = ONE_DAY * 365;\r\n var defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{hh}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\r\n };\r\n var fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n var fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}-{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n };\r\n var primaryTimeUnits = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n var timeUnits = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n ];\r\n function pad(str, len) {\r\n str += '';\r\n return '0000'.substr(0, len - str.length) + str;\r\n }\r\n function getPrimaryTimeUnit(timeUnit) {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n return timeUnit;\r\n }\r\n }\r\n function isPrimaryTimeUnit(timeUnit) {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n }\r\n function getDefaultFormatPrecisionOfInterval(timeUnit) {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n return 'second';\r\n }\r\n }\r\n function format(time, template, isUTC, lang) {\r\n var date = parseDate(time);\r\n var y = date[fullYearGetterName(isUTC)]();\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var q = Math.floor((M - 1) / 4) + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\r\n var H = date[hoursGetterName(isUTC)]();\r\n var h = (H - 1) % 12 + 1;\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n var timeModel = localeModel.getModel('time');\r\n var month = timeModel.get('month');\r\n var monthAbbr = timeModel.get('monthAbbr');\r\n var dayOfWeek = timeModel.get('dayOfWeek');\r\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n return (template || '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, y % 100 + '')\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n }\r\n function leveledFormat(tick, idx, formatter, lang, isUTC) {\r\n var template = null;\r\n if (typeof formatter === 'string') {\r\n template = formatter;\r\n }\r\n else if (typeof formatter === 'function') {\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n var defaults$1 = extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults$1[primaryTimeUnits[i]] = \"{primary|\" + defaults$1[primaryTimeUnits[i]] + \"}\";\r\n }\r\n }\r\n var mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter\r\n : defaults(formatter, defaults$1))\r\n : defaults$1);\r\n var unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n var targetId = timeUnits.indexOf(unit);\r\n for (var i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults$1.none;\r\n }\r\n if (isArray(template)) {\r\n var levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n }\r\n function getUnitFromValue(value, isUTC) {\r\n var date = parseDate(value);\r\n var M = date[monthGetterName(isUTC)]() + 1;\r\n var d = date[dateGetterName(isUTC)]();\r\n var h = date[hoursGetterName(isUTC)]();\r\n var m = date[minutesGetterName(isUTC)]();\r\n var s = date[secondsGetterName(isUTC)]();\r\n var S = date[millisecondsGetterName(isUTC)]();\r\n var isSecond = S === 0;\r\n var isMinute = isSecond && s === 0;\r\n var isHour = isMinute && m === 0;\r\n var isDay = isHour && h === 0;\r\n var isMonth = isDay && d === 1;\r\n var isYear = isMonth && M === 1;\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n }\r\n function getUnitValue(value, unit, isUTC) {\r\n var date = typeof value === 'number'\r\n ? parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n }\r\n function fullYearGetterName(isUTC) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n }\r\n function monthGetterName(isUTC) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n }\r\n function dateGetterName(isUTC) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n }\r\n function hoursGetterName(isUTC) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n }\r\n function minutesGetterName(isUTC) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n }\r\n function secondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function millisecondsGetterName(isUTC) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n }\r\n function fullYearSetterName(isUTC) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n }\r\n function monthSetterName(isUTC) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n }\r\n function dateSetterName(isUTC) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n }\r\n function hoursSetterName(isUTC) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n }\r\n function minutesSetterName(isUTC) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n }\r\n function secondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\r\n function millisecondsSetterName(isUTC) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n }\n\n function addCommas(x) {\r\n if (!isNumeric(x)) {\r\n return isString(x) ? x : '-';\r\n }\r\n var parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n }\r\n var normalizeCssArray$1 = normalizeCssArray;\r\n var replaceReg = /([&<>\"'])/g;\r\n var replaceMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n '\\'': '''\r\n };\r\n function encodeHTML(source) {\r\n return source == null\r\n ? ''\r\n : (source + '').replace(replaceReg, function (str, c) {\r\n return replaceMap[c];\r\n });\r\n }\r\n var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n var wrapVar = function (varName, seriesIdx) {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n };\r\n function formatTpl(tpl, paramsList, encode) {\r\n if (!isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n var seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n var $vars = paramsList[0].$vars || [];\r\n for (var i = 0; i < $vars.length; i++) {\r\n var alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (var k = 0; k < $vars.length; k++) {\r\n var val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\r\n }\r\n }\r\n return tpl;\r\n }\r\n function convertToColorString(color, defaultColor) {\r\n defaultColor = defaultColor || 'transparent';\r\n return isString(color)\r\n ? color\r\n : isObject(color)\r\n ? (color.colorStops\r\n && (color.colorStops[0] || {}).color\r\n || defaultColor)\r\n : defaultColor;\r\n }\n\n var each$1 = each;\r\n var LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n ];\r\n var HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n ];\r\n function boxLayout(orient, group, gap, maxWidth, maxHeight) {\r\n var x = 0;\r\n var y = 0;\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n var currentLineMaxSize = 0;\r\n group.eachChild(function (child, idx) {\r\n var rect = child.getBoundingRect();\r\n var nextChild = group.childAt(idx + 1);\r\n var nextChildRect = nextChild && nextChild.getBoundingRect();\r\n var nextX;\r\n var nextY;\r\n if (orient === 'horizontal') {\r\n var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n if (nextX > maxWidth || child.newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n if (nextY > maxHeight || child.newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n if (child.newline) {\r\n return;\r\n }\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n }\r\n var vbox = curry(boxLayout, 'vertical');\r\n var hbox = curry(boxLayout, 'horizontal');\r\n function getLayoutRect(positionInfo, containerRect, margin) {\r\n margin = normalizeCssArray$1(margin || 0);\r\n var containerWidth = containerRect.width;\r\n var containerHeight = containerRect.height;\r\n var left = parsePercent$2(positionInfo.left, containerWidth);\r\n var top = parsePercent$2(positionInfo.top, containerHeight);\r\n var right = parsePercent$2(positionInfo.right, containerWidth);\r\n var bottom = parsePercent$2(positionInfo.bottom, containerHeight);\r\n var width = parsePercent$2(positionInfo.width, containerWidth);\r\n var height = parsePercent$2(positionInfo.height, containerHeight);\r\n var verticalMargin = margin[2] + margin[0];\r\n var horizontalMargin = margin[1] + margin[3];\r\n var aspect = positionInfo.aspect;\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n if (aspect != null) {\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\r\n rect.margin = margin;\r\n return rect;\r\n }\r\n function fetchLayoutMode(ins) {\r\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? { type: layoutMode }\r\n : null;\r\n }\r\n function mergeLayoutParam(targetOption, newOption, opt) {\r\n var ignoreSize = opt && opt.ignoreSize;\r\n !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n var hResult = merge(HV_NAMES[0], 0);\r\n var vResult = merge(HV_NAMES[1], 1);\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n function merge(names, hvIdx) {\r\n var newParams = {};\r\n var newValueCount = 0;\r\n var merged = {};\r\n var mergedValueCount = 0;\r\n var enoughParamNumber = 2;\r\n each$1(names, function (name) {\r\n merged[name] = targetOption[name];\r\n });\r\n each$1(names, function (name) {\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n if (ignoreSize[hvIdx]) {\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n for (var i = 0; i < names.length; i++) {\r\n var name_1 = names[i];\r\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\r\n newParams[name_1] = targetOption[name_1];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n function hasProp(obj, name) {\r\n return obj.hasOwnProperty(name);\r\n }\r\n function hasValue(obj, name) {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n function copy(names, target, source) {\r\n each$1(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n }\r\n function getLayoutParams(source) {\r\n return copyLayoutParams({}, source);\r\n }\r\n function copyLayoutParams(target, source) {\r\n source && target && each$1(LOCATION_PARAMS, function (name) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n }\n\n var inner = makeInner();\r\n var ComponentModel = (function (_super) {\r\n __extends(ComponentModel, _super);\r\n function ComponentModel(option, parentModel, ecModel) {\r\n var _this = _super.call(this, option, parentModel, ecModel) || this;\r\n _this.uid = getUID('ec_cpt_model');\r\n return _this;\r\n }\r\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n };\r\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(this.mainType));\r\n merge(option, this.getDefaultOption());\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\r\n merge(this.option, option, true);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, option, layoutMode);\r\n }\r\n };\r\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) { };\r\n ComponentModel.prototype.getDefaultOption = function () {\r\n var ctor = this.constructor;\r\n if (!isExtendedClass(ctor)) {\r\n return ctor.defaultOption;\r\n }\r\n var fields = inner(this);\r\n if (!fields.defaultOption) {\r\n var optList = [];\r\n var clz = ctor;\r\n while (clz) {\r\n var opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n var defaultOption = {};\r\n for (var i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption;\r\n };\r\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\r\n var indexKey = (mainType + 'Index');\r\n var idKey = (mainType + 'Id');\r\n return queryReferringComponents(this.ecModel, mainType, {\r\n index: this.get(indexKey, true),\r\n id: this.get(idKey, true)\r\n }, opt);\r\n };\r\n ComponentModel.prototype.getBoxLayoutParams = function () {\r\n var boxLayoutModel = this;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n };\r\n ComponentModel.protoInitialize = (function () {\r\n var proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n return ComponentModel;\r\n }(Model));\r\n mountExtend(ComponentModel, Model);\r\n enableClassManagement(ComponentModel, { registerWhenExtend: true });\r\n enableSubTypeDefaulter(ComponentModel);\r\n enableTopologicalTravel(ComponentModel, getDependencies);\r\n function getDependencies(componentType) {\r\n var deps = [];\r\n each(ComponentModel.getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\r\n });\r\n deps = map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n return deps;\r\n }\n\n var platform = '';\r\n if (typeof navigator !== 'undefined') {\r\n platform = navigator.platform || '';\r\n }\r\n var decalColor = 'rgba(0, 0, 0, 0.2)';\r\n var globalDefault = {\r\n darkMode: 'auto',\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n dashLineOffset: 0,\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n textStyle: {\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n blendMode: null,\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationThreshold: 2000,\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n hoverLayerThreshold: 3000,\r\n useUTC: false\r\n };\n\n var VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'seriesName'\r\n ]);\r\n var SOURCE_FORMAT_ORIGINAL = 'original';\r\n var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\r\n var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\r\n var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\r\n var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\r\n var SOURCE_FORMAT_UNKNOWN = 'unknown';\r\n var SERIES_LAYOUT_BY_COLUMN = 'column';\r\n var SERIES_LAYOUT_BY_ROW = 'row';\n\n var BE_ORDINAL = {\r\n Must: 1,\r\n Might: 2,\r\n Not: 3\r\n };\r\n var innerGlobalModel = makeInner();\r\n function resetSourceDefaulter(ecModel) {\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n }\r\n function inheritSourceMetaRawOption(upstream, newMetaRawOption) {\r\n var parentMetaRawOption = upstream ? upstream.metaRawOption : null;\r\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, parentMetaRawOption ? parentMetaRawOption.seriesLayoutBy : null);\r\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upstream ? upstream.startIndex : null);\r\n var dimensions = retrieve2(newMetaRawOption.dimensions, upstream ? upstream.dimensionsDefine : null);\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n }\r\n function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n var encodeItemName = [];\r\n var encodeSeriesName = [];\r\n var ecModel = seriesModel.ecModel;\r\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n var baseCategoryDimIndex;\r\n var categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n var coordDimInfo = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n var datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, { categoryWayDim: categoryWayValueDimStart, valueWayDim: 0 });\r\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\r\n var coordDimName = coordDimInfo.name;\r\n var count = getDataDimCountOnCoordDim(coordDimInfo);\r\n if (baseCategoryDimIndex == null) {\r\n var start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n }\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n else {\r\n var start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n function pushDim(dimIdxArr, idxFrom, idxCount) {\r\n for (var i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n function getDataDimCountOnCoordDim(coordDimInfo) {\r\n var dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n return encode;\r\n }\r\n function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\r\n var encode = {};\r\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n var sourceFormat = source.sourceFormat;\r\n var dimensionsDefine = source.dimensionsDefine;\r\n var potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n var idxResult = (function () {\r\n var idxRes0 = {};\r\n var idxRes1 = {};\r\n var guessRecords = [];\r\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\r\n guessRecords.push(guessResult);\r\n var isPureNumber = guessResult === BE_ORDINAL.Not;\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n function fulfilled(idxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n return encode;\r\n }\r\n function querySeriesUpstreamDatasetModel(seriesModel) {\r\n var thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n }, SINGLE_REFERRING).models[0];\r\n }\r\n }\r\n function queryDatasetUpstreamDatasetModels(datasetModel) {\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)) {\r\n return [];\r\n }\r\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n }, SINGLE_REFERRING).models;\r\n }\r\n function guessOrdinal(source, dimIndex) {\r\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\r\n }\r\n function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\r\n var result;\r\n var maxLoop = 5;\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var dimName;\r\n var dimType;\r\n if (dimensionsDefine) {\r\n var dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n var sample = dataArrayRows[dimIndex];\r\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n var row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var dataObjectRows = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n var item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n var dataKeyedColumns = data;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n var sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var dataOriginal = data;\r\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n var item = dataOriginal[i];\r\n var val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n function detectValue(val) {\r\n var beStr = isString(val);\r\n if (val != null && isFinite(val) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n return BE_ORDINAL.Not;\r\n }\n\n var internalOptionCreatorMap = createHashMap();\r\n function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\r\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n var internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (var i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n }\n\n var innerColor = makeInner();\r\n var innerDecal = makeInner();\r\n var PaletteMixin = (function () {\r\n function PaletteMixin() {\r\n }\r\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\r\n var defaultPalette = normalizeToArray(this.get('color', true));\r\n var layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n };\r\n PaletteMixin.prototype.clearColorPalette = function () {\r\n clearPalette(this, innerColor);\r\n };\r\n return PaletteMixin;\r\n }());\r\n function getDecalFromPalette(ecModel, name, scope, requestNum) {\r\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n }\r\n function getNearestPalette(palettes, requestColorNum) {\r\n var paletteNum = palettes.length;\r\n for (var i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n }\r\n function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\r\n scope = scope || that;\r\n var scopeFields = inner(scope);\r\n var paletteIdx = scopeFields.paletteIdx || 0;\r\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n var palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n palette = palette || defaultPalette;\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n var pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n return pickedPaletteItem;\r\n }\r\n function clearPalette(that, inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n }\n\n var reCreateSeriesIndices;\r\n var assertSeriesInitialized;\r\n var initBase;\r\n var OPTION_INNER_KEY = '\\0_ec_inner';\r\n var GlobalModel = (function (_super) {\r\n __extends(GlobalModel, _super);\r\n function GlobalModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\r\n theme = theme || {};\r\n this.option = null;\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n };\r\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\r\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\r\n var innerOpt = normalizeSetOptionInput(opts);\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n this._resetOption(null, innerOpt);\r\n };\r\n GlobalModel.prototype.resetOption = function (type, opt) {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n };\r\n GlobalModel.prototype._resetOption = function (type, opt) {\r\n var optionChanged = false;\r\n var optionManager = this._optionManager;\r\n if (!type || type === 'recreate') {\r\n var baseOption = optionManager.mountOption(type === 'recreate');\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n var timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n if (!type || type === 'recreate' || type === 'media') {\r\n var mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n return optionChanged;\r\n };\r\n GlobalModel.prototype.mergeOption = function (option) {\r\n this._mergeOption(option, null);\r\n };\r\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\r\n var option = this.option;\r\n var componentsMap = this._componentsMap;\r\n var componentsCount = this._componentsCount;\r\n var newCmptTypes = [];\r\n var newCmptTypeMap = createHashMap();\r\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n resetSourceDefaulter(this);\r\n each(newOption, function (componentOption, mainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(mainType)) {\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n if (replaceMergeMainTypeMap) {\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\r\n function visitComponent(mainType) {\r\n var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));\r\n var oldCmptList = componentsMap.get(mainType);\r\n var mergeMode = !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n var optionsByMainType = [];\r\n var cmptsByMainType = [];\r\n var cmptsCountByMainType = 0;\r\n each(mappingResult, function (resultItem, index) {\r\n var componentModel = resultItem.existing;\r\n var newCmptOption = resultItem.newOption;\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n }\r\n else {\r\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n var extraOpt = extend({\r\n componentIndex: index\r\n }, resultItem.keyInfo);\r\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n };\r\n GlobalModel.prototype.getOption = function () {\r\n var option = clone(this.option);\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n var opts = normalizeToArray(optInMainType);\r\n var realLen = opts.length;\r\n var metNonInner = false;\r\n for (var i = realLen - 1; i >= 0; i--) {\r\n if (opts[i] && !isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n delete option[OPTION_INNER_KEY];\r\n return option;\r\n };\r\n GlobalModel.prototype.getTheme = function () {\r\n return this._theme;\r\n };\r\n GlobalModel.prototype.getLocaleModel = function () {\r\n return this._locale;\r\n };\r\n GlobalModel.prototype.getLocale = function (localePosition) {\r\n var locale = this.getLocaleModel();\r\n return locale.get(localePosition);\r\n };\r\n GlobalModel.prototype.setUpdatePayload = function (payload) {\r\n this._payload = payload;\r\n };\r\n GlobalModel.prototype.getUpdatePayload = function () {\r\n return this._payload;\r\n };\r\n GlobalModel.prototype.getComponent = function (mainType, idx) {\r\n var list = this._componentsMap.get(mainType);\r\n if (list) {\r\n var cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.queryComponents = function (condition) {\r\n var mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n var index = condition.index;\r\n var id = condition.id;\r\n var name = condition.name;\r\n var cmpts = this._componentsMap.get(mainType);\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n var result;\r\n if (index != null) {\r\n result = [];\r\n each(normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n result = filter(cmpts, function (cmpt) { return !!cmpt; });\r\n }\r\n return filterBySubType(result, condition);\r\n };\r\n GlobalModel.prototype.findComponents = function (condition) {\r\n var query = condition.query;\r\n var mainType = condition.mainType;\r\n var queryCond = getQueryCond(query);\r\n var result = queryCond\r\n ? this.queryComponents(queryCond)\r\n : filter(this._componentsMap.get(mainType), function (cmpt) { return !!cmpt; });\r\n return doFilter(filterBySubType(result, condition));\r\n function getQueryCond(q) {\r\n var indexAttr = mainType + 'Index';\r\n var idAttr = mainType + 'Id';\r\n var nameAttr = mainType + 'Name';\r\n return q && (q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null)\r\n ? {\r\n mainType: mainType,\r\n index: q[indexAttr],\r\n id: q[idAttr],\r\n name: q[nameAttr]\r\n }\r\n : null;\r\n }\r\n function doFilter(res) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n };\r\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\r\n var componentsMap = this._componentsMap;\r\n if (isFunction(mainType)) {\r\n var ctxForAll_1 = cb;\r\n var cbForAll_1 = mainType;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n var cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (var i = 0; cmpts && i < cmpts.length; i++) {\r\n var cmpt = cmpts[i];\r\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\r\n }\r\n }\r\n };\r\n GlobalModel.prototype.getSeriesByName = function (name) {\r\n var nameStr = convertOptionIdName(name, null);\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && nameStr != null && oneSeries.name === nameStr; });\r\n };\r\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\r\n return this._componentsMap.get('series')[seriesIndex];\r\n };\r\n GlobalModel.prototype.getSeriesByType = function (subType) {\r\n return filter(this._componentsMap.get('series'), function (oneSeries) { return !!oneSeries && oneSeries.subType === subType; });\r\n };\r\n GlobalModel.prototype.getSeries = function () {\r\n return filter(this._componentsMap.get('series').slice(), function (oneSeries) { return !!oneSeries; });\r\n };\r\n GlobalModel.prototype.getSeriesCount = function () {\r\n return this._componentsCount.get('series');\r\n };\r\n GlobalModel.prototype.eachSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n };\r\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n var series = this._componentsMap.get('series')[rawSeriesIndex];\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n };\r\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n };\r\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n };\r\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\r\n return (this._seriesIndices || []).slice();\r\n };\r\n GlobalModel.prototype.filterSeries = function (cb, context) {\r\n assertSeriesInitialized(this);\r\n var newSeriesIndices = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n var series = this._componentsMap.get('series')[seriesRawIdx];\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n };\r\n GlobalModel.prototype.restoreData = function (payload) {\r\n reCreateSeriesIndices(this);\r\n var componentsMap = this._componentsMap;\r\n var componentTypes = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (componentType !== 'series'\r\n || !isNotTargetSeries(component, payload))) {\r\n component.restoreData();\r\n }\r\n });\r\n });\r\n };\r\n GlobalModel.internalField = (function () {\r\n reCreateSeriesIndices = function (ecModel) {\r\n var seriesIndices = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n assertSeriesInitialized = function (ecModel) {\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n initBase = function (ecModel, baseOption) {\r\n ecModel.option = {};\r\n ecModel.option[OPTION_INNER_KEY] = 1;\r\n ecModel._componentsMap = createHashMap({ series: [] });\r\n ecModel._componentsCount = createHashMap();\r\n var airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n merge(baseOption, globalDefault, false);\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n })();\r\n return GlobalModel;\r\n }(Model));\r\n function isNotTargetSeries(seriesModel, payload) {\r\n if (payload) {\r\n var index = payload.seriesIndex;\r\n var id = payload.seriesId;\r\n var name_1 = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name_1 != null && seriesModel.name !== name_1);\r\n }\r\n }\r\n function mergeTheme(option, theme) {\r\n var notMergeColorLayer = option.color && !option.colorLayer;\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n function queryByIdOrName(attr, idOrName, cmpts) {\r\n if (isArray(idOrName)) {\r\n var keyMap_1 = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n var idName = convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap_1.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, function (cmpt) { return cmpt && keyMap_1.get(cmpt[attr]); });\r\n }\r\n else {\r\n var idName_1 = convertOptionIdName(idOrName, null);\r\n return filter(cmpts, function (cmpt) { return cmpt && idName_1 != null && cmpt[attr] === idName_1; });\r\n }\r\n }\r\n function filterBySubType(components, condition) {\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, function (cmpt) { return cmpt && cmpt.subType === condition.subType; })\r\n : components;\r\n }\r\n function normalizeSetOptionInput(opts) {\r\n var replaceMergeMainTypeMap = createHashMap();\r\n opts && each(normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n }\r\n mixin(GlobalModel, PaletteMixin);\n\n var availableMethods = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n 'getOption',\r\n 'getId',\r\n 'updateLabelLayout'\r\n ];\r\n var ExtensionAPI = (function () {\r\n function ExtensionAPI(ecInstance) {\r\n each(availableMethods, function (methodName) {\r\n this[methodName] = bind(ecInstance[methodName], ecInstance);\r\n }, this);\r\n }\r\n return ExtensionAPI;\r\n }());\n\n var coordinateSystemCreators = {};\r\n var CoordinateSystemManager = (function () {\r\n function CoordinateSystemManager() {\r\n this._coordinateSystems = [];\r\n }\r\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\r\n var coordinateSystems = [];\r\n each(coordinateSystemCreators, function (creater, type) {\r\n var list = creater.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n this._coordinateSystems = coordinateSystems;\r\n };\r\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\r\n each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n };\r\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\r\n return this._coordinateSystems.slice();\r\n };\r\n CoordinateSystemManager.register = function (type, creator) {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n CoordinateSystemManager.get = function (type) {\r\n return coordinateSystemCreators[type];\r\n };\r\n return CoordinateSystemManager;\r\n }());\n\n var QUERY_REG = /^(min|max)?(.+)$/;\r\n var OptionManager = (function () {\r\n function OptionManager(api) {\r\n this._timelineOptions = [];\r\n this._mediaList = [];\r\n this._currentMediaIndices = [];\r\n this._api = api;\r\n }\r\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\r\n if (rawOption) {\r\n each(normalizeToArray(rawOption.series), function (series) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray(rawOption.dataset), function (dataset) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n rawOption = clone(rawOption);\r\n var optionBackup = this._optionBackup;\r\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\r\n this._newBaseOption = newParsedOption.baseOption;\r\n if (optionBackup) {\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n };\r\n OptionManager.prototype.mountOption = function (isRecreate) {\r\n var optionBackup = this._optionBackup;\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n return clone(isRecreate\r\n ? optionBackup.baseOption : this._newBaseOption);\r\n };\r\n OptionManager.prototype.getTimelineOption = function (ecModel) {\r\n var option;\r\n var timelineOptions = this._timelineOptions;\r\n if (timelineOptions.length) {\r\n var timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(timelineOptions[timelineModel.getCurrentIndex()]);\r\n }\r\n }\r\n return option;\r\n };\r\n OptionManager.prototype.getMediaOption = function (ecModel) {\r\n var ecWidth = this._api.getWidth();\r\n var ecHeight = this._api.getHeight();\r\n var mediaList = this._mediaList;\r\n var mediaDefault = this._mediaDefault;\r\n var indices = [];\r\n var result = [];\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n for (var i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\r\n });\r\n }\r\n this._currentMediaIndices = indices;\r\n return result;\r\n };\r\n return OptionManager;\r\n }());\r\n function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) {\r\n var mediaList = [];\r\n var mediaDefault;\r\n var baseOption;\r\n var declaredBaseOption = rawOption.baseOption;\r\n var timelineOnRoot = rawOption.timeline;\r\n var timelineOptionsOnRoot = rawOption.options;\r\n var mediaOnRoot = rawOption.media;\r\n var hasMedia = !!rawOption.media;\r\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline));\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject(singleMedia.query.option)) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, function (option) { return doPreprocess(option); });\r\n each(mediaList, function (media) { return doPreprocess(media.option); });\r\n function doPreprocess(option) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n }\r\n function applyMediaQuery(query, ecWidth, ecHeight) {\r\n var realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight\r\n };\r\n var applicatable = true;\r\n each(query, function (value, attr) {\r\n var matched = attr.match(QUERY_REG);\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n var operator = matched[1];\r\n var realAttr = matched[2].toLowerCase();\r\n if (!compare(realMap[realAttr], value, operator)) {\r\n applicatable = false;\r\n }\r\n });\r\n return applicatable;\r\n }\r\n function compare(real, expect, operator) {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else {\r\n return real === expect;\r\n }\r\n }\r\n function indicesEquals(indices1, indices2) {\r\n return indices1.join(',') === indices2.join(',');\r\n }\n\n var each$2 = each;\r\n var isObject$1 = isObject;\r\n var POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n ];\r\n function compatEC2ItemStyle(opt) {\r\n var itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n var styleName = POSSIBLE_STYLES[i];\r\n var normalItemStyleOpt = itemStyleOpt.normal;\r\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n }\r\n function convertNormalEmphasis(opt, optType, useExtend) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n var normalOpt = opt[optType].normal;\r\n var emphasisOpt = opt[optType].emphasis;\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\r\n }\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n }\r\n function removeEC3NormalStatus(opt) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n }\r\n function compatTextStyle(opt, propName) {\r\n var labelOptSingle = isObject$1(opt) && opt[propName];\r\n var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\r\n }\r\n for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n var textPropName = TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n }\r\n function compatEC3CommonStyles(opt) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n }\r\n function processSeries(seriesOpt) {\r\n if (!isObject$1(seriesOpt)) {\r\n return;\r\n }\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n compatTextStyle(seriesOpt, 'label');\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n var markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n var markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n var markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n var data = seriesOpt.data;\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n var edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !isTypedArray(edgeData)) {\r\n for (var i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n var mpData = markPoint.data;\r\n for (var i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n var mlData = markLine.data;\r\n for (var i = 0; i < mlData.length; i++) {\r\n if (isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n }\r\n function toArr(o) {\r\n return isArray(o) ? o : o ? [o] : [];\r\n }\r\n function toObj(o) {\r\n return (isArray(o) ? o[0] : o) || {};\r\n }\r\n function globalCompatStyle(option, isTheme) {\r\n each$2(toArr(option.series), function (seriesOpt) {\r\n isObject$1(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n each$2(axes, function (axisName) {\r\n each$2(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.parallel), function (parallelOpt) {\r\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n each$2(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n each$2(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n });\r\n each$2(toArr(option.geo), function (geoOpt) {\r\n if (isObject$1(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each$2(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n each$2(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n var data = timelineOpt.data;\r\n isArray(data) && each(data, function (item) {\r\n if (isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n each$2(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each$2(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n }\n\n function get(opt, path) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n }\r\n function set(opt, path, val, overwrite) {\r\n var pathArr = path.split(',');\r\n var obj = opt;\r\n var key;\r\n var i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n }\r\n function compatLayoutProperties(option) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n }\r\n var LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n ];\r\n var COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n ];\r\n var BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n ];\r\n function compatBarItemStyle(option) {\r\n var itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n var newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function compatPieLabel(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n }\r\n function compatSunburstState(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n }\r\n function compatGraphFocus(option) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n }\r\n function traverseTree(data, cb) {\r\n if (data) {\r\n for (var i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n }\r\n function globalBackwardCompat(option, isTheme) {\r\n globalCompatStyle(option, isTheme);\r\n option.series = normalizeToArray(option.series);\r\n each(option.series, function (seriesOpt) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n var seriesType = seriesOpt.type;\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel(seriesOpt.label);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n var pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle(seriesOpt.backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n var data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (var i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n var highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n compatSunburstState(seriesOpt);\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n var options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n }\n\n function dataStack(ecModel) {\r\n var stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var stack = seriesModel.get('stack');\r\n if (stack) {\r\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n var data = seriesModel.getData();\r\n var stackInfo = {\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\r\n return;\r\n }\r\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n stackInfoMap.each(calculateStack);\r\n }\r\n function calculateStack(stackInfoList) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n var resultVal = [];\r\n var resultNaN = [NaN, NaN];\r\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n var targetData = targetStackInfo.data;\r\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n var newData = targetData.map(dims, function (v0, v1, dataIndex) {\r\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n var byValue;\r\n var stackedDataRawIndex;\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\r\n }\r\n var stackedOver = NaN;\r\n for (var j = idxInStack - 1; j >= 0; j--) {\r\n var stackInfo = stackInfoList[j];\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n if (stackedDataRawIndex >= 0) {\r\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\r\n if ((sum >= 0 && val > 0)\r\n || (sum <= 0 && val < 0)) {\r\n sum += val;\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n return resultVal;\r\n });\r\n targetData.hostModel.setData(newData);\r\n targetStackInfo.data = newData;\r\n });\r\n }\n\n var SourceImpl = (function () {\r\n function SourceImpl(fields) {\r\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDefine = fields.dimensionsDefine;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.encodeDefine = fields.encodeDefine;\r\n this.metaRawOption = fields.metaRawOption;\r\n }\r\n return SourceImpl;\r\n }());\r\n function isSourceInstance(val) {\r\n return val instanceof SourceImpl;\r\n }\r\n function createSource(sourceData, thisMetaRawOption, sourceFormat, encodeDefine) {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\r\n var source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(encodeDefine),\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n return source;\r\n }\r\n function createSourceFromSeriesDataOption(data) {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n }\r\n function cloneSourceShallow(source) {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount,\r\n encodeDefine: makeEncodeDefine(source.encodeDefine)\r\n });\r\n }\r\n function makeEncodeDefine(encodeDefine) {\r\n return encodeDefine\r\n ? createHashMap(encodeDefine)\r\n : null;\r\n }\r\n function detectSourceFormat(data) {\r\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n var item = data[i];\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (var key in data) {\r\n if (hasOwn(data, key) && isArrayLike(data[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (data != null) {\r\n throw new Error('Invalid data');\r\n }\r\n return sourceFormat;\r\n }\r\n function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\r\n var dimensionsDetectedCount;\r\n var startIndex;\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex: startIndex,\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var dataArrayRows = data;\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '');\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var value0 = getDataItemValue(data[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n }\r\n function objectRowsCollectDimensions(data) {\r\n var firstIndex = 0;\r\n var obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) { }\r\n if (obj) {\r\n var dimensions_1 = [];\r\n each(obj, function (value, key) {\r\n dimensions_1.push(key);\r\n });\r\n return dimensions_1;\r\n }\r\n }\r\n function normalizeDimensionsOption(dimensionsDefine) {\r\n if (!dimensionsDefine) {\r\n return;\r\n }\r\n var nameMap = createHashMap();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n var item = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n if (name == null) {\r\n return item;\r\n }\r\n item.name += '';\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n var exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, { count: 1 });\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n return item;\r\n });\r\n }\r\n function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (var i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n var value0 = data[0] || [];\r\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n }\n\n var _a, _b, _c;\r\n var providerMethods;\r\n var mountMethods;\r\n var DefaultDataProvider = (function () {\r\n function DefaultDataProvider(sourceParam, dimSize) {\r\n var source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam)\r\n : sourceParam;\r\n this._source = source;\r\n var data = this._data = source.data;\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n mountMethods(this, data, source);\r\n }\r\n DefaultDataProvider.prototype.getSource = function () {\r\n return this._source;\r\n };\r\n DefaultDataProvider.prototype.count = function () {\r\n return 0;\r\n };\r\n DefaultDataProvider.prototype.getItem = function (idx, out) {\r\n return;\r\n };\r\n DefaultDataProvider.prototype.appendData = function (newData) {\r\n };\r\n DefaultDataProvider.prototype.clean = function () {\r\n };\r\n DefaultDataProvider.protoInitialize = (function () {\r\n var proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n DefaultDataProvider.internalField = (function () {\r\n var _a;\r\n mountMethods = function (provider, data, source) {\r\n var sourceFormat = source.sourceFormat;\r\n var seriesLayoutBy = source.seriesLayoutBy;\r\n var startIndex = source.startIndex;\r\n var dimsDef = source.dimensionsDefine;\r\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n extend(provider, methods);\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n var getItemForTypedArray = function (idx, out) {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n var offset = dimSize * idx;\r\n for (var i = 0; i < dimSize; i++) {\r\n out[i] = data[offset + i];\r\n }\r\n return out;\r\n };\r\n var fillStorageForTypedArray = function (start, end, storage, extent) {\r\n var data = this._data;\r\n var dimSize = this._dimSize;\r\n for (var dim = 0; dim < dimSize; dim++) {\r\n var dimExtent = extent[dim];\r\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n var count = end - start;\r\n var arr = storage[dim];\r\n for (var i = 0; i < count; i++) {\r\n var val = data[(start + i) * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n var countForTypedArray = function () {\r\n return this._data ? (this._data.length / this._dimSize) : 0;\r\n };\r\n providerMethods = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\r\n pure: true,\r\n appendData: function (newData) {\r\n var data = this._data;\r\n each(newData, function (newCol, key) {\r\n var oldCol = data[key] || (data[key] = []);\r\n for (var i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = {\r\n appendData: appendDataSimply\r\n },\r\n _a[SOURCE_FORMAT_TYPED_ARRAY] = {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (newData) {\r\n if (__DEV__) {\r\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\r\n }\r\n this._data = newData;\r\n },\r\n clean: function () {\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n },\r\n _a);\r\n function appendDataSimply(newData) {\r\n for (var i = 0; i < newData.length; i++) {\r\n this._data.push(newData[i]);\r\n }\r\n }\r\n })();\r\n return DefaultDataProvider;\r\n }());\r\n var getItemSimply = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx];\r\n };\r\n var rawSourceItemGetterMap = (_a = {},\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\r\n return rawData[idx + startIndex];\r\n },\r\n _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx) {\r\n idx += startIndex;\r\n var item = [];\r\n var data = rawData;\r\n for (var i = 0; i < data.length; i++) {\r\n var row = data[i];\r\n item.push(row ? row[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply,\r\n _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx) {\r\n var item = [];\r\n for (var i = 0; i < dimsDef.length; i++) {\r\n var dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n item.push(col ? col[idx] : null);\r\n }\r\n return item;\r\n },\r\n _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply,\r\n _a);\r\n function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var countSimply = function (rawData, startIndex, dimsDef) {\r\n return rawData.length;\r\n };\r\n var rawSourceDataCounterMap = (_b = {},\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\r\n return Math.max(0, rawData.length - startIndex);\r\n },\r\n _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\r\n var row = rawData[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply,\r\n _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\r\n var dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n var col = rawData[dimName];\r\n return col ? col.length : 0;\r\n },\r\n _b[SOURCE_FORMAT_ORIGINAL] = countSimply,\r\n _b);\r\n function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\r\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n }\r\n var getRawValueSimply = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimIndex] : dataItem;\r\n };\r\n var rawSourceValueGetterMap = (_c = {},\r\n _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, dimName) {\r\n return dimIndex != null ? dataItem[dimName] : dataItem;\r\n },\r\n _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply,\r\n _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, dimName) {\r\n var value = getDataItemValue(dataItem);\r\n return (dimIndex == null || !(value instanceof Array))\r\n ? value\r\n : value[dimIndex];\r\n },\r\n _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply,\r\n _c);\r\n function getRawSourceValueGetter(sourceFormat) {\r\n var method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not suppport get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n }\r\n function getMethodMapKey(sourceFormat, seriesLayoutBy) {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n }\r\n function retrieveRawValue(data, dataIndex, dim) {\r\n if (!data) {\r\n return;\r\n }\r\n var dataItem = data.getRawDataItem(dataIndex);\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var sourceFormat = data.getProvider().getSource().sourceFormat;\r\n var dimName;\r\n var dimIndex;\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (dimInfo) {\r\n dimName = dimInfo.name;\r\n dimIndex = dimInfo.index;\r\n }\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, dimName);\r\n }\n\n var DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n var DataFormatMixin = (function () {\r\n function DataFormatMixin() {\r\n }\r\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\r\n var data = this.getData(dataType);\r\n var rawValue = this.getRawValue(dataIndex, dataType);\r\n var rawDataIndex = data.getRawIndex(dataIndex);\r\n var name = data.getName(dataIndex);\r\n var itemOpt = data.getRawDataItem(dataIndex);\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\r\n var borderColor = style && style.stroke;\r\n var mainType = this.mainType;\r\n var isSeries = mainType === 'series';\r\n var userOutput = data.userOutput;\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: this.seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.dimensionNames : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n };\r\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\r\n status = status || 'normal';\r\n var data = this.getData(dataType);\r\n var params = this.getDataParams(dataIndex, dataType);\r\n if (extendParams) {\r\n extend(params, extendParams);\r\n }\r\n if (labelDimIndex != null && (params.value instanceof Array)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n if (!formatter) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']);\r\n }\r\n if (typeof formatter === 'function') {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (typeof formatter === 'string') {\r\n var str = formatTpl(formatter, params);\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dim) {\r\n var len = dim.length;\r\n if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') {\r\n dim = +dim.slice(1, len - 1);\r\n }\r\n return retrieveRawValue(data, dataIndex, dim);\r\n });\r\n }\r\n };\r\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n };\r\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return;\r\n };\r\n return DataFormatMixin;\r\n }());\n\n function createTask(define) {\r\n return new Task(define);\r\n }\r\n var Task = (function () {\r\n function Task(define) {\r\n define = define || {};\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n this._dirty = true;\r\n }\r\n Task.prototype.perform = function (performArgs) {\r\n var upTask = this._upstream;\r\n var skip = performArgs && performArgs.skip;\r\n if (this._dirty && upTask) {\r\n var context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n var planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n var lastModBy = normalizeModBy(this._modBy);\r\n var lastModDataCount = this._modDataCount || 0;\r\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n var modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n function normalizeModBy(val) {\r\n !(val >= 1) && (val = 1);\r\n return val;\r\n }\r\n var forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n var step = performArgs && performArgs.step;\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n if (this._progress) {\r\n var start = this._dueIndex;\r\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n var progress = this._progress;\r\n if (isArray(progress)) {\r\n for (var i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n this._dueIndex = end;\r\n var outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n if (__DEV__) {\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n return this.unfinished();\r\n };\r\n Task.prototype.dirty = function () {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n };\r\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n };\r\n Task.prototype._doReset = function (skip) {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n var progress;\r\n var forceFirstProgress;\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && progress.progress) {\r\n forceFirstProgress = progress.forceFirstProgress;\r\n progress = progress.progress;\r\n }\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n this._progress = progress;\r\n this._modBy = this._modDataCount = null;\r\n var downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n return forceFirstProgress;\r\n };\r\n Task.prototype.unfinished = function () {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n };\r\n Task.prototype.pipe = function (downTask) {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n };\r\n Task.prototype.dispose = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n this._dirty = false;\r\n this._disposed = true;\r\n };\r\n Task.prototype.getUpstream = function () {\r\n return this._upstream;\r\n };\r\n Task.prototype.getDownstream = function () {\r\n return this._downstream;\r\n };\r\n Task.prototype.setOutputEnd = function (end) {\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n };\r\n return Task;\r\n }());\r\n var iterator = (function () {\r\n var end;\r\n var current;\r\n var modBy;\r\n var modDataCount;\r\n var winCount;\r\n var it = {\r\n reset: function (s, e, sStep, sCount) {\r\n current = s;\r\n end = e;\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n return it;\r\n function sequentialNext() {\r\n return current < end ? current++ : null;\r\n }\r\n function modNext() {\r\n var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n var result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n })();\n\n function parseDataValue(value, opt) {\r\n var dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n var ordinalMeta = opt && opt.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.parseAndCollect(value)\r\n : value;\r\n }\r\n if (dimType === 'time'\r\n && typeof value !== 'number'\r\n && value != null\r\n && value !== '-') {\r\n value = +parseDate(value);\r\n }\r\n return (value == null || value === '')\r\n ? NaN\r\n : +value;\r\n }\r\n var valueParserMap = createHashMap({\r\n 'number': function (val) {\r\n return parseFloat(val);\r\n },\r\n 'time': function (val) {\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return typeof val === 'string' ? trim(val) : val;\r\n }\r\n });\n\n var ExternalSource = (function () {\r\n function ExternalSource() {\r\n }\r\n ExternalSource.prototype.getRawData = function () {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\r\n throw new Error('not supported');\r\n };\r\n ExternalSource.prototype.cloneRawData = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.getDimensionInfo = function (dim) {\r\n return;\r\n };\r\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.count = function () {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n return;\r\n };\r\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\r\n return parseDataValue(rawVal, dimInfo);\r\n };\r\n return ExternalSource;\r\n }());\r\n function createExternalSource(internalSource, externalTransform) {\r\n var extSource = new ExternalSource();\r\n var data = internalSource.data;\r\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n var sourceHeaderCount = internalSource.startIndex;\r\n var dimensions = [];\r\n var dimsByName = {};\r\n var dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n var name = dimDef.name;\r\n var dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n if (name != null) {\r\n var errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n else {\r\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n var dimDef = dimensions[dimIndex];\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\r\n }\r\n };\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n return extSource;\r\n }\r\n function getRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS\r\n || !data\r\n || (isArray(data) && !data.length)) {\r\n return upstream.data;\r\n }\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n function cloneRawData(upstream) {\r\n var sourceFormat = upstream.sourceFormat;\r\n var data = upstream.data;\r\n if (!data) {\r\n return data;\r\n }\r\n else if (isArray(data) && !data.length) {\r\n return [];\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(data[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n var result = [];\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n result.push(extend({}, data[i]));\r\n }\r\n return result;\r\n }\r\n }\r\n function getDimensionInfo(dimensions, dimsByName, dim) {\r\n if (dim == null) {\r\n return;\r\n }\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !hasOwn(dimsByName, dim))) {\r\n return dimensions[dim];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim];\r\n }\r\n }\r\n function cloneAllDimensionInfo(dimensions) {\r\n return clone(dimensions);\r\n }\r\n var externalTransformMap = createHashMap();\r\n function registerExternalTransform(externalTransform) {\r\n externalTransform = clone(externalTransform);\r\n var type = externalTransform.type;\r\n var errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n }\r\n function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\r\n var pipedTransOption = normalizeToArray(rawTransOption);\r\n var pipeLen = pipedTransOption.length;\r\n var errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n for (var i = 0, len = pipeLen; i < len; i++) {\r\n var transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n return sourceList;\r\n }\r\n function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {\r\n var errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var transType = transOption.type;\r\n var externalTransform = externalTransformMap.get(transType);\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n var extUpSourceList = map(upSourceList, function (upSource) { return createExternalSource(upSource, externalTransform); });\r\n var resultList = normalizeToArray(externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n }));\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n var printStrArr = map(resultList, function (extSource) {\r\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n consoleLog(printStrArr);\r\n }\r\n }\r\n return map(resultList, function (result) {\r\n var errMsg = '';\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var resultData = result.data;\r\n if (resultData != null) {\r\n if (!isObject(resultData) && !isArrayLike(resultData)) {\r\n if (__DEV__) {\r\n errMsg = 'Result data should be object or array in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n else {\r\n resultData = upSourceList[0].data;\r\n }\r\n var resultMetaRawOption = inheritSourceMetaRawOption(upSourceList[0], {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n });\r\n return createSource(resultData, resultMetaRawOption, null, null);\r\n });\r\n }\n\n var SourceManager = (function () {\r\n function SourceManager(sourceHost) {\r\n this._sourceList = [];\r\n this._upstreamSignList = [];\r\n this._versionSignBase = 0;\r\n this._sourceHost = sourceHost;\r\n }\r\n SourceManager.prototype.dirty = function () {\r\n this._setLocalSource([], []);\r\n };\r\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n };\r\n SourceManager.prototype._getVersionSign = function () {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n };\r\n SourceManager.prototype.prepareSource = function () {\r\n if (this._isDirty()) {\r\n this._createSource();\r\n }\r\n };\r\n SourceManager.prototype._createSource = function () {\r\n this._setLocalSource([], []);\r\n var sourceHost = this._sourceHost;\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n var hasUpstream = !!upSourceMgrList.length;\r\n var resultSourceList;\r\n var upstreamSignList;\r\n if (isSeries(sourceHost)) {\r\n var seriesModel = sourceHost;\r\n var data = void 0;\r\n var sourceFormat = void 0;\r\n var upSource = void 0;\r\n if (hasUpstream) {\r\n var upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n else {\r\n data = seriesModel.get('data', true);\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n var thisMetaRawOption = inheritSourceMetaRawOption(upSource, this._getSourceMetaRawOption());\r\n resultSourceList = [createSource(data, thisMetaRawOption, sourceFormat, seriesModel.get('encode', true))];\r\n }\r\n else {\r\n var datasetModel = sourceHost;\r\n if (hasUpstream) {\r\n var result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n else {\r\n var sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null, null)];\r\n upstreamSignList = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n };\r\n SourceManager.prototype._applyTransform = function (upMgrList) {\r\n var datasetModel = this._sourceHost;\r\n var transformOption = datasetModel.get('transform', true);\r\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n if (fromTransformResult != null) {\r\n var errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n var sourceList;\r\n var upSourceList = [];\r\n var upstreamSignList = [];\r\n each(upMgrList, function (upMgr) {\r\n upMgr.prepareSource();\r\n var upSource = upMgr.getSource(fromTransformResult || 0);\r\n var errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n if (transformOption) {\r\n sourceList = applyDataTransform(transformOption, upSourceList, { datasetIndex: datasetModel.componentIndex });\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n return { sourceList: sourceList, upstreamSignList: upstreamSignList };\r\n };\r\n SourceManager.prototype._isDirty = function () {\r\n var sourceList = this._sourceList;\r\n if (!sourceList.length) {\r\n return true;\r\n }\r\n var upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (var i = 0; i < upSourceMgrList.length; i++) {\r\n var upSrcMgr = upSourceMgrList[i];\r\n if (upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\r\n return true;\r\n }\r\n }\r\n };\r\n SourceManager.prototype.getSource = function (sourceIndex) {\r\n return this._sourceList[sourceIndex || 0];\r\n };\r\n SourceManager.prototype._getUpstreamSourceManagers = function () {\r\n var sourceHost = this._sourceHost;\r\n if (isSeries(sourceHost)) {\r\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { return datasetModel.getSourceManager(); });\r\n }\r\n };\r\n SourceManager.prototype._getSourceMetaRawOption = function () {\r\n var sourceHost = this._sourceHost;\r\n var seriesLayoutBy;\r\n var sourceHeader;\r\n var dimensions;\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n var model = sourceHost;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy: seriesLayoutBy, sourceHeader: sourceHeader, dimensions: dimensions };\r\n };\r\n return SourceManager;\r\n }());\r\n function disableTransformOptionMerge(datasetModel) {\r\n var transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n }\r\n function isSeries(sourceHost) {\r\n return sourceHost.mainType === 'series';\r\n }\r\n function doThrow(errMsg) {\r\n throw new Error(errMsg);\r\n }\n\n function createTooltipMarkup(type, option) {\r\n option.type = type;\r\n return option;\r\n }\r\n function retrieveVisualColorForTooltipMarker(series, dataIndex) {\r\n var style = series.getData().getItemVisual(dataIndex, 'style');\r\n var color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n }\n\n function defaultSeriesFormatTooltip(opt) {\r\n var series = opt.series;\r\n var dataIndex = opt.dataIndex;\r\n var multipleSeries = opt.multipleSeries;\r\n var data = series.getData();\r\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n var tooltipDimLen = tooltipDims.length;\r\n var value = series.getRawValue(dataIndex);\r\n var isValueArr = isArray(value);\r\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n var inlineValue;\r\n var inlineValueType;\r\n var subBlocks;\r\n var sortParam;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n var seriesNameSpecified = isNameSpecified(series);\r\n var seriesName = seriesNameSpecified && series.name || '';\r\n var itemName = data.getName(dataIndex);\r\n var inlineName = multipleSeries ? seriesName : itemName;\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n name: inlineName,\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType\r\n })\r\n ].concat(subBlocks || [])\r\n });\r\n }\r\n function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\r\n var data = series.getData();\r\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n var dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n var inlineValues = [];\r\n var inlineValueTypes = [];\r\n var blocks = [];\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n : each(value, setEachItem);\r\n function setEachItem(val, dim) {\r\n var dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n return { inlineValues: inlineValues, inlineValueTypes: inlineValueTypes, blocks: blocks };\r\n }\n\n var inner$1 = makeInner();\r\n function getSelectionKey(data, dataIndex) {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n }\r\n var SeriesModel = (function (_super) {\r\n __extends(SeriesModel, _super);\r\n function SeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this._selectedDataIndicesMap = {};\r\n return _this;\r\n }\r\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\r\n this.seriesIndex = this.componentIndex;\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = { model: this };\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n var sourceManager = inner$1(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n if (__DEV__) {\r\n assert(data, 'getInitialData returned invalid data.');\r\n }\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeSubType = this.subType;\r\n if (ComponentModel.hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n merge(option, ecModel.getTheme().get(this.subType));\r\n merge(option, this.getDefaultOption());\r\n defaultEmphasis(option, 'label', ['show']);\r\n this.fillDataTextStyle(option.data);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\r\n newSeriesOption = merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data);\r\n var layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\r\n }\r\n var sourceManager = inner$1(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n var data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n inner$1(this).dataBeforeProcessed = data;\r\n autoSeriesName(this);\r\n this._initSelectedMapFromData(data);\r\n };\r\n SeriesModel.prototype.fillDataTextStyle = function (data) {\r\n if (data && !isTypedArray(data)) {\r\n var props = ['show'];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n };\r\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return;\r\n };\r\n SeriesModel.prototype.appendData = function (params) {\r\n var data = this.getRawData();\r\n data.appendData(params.data);\r\n };\r\n SeriesModel.prototype.getData = function (dataType) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var data = task.context.data;\r\n return (dataType == null ? data : data.getLinkedData(dataType));\r\n }\r\n else {\r\n return inner$1(this).data;\r\n }\r\n };\r\n SeriesModel.prototype.getAllData = function () {\r\n var mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n };\r\n SeriesModel.prototype.setData = function (data) {\r\n var task = getCurrentTask(this);\r\n if (task) {\r\n var context = task.context;\r\n context.outputData = data;\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner$1(this).data = data;\r\n };\r\n SeriesModel.prototype.getSource = function () {\r\n return inner$1(this).sourceManager.getSource();\r\n };\r\n SeriesModel.prototype.getRawData = function () {\r\n return inner$1(this).dataBeforeProcessed;\r\n };\r\n SeriesModel.prototype.getBaseAxis = function () {\r\n var coordSys = this.coordinateSystem;\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n };\r\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n };\r\n SeriesModel.prototype.isAnimationEnabled = function () {\r\n if (env.node) {\r\n return false;\r\n }\r\n var animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n };\r\n SeriesModel.prototype.restoreData = function () {\r\n this.dataTask.dirty();\r\n };\r\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\r\n var ecModel = this.ecModel;\r\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n };\r\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n };\r\n SeriesModel.prototype.getProgressive = function () {\r\n return this.get('progressive');\r\n };\r\n SeriesModel.prototype.getProgressiveThreshold = function () {\r\n return this.get('progressiveThreshold');\r\n };\r\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n };\r\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n var data = this.getData(dataType);\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n };\r\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\r\n var tmpArr = [];\r\n for (var i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n };\r\n SeriesModel.prototype.getSelectedDataIndices = function () {\r\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n var nameOrIds = keys(selectedDataIndicesMap);\r\n var dataIndices = [];\r\n for (var i = 0; i < nameOrIds.length; i++) {\r\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n };\r\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\r\n var selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n var data = this.getData(dataType);\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n return selectedMap[nameOrId] || false;\r\n };\r\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\r\n var _a, _b;\r\n var selectedMode = this.option.selectedMode;\r\n var len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n if (selectedMode === 'multiple') {\r\n var selectedMap = this.option.selectedMap || (this.option.selectedMap = {});\r\n for (var i = 0; i < len; i++) {\r\n var dataIndex = innerDataIndices[i];\r\n var nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n var lastDataIndex = innerDataIndices[len - 1];\r\n var nameOrId = getSelectionKey(data, lastDataIndex);\r\n this.option.selectedMap = (_a = {},\r\n _a[nameOrId] = true,\r\n _a);\r\n this._selectedDataIndicesMap = (_b = {},\r\n _b[nameOrId] = data.getRawIndex(lastDataIndex),\r\n _b);\r\n }\r\n };\r\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n var dataIndices = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (typeof rawItem === 'object'\r\n && rawItem.selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n };\r\n SeriesModel.registerClass = function (clz) {\r\n return ComponentModel.registerClass(clz);\r\n };\r\n SeriesModel.protoInitialize = (function () {\r\n var proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.useColorPaletteOnData = false;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n return SeriesModel;\r\n }(ComponentModel));\r\n mixin(SeriesModel, DataFormatMixin);\r\n mixin(SeriesModel, PaletteMixin);\r\n mountExtend(SeriesModel, ComponentModel);\r\n function autoSeriesName(seriesModel) {\r\n var name = seriesModel.name;\r\n if (!isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n }\r\n function getSeriesAutoName(seriesModel) {\r\n var data = seriesModel.getRawData();\r\n var dataDims = data.mapDimensionsAll('seriesName');\r\n var nameArr = [];\r\n each(dataDims, function (dataDim) {\r\n var dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n }\r\n function dataTaskCount(context) {\r\n return context.model.getRawData().count();\r\n }\r\n function dataTaskReset(context) {\r\n var seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n }\r\n function dataTaskProgress(param, context) {\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n }\r\n function wrapData(data, seriesModel) {\r\n each(__spreadArrays(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName, curry(onDataChange, seriesModel));\r\n });\r\n }\r\n function onDataChange(seriesModel, newList) {\r\n var task = getCurrentTask(seriesModel);\r\n if (task) {\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n }\r\n function getCurrentTask(seriesModel) {\r\n var scheduler = (seriesModel.ecModel || {}).scheduler;\r\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n if (pipeline) {\r\n var task = pipeline.currentTask;\r\n if (task) {\r\n var agentStubMap = task.agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n }\n\n var ComponentView = (function () {\r\n function ComponentView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewComponent');\r\n }\r\n ComponentView.prototype.init = function (ecModel, api) { };\r\n ComponentView.prototype.render = function (model, ecModel, api, payload) { };\r\n ComponentView.prototype.dispose = function (ecModel, api) { };\r\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\r\n };\r\n ComponentView.prototype.blurSeries = function (seriesModels, ecModel) {\r\n };\r\n return ComponentView;\r\n }());\r\n enableClassExtend(ComponentView);\r\n enableClassManagement(ComponentView, { registerWhenExtend: true });\n\n function createRenderPlanner() {\r\n var inner = makeInner();\r\n return function (seriesModel) {\r\n var fields = inner(seriesModel);\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var originalLarge = !!fields.large;\r\n var originalProgressive = !!fields.progressiveRender;\r\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n return (!!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset');\r\n };\r\n }\n\n var inner$2 = makeInner();\r\n var renderPlanner = createRenderPlanner();\r\n var ChartView = (function () {\r\n function ChartView() {\r\n this.group = new Group();\r\n this.uid = getUID('viewChart');\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = { view: this };\r\n }\r\n ChartView.prototype.init = function (ecModel, api) { };\r\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { };\r\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'emphasis');\r\n };\r\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n toggleHighlight(seriesModel.getData(), payload, 'normal');\r\n };\r\n ChartView.prototype.remove = function (ecModel, api) {\r\n this.group.removeAll();\r\n };\r\n ChartView.prototype.dispose = function (ecModel, api) { };\r\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\r\n this.render(seriesModel, ecModel, api, payload);\r\n };\r\n ChartView.markUpdateMethod = function (payload, methodName) {\r\n inner$2(payload).updateMethod = methodName;\r\n };\r\n ChartView.protoInitialize = (function () {\r\n var proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n return ChartView;\r\n }());\r\n function elSetState(el, state, highlightDigit) {\r\n if (el) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n }\r\n function toggleHighlight(data, payload, state) {\r\n var dataIndex = queryDataIndex(data, payload);\r\n var highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n if (dataIndex != null) {\r\n each(normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n }\r\n enableClassExtend(ChartView, ['dispose']);\r\n enableClassManagement(ChartView, { registerWhenExtend: true });\r\n function renderTaskPlan(context) {\r\n return renderPlanner(context.model);\r\n }\r\n function renderTaskReset(context) {\r\n var seriesModel = context.model;\r\n var ecModel = context.ecModel;\r\n var api = context.api;\r\n var payload = context.payload;\r\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n var view = context.view;\r\n var updateMethod = payload && inner$2(payload).updateMethod;\r\n var methodName = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n : 'render';\r\n if (methodName !== 'render') {\r\n view[methodName](seriesModel, ecModel, api, payload);\r\n }\r\n return progressMethodMap[methodName];\r\n }\r\n var progressMethodMap = {\r\n incrementalPrepareRender: {\r\n progress: function (params, context) {\r\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\r\n }\r\n },\r\n render: {\r\n forceFirstProgress: true,\r\n progress: function (params, context) {\r\n context.view.render(context.model, context.ecModel, context.api, context.payload);\r\n }\r\n }\r\n };\n\n function throttle(fn, delay, debounce) {\r\n var currCall;\r\n var lastCall = 0;\r\n var lastExec = 0;\r\n var timer = null;\r\n var diff;\r\n var scope;\r\n var args;\r\n var debounceNextCall;\r\n delay = delay || 0;\r\n function exec() {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n var cb = function () {\r\n var cbArgs = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cbArgs[_i] = arguments[_i];\r\n }\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n var thisDelay = debounceNextCall || delay;\r\n var thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n clearTimeout(timer);\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n lastCall = currCall;\r\n };\r\n cb.clear = function () {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n cb.debounceNextCall = function (debounceDelay) {\r\n debounceNextCall = debounceDelay;\r\n };\r\n return cb;\r\n }\n\n var inner$3 = makeInner();\r\n var defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n };\r\n var defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n };\r\n function getStyleMapper(seriesModel, stylePath) {\r\n var styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath];\r\n if (!styleMapper) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n }\r\n function getDefaultColorKey(seriesModel, stylePath) {\r\n var colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath];\r\n if (!colorKey) {\r\n console.warn(\"Unkown style type '\" + stylePath + \"'.\");\r\n return 'fill';\r\n }\r\n return colorKey;\r\n }\r\n var seriesStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var styleModel = seriesModel.getModel(stylePath);\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var globalStyle = getStyle(styleModel);\r\n var decalOption = styleModel.getShallow('decal');\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n var color = globalStyle[colorKey];\r\n var colorCallback = isFunction(color) ? color : null;\r\n if (!globalStyle[colorKey] || colorCallback) {\r\n globalStyle[colorKey] = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount());\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n return {\r\n dataEach: function (data, idx) {\r\n var dataParams = seriesModel.getDataParams(idx);\r\n var itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n };\r\n var sharedModel = new Model();\r\n var dataStyleTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var getStyle = getStyleMapper(seriesModel, stylePath);\r\n var colorKey = data.getVisual('drawType');\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n var rawItem = data.getRawDataItem(idx);\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n var style = getStyle(sharedModel);\r\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n };\r\n var dataColorPaletteTask = {\r\n performRawSeries: true,\r\n overallReset: function (ecModel) {\r\n var paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var colorScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, colorScope);\r\n }\r\n inner$3(seriesModel).scope = colorScope;\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var dataAll = seriesModel.getRawData();\r\n var idxMap = {};\r\n var data = seriesModel.getData();\r\n var colorScope = inner$3(seriesModel).scope;\r\n var stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n dataAll.each(function (rawIdx) {\r\n var idx = idxMap[rawIdx];\r\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n if (fromPalette) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n var name_1 = dataAll.getName(rawIdx) || (rawIdx + '');\r\n var dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n };\n\n var PI$5 = Math.PI;\r\n function defaultLoading(api, opts) {\r\n opts = opts || {};\r\n defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: '12px',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n var group = new Group();\r\n var mask = new Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n var font = opts.fontSize + ' sans-serif';\r\n var labelRect = new Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: new ZRText({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n font: font\r\n }\r\n }),\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n var arc;\r\n if (opts.showSpinner) {\r\n arc = new Arc({\r\n shape: {\r\n startAngle: -PI$5 / 2,\r\n endAngle: -PI$5 / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI$5 * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI$5 * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n group.add(arc);\r\n }\r\n group.resize = function () {\r\n var textWidth = getWidth(opts.text, font);\r\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner ? 0 : textWidth / 2);\r\n var cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n }\n\n var Scheduler = (function () {\r\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\r\n this._stageTaskMap = createHashMap();\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n Scheduler.prototype.restoreData = function (ecModel, payload) {\r\n ecModel.restoreData(payload);\r\n this._stageTaskMap.each(function (taskRecord) {\r\n var overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n };\r\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n var pCtx = pipeline.context;\r\n var incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n var step = incremental ? pipeline.step : null;\r\n var modDataCount = pCtx && pCtx.modDataCount;\r\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n return { step: step, modBy: modBy, modDataCount: modDataCount };\r\n };\r\n Scheduler.prototype.getPipeline = function (pipelineId) {\r\n return this._pipelineMap.get(pipelineId);\r\n };\r\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\r\n var pipeline = this._pipelineMap.get(seriesModel.uid);\r\n var data = seriesModel.getData();\r\n var dataLen = data.count();\r\n var progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n };\r\n Scheduler.prototype.restorePipelines = function (ecModel) {\r\n var scheduler = this;\r\n var pipelineMap = scheduler._pipelineMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var progressive = seriesModel.getProgressive();\r\n var pipelineId = seriesModel.uid;\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n };\r\n Scheduler.prototype.prepareStageTasks = function () {\r\n var stageTaskMap = this._stageTaskMap;\r\n var ecModel = this.api.getModel();\r\n var api = this.api;\r\n each(this._allHandlers, function (handler) {\r\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n };\r\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\r\n var renderTask = view.renderTask;\r\n var context = renderTask.context;\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n this._pipe(model, renderTask);\r\n };\r\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { block: true });\r\n };\r\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n };\r\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\r\n opt = opt || {};\r\n var unfinished = false;\r\n var scheduler = this;\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var overallTask = stageHandlerRecord.overallTask;\r\n if (overallTask) {\r\n var overallNeedDirty_1;\r\n var agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty_1 = true;\r\n }\r\n });\r\n overallNeedDirty_1 && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs_1);\r\n });\r\n if (overallTask.perform(performArgs_1)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n var performArgs = scheduler.getPerformArgs(task, opt.block);\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n function needSetDirty(opt, task) {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\r\n var unfinished;\r\n ecModel.eachSeries(function (seriesModel) {\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n this.unfinished = unfinished || this.unfinished;\r\n };\r\n Scheduler.prototype.plan = function () {\r\n this._pipelineMap.each(function (pipeline) {\r\n var task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n } while (task);\r\n });\r\n };\r\n Scheduler.prototype.updatePayload = function (task, payload) {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n };\r\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n function create(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n }));\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n };\r\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\r\n var scheduler = this;\r\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n || createTask({ reset: overallTaskReset });\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n var oldAgentStubMap = overallTask.agentStubMap;\r\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n var seriesType = stageHandler.seriesType;\r\n var getTargetSeries = stageHandler.getTargetSeries;\r\n var overallProgress = true;\r\n var shouldOverallTaskDirty = false;\r\n var errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", '\r\n + 'becuase it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n function createStub(seriesModel) {\r\n var pipelineId = seriesModel.uid;\r\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (shouldOverallTaskDirty = true,\r\n createTask({ reset: stubReset, onDirty: stubOnDirty })));\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n };\r\n Scheduler.prototype._pipe = function (seriesModel, task) {\r\n var pipelineId = seriesModel.uid;\r\n var pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n };\r\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n };\r\n }\r\n stageHandler.uid = getUID('stageHandler');\r\n visualType && (stageHandler.visualType = visualType);\r\n return stageHandler;\r\n };\r\n return Scheduler;\r\n }());\r\n function overallTaskReset(context) {\r\n context.overallReset(context.ecModel, context.api, context.payload);\r\n }\r\n function stubReset(context) {\r\n return context.overallProgress && stubProgress;\r\n }\r\n function stubProgress() {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n }\r\n function stubOnDirty() {\r\n this.agent && this.agent.dirty();\r\n }\r\n function seriesTaskPlan(context) {\r\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\r\n }\r\n function seriesTaskReset(context) {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n }\r\n var singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n function makeSeriesTaskProgress(resetDefineIdx) {\r\n return function (params, context) {\r\n var data = context.data;\r\n var resetDefine = context.resetDefines[resetDefineIdx];\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (var i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n }\r\n function seriesTaskCount(context) {\r\n return context.data.count();\r\n }\r\n function detectSeriseType(legacyFunc) {\r\n seriesType = null;\r\n try {\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n }\r\n var ecModelMock = {};\r\n var apiMock = {};\r\n var seriesType;\r\n mockMethods(ecModelMock, GlobalModel);\r\n mockMethods(apiMock, ExtensionAPI);\r\n ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n };\r\n ecModelMock.eachComponent = function (cond) {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n };\r\n function mockMethods(target, Clz) {\r\n for (var name_1 in Clz.prototype) {\r\n target[name_1] = noop;\r\n }\r\n }\n\n var colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n ];\r\n var lightTheme = {\r\n color: colorAll,\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n };\n\n var contrastColor = '#B9B8CE';\r\n var backgroundColor = '#100C2A';\r\n var axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n };\r\n var colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n ];\r\n var theme = {\r\n darkMode: true,\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#FD1050',\r\n color0: '#0CF49B',\r\n borderColor: '#FD1050',\r\n borderColor0: '#0CF49B'\r\n }\r\n }\r\n };\r\n theme.categoryAxis.splitLine.show = false;\n\n var DatasetModel = (function (_super) {\r\n __extends(DatasetModel, _super);\r\n function DatasetModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\r\n _super.prototype.init.call(this, option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\r\n _super.prototype.mergeOption.call(this, newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n };\r\n DatasetModel.prototype.optionUpdated = function () {\r\n this._sourceManager.dirty();\r\n };\r\n DatasetModel.prototype.getSourceManager = function () {\r\n return this._sourceManager;\r\n };\r\n DatasetModel.type = 'dataset';\r\n DatasetModel.defaultOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n return DatasetModel;\r\n }(ComponentModel));\r\n ComponentModel.registerClass(DatasetModel);\r\n var DatasetView = (function (_super) {\r\n __extends(DatasetView, _super);\r\n function DatasetView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'dataset';\r\n return _this;\r\n }\r\n DatasetView.type = 'dataset';\r\n return DatasetView;\r\n }(ComponentView));\r\n ComponentView.registerClass(DatasetView);\n\n var storage = createHashMap();\r\n var mapDataStorage = {\r\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\r\n var records;\r\n if (isArray(rawDef)) {\r\n records = rawDef;\r\n }\r\n else if (rawDef.svg) {\r\n records = [{\r\n type: 'svg',\r\n source: rawDef.svg,\r\n specialAreas: rawDef.specialAreas\r\n }];\r\n }\r\n else {\r\n var geoSource = rawDef.geoJson\r\n || rawDef.geoJSON;\r\n if (geoSource && !rawDef.features) {\r\n rawSpecialAreas = rawDef.specialAreas;\r\n rawDef = geoSource;\r\n }\r\n records = [{\r\n type: 'geoJSON',\r\n source: rawDef,\r\n specialAreas: rawSpecialAreas\r\n }];\r\n }\r\n each(records, function (record) {\r\n var type = record.type;\r\n type === 'geoJson' && (type = record.type = 'geoJSON');\r\n var parse = parsers[type];\r\n if (__DEV__) {\r\n assert(parse, 'Illegal map type: ' + type);\r\n }\r\n parse(record);\r\n });\r\n return storage.set(mapName, records);\r\n },\r\n retrieveMap: function (mapName) {\r\n return storage.get(mapName);\r\n }\r\n };\r\n var parsers = {\r\n geoJSON: function (record) {\r\n var source = record.source;\r\n record.geoJSON = !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n },\r\n svg: function (record) {\r\n record.svgXML = parseXML(record.source);\r\n }\r\n };\n\n var ECEventProcessor = (function () {\r\n function ECEventProcessor() {\r\n }\r\n ECEventProcessor.prototype.normalizeQuery = function (query) {\r\n var cptQuery = {};\r\n var dataQuery = {};\r\n var otherQuery = {};\r\n if (isString(query)) {\r\n var condCptType = parseClassType(query);\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n else {\r\n var suffixes_1 = ['Index', 'Name', 'Id'];\r\n var dataKeys_1 = { name: 1, dataIndex: 1, dataType: 1 };\r\n each(query, function (val, key) {\r\n var reserved = false;\r\n for (var i = 0; i < suffixes_1.length; i++) {\r\n var propSuffix = suffixes_1[i];\r\n var suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n var mainType = key.slice(0, suffixPos);\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys_1.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n };\r\n ECEventProcessor.prototype.filter = function (eventType, query) {\r\n var eventInfo = this.eventInfo;\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n var targetEl = eventInfo.targetEl;\r\n var packedEvent = eventInfo.packedEvent;\r\n var model = eventInfo.model;\r\n var view = eventInfo.view;\r\n if (!model || !view) {\r\n return true;\r\n }\r\n var cptQuery = query.cptQuery;\r\n var dataQuery = query.dataQuery;\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\r\n function check(query, host, prop, propOnHost) {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n };\r\n ECEventProcessor.prototype.afterTrigger = function () {\r\n this.eventInfo = null;\r\n };\r\n return ECEventProcessor;\r\n }());\n\n var seriesSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n var data = seriesModel.getData();\r\n if (seriesModel.legendSymbol) {\r\n data.setVisual('legendSymbol', seriesModel.legendSymbol);\r\n }\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n var symbolType = seriesModel.get('symbol');\r\n var symbolSize = seriesModel.get('symbolSize');\r\n var keepAspect = seriesModel.get('symbolKeepAspect');\r\n var symbolRotate = seriesModel.get('symbolRotate');\r\n var hasSymbolTypeCallback = isFunction(symbolType);\r\n var hasSymbolSizeCallback = isFunction(symbolSize);\r\n var hasSymbolRotateCallback = isFunction(symbolRotate);\r\n var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;\r\n var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : seriesModel.defaultSymbol;\r\n var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;\r\n var seriesSymbolRotate = !hasSymbolRotateCallback ? symbolRotate : null;\r\n data.setVisual({\r\n legendSymbol: seriesModel.legendSymbol || seriesSymbol,\r\n symbol: seriesSymbol,\r\n symbolSize: seriesSymbolSize,\r\n symbolKeepAspect: keepAspect,\r\n symbolRotate: seriesSymbolRotate\r\n });\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n function dataEach(data, idx) {\r\n var rawValue = seriesModel.getRawValue(idx);\r\n var params = seriesModel.getDataParams(idx);\r\n hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));\r\n hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\r\n hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));\r\n }\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n };\r\n var dataSymbolTask = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n function dataEach(data, idx) {\r\n var itemModel = data.getItemModel(idx);\r\n var itemSymbolType = itemModel.getShallow('symbol', true);\r\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\r\n var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);\r\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);\r\n if (itemSymbolType != null) {\r\n data.setItemVisual(idx, 'symbol', itemSymbolType);\r\n }\r\n if (itemSymbolSize != null) {\r\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\r\n }\r\n if (itemSymbolRotate != null) {\r\n data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);\r\n }\r\n if (itemSymbolKeepAspect != null) {\r\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\r\n }\r\n }\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n };\n\n function getItemVisualFromData(data, dataIndex, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\r\n function getVisualFromData(data, key) {\r\n switch (key) {\r\n case 'color':\r\n var style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(\"Unknown visual type \" + key);\r\n }\r\n }\r\n }\n\n var PI2$6 = Math.PI * 2;\r\n var CMD$3 = PathProxy.CMD;\r\n var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\r\n function getCandidateAnchor(pos, distance, rect, outPt, outDir) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(rect.x + width / 2, rect.y - distance);\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(rect.x + width / 2, rect.y + height + distance);\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(rect.x - distance, rect.y + height / 2);\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(rect.x + width + distance, rect.y + height / 2);\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n }\r\n function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\r\n x -= cx;\r\n y -= cy;\r\n var d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n var ox = x * r + cx;\r\n var oy = y * r + cy;\r\n if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n if (anticlockwise) {\r\n var tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2$6;\r\n }\r\n var angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2$6;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle)) {\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n var x1 = r * Math.cos(startAngle) + cx;\r\n var y1 = r * Math.sin(startAngle) + cy;\r\n var x2 = r * Math.cos(endAngle) + cx;\r\n var y2 = r * Math.sin(endAngle) + cy;\r\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n }\r\n function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\r\n var dx = x - x1;\r\n var dy = y - y1;\r\n var dx1 = x2 - x1;\r\n var dy1 = y2 - y1;\r\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n var projectedLen = dx * dx1 + dy * dy1;\r\n var t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n var ox = out[0] = x1 + t * dx1;\r\n var oy = out[1] = y1 + t * dy1;\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n function projectPointToRect(x1, y1, width, height, x, y, out) {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n var x2 = x1 + width;\r\n var y2 = y1 + height;\r\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n }\r\n var tmpPt = [];\r\n function nearestPointOnRect(pt, rect, out) {\r\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n }\r\n function nearestPointOnPath(pt, path, out) {\r\n var xi = 0;\r\n var yi = 0;\r\n var x0 = 0;\r\n var y0 = 0;\r\n var x1;\r\n var y1;\r\n var minDist = Infinity;\r\n var data = path.data;\r\n var x = pt.x;\r\n var y = pt.y;\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n var d = minDist;\r\n switch (cmd) {\r\n case CMD$3.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD$3.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.C:\r\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.Q:\r\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD$3.A:\r\n var cx = data[i++];\r\n var cy = data[i++];\r\n var rx = data[i++];\r\n var ry = data[i++];\r\n var theta = data[i++];\r\n var dTheta = data[i++];\r\n i += 1;\r\n var anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n if (i <= 1) {\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n var _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD$3.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n var width = data[i++];\r\n var height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD$3.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n return minDist;\r\n }\r\n var pt0 = new Point();\r\n var pt1 = new Point();\r\n var pt2 = new Point();\r\n var dir = new Point();\r\n var dir2 = new Point();\r\n function updateLabelLinePoints(target, labelLineModel) {\r\n if (!target) {\r\n return;\r\n }\r\n var labelLine = target.getTextGuideLine();\r\n var label = target.getTextContent();\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n var labelGuideConfig = target.textGuideLineConfig || {};\r\n var points = [[0, 0], [0, 0], [0, 0]];\r\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n var labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n var minDist = Infinity;\r\n var anchorPoint = labelGuideConfig.anchor;\r\n var targetTransform = target.getComputedTransform();\r\n var targetInversedTransform = targetTransform && invert([], targetTransform);\r\n var len = labelLineModel.get('length2') || 0;\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (var i = 0; i < searchSpace.length; i++) {\r\n var candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n pt1.transform(targetInversedTransform);\r\n var boundingRect = target.getBoundingRect();\r\n var dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n labelLine.setShape({ points: points });\r\n }\r\n var tmpArr = [];\r\n var tmpProjPoint = new Point();\r\n function limitTurnAngle(linePoints, minTurnAngle) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(dir2);\r\n var minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n var len1 = dir.len();\r\n var len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n var angleCos = dir.dot(surfaceNormal);\r\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n if (angleCos < maxSurfaceAngleCos) {\r\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n var HALF_PI = Math.PI / 2;\r\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n var t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n }\r\n function setLabelLineState(labelLine, ignore, stateName, stateModel) {\r\n var isNormal = stateName === 'normal';\r\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n stateObj.ignore = ignore;\r\n var smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n stateObj.shape.smooth = smooth;\r\n }\r\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n }\r\n function buildLabelLinePath(path, shape) {\r\n var smooth = shape.smooth;\r\n var points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n var len1 = dist(points[0], points[1]);\r\n var len2 = dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n var moveLen = Math.min(len1, len2) * smooth;\r\n var midPoint0 = lerp([], points[1], points[0], moveLen / len1);\r\n var midPoint2 = lerp([], points[1], points[2], moveLen / len2);\r\n var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (var i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n }\r\n function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\r\n var labelLine = targetEl.getTextGuideLine();\r\n var label = targetEl.getTextContent();\r\n if (!label) {\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n var normalModel = statesModels.normal;\r\n var showNormal = normalModel.get('show');\r\n var labelIgnoreNormal = label.ignore;\r\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\r\n var stateName = DISPLAY_STATES[i];\r\n var stateModel = statesModels[stateName];\r\n var isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n var stateShow = stateModel.get('show');\r\n var isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored\r\n || !retrieve2(stateShow, showNormal)) {\r\n var stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n continue;\r\n }\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n labelLine.style.fill = null;\r\n var showAbove = normalModel.get('showAbove');\r\n var labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n }\r\n function getLabelLineStatesModels(itemModel, labelLineName) {\r\n labelLineName = (labelLineName || 'labelLine');\r\n var statesModels = {\r\n normal: itemModel.getModel(labelLineName)\r\n };\r\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\r\n var stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n }\n\n function prepareLayoutList(input) {\r\n var list = [];\r\n for (var i = 0; i < input.length; i++) {\r\n var rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n var label = rawItem.label;\r\n var transform = label.getComputedTransform();\r\n var localRect = label.getBoundingRect();\r\n var isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n var minMargin = label.style.margin || 0;\r\n var globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n list.push({\r\n label: label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect: localRect,\r\n obb: obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform: transform\r\n });\r\n }\r\n return list;\r\n }\r\n function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\r\n var len = list.length;\r\n if (len < 2) {\r\n return;\r\n }\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n var lastPos = 0;\r\n var delta;\r\n var adjusted = false;\r\n var totalShifts = 0;\r\n for (var i = 0; i < len; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n var shift = Math.max(-delta, 0);\r\n totalShifts += shift;\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n var first = list[0];\r\n var last = list[len - 1];\r\n var minGap;\r\n var maxGap;\r\n updateMinMaxGap();\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n updateMinMaxGap();\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\r\n if (gapThisBound < 0) {\r\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n var remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n function shiftList(delta, start, end) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (var i = start; i < end; i++) {\r\n var item = list[i];\r\n var rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n function squeezeGaps(delta, maxSqeezePercent) {\r\n var gaps = [];\r\n var totalGaps = 0;\r\n for (var i = 1; i < len; i++) {\r\n var prevItemRect = list[i - 1].rect;\r\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n if (delta > 0) {\r\n for (var i = 0; i < len - 1; i++) {\r\n var movement = gaps[i] * squeezePercent;\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n for (var i = len - 1; i > 0; i--) {\r\n var movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n function squeezeWhenBailout(delta) {\r\n var dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n var moveForEachLabel = Math.ceil(delta / (len - 1));\r\n for (var i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n delta -= moveForEachLabel;\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n return adjusted;\r\n }\r\n function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n }\r\n function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n }\r\n function hideOverlap(labelList) {\r\n var displayedLabels = [];\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n var globalRect = new BoundingRect(0, 0, 0, 0);\r\n function hideEl(el) {\r\n if (!el.ignore) {\r\n var emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n el.ignore = true;\r\n }\r\n for (var i = 0; i < labelList.length; i++) {\r\n var labelItem = labelList[i];\r\n var isAxisAligned = labelItem.axisAligned;\r\n var localRect = labelItem.localRect;\r\n var transform = labelItem.transform;\r\n var label = labelItem.label;\r\n var labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n var obb = labelItem.obb;\r\n var overlapped = false;\r\n for (var j = 0; j < displayedLabels.length; j++) {\r\n var existsTextCfg = displayedLabels[j];\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n if (isAxisAligned && existsTextCfg.axisAligned) {\r\n overlapped = true;\r\n break;\r\n }\r\n if (!existsTextCfg.obb) {\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n if (!obb) {\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n }\n\n function cloneArr(points) {\r\n if (points) {\r\n var newPoints = [];\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n }\r\n function prepareLayoutCallbackParams(labelItem, hostEl) {\r\n var label = labelItem.label;\r\n var labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n }\r\n var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\r\n var dummyTransformable = new Transformable();\r\n var labelLayoutInnerStore = makeInner();\r\n var labelLineAnimationStore = makeInner();\r\n function extendWithKeys(target, source, keys) {\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n var LabelManager = (function () {\r\n function LabelManager() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n LabelManager.prototype.clearLabels = function () {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n };\r\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\r\n var labelStyle = label.style;\r\n var hostEl = label.__hostTarget;\r\n var textConfig = hostEl.textConfig || {};\r\n var labelTransform = label.getComputedTransform();\r\n var labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n var host = label.__hostTarget;\r\n var hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n var transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n var labelGuide = hostRect && host.getTextGuideLine();\r\n this._labelList.push({\r\n label: label,\r\n labelLine: labelGuide,\r\n seriesModel: seriesModel,\r\n dataIndex: dataIndex,\r\n dataType: dataType,\r\n layoutOption: layoutOption,\r\n computedLayoutOption: null,\r\n rect: labelRect,\r\n hostRect: hostRect,\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n rotation: dummyTransformable.rotation,\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n fontSize: labelStyle.fontSize\r\n },\r\n cursor: label.cursor,\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n };\r\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\r\n var _this = this;\r\n this._chartViewList.push(chartView);\r\n var seriesModel = chartView.__model;\r\n var layoutOption = seriesModel.get('labelLayout');\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var textEl = child.getTextContent();\r\n var ecData = getECData(child);\r\n if (textEl && !textEl.disableLabelLayout) {\r\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n };\r\n LabelManager.prototype.updateLayoutConfig = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n function createDragHandler(el, labelLineModel) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (var i = 0; i < this._labelList.length; i++) {\r\n var labelItem = this._labelList[i];\r\n var label = labelItem.label;\r\n var hostEl = label.__hostTarget;\r\n var defaultLabelAttr = labelItem.defaultAttr;\r\n var layoutOption = void 0;\r\n if (typeof labelItem.layoutOption === 'function') {\r\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n var degreeToRadian = Math.PI / 180;\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n local: false,\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n var needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n label.x = parsePercent$2(layoutOption.x, width);\r\n label.setStyle('x', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n if (layoutOption.y != null) {\r\n label.y = parsePercent$2(layoutOption.y, height);\r\n label.setStyle('y', 0);\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n if (layoutOption.labelLinePoints) {\r\n var guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n var labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n var hostModel = labelItem.seriesModel;\r\n if (labelItem.dataIndex != null) {\r\n var data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n };\r\n LabelManager.prototype.layout = function (api) {\r\n var width = api.getWidth();\r\n var height = api.getHeight();\r\n var labelList = prepareLayoutList(this._labelList);\r\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n hideOverlap(labelsNeedsHideOverlap);\r\n };\r\n LabelManager.prototype.processLabelsOverall = function () {\r\n var _this = this;\r\n each(this._chartViewList, function (chartView) {\r\n var seriesModel = chartView.__model;\r\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n var animationEnabled = seriesModel.isAnimationEnabled();\r\n chartView.group.traverse(function (child) {\r\n if (child.ignore) {\r\n return true;\r\n }\r\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n var label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n _this._updateLabelLine(child, seriesModel);\r\n }\r\n if (animationEnabled) {\r\n _this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n };\r\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n if (textEl && dataIndex != null) {\r\n var data = seriesModel.getData(ecData.dataType);\r\n var itemModel = data.getItemModel(dataIndex);\r\n var defaultStyle = {};\r\n var visualStyle = data.getItemVisual(dataIndex, 'style');\r\n var visualType = data.getVisual('drawType');\r\n defaultStyle.stroke = visualStyle[visualType];\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n };\r\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\r\n var textEl = el.getTextContent();\r\n var guideLine = el.getTextGuideLine();\r\n if (textEl\r\n && !textEl.ignore\r\n && !textEl.invisible\r\n && !el.disableLabelAnimation\r\n && !isElementRemoved(el)) {\r\n var layoutStore = labelLayoutInnerStore(textEl);\r\n var oldLayout = layoutStore.oldLayout;\r\n var ecData = getECData(el);\r\n var dataIndex = ecData.dataIndex;\r\n var newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n var data = seriesModel.getData(ecData.dataType);\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n if (!labelInner(textEl).valueAnimation) {\r\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n if (textEl.states.select) {\r\n var layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n if (textEl.states.emphasis) {\r\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n animateLabelValue(textEl, dataIndex, data, seriesModel);\r\n }\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n var layoutStore = labelLineAnimationStore(guideLine);\r\n var oldLayout = layoutStore.oldLayout;\r\n var newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n };\r\n return LabelManager;\r\n }());\n\n function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\r\n function getSeriesIndices(ecModel, payload) {\r\n var seriesIndices = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n }\r\n function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\r\n var legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel) {\r\n var seriesIndex = seriesModel.seriesIndex;\r\n var selected = payload.selected;\r\n for (var i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: extend({}, seriesModel.option.selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function handleLegacySelectEvents(messageCenter, ecIns, ecModel) {\r\n messageCenter.on('selectchanged', function (params) {\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n }\n\n function createLinearGradient(ctx, obj, rect) {\r\n var x = obj.x == null ? 0 : obj.x;\r\n var x2 = obj.x2 == null ? 1 : obj.x2;\r\n var y = obj.y == null ? 0 : obj.y;\r\n var y2 = obj.y2 == null ? 0 : obj.y2;\r\n if (!obj.global) {\r\n x = x * rect.width + rect.x;\r\n x2 = x2 * rect.width + rect.x;\r\n y = y * rect.height + rect.y;\r\n y2 = y2 * rect.height + rect.y;\r\n }\r\n x = isNaN(x) ? 0 : x;\r\n x2 = isNaN(x2) ? 1 : x2;\r\n y = isNaN(y) ? 0 : y;\r\n y2 = isNaN(y2) ? 0 : y2;\r\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\r\n return canvasGradient;\r\n }\r\n function createRadialGradient(ctx, obj, rect) {\r\n var width = rect.width;\r\n var height = rect.height;\r\n var min = Math.min(width, height);\r\n var x = obj.x == null ? 0.5 : obj.x;\r\n var y = obj.y == null ? 0.5 : obj.y;\r\n var r = obj.r == null ? 0.5 : obj.r;\r\n if (!obj.global) {\r\n x = x * width + rect.x;\r\n y = y * height + rect.y;\r\n r = r * min;\r\n }\r\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\r\n return canvasGradient;\r\n }\r\n function getCanvasGradient(ctx, obj, rect) {\r\n var canvasGradient = obj.type === 'radial'\r\n ? createRadialGradient(ctx, obj, rect)\r\n : createLinearGradient(ctx, obj, rect);\r\n var colorStops = obj.colorStops;\r\n for (var i = 0; i < colorStops.length; i++) {\r\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\r\n }\r\n return canvasGradient;\r\n }\r\n function isClipPathChanged(clipPaths, prevClipPaths) {\r\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\r\n return false;\r\n }\r\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\r\n return true;\r\n }\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n if (clipPaths[i] !== prevClipPaths[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\n\n function normalizeLineDash(lineType, lineWidth) {\r\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\r\n return null;\r\n }\r\n lineWidth = lineWidth || 1;\r\n return lineType === 'dashed'\r\n ? [4 * lineWidth, 2 * lineWidth]\r\n : lineType === 'dotted'\r\n ? [lineWidth]\r\n : isNumber(lineType)\r\n ? [lineType] : isArray(lineType) ? lineType : null;\r\n }\n\n var pathProxyForDraw = new PathProxy(true);\r\n function styleHasStroke(style) {\r\n var stroke = style.stroke;\r\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\r\n }\r\n function styleHasFill(style) {\r\n var fill = style.fill;\r\n return fill != null && fill !== 'none';\r\n }\r\n function doFillPath(ctx, style) {\r\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.fillOpacity * style.opacity;\r\n ctx.fill();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.fill();\r\n }\r\n }\r\n function doStrokePath(ctx, style) {\r\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\r\n var originalGlobalAlpha = ctx.globalAlpha;\r\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\r\n ctx.stroke();\r\n ctx.globalAlpha = originalGlobalAlpha;\r\n }\r\n else {\r\n ctx.stroke();\r\n }\r\n }\r\n function createCanvasPattern(ctx, pattern, el) {\r\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\r\n if (isImageReady(image)) {\r\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\r\n if (typeof DOMMatrix === 'function') {\r\n var matrix = new DOMMatrix();\r\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) / Math.PI * 180);\r\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\r\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\r\n canvasPattern.setTransform(matrix);\r\n }\r\n return canvasPattern;\r\n }\r\n }\r\n function brushPath(ctx, el, style, inBatch) {\r\n var hasStroke = styleHasStroke(style);\r\n var hasFill = styleHasFill(style);\r\n var strokePercent = style.strokePercent;\r\n var strokePart = strokePercent < 1;\r\n var firstDraw = !el.path;\r\n if ((!el.silent || strokePart) && firstDraw) {\r\n el.createPathProxy();\r\n }\r\n var path = el.path || pathProxyForDraw;\r\n if (!inBatch) {\r\n var fill = style.fill;\r\n var stroke = style.stroke;\r\n var hasFillGradient = hasFill && !!fill.colorStops;\r\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\r\n var hasFillPattern = hasFill && !!fill.image;\r\n var hasStrokePattern = hasStroke && !!stroke.image;\r\n var fillGradient = void 0;\r\n var strokeGradient = void 0;\r\n var fillPattern = void 0;\r\n var strokePattern = void 0;\r\n var rect = void 0;\r\n if (hasFillGradient || hasStrokeGradient) {\r\n rect = el.getBoundingRect();\r\n }\r\n if (hasFillGradient) {\r\n fillGradient = el.__dirty\r\n ? getCanvasGradient(ctx, fill, rect)\r\n : el.__canvasFillGradient;\r\n el.__canvasFillGradient = fillGradient;\r\n }\r\n if (hasStrokeGradient) {\r\n strokeGradient = el.__dirty\r\n ? getCanvasGradient(ctx, stroke, rect)\r\n : el.__canvasStrokeGradient;\r\n el.__canvasStrokeGradient = strokeGradient;\r\n }\r\n if (hasFillPattern) {\r\n fillPattern = (el.__dirty || !el.__canvasFillPattern)\r\n ? createCanvasPattern(ctx, fill, el)\r\n : el.__canvasFillPattern;\r\n el.__canvasFillPattern = fillPattern;\r\n }\r\n if (hasStrokePattern) {\r\n strokePattern = (el.__dirty || !el.__canvasStrokePattern)\r\n ? createCanvasPattern(ctx, stroke, el)\r\n : el.__canvasStrokePattern;\r\n el.__canvasStrokePattern = fillPattern;\r\n }\r\n if (hasFillGradient) {\r\n ctx.fillStyle = fillGradient;\r\n }\r\n else if (hasFillPattern) {\r\n if (fillPattern) {\r\n ctx.fillStyle = fillPattern;\r\n }\r\n else {\r\n hasFill = false;\r\n }\r\n }\r\n if (hasStrokeGradient) {\r\n ctx.strokeStyle = strokeGradient;\r\n }\r\n else if (hasStrokePattern) {\r\n if (strokePattern) {\r\n ctx.strokeStyle = strokePattern;\r\n }\r\n else {\r\n hasStroke = false;\r\n }\r\n }\r\n }\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n var ctxLineDash = !!ctx.setLineDash;\r\n var scale = el.getGlobalScale();\r\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\r\n if (lineDash) {\r\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_1 && lineScale_1 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_1;\r\n });\r\n lineDashOffset /= lineScale_1;\r\n }\r\n }\r\n var needsRebuild = true;\r\n if (firstDraw || (el.__dirty & Path.SHAPE_CHANGED_BIT)\r\n || (lineDash && !ctxLineDash && hasStroke)) {\r\n path.setDPR(ctx.dpr);\r\n if (strokePart) {\r\n path.setContext(null);\r\n }\r\n else {\r\n path.setContext(ctx);\r\n needsRebuild = false;\r\n }\r\n path.reset();\r\n if (lineDash && !ctxLineDash) {\r\n path.setLineDash(lineDash);\r\n path.setLineDashOffset(lineDashOffset);\r\n }\r\n el.buildPath(path, el.shape, inBatch);\r\n path.toStatic();\r\n el.pathUpdated();\r\n }\r\n if (needsRebuild) {\r\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n }\r\n if (!inBatch) {\r\n if (style.strokeFirst) {\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n }\r\n else {\r\n if (hasFill) {\r\n doFillPath(ctx, style);\r\n }\r\n if (hasStroke) {\r\n doStrokePath(ctx, style);\r\n }\r\n }\r\n }\r\n if (lineDash && ctxLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n function brushImage(ctx, el, style) {\r\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\r\n if (!image || !isImageReady(image)) {\r\n return;\r\n }\r\n var x = style.x || 0;\r\n var y = style.y || 0;\r\n var width = el.getWidth();\r\n var height = el.getHeight();\r\n var aspect = image.width / image.height;\r\n if (width == null && height != null) {\r\n width = height * aspect;\r\n }\r\n else if (height == null && width != null) {\r\n height = width / aspect;\r\n }\r\n else if (width == null && height == null) {\r\n width = image.width;\r\n height = image.height;\r\n }\r\n if (style.sWidth && style.sHeight) {\r\n var sx = style.sx || 0;\r\n var sy = style.sy || 0;\r\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\r\n }\r\n else if (style.sx && style.sy) {\r\n var sx = style.sx;\r\n var sy = style.sy;\r\n var sWidth = width - sx;\r\n var sHeight = height - sy;\r\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\r\n }\r\n else {\r\n ctx.drawImage(image, x, y, width, height);\r\n }\r\n }\r\n function brushText(ctx, el, style) {\r\n var text = style.text;\r\n text != null && (text += '');\r\n if (text) {\r\n ctx.font = style.font || DEFAULT_FONT;\r\n ctx.textAlign = style.textAlign;\r\n ctx.textBaseline = style.textBaseline;\r\n var hasLineDash = void 0;\r\n if (ctx.setLineDash) {\r\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\r\n var lineDashOffset = style.lineDashOffset;\r\n if (lineDash) {\r\n var lineScale_2 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\r\n if (lineScale_2 && lineScale_2 !== 1) {\r\n lineDash = map(lineDash, function (rawVal) {\r\n return rawVal / lineScale_2;\r\n });\r\n lineDashOffset /= lineScale_2;\r\n }\r\n ctx.setLineDash(lineDash);\r\n ctx.lineDashOffset = lineDashOffset;\r\n hasLineDash = true;\r\n }\r\n }\r\n if (style.strokeFirst) {\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n }\r\n else {\r\n if (styleHasFill(style)) {\r\n ctx.fillText(text, style.x, style.y);\r\n }\r\n if (styleHasStroke(style)) {\r\n ctx.strokeText(text, style.x, style.y);\r\n }\r\n }\r\n if (hasLineDash) {\r\n ctx.setLineDash([]);\r\n }\r\n }\r\n }\r\n var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\r\n var STROKE_PROPS = [\r\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\r\n ];\r\n function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\r\n var styleChanged = false;\r\n if (!forceSetAll) {\r\n prevStyle = prevStyle || {};\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? DEFAULT_COMMON_STYLE.opacity : style.opacity;\r\n }\r\n if (forceSetAll || style.blend !== prevStyle.blend) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\r\n }\r\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\r\n var propName = SHADOW_NUMBER_PROPS[i];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = ctx.dpr * (style[propName] || 0);\r\n }\r\n }\r\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\r\n }\r\n return styleChanged;\r\n }\r\n function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n var style = getStyle(el, scope.inHover);\r\n var prevStyle = forceSetAll\r\n ? null\r\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\r\n if (style === prevStyle) {\r\n return false;\r\n }\r\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\r\n if (forceSetAll || style.fill !== prevStyle.fill) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.fillStyle = style.fill;\r\n }\r\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.strokeStyle = style.stroke;\r\n }\r\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\r\n }\r\n if (el.hasStroke()) {\r\n var lineWidth = style.lineWidth;\r\n var newLineWidth = lineWidth / ((style.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1);\r\n if (ctx.lineWidth !== newLineWidth) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx.lineWidth = newLineWidth;\r\n }\r\n }\r\n for (var i = 0; i < STROKE_PROPS.length; i++) {\r\n var prop = STROKE_PROPS[i];\r\n var propName = prop[0];\r\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\r\n if (!styleChanged) {\r\n flushPathDrawn(ctx, scope);\r\n styleChanged = true;\r\n }\r\n ctx[propName] = style[propName] || prop[1];\r\n }\r\n }\r\n return styleChanged;\r\n }\r\n function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\r\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\r\n }\r\n function setContextTransform(ctx, el) {\r\n var m = el.transform;\r\n var dpr = ctx.dpr || 1;\r\n if (m) {\r\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\r\n }\r\n else {\r\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\r\n }\r\n }\r\n function updateClipStatus(clipPaths, ctx, scope) {\r\n var allClipped = false;\r\n for (var i = 0; i < clipPaths.length; i++) {\r\n var clipPath = clipPaths[i];\r\n allClipped = allClipped || clipPath.isZeroArea();\r\n setContextTransform(ctx, clipPath);\r\n ctx.beginPath();\r\n clipPath.buildPath(ctx, clipPath.shape);\r\n ctx.clip();\r\n }\r\n scope.allClipped = allClipped;\r\n }\r\n function isTransformChanged(m0, m1) {\r\n if (m0 && m1) {\r\n return m0[0] !== m1[0]\r\n || m0[1] !== m1[1]\r\n || m0[2] !== m1[2]\r\n || m0[3] !== m1[3]\r\n || m0[4] !== m1[4]\r\n || m0[5] !== m1[5];\r\n }\r\n else if (!m0 && !m1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n var DRAW_TYPE_PATH = 1;\r\n var DRAW_TYPE_IMAGE = 2;\r\n var DRAW_TYPE_TEXT = 3;\r\n var DRAW_TYPE_INCREMENTAL = 4;\r\n function canPathBatch(style) {\r\n var hasFill = styleHasFill(style);\r\n var hasStroke = styleHasStroke(style);\r\n return !(style.lineDash\r\n || !(+hasFill ^ +hasStroke)\r\n || (hasFill && typeof style.fill !== 'string')\r\n || (hasStroke && typeof style.stroke !== 'string')\r\n || style.strokePercent < 1\r\n || style.strokeOpacity < 1\r\n || style.fillOpacity < 1);\r\n }\r\n function flushPathDrawn(ctx, scope) {\r\n scope.batchFill && ctx.fill();\r\n scope.batchStroke && ctx.stroke();\r\n scope.batchFill = '';\r\n scope.batchStroke = '';\r\n }\r\n function getStyle(el, inHover) {\r\n return inHover ? (el.__hoverStyle || el.style) : el.style;\r\n }\r\n function brushSingle(ctx, el) {\r\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\r\n }\r\n function brush(ctx, el, scope, isLast) {\r\n var m = el.transform;\r\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\r\n el.__dirty &= ~Element.REDARAW_BIT;\r\n el.__isRendered = false;\r\n return;\r\n }\r\n var clipPaths = el.__clipPaths;\r\n var prevElClipPaths = scope.prevElClipPaths;\r\n var forceSetTransform = false;\r\n var forceSetStyle = false;\r\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\r\n if (prevElClipPaths && prevElClipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.restore();\r\n forceSetStyle = forceSetTransform = true;\r\n scope.prevElClipPaths = null;\r\n scope.allClipped = false;\r\n scope.prevEl = null;\r\n }\r\n if (clipPaths && clipPaths.length) {\r\n flushPathDrawn(ctx, scope);\r\n ctx.save();\r\n updateClipStatus(clipPaths, ctx, scope);\r\n forceSetTransform = true;\r\n }\r\n scope.prevElClipPaths = clipPaths;\r\n }\r\n if (scope.allClipped) {\r\n el.__isRendered = false;\r\n return;\r\n }\r\n el.beforeBrush && el.beforeBrush();\r\n el.innerBeforeBrush();\r\n var prevEl = scope.prevEl;\r\n if (!prevEl) {\r\n forceSetStyle = forceSetTransform = true;\r\n }\r\n var canBatchPath = el instanceof Path\r\n && el.autoBatch\r\n && canPathBatch(el.style);\r\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\r\n flushPathDrawn(ctx, scope);\r\n setContextTransform(ctx, el);\r\n }\r\n else if (!canBatchPath) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n var style = getStyle(el, scope.inHover);\r\n if (el instanceof Path) {\r\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_PATH;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\r\n ctx.beginPath();\r\n }\r\n brushPath(ctx, el, style, canBatchPath);\r\n if (canBatchPath) {\r\n scope.batchFill = style.fill || '';\r\n scope.batchStroke = style.stroke || '';\r\n }\r\n }\r\n else {\r\n if (el instanceof TSpan) {\r\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_TEXT;\r\n }\r\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushText(ctx, el, style);\r\n }\r\n else if (el instanceof ZRImage) {\r\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_IMAGE;\r\n }\r\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\r\n brushImage(ctx, el, style);\r\n }\r\n else if (el instanceof IncrementalDisplayble) {\r\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\r\n forceSetStyle = true;\r\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\r\n }\r\n brushIncremental(ctx, el, scope);\r\n }\r\n }\r\n if (canBatchPath && isLast) {\r\n flushPathDrawn(ctx, scope);\r\n }\r\n el.innerAfterBrush();\r\n el.afterBrush && el.afterBrush();\r\n scope.prevEl = el;\r\n el.__dirty = 0;\r\n el.__isRendered = true;\r\n }\r\n function brushIncremental(ctx, el, scope) {\r\n var displayables = el.getDisplayables();\r\n var temporalDisplayables = el.getTemporalDisplayables();\r\n ctx.save();\r\n var innerScope = {\r\n prevElClipPaths: null,\r\n prevEl: null,\r\n allClipped: false,\r\n viewWidth: scope.viewWidth,\r\n viewHeight: scope.viewHeight,\r\n inHover: scope.inHover\r\n };\r\n var i;\r\n var len;\r\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\r\n var displayable = displayables[i];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i === len - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\r\n var displayable = temporalDisplayables[i_1];\r\n displayable.beforeBrush && displayable.beforeBrush();\r\n displayable.innerBeforeBrush();\r\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\r\n displayable.innerAfterBrush();\r\n displayable.afterBrush && displayable.afterBrush();\r\n innerScope.prevEl = displayable;\r\n }\r\n el.clearTemporalDisplayables();\r\n el.notClear = true;\r\n ctx.restore();\r\n }\n\n function returnFalse() {\r\n return false;\r\n }\r\n function createDom(id, painter, dpr) {\r\n var newDom = createCanvas();\r\n var width = painter.getWidth();\r\n var height = painter.getHeight();\r\n var newDomStyle = newDom.style;\r\n if (newDomStyle) {\r\n newDomStyle.position = 'absolute';\r\n newDomStyle.left = '0';\r\n newDomStyle.top = '0';\r\n newDomStyle.width = width + 'px';\r\n newDomStyle.height = height + 'px';\r\n newDom.setAttribute('data-zr-dom-id', id);\r\n }\r\n newDom.width = width * dpr;\r\n newDom.height = height * dpr;\r\n return newDom;\r\n }\r\n var Layer = (function (_super) {\r\n __extends(Layer, _super);\r\n function Layer(id, painter, dpr) {\r\n var _this = _super.call(this) || this;\r\n _this.motionBlur = false;\r\n _this.lastFrameAlpha = 0.7;\r\n _this.dpr = 1;\r\n _this.virtual = false;\r\n _this.config = {};\r\n _this.incremental = false;\r\n _this.zlevel = 0;\r\n _this.maxRepaintRectCount = 5;\r\n _this.__dirty = true;\r\n _this.__firstTimePaint = true;\r\n _this.__used = false;\r\n _this.__drawIndex = 0;\r\n _this.__startIndex = 0;\r\n _this.__endIndex = 0;\r\n _this.__prevStartIndex = null;\r\n _this.__prevEndIndex = null;\r\n var dom;\r\n dpr = dpr || devicePixelRatio;\r\n if (typeof id === 'string') {\r\n dom = createDom(id, painter, dpr);\r\n }\r\n else if (isObject(id)) {\r\n dom = id;\r\n id = dom.id;\r\n }\r\n _this.id = id;\r\n _this.dom = dom;\r\n var domStyle = dom.style;\r\n if (domStyle) {\r\n dom.onselectstart = returnFalse;\r\n domStyle.webkitUserSelect = 'none';\r\n domStyle.userSelect = 'none';\r\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\r\n domStyle['-webkit-touch-callout'] = 'none';\r\n domStyle.padding = '0';\r\n domStyle.margin = '0';\r\n domStyle.borderWidth = '0';\r\n }\r\n _this.domBack = null;\r\n _this.ctxBack = null;\r\n _this.painter = painter;\r\n _this.config = null;\r\n _this.dpr = dpr;\r\n return _this;\r\n }\r\n Layer.prototype.getElementCount = function () {\r\n return this.__endIndex - this.__startIndex;\r\n };\r\n Layer.prototype.afterBrush = function () {\r\n this.__prevStartIndex = this.__startIndex;\r\n this.__prevEndIndex = this.__endIndex;\r\n };\r\n Layer.prototype.initContext = function () {\r\n this.ctx = this.dom.getContext('2d');\r\n this.ctx.dpr = this.dpr;\r\n };\r\n Layer.prototype.setUnpainted = function () {\r\n this.__firstTimePaint = true;\r\n };\r\n Layer.prototype.createBackBuffer = function () {\r\n var dpr = this.dpr;\r\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\r\n this.ctxBack = this.domBack.getContext('2d');\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n };\r\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\r\n if (this.__firstTimePaint) {\r\n this.__firstTimePaint = false;\r\n return null;\r\n }\r\n var mergedRepaintRects = [];\r\n var maxRepaintRectCount = this.maxRepaintRectCount;\r\n var full = false;\r\n var pendingRect = new BoundingRect(0, 0, 0, 0);\r\n function addRectToMergePool(rect) {\r\n if (!rect.isFinite() || rect.isZero()) {\r\n return;\r\n }\r\n if (mergedRepaintRects.length === 0) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n else {\r\n var isMerged = false;\r\n var minDeltaArea = Infinity;\r\n var bestRectToMergeIdx = 0;\r\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\r\n var mergedRect = mergedRepaintRects[i];\r\n if (mergedRect.intersect(rect)) {\r\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\r\n pendingRect_1.copy(mergedRect);\r\n pendingRect_1.union(rect);\r\n mergedRepaintRects[i] = pendingRect_1;\r\n isMerged = true;\r\n break;\r\n }\r\n else if (full) {\r\n pendingRect.copy(rect);\r\n pendingRect.union(mergedRect);\r\n var aArea = rect.width * rect.height;\r\n var bArea = mergedRect.width * mergedRect.height;\r\n var pendingArea = pendingRect.width * pendingRect.height;\r\n var deltaArea = pendingArea - aArea - bArea;\r\n if (deltaArea < minDeltaArea) {\r\n minDeltaArea = minDeltaArea;\r\n bestRectToMergeIdx = i;\r\n }\r\n }\r\n }\r\n if (full) {\r\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\r\n isMerged = true;\r\n }\r\n if (!isMerged) {\r\n var boundingRect = new BoundingRect(0, 0, 0, 0);\r\n boundingRect.copy(rect);\r\n mergedRepaintRects.push(boundingRect);\r\n }\r\n if (!full) {\r\n full = mergedRepaintRects.length >= maxRepaintRectCount;\r\n }\r\n }\r\n }\r\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\r\n var el = displayList[i];\r\n if (el) {\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n var prevRect = el.__isRendered && ((el.__dirty & Element.REDARAW_BIT) || !shouldPaint)\r\n ? el.getPrevPaintRect()\r\n : null;\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n var curRect = shouldPaint && ((el.__dirty & Element.REDARAW_BIT) || !el.__isRendered)\r\n ? el.getPaintRect()\r\n : null;\r\n if (curRect) {\r\n addRectToMergePool(curRect);\r\n }\r\n }\r\n }\r\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\r\n var el = prevList[i];\r\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\r\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\r\n var prevRect = el.getPrevPaintRect();\r\n if (prevRect) {\r\n addRectToMergePool(prevRect);\r\n }\r\n }\r\n }\r\n var hasIntersections;\r\n do {\r\n hasIntersections = false;\r\n for (var i = 0; i < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].isZero()) {\r\n mergedRepaintRects.splice(i, 1);\r\n continue;\r\n }\r\n for (var j = i + 1; j < mergedRepaintRects.length;) {\r\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\r\n hasIntersections = true;\r\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\r\n mergedRepaintRects.splice(j, 1);\r\n }\r\n else {\r\n j++;\r\n }\r\n }\r\n i++;\r\n }\r\n } while (hasIntersections);\r\n this._paintRects = mergedRepaintRects;\r\n return mergedRepaintRects;\r\n };\r\n Layer.prototype.debugGetPaintRects = function () {\r\n return (this._paintRects || []).slice();\r\n };\r\n Layer.prototype.resize = function (width, height) {\r\n var dpr = this.dpr;\r\n var dom = this.dom;\r\n var domStyle = dom.style;\r\n var domBack = this.domBack;\r\n if (domStyle) {\r\n domStyle.width = width + 'px';\r\n domStyle.height = height + 'px';\r\n }\r\n dom.width = width * dpr;\r\n dom.height = height * dpr;\r\n if (domBack) {\r\n domBack.width = width * dpr;\r\n domBack.height = height * dpr;\r\n if (dpr !== 1) {\r\n this.ctxBack.scale(dpr, dpr);\r\n }\r\n }\r\n };\r\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\r\n var dom = this.dom;\r\n var ctx = this.ctx;\r\n var width = dom.width;\r\n var height = dom.height;\r\n clearColor = clearColor || this.clearColor;\r\n var haveMotionBLur = this.motionBlur && !clearAll;\r\n var lastFrameAlpha = this.lastFrameAlpha;\r\n var dpr = this.dpr;\r\n var self = this;\r\n if (haveMotionBLur) {\r\n if (!this.domBack) {\r\n this.createBackBuffer();\r\n }\r\n this.ctxBack.globalCompositeOperation = 'copy';\r\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\r\n }\r\n var domBack = this.domBack;\r\n function doClear(x, y, width, height) {\r\n ctx.clearRect(x, y, width, height);\r\n if (clearColor && clearColor !== 'transparent') {\r\n var clearColorGradientOrPattern = void 0;\r\n if (isGradientObject(clearColor)) {\r\n clearColorGradientOrPattern = clearColor.__canvasGradient\r\n || getCanvasGradient(ctx, clearColor, {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n });\r\n clearColor.__canvasGradient = clearColorGradientOrPattern;\r\n }\r\n else if (isPatternObject(clearColor)) {\r\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\r\n dirty: function () {\r\n self.setUnpainted();\r\n self.__painter.refresh();\r\n }\r\n });\r\n }\r\n ctx.save();\r\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\r\n ctx.fillRect(x, y, width, height);\r\n ctx.restore();\r\n }\r\n if (haveMotionBLur) {\r\n ctx.save();\r\n ctx.globalAlpha = lastFrameAlpha;\r\n ctx.drawImage(domBack, x, y, width, height);\r\n ctx.restore();\r\n }\r\n }\r\n if (!repaintRects || haveMotionBLur) {\r\n doClear(0, 0, width, height);\r\n }\r\n else if (repaintRects.length) {\r\n each(repaintRects, function (rect) {\r\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n });\r\n }\r\n };\r\n return Layer;\r\n }(Eventful));\n\n var HOVER_LAYER_ZLEVEL = 1e5;\r\n var CANVAS_ZLEVEL = 314159;\r\n var EL_AFTER_INCREMENTAL_INC = 0.01;\r\n var INCREMENTAL_INC = 0.001;\r\n function parseInt10(val) {\r\n return parseInt(val, 10);\r\n }\r\n function isLayerValid(layer) {\r\n if (!layer) {\r\n return false;\r\n }\r\n if (layer.__builtin__) {\r\n return true;\r\n }\r\n if (typeof (layer.resize) !== 'function'\r\n || typeof (layer.refresh) !== 'function') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n function createRoot(width, height) {\r\n var domRoot = document.createElement('div');\r\n domRoot.style.cssText = [\r\n 'position:relative',\r\n 'width:' + width + 'px',\r\n 'height:' + height + 'px',\r\n 'padding:0',\r\n 'margin:0',\r\n 'border-width:0'\r\n ].join(';') + ';';\r\n return domRoot;\r\n }\r\n var CanvasPainter = (function () {\r\n function CanvasPainter(root, storage, opts, id) {\r\n this.type = 'canvas';\r\n this._zlevelList = [];\r\n this._prevDisplayList = [];\r\n this._layers = {};\r\n this._layerConfig = {};\r\n this._needsManuallyCompositing = false;\r\n this.type = 'canvas';\r\n var singleCanvas = !root.nodeName\r\n || root.nodeName.toUpperCase() === 'CANVAS';\r\n this._opts = opts = extend({}, opts || {});\r\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\r\n this._singleCanvas = singleCanvas;\r\n this.root = root;\r\n var rootStyle = root.style;\r\n if (rootStyle) {\r\n rootStyle.webkitTapHighlightColor = 'transparent';\r\n rootStyle.webkitUserSelect = 'none';\r\n rootStyle.userSelect = 'none';\r\n rootStyle['-webkit-touch-callout'] = 'none';\r\n root.innerHTML = '';\r\n }\r\n this.storage = storage;\r\n var zlevelList = this._zlevelList;\r\n this._prevDisplayList = [];\r\n var layers = this._layers;\r\n if (!singleCanvas) {\r\n this._width = this._getSize(0);\r\n this._height = this._getSize(1);\r\n var domRoot = this._domRoot = createRoot(this._width, this._height);\r\n root.appendChild(domRoot);\r\n }\r\n else {\r\n var rootCanvas = root;\r\n var width = rootCanvas.width;\r\n var height = rootCanvas.height;\r\n if (opts.width != null) {\r\n width = opts.width;\r\n }\r\n if (opts.height != null) {\r\n height = opts.height;\r\n }\r\n this.dpr = opts.devicePixelRatio || 1;\r\n rootCanvas.width = width * this.dpr;\r\n rootCanvas.height = height * this.dpr;\r\n this._width = width;\r\n this._height = height;\r\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\r\n mainLayer.__builtin__ = true;\r\n mainLayer.initContext();\r\n layers[CANVAS_ZLEVEL] = mainLayer;\r\n mainLayer.zlevel = CANVAS_ZLEVEL;\r\n zlevelList.push(CANVAS_ZLEVEL);\r\n this._domRoot = root;\r\n }\r\n }\r\n CanvasPainter.prototype.getType = function () {\r\n return 'canvas';\r\n };\r\n CanvasPainter.prototype.isSingleCanvas = function () {\r\n return this._singleCanvas;\r\n };\r\n CanvasPainter.prototype.getViewportRoot = function () {\r\n return this._domRoot;\r\n };\r\n CanvasPainter.prototype.getViewportRootOffset = function () {\r\n var viewportRoot = this.getViewportRoot();\r\n if (viewportRoot) {\r\n return {\r\n offsetLeft: viewportRoot.offsetLeft || 0,\r\n offsetTop: viewportRoot.offsetTop || 0\r\n };\r\n }\r\n };\r\n CanvasPainter.prototype.refresh = function (paintAll) {\r\n var list = this.storage.getDisplayList(true);\r\n var prevList = this._prevDisplayList;\r\n var zlevelList = this._zlevelList;\r\n this._redrawId = Math.random();\r\n this._paintList(list, prevList, paintAll, this._redrawId);\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__ && layer.refresh) {\r\n var clearColor = i === 0 ? this._backgroundColor : null;\r\n layer.refresh(clearColor);\r\n }\r\n }\r\n if (this._opts.useDirtyRect) {\r\n this._prevDisplayList = list.slice();\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.refreshHover = function () {\r\n this._paintHoverList(this.storage.getDisplayList(false));\r\n };\r\n CanvasPainter.prototype._paintHoverList = function (list) {\r\n var len = list.length;\r\n var hoverLayer = this._hoverlayer;\r\n hoverLayer && hoverLayer.clear();\r\n if (!len) {\r\n return;\r\n }\r\n var scope = {\r\n inHover: true,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var ctx;\r\n for (var i = 0; i < len; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n if (!hoverLayer) {\r\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\r\n }\r\n if (!ctx) {\r\n ctx = hoverLayer.ctx;\r\n ctx.save();\r\n }\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n if (ctx) {\r\n ctx.restore();\r\n }\r\n };\r\n CanvasPainter.prototype.getHoverLayer = function () {\r\n return this.getLayer(HOVER_LAYER_ZLEVEL);\r\n };\r\n CanvasPainter.prototype.paintOne = function (ctx, el) {\r\n brushSingle(ctx, el);\r\n };\r\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\r\n if (this._redrawId !== redrawId) {\r\n return;\r\n }\r\n paintAll = paintAll || false;\r\n this._updateLayerStatus(list);\r\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\r\n if (this._needsManuallyCompositing) {\r\n this._compositeManually();\r\n }\r\n if (needsRefreshHover) {\r\n this._paintHoverList(list);\r\n }\r\n if (!finished) {\r\n var self_1 = this;\r\n requestAnimationFrame$1(function () {\r\n self_1._paintList(list, prevList, paintAll, redrawId);\r\n });\r\n }\r\n else {\r\n this.eachLayer(function (layer) {\r\n layer.afterBrush && layer.afterBrush();\r\n });\r\n }\r\n };\r\n CanvasPainter.prototype._compositeManually = function () {\r\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\r\n var width = this._domRoot.width;\r\n var height = this._domRoot.height;\r\n ctx.clearRect(0, 0, width, height);\r\n this.eachBuiltinLayer(function (layer) {\r\n if (layer.virtual) {\r\n ctx.drawImage(layer.dom, 0, 0, width, height);\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\r\n var _this = this;\r\n var layerList = [];\r\n var useDirtyRect = this._opts.useDirtyRect;\r\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\r\n var zlevel = this._zlevelList[zi];\r\n var layer = this._layers[zlevel];\r\n if (layer.__builtin__\r\n && layer !== this._hoverlayer\r\n && (layer.__dirty || paintAll)) {\r\n layerList.push(layer);\r\n }\r\n }\r\n var finished = true;\r\n var needsRefreshHover = false;\r\n var _loop_1 = function (k) {\r\n var layer = layerList[k];\r\n var ctx = layer.ctx;\r\n var repaintRects = useDirtyRect\r\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\r\n ctx.save();\r\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\r\n var useTimer = !paintAll && layer.incremental && Date.now;\r\n var startTime = useTimer && Date.now();\r\n var clearColor = layer.zlevel === this_1._zlevelList[0]\r\n ? this_1._backgroundColor : null;\r\n if (layer.__startIndex === layer.__endIndex) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n else if (start === layer.__startIndex) {\r\n var firstEl = list[start];\r\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\r\n layer.clear(false, clearColor, repaintRects);\r\n }\r\n }\r\n if (start === -1) {\r\n console.error('For some unknown reason. drawIndex is -1');\r\n start = layer.__startIndex;\r\n }\r\n var i;\r\n var repaint = function (repaintRect) {\r\n var scope = {\r\n inHover: false,\r\n allClipped: false,\r\n prevEl: null,\r\n viewWidth: _this._width,\r\n viewHeight: _this._height\r\n };\r\n for (i = start; i < layer.__endIndex; i++) {\r\n var el = list[i];\r\n if (el.__inHover) {\r\n needsRefreshHover = true;\r\n }\r\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\r\n if (useTimer) {\r\n var dTime = Date.now() - startTime;\r\n if (dTime > 15) {\r\n break;\r\n }\r\n }\r\n }\r\n if (scope.prevElClipPaths) {\r\n ctx.restore();\r\n }\r\n };\r\n if (repaintRects) {\r\n if (repaintRects.length === 0) {\r\n i = layer.__endIndex;\r\n }\r\n else {\r\n var dpr = this_1.dpr;\r\n for (var r = 0; r < repaintRects.length; ++r) {\r\n var rect = repaintRects[r];\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\r\n ctx.clip();\r\n repaint(rect);\r\n ctx.restore();\r\n }\r\n }\r\n }\r\n else {\r\n ctx.save();\r\n repaint();\r\n ctx.restore();\r\n }\r\n layer.__drawIndex = i;\r\n if (layer.__drawIndex < layer.__endIndex) {\r\n finished = false;\r\n }\r\n };\r\n var this_1 = this;\r\n for (var k = 0; k < layerList.length; k++) {\r\n _loop_1(k);\r\n }\r\n if (env.wxa) {\r\n each(this._layers, function (layer) {\r\n if (layer && layer.ctx && layer.ctx.draw) {\r\n layer.ctx.draw();\r\n }\r\n });\r\n }\r\n return {\r\n finished: finished,\r\n needsRefreshHover: needsRefreshHover\r\n };\r\n };\r\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\r\n var ctx = currentLayer.ctx;\r\n if (useDirtyRect) {\r\n var paintRect = el.getPaintRect();\r\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\r\n brush(ctx, el, scope, isLast);\r\n el.setPrevPaintRect(paintRect);\r\n }\r\n }\r\n else {\r\n brush(ctx, el, scope, isLast);\r\n }\r\n };\r\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\r\n if (this._singleCanvas && !this._needsManuallyCompositing) {\r\n zlevel = CANVAS_ZLEVEL;\r\n }\r\n var layer = this._layers[zlevel];\r\n if (!layer) {\r\n layer = new Layer('zr_' + zlevel, this, this.dpr);\r\n layer.zlevel = zlevel;\r\n layer.__builtin__ = true;\r\n if (this._layerConfig[zlevel]) {\r\n merge(layer, this._layerConfig[zlevel], true);\r\n }\r\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\r\n merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\r\n }\r\n if (virtual) {\r\n layer.virtual = virtual;\r\n }\r\n this.insertLayer(zlevel, layer);\r\n layer.initContext();\r\n }\r\n return layer;\r\n };\r\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\r\n var layersMap = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var len = zlevelList.length;\r\n var domRoot = this._domRoot;\r\n var prevLayer = null;\r\n var i = -1;\r\n if (layersMap[zlevel]) {\r\n logError('ZLevel ' + zlevel + ' has been used already');\r\n return;\r\n }\r\n if (!isLayerValid(layer)) {\r\n logError('Layer of zlevel ' + zlevel + ' is not valid');\r\n return;\r\n }\r\n if (len > 0 && zlevel > zlevelList[0]) {\r\n for (i = 0; i < len - 1; i++) {\r\n if (zlevelList[i] < zlevel\r\n && zlevelList[i + 1] > zlevel) {\r\n break;\r\n }\r\n }\r\n prevLayer = layersMap[zlevelList[i]];\r\n }\r\n zlevelList.splice(i + 1, 0, zlevel);\r\n layersMap[zlevel] = layer;\r\n if (!layer.virtual) {\r\n if (prevLayer) {\r\n var prevDom = prevLayer.dom;\r\n if (prevDom.nextSibling) {\r\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n else {\r\n if (domRoot.firstChild) {\r\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\r\n }\r\n else {\r\n domRoot.appendChild(layer.dom);\r\n }\r\n }\r\n }\r\n layer.__painter = this;\r\n };\r\n CanvasPainter.prototype.eachLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n cb.call(context, this._layers[z], z);\r\n }\r\n };\r\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\r\n var zlevelList = this._zlevelList;\r\n for (var i = 0; i < zlevelList.length; i++) {\r\n var z = zlevelList[i];\r\n var layer = this._layers[z];\r\n if (!layer.__builtin__) {\r\n cb.call(context, layer, z);\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.getLayers = function () {\r\n return this._layers;\r\n };\r\n CanvasPainter.prototype._updateLayerStatus = function (list) {\r\n this.eachBuiltinLayer(function (layer, z) {\r\n layer.__dirty = layer.__used = false;\r\n });\r\n function updatePrevLayer(idx) {\r\n if (prevLayer) {\r\n if (prevLayer.__endIndex !== idx) {\r\n prevLayer.__dirty = true;\r\n }\r\n prevLayer.__endIndex = idx;\r\n }\r\n }\r\n if (this._singleCanvas) {\r\n for (var i_1 = 1; i_1 < list.length; i_1++) {\r\n var el = list[i_1];\r\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\r\n this._needsManuallyCompositing = true;\r\n break;\r\n }\r\n }\r\n }\r\n var prevLayer = null;\r\n var incrementalLayerCount = 0;\r\n var prevZlevel;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n var el = list[i];\r\n var zlevel = el.zlevel;\r\n var layer = void 0;\r\n if (prevZlevel !== zlevel) {\r\n prevZlevel = zlevel;\r\n incrementalLayerCount = 0;\r\n }\r\n if (el.incremental) {\r\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\r\n layer.incremental = true;\r\n incrementalLayerCount = 1;\r\n }\r\n else {\r\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\r\n }\r\n if (!layer.__builtin__) {\r\n logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\r\n }\r\n if (layer !== prevLayer) {\r\n layer.__used = true;\r\n if (layer.__startIndex !== i) {\r\n layer.__dirty = true;\r\n }\r\n layer.__startIndex = i;\r\n if (!layer.incremental) {\r\n layer.__drawIndex = i;\r\n }\r\n else {\r\n layer.__drawIndex = -1;\r\n }\r\n updatePrevLayer(i);\r\n prevLayer = layer;\r\n }\r\n if ((el.__dirty & Element.REDARAW_BIT) && !el.__inHover) {\r\n layer.__dirty = true;\r\n if (layer.incremental && layer.__drawIndex < 0) {\r\n layer.__drawIndex = i;\r\n }\r\n }\r\n }\r\n updatePrevLayer(i);\r\n this.eachBuiltinLayer(function (layer, z) {\r\n if (!layer.__used && layer.getElementCount() > 0) {\r\n layer.__dirty = true;\r\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\r\n }\r\n if (layer.__dirty && layer.__drawIndex < 0) {\r\n layer.__drawIndex = layer.__startIndex;\r\n }\r\n });\r\n };\r\n CanvasPainter.prototype.clear = function () {\r\n this.eachBuiltinLayer(this._clearLayer);\r\n return this;\r\n };\r\n CanvasPainter.prototype._clearLayer = function (layer) {\r\n layer.clear();\r\n };\r\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\r\n this._backgroundColor = backgroundColor;\r\n each(this._layers, function (layer) {\r\n layer.setUnpainted();\r\n });\r\n };\r\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\r\n if (config) {\r\n var layerConfig = this._layerConfig;\r\n if (!layerConfig[zlevel]) {\r\n layerConfig[zlevel] = config;\r\n }\r\n else {\r\n merge(layerConfig[zlevel], config, true);\r\n }\r\n for (var i = 0; i < this._zlevelList.length; i++) {\r\n var _zlevel = this._zlevelList[i];\r\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\r\n var layer = this._layers[_zlevel];\r\n merge(layer, layerConfig[zlevel], true);\r\n }\r\n }\r\n }\r\n };\r\n CanvasPainter.prototype.delLayer = function (zlevel) {\r\n var layers = this._layers;\r\n var zlevelList = this._zlevelList;\r\n var layer = layers[zlevel];\r\n if (!layer) {\r\n return;\r\n }\r\n layer.dom.parentNode.removeChild(layer.dom);\r\n delete layers[zlevel];\r\n zlevelList.splice(indexOf(zlevelList, zlevel), 1);\r\n };\r\n CanvasPainter.prototype.resize = function (width, height) {\r\n if (!this._domRoot.style) {\r\n if (width == null || height == null) {\r\n return;\r\n }\r\n this._width = width;\r\n this._height = height;\r\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\r\n }\r\n else {\r\n var domRoot = this._domRoot;\r\n domRoot.style.display = 'none';\r\n var opts = this._opts;\r\n width != null && (opts.width = width);\r\n height != null && (opts.height = height);\r\n width = this._getSize(0);\r\n height = this._getSize(1);\r\n domRoot.style.display = '';\r\n if (this._width !== width || height !== this._height) {\r\n domRoot.style.width = width + 'px';\r\n domRoot.style.height = height + 'px';\r\n for (var id in this._layers) {\r\n if (this._layers.hasOwnProperty(id)) {\r\n this._layers[id].resize(width, height);\r\n }\r\n }\r\n this.refresh(true);\r\n }\r\n this._width = width;\r\n this._height = height;\r\n }\r\n return this;\r\n };\r\n CanvasPainter.prototype.clearLayer = function (zlevel) {\r\n var layer = this._layers[zlevel];\r\n if (layer) {\r\n layer.clear();\r\n }\r\n };\r\n CanvasPainter.prototype.dispose = function () {\r\n this.root.innerHTML = '';\r\n this.root =\r\n this.storage =\r\n this._domRoot =\r\n this._layers = null;\r\n };\r\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\r\n opts = opts || {};\r\n if (this._singleCanvas && !this._compositeManually) {\r\n return this._layers[CANVAS_ZLEVEL].dom;\r\n }\r\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\r\n var ctx = imageLayer.ctx;\r\n imageLayer.initContext();\r\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\r\n if (opts.pixelRatio <= this.dpr) {\r\n this.refresh();\r\n var width_1 = imageLayer.dom.width;\r\n var height_1 = imageLayer.dom.height;\r\n var ctx_1 = imageLayer.ctx;\r\n this.eachLayer(function (layer) {\r\n if (layer.__builtin__) {\r\n ctx_1.drawImage(layer.dom, 0, 0, width_1, height_1);\r\n }\r\n else if (layer.renderToCanvas) {\r\n imageLayer.ctx.save();\r\n layer.renderToCanvas(imageLayer.ctx);\r\n imageLayer.ctx.restore();\r\n }\r\n });\r\n }\r\n else {\r\n var scope = {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n };\r\n var displayList = this.storage.getDisplayList(true);\r\n for (var i = 0, len = displayList.length; i < len; i++) {\r\n var el = displayList[i];\r\n brush(ctx, el, scope, i === len - 1);\r\n }\r\n }\r\n return imageLayer.dom;\r\n };\r\n CanvasPainter.prototype.getWidth = function () {\r\n return this._width;\r\n };\r\n CanvasPainter.prototype.getHeight = function () {\r\n return this._height;\r\n };\r\n CanvasPainter.prototype._getSize = function (whIdx) {\r\n var opts = this._opts;\r\n var wh = ['width', 'height'][whIdx];\r\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\r\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\r\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\r\n if (opts[wh] != null && opts[wh] !== 'auto') {\r\n return parseFloat(opts[wh]);\r\n }\r\n var root = this.root;\r\n var stl = document.defaultView.getComputedStyle(root);\r\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\r\n - (parseInt10(stl[plt]) || 0)\r\n - (parseInt10(stl[prb]) || 0)) | 0;\r\n };\r\n CanvasPainter.prototype.pathToImage = function (path, dpr) {\r\n dpr = dpr || this.dpr;\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n var rect = path.getBoundingRect();\r\n var style = path.style;\r\n var shadowBlurSize = style.shadowBlur * dpr;\r\n var shadowOffsetX = style.shadowOffsetX * dpr;\r\n var shadowOffsetY = style.shadowOffsetY * dpr;\r\n var lineWidth = path.hasStroke() ? style.lineWidth : 0;\r\n var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize);\r\n var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize);\r\n var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize);\r\n var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize);\r\n var width = rect.width + leftMargin + rightMargin;\r\n var height = rect.height + topMargin + bottomMargin;\r\n canvas.width = width * dpr;\r\n canvas.height = height * dpr;\r\n ctx.scale(dpr, dpr);\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.dpr = dpr;\r\n var pathTransform = {\r\n x: path.x,\r\n y: path.y,\r\n scaleX: path.scaleX,\r\n scaleY: path.scaleY,\r\n rotation: path.rotation,\r\n originX: path.originX,\r\n originY: path.originY\r\n };\r\n path.x = leftMargin - rect.x;\r\n path.y = topMargin - rect.y;\r\n path.rotation = 0;\r\n path.scaleX = 1;\r\n path.scaleY = 1;\r\n path.updateTransform();\r\n if (path) {\r\n brush(ctx, path, {\r\n inHover: false,\r\n viewWidth: this._width,\r\n viewHeight: this._height\r\n }, true);\r\n }\r\n var imgShape = new ZRImage({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n image: canvas\r\n }\r\n });\r\n extend(path, pathTransform);\r\n return imgShape;\r\n };\r\n return CanvasPainter;\r\n }());\n\n registerPainter('canvas', CanvasPainter);\n\n function findEventDispatcher(target, det, returnFirstMatch) {\r\n var found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n }\n\n var wmUniqueIndex = Math.round(Math.random() * 9);\r\n var WeakMap = (function () {\r\n function WeakMap() {\r\n this._id = '__ec_inner_' + wmUniqueIndex++;\r\n }\r\n WeakMap.prototype.get = function (key) {\r\n return this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype.set = function (key, value) {\r\n var target = this._guard(key);\r\n if (typeof Object.defineProperty === 'function') {\r\n Object.defineProperty(target, this._id, {\r\n value: value,\r\n enumerable: false,\r\n configurable: true\r\n });\r\n }\r\n else {\r\n target[this._id] = value;\r\n }\r\n return this;\r\n };\r\n WeakMap.prototype[\"delete\"] = function (key) {\r\n if (this.has(key)) {\r\n delete this._guard(key)[this._id];\r\n return true;\r\n }\r\n return false;\r\n };\r\n WeakMap.prototype.has = function (key) {\r\n return !!this._guard(key)[this._id];\r\n };\r\n WeakMap.prototype._guard = function (key) {\r\n if (key !== Object(key)) {\r\n throw TypeError('Value of WeakMap is not a non-null object.');\r\n }\r\n return key;\r\n };\r\n return WeakMap;\r\n }());\n\n var Triangle = Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n });\r\n var Diamond = Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var cx = shape.cx;\r\n var cy = shape.cy;\r\n var width = shape.width / 2;\r\n var height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n });\r\n var Pin = Path.extend({\r\n type: 'pin',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n var x = shape.x;\r\n var y = shape.y;\r\n var w = shape.width / 5 * 3;\r\n var h = Math.max(w, shape.height);\r\n var r = w / 2;\r\n var dy = r * r / (h - r);\r\n var cy = y - h + r + dy;\r\n var angle = Math.asin(dy / r);\r\n var dx = Math.cos(angle) * r;\r\n var tanX = Math.sin(angle);\r\n var tanY = Math.cos(angle);\r\n var cpLen = r * 0.6;\r\n var cpLen2 = r * 0.7;\r\n path.moveTo(x - dx, cy + dy);\r\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\r\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\r\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\r\n path.closePath();\r\n }\r\n });\r\n var Arrow = Path.extend({\r\n type: 'arrow',\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (ctx, shape) {\r\n var height = shape.height;\r\n var width = shape.width;\r\n var x = shape.x;\r\n var y = shape.y;\r\n var dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n });\r\n var symbolCtors = {\r\n line: Rect,\r\n rect: Rect,\r\n roundRect: Rect,\r\n square: Rect,\r\n circle: Circle,\r\n diamond: Diamond,\r\n pin: Pin,\r\n arrow: Arrow,\r\n triangle: Triangle\r\n };\r\n var symbolShapeMakers = {\r\n line: function (x, y, w, h, shape) {\r\n var thickness = 2;\r\n shape.x = x;\r\n shape.y = y + h / 2 - thickness / 2;\r\n shape.width = w;\r\n shape.height = thickness;\r\n },\r\n rect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n roundRect: function (x, y, w, h, shape) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n square: function (x, y, w, h, shape) {\r\n var size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n circle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n diamond: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n pin: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n arrow: function (x, y, w, h, shape) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n triangle: function (x, y, w, h, shape) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n };\r\n var symbolBuildProxies = {};\r\n each(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n });\r\n var SymbolClz = Path.extend({\r\n type: 'symbol',\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n calculateTextPosition: function (out, config, rect) {\r\n var res = calculateTextPosition(out, config, rect);\r\n var shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n buildPath: function (ctx, shape, inBundle) {\r\n var symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n var proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n });\r\n function symbolPathSetColor(color, innerColor) {\r\n if (this.type !== 'image') {\r\n var symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n }\r\n function createSymbol(symbolType, x, y, w, h, color, keepAspect) {\r\n var isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n var symbolPath;\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n });\r\n }\r\n symbolPath.__isEmptyBrush = isEmpty;\r\n symbolPath.setColor = symbolPathSetColor;\r\n if (color) {\r\n symbolPath.setColor(color);\r\n }\r\n return symbolPath;\r\n }\n\n var decalMap = new WeakMap();\r\n var decalCache = new LRU(100);\r\n var decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY', 'dashLineOffset',\r\n 'maxTileWidth', 'maxTileHeight'\r\n ];\r\n function createOrUpdatePatternFromDecal(decalObject, api) {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n var dpr = api.getDevicePixelRatio();\r\n var zr = api.getZr();\r\n var isSVG = zr.painter.type === 'svg';\r\n if (decalObject.dirty) {\r\n decalMap[\"delete\"](decalObject);\r\n }\r\n var oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n var decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n dashLineOffset: 0,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n });\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n var pattern = { repeat: 'repeat' };\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n decalMap.set(decalObject, pattern);\r\n decalObject.dirty = false;\r\n return pattern;\r\n function setPatternnSource(pattern) {\r\n var keys = [dpr];\r\n var isValidKey = true;\r\n for (var i = 0; i < decalKeys.length; ++i) {\r\n var value = decalOpt[decalKeys[i]];\r\n var valueType = typeof value;\r\n if (value != null\r\n && !isArray(value)\r\n && valueType !== 'string'\r\n && valueType !== 'number'\r\n && valueType !== 'boolean') {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n var cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n var cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? pattern.svgElement = cache\r\n : pattern.image = cache;\r\n }\r\n }\r\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n var canvas = !isSVG && createCanvas();\r\n var svgRoot = isSVG && zr.painter.createSVGElement('g');\r\n var pSize = getPatternSize();\r\n var ctx;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n pattern.image = canvas;\r\n pattern.svgElement = svgRoot;\r\n pattern.svgWidth = pSize.width;\r\n pattern.svgHeight = pSize.height;\r\n function getPatternSize() {\r\n var width = 1;\r\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n var symbolRepeats = 1;\r\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n if (__DEV__) {\r\n var warn = function (attrName) {\r\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n var ySum = 0;\r\n for (var i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n return;\r\n }\r\n var y = -lineBlockLengthY;\r\n var yId = 0;\r\n var yIdTotal = 0;\r\n var xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n var symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n var x = 0;\r\n var xId1 = 0;\r\n var xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n var xSum = 0;\r\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n break;\r\n }\r\n if (xId1 % 2 === 0) {\r\n var size = (1 - decalOpt.symbolSize) * 0.5;\r\n var left = x + dashArrayX[xId0][xId1] * size;\r\n var top_1 = y + dashArrayY[yId] * size;\r\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n var height = dashArrayY[yId] * decalOpt.symbolSize;\r\n var symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n function brushSymbol(x, y, width, height, symbolType) {\r\n var scale = isSVG ? 1 : dpr;\r\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\r\n if (isSVG) {\r\n svgRoot.appendChild(zr.painter.paintOne(symbol));\r\n }\r\n else {\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function normalizeSymbolArray(symbol) {\r\n if (!symbol || symbol.length === 0) {\r\n return [['rect']];\r\n }\r\n if (typeof symbol === 'string') {\r\n return [[symbol]];\r\n }\r\n var isAllString = true;\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] !== 'string') {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < symbol.length; ++i) {\r\n if (typeof symbol[i] === 'string') {\r\n result.push([symbol[i]]);\r\n }\r\n else {\r\n result.push(symbol[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayX(dash) {\r\n if (!dash || dash.length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n var isAllNumber = true;\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] !== 'number') {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash]);\r\n }\r\n var result = [];\r\n for (var i = 0; i < dash.length; ++i) {\r\n if (typeof dash[i] === 'number') {\r\n var dashValue = Math.ceil(dash[i]);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n var dashValue = map(dash[i], function (n) { return Math.ceil(n); });\r\n if (dashValue.length % 2 === 1) {\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function normalizeDashArrayY(dash) {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (typeof dash === 'number') {\r\n var dashValue_1 = Math.ceil(dash);\r\n return [dashValue_1, dashValue_1];\r\n }\r\n var dashValue = map(dash, function (n) { return Math.ceil(n); });\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n }\r\n function getLineBlockLengthX(dash) {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n }\r\n function getLineBlockLengthY(dash) {\r\n var blockLength = 0;\r\n for (var i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n }\n\n function decalVisual(ecModel, api) {\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (data.hasItemVisual()) {\r\n data.each(function (idx) {\r\n var decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n var decal = data.getVisual('decal');\r\n if (decal) {\r\n var style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\n\n var assert$1 = assert;\r\n var each$3 = each;\r\n var isFunction$1 = isFunction;\r\n var isObject$2 = isObject;\r\n var version = '5.0.0';\r\n var dependencies = {\r\n zrender: '5.0.1'\r\n };\r\n var TEST_FRAME_REMAIN_TIME = 1;\r\n var PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n var PRIORITY_PROCESSOR_DATASTACK = 900;\r\n var PRIORITY_PROCESSOR_FILTER = 1000;\r\n var PRIORITY_PROCESSOR_DEFAULT = 2000;\r\n var PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n var PRIORITY_VISUAL_LAYOUT = 1000;\r\n var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\n var PRIORITY_VISUAL_GLOBAL = 2000;\r\n var PRIORITY_VISUAL_CHART = 3000;\r\n var PRIORITY_VISUAL_COMPONENT = 4000;\r\n var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\n var PRIORITY_VISUAL_BRUSH = 5000;\r\n var PRIORITY_VISUAL_ARIA = 6000;\r\n var PRIORITY_VISUAL_DECAL = 7000;\r\n var PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n };\r\n var IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\r\n var OPTION_UPDATED_KEY = '__optionUpdated';\r\n var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\r\n var ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n var CONNECT_STATUS_KEY = '__connectUpdateStatus';\r\n var CONNECT_STATUS_PENDING = 0;\r\n var CONNECT_STATUS_UPDATING = 1;\r\n var CONNECT_STATUS_UPDATED = 2;\r\n function createRegisterEventWithLowercaseECharts(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function createRegisterEventWithLowercaseMessageCenter(method) {\r\n return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n }\r\n function toLowercaseNameAndCallEventful(host, method, args) {\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args);\r\n }\r\n var MessageCenter = (function (_super) {\r\n __extends(MessageCenter, _super);\r\n function MessageCenter() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return MessageCenter;\r\n }(Eventful));\r\n var messageCenterProto = MessageCenter.prototype;\r\n messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\n messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n var prepare;\r\n var prepareView;\r\n var updateDirectly;\r\n var updateMethods;\r\n var doConvertPixel;\r\n var updateStreamModes;\r\n var doDispatchAction;\r\n var flushPendingActions;\r\n var triggerUpdatedEvent;\r\n var bindRenderedEvent;\r\n var bindMouseEvent;\r\n var clearColorPalette;\r\n var render;\r\n var renderComponents;\r\n var renderSeries;\r\n var performPostUpdateFuncs;\r\n var createExtensionAPI;\r\n var enableConnect;\r\n var setTransitionOpt;\r\n var markStatusToUpdate;\r\n var applyChangedStates;\r\n var ECharts = (function (_super) {\r\n __extends(ECharts, _super);\r\n function ECharts(dom, theme, opts) {\r\n var _this = _super.call(this, new ECEventProcessor()) || this;\r\n _this._chartsViews = [];\r\n _this._chartsMap = {};\r\n _this._componentsViews = [];\r\n _this._componentsMap = {};\r\n _this._pendingActions = [];\r\n opts = opts || {};\r\n if (typeof theme === 'string') {\r\n theme = themeStorage[theme];\r\n }\r\n _this._dom = dom;\r\n var root = (typeof window === 'undefined' ? global : window);\r\n var defaultRenderer = 'canvas';\r\n var defaultUseDirtyRect = false;\r\n if (__DEV__) {\r\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\r\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\r\n defaultUseDirtyRect = devUseDirtyRect == null\r\n ? defaultUseDirtyRect\r\n : devUseDirtyRect;\r\n }\r\n var zr = _this._zr = init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\r\n });\r\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n theme = clone(theme);\r\n theme && globalBackwardCompat(theme, true);\r\n _this._theme = theme;\r\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n _this._coordSysMgr = new CoordinateSystemManager();\r\n var api = _this._api = createExtensionAPI(_this);\r\n function prioritySortFunc(a, b) {\r\n return a.__prio - b.__prio;\r\n }\r\n sort(visualFuncs, prioritySortFunc);\r\n sort(dataProcessorFuncs, prioritySortFunc);\r\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\r\n _this._messageCenter = new MessageCenter();\r\n _this._labelManager = new LabelManager();\r\n _this._initEvents();\r\n _this.resize = bind(_this.resize, _this);\r\n zr.animation.on('frame', _this._onframe, _this);\r\n bindRenderedEvent(zr, _this);\r\n bindMouseEvent(zr, _this);\r\n setAsPrimitive(_this);\r\n return _this;\r\n }\r\n ECharts.prototype._onframe = function () {\r\n if (this._disposed) {\r\n return;\r\n }\r\n applyChangedStates(this);\r\n var scheduler = this._scheduler;\r\n if (this[OPTION_UPDATED_KEY]) {\r\n var silent = this[OPTION_UPDATED_KEY].silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[OPTION_UPDATED_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n else if (scheduler.unfinished) {\r\n var remainTime = TEST_FRAME_REMAIN_TIME;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n var startTime = +new Date();\r\n scheduler.performSeriesTasks(ecModel);\r\n scheduler.performDataProcessorTasks(ecModel);\r\n updateStreamModes(this, ecModel);\r\n scheduler.performVisualTasks(ecModel);\r\n renderSeries(this, this._model, api, 'remain');\r\n remainTime -= (+new Date() - startTime);\r\n } while (remainTime > 0 && scheduler.unfinished);\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n }\r\n };\r\n ECharts.prototype.getDom = function () {\r\n return this._dom;\r\n };\r\n ECharts.prototype.getId = function () {\r\n return this.id;\r\n };\r\n ECharts.prototype.getZr = function () {\r\n return this._zr;\r\n };\r\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var silent;\r\n var replaceMerge;\r\n var transitionOpt;\r\n if (isObject$2(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n if (!this._model || notMerge) {\r\n var optionManager = new OptionManager(this._api);\r\n var theme = this._theme;\r\n var ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n this._model.setOption(option, { replaceMerge: replaceMerge }, optionPreprocessorFuncs);\r\n setTransitionOpt(this, transitionOpt);\r\n if (lazyUpdate) {\r\n this[OPTION_UPDATED_KEY] = { silent: silent };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n prepare(this);\r\n updateMethods.update.call(this);\r\n this._zr.flush();\r\n this[OPTION_UPDATED_KEY] = false;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n };\r\n ECharts.prototype.setTheme = function () {\r\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n };\r\n ECharts.prototype.getModel = function () {\r\n return this._model;\r\n };\r\n ECharts.prototype.getOption = function () {\r\n return this._model && this._model.getOption();\r\n };\r\n ECharts.prototype.getWidth = function () {\r\n return this._zr.getWidth();\r\n };\r\n ECharts.prototype.getHeight = function () {\r\n return this._zr.getHeight();\r\n };\r\n ECharts.prototype.getDevicePixelRatio = function () {\r\n return this._zr.painter.dpr || window.devicePixelRatio || 1;\r\n };\r\n ECharts.prototype.getRenderedCanvas = function (opts) {\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n opts = extend({}, opts || {});\r\n opts.pixelRatio = opts.pixelRatio || 1;\r\n opts.backgroundColor = opts.backgroundColor\r\n || this._model.get('backgroundColor');\r\n var zr = this._zr;\r\n return zr.painter.getRenderedCanvas(opts);\r\n };\r\n ECharts.prototype.getSvgDataURL = function () {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n var zr = this._zr;\r\n var list = zr.storage.getDisplayList();\r\n each(list, function (el) {\r\n el.stopAnimation(null, true);\r\n });\r\n return zr.painter.toDataURL();\r\n };\r\n ECharts.prototype.getDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n opts = opts || {};\r\n var excludeComponents = opts.excludeComponents;\r\n var ecModel = this._model;\r\n var excludesComponentViews = [];\r\n var self = this;\r\n each$3(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n var view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n var url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\r\n each$3(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n return url;\r\n };\r\n ECharts.prototype.getConnectedDataURL = function (opts) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!env.canvasSupported) {\r\n return;\r\n }\r\n var isSvg = opts.type === 'svg';\r\n var groupId = this.group;\r\n var mathMin = Math.min;\r\n var mathMax = Math.max;\r\n var MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n var left_1 = MAX_NUMBER;\r\n var top_1 = MAX_NUMBER;\r\n var right_1 = -MAX_NUMBER;\r\n var bottom_1 = -MAX_NUMBER;\r\n var canvasList_1 = [];\r\n var dpr_1 = (opts && opts.pixelRatio) || 1;\r\n each(instances, function (chart, id) {\r\n if (chart.group === groupId) {\r\n var canvas = isSvg\r\n ? chart.getZr().painter.getSvgDom().innerHTML\r\n : chart.getRenderedCanvas(clone(opts));\r\n var boundingRect = chart.getDom().getBoundingClientRect();\r\n left_1 = mathMin(boundingRect.left, left_1);\r\n top_1 = mathMin(boundingRect.top, top_1);\r\n right_1 = mathMax(boundingRect.right, right_1);\r\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\r\n canvasList_1.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n left_1 *= dpr_1;\r\n top_1 *= dpr_1;\r\n right_1 *= dpr_1;\r\n bottom_1 *= dpr_1;\r\n var width = right_1 - left_1;\r\n var height = bottom_1 - top_1;\r\n var targetCanvas = createCanvas();\r\n var zr_1 = init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr_1.resize({\r\n width: width,\r\n height: height\r\n });\r\n if (isSvg) {\r\n var content_1 = '';\r\n each$3(canvasList_1, function (item) {\r\n var x = item.left - left_1;\r\n var y = item.top - top_1;\r\n content_1 += '' + item.dom + '';\r\n });\r\n zr_1.painter.getSvgRoot().innerHTML = content_1;\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\r\n }\r\n zr_1.refreshImmediately();\r\n return zr_1.painter.toDataURL();\r\n }\r\n else {\r\n if (opts.connectedBackgroundColor) {\r\n zr_1.add(new Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n each$3(canvasList_1, function (item) {\r\n var img = new ZRImage({\r\n style: {\r\n x: item.left * dpr_1 - left_1,\r\n y: item.top * dpr_1 - top_1,\r\n image: item.dom\r\n }\r\n });\r\n zr_1.add(img);\r\n });\r\n zr_1.refreshImmediately();\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n };\r\n ECharts.prototype.convertToPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n };\r\n ECharts.prototype.convertFromPixel = function (finder, value) {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n };\r\n ECharts.prototype.containPixel = function (finder, value) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var ecModel = this._model;\r\n var result;\r\n var findResult = parseFinder(ecModel, finder);\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models, function (model) {\r\n var coordSys = model.coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n var view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model);\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n return !!result;\r\n };\r\n ECharts.prototype.getVisual = function (finder, visualType) {\r\n var ecModel = this._model;\r\n var parsedFinder = parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n });\r\n var seriesModel = parsedFinder.seriesModel;\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n console.warn('There is no specified seires model');\r\n }\r\n }\r\n var data = seriesModel.getData();\r\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n };\r\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\r\n return this._componentsMap[componentModel.__viewId];\r\n };\r\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return this._chartsMap[seriesModel.__viewId];\r\n };\r\n ECharts.prototype._initEvents = function () {\r\n var _this = this;\r\n each$3(MOUSE_EVENT_NAMES, function (eveName) {\r\n var handler = function (e) {\r\n var ecModel = _this.getModel();\r\n var el = e.target;\r\n var params;\r\n var isGlobalOut = eveName === 'globalout';\r\n if (isGlobalOut) {\r\n params = {};\r\n }\r\n else {\r\n el && findEventDispatcher(el, function (parent) {\r\n var ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {});\r\n return true;\r\n }\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData);\r\n return true;\r\n }\r\n }, true);\r\n }\r\n if (params) {\r\n var componentType = params.componentType;\r\n var componentIndex = params.componentIndex;\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea') {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n var model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\r\n if (__DEV__) {\r\n if (!isGlobalOut && !(model && view)) {\r\n console.warn('model or view can not be found by params');\r\n }\r\n }\r\n params.event = e;\r\n params.type = eveName;\r\n _this._$eventProcessor.eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n _this.trigger(eveName, params);\r\n }\r\n };\r\n handler.zrEventfulCallAtLast = true;\r\n _this._zr.on(eveName, handler, _this);\r\n });\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n each$3(['selectchanged'], function (eventType) {\r\n _this._messageCenter.on(eventType, function (event) {\r\n this.trigger(eventType, event);\r\n }, _this);\r\n });\r\n handleLegacySelectEvents(this._messageCenter, this, this._model);\r\n };\r\n ECharts.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ECharts.prototype.clear = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] }, true);\r\n };\r\n ECharts.prototype.dispose = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n var api = this._api;\r\n var ecModel = this._model;\r\n each$3(this._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each$3(this._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n this._zr.dispose();\r\n delete instances[this.id];\r\n };\r\n ECharts.prototype.resize = function (opts) {\r\n if (__DEV__) {\r\n assert$1(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\r\n }\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._zr.resize(opts);\r\n var ecModel = this._model;\r\n this._loadingFX && this._loadingFX.resize();\r\n if (!ecModel) {\r\n return;\r\n }\r\n var optionChanged = ecModel.resetOption('media');\r\n var silent = opts && opts.silent;\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n optionChanged && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: {\r\n duration: 0\r\n }\r\n });\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.showLoading = function (name, cfg) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (isObject$2(name)) {\r\n cfg = name;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n console.warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n var el = loadingEffects[name](this._api, cfg);\r\n var zr = this._zr;\r\n this._loadingFX = el;\r\n zr.add(el);\r\n };\r\n ECharts.prototype.hideLoading = function () {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n };\r\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\r\n var payload = extend({}, eventObj);\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n };\r\n ECharts.prototype.dispatchAction = function (payload, opt) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n if (!isObject$2(opt)) {\r\n opt = { silent: !!opt };\r\n }\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n if (!this._model) {\r\n return;\r\n }\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n var silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n var flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n this._throttledZrFlush();\r\n }\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n };\r\n ECharts.prototype.updateLabelLayout = function () {\r\n var labelManager = this._labelManager;\r\n labelManager.updateLayoutConfig(this._api);\r\n labelManager.layout(this._api);\r\n labelManager.processLabelsOverall();\r\n };\r\n ECharts.prototype.appendData = function (params) {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n var seriesIndex = params.seriesIndex;\r\n var ecModel = this.getModel();\r\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (__DEV__) {\r\n assert$1(params.data && seriesModel);\r\n }\r\n seriesModel.appendData(params);\r\n this._scheduler.unfinished = true;\r\n this.getZr().wakeUp();\r\n };\r\n ECharts.internalField = (function () {\r\n prepare = function (ecIns) {\r\n var scheduler = ecIns._scheduler;\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n scheduler.plan();\r\n };\r\n prepareView = function (ecIns, isComponent) {\r\n var ecModel = ecIns._model;\r\n var scheduler = ecIns._scheduler;\r\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n var zr = ecIns._zr;\r\n var api = ecIns._api;\r\n for (var i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n function doPrepare(model) {\r\n var requireNewView = model.__requireNewView;\r\n model.__requireNewView = false;\r\n var viewId = '_ec_' + model.id + '_' + model.type;\r\n var view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n var classType = parseClassType(model.type);\r\n var Clazz = isComponent\r\n ? ComponentView.getClass(classType.main, classType.sub)\r\n : (ChartView.getClass(classType.sub));\r\n if (__DEV__) {\r\n assert$1(Clazz, classType.sub + ' does not exist.');\r\n }\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view);\r\n zr.add(view.group);\r\n }\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\r\n }\r\n for (var i = 0; i < viewList.length;) {\r\n var view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && view.renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\r\n var ecModel = ecIns._model;\r\n ecModel.setUpdatePayload(payload);\r\n if (!mainType) {\r\n each$3([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n var query = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n var condition = { mainType: mainType, query: query };\r\n subType && (condition.subType = subType);\r\n var excludeSeriesId = payload.excludeSeriesId;\r\n var excludeSeriesIdMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each$3(normalizeToArray(excludeSeriesId), function (id) {\r\n var modelId = convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n if (!excludeSeriesIdMap || excludeSeriesIdMap.get(model.id) == null) {\r\n if (isHighDownPayload(payload) && !payload.notBlur) {\r\n if (model instanceof SeriesModel) {\r\n toggleSeriesBlurStateFromPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\r\n }\r\n }, ecIns);\r\n function callView(view) {\r\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\r\n }\r\n };\r\n updateMethods = {\r\n prepareAndUpdate: function (payload) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n },\r\n update: function (payload) {\r\n var ecModel = this._model;\r\n var api = this._api;\r\n var zr = this._zr;\r\n var coordSysMgr = this._coordSysMgr;\r\n var scheduler = this._scheduler;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n scheduler.restoreData(ecModel, payload);\r\n scheduler.performSeriesTasks(ecModel);\r\n coordSysMgr.create(ecModel, api);\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n updateStreamModes(this, ecModel);\r\n coordSysMgr.update(ecModel, api);\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n render(this, ecModel, api, payload);\r\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n var darkMode = ecModel.get('darkMode');\r\n if (!env.canvasSupported) {\r\n var colorArr = parse(backgroundColor);\r\n backgroundColor = stringify(colorArr, 'rgb');\r\n if (colorArr[3] === 0) {\r\n backgroundColor = 'transparent';\r\n }\r\n }\r\n else {\r\n zr.setBackgroundColor(backgroundColor);\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n }\r\n performPostUpdateFuncs(ecModel, api);\r\n },\r\n updateTransform: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n var api = this._api;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n var componentDirtyList = [];\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n var seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true, dirtyMap: seriesDirtyMap });\r\n renderSeries(this, ecModel, api, payload, seriesDirtyMap);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateView: function (payload) {\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { setDirty: true });\r\n render(this, this._model, this._api, payload);\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateVisual: function (payload) {\r\n var _this = this;\r\n var ecModel = this._model;\r\n if (!ecModel) {\r\n return;\r\n }\r\n ecModel.setUpdatePayload(payload);\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n clearColorPalette(ecModel);\r\n this._scheduler.performVisualTasks(ecModel, payload, { visualType: 'visual', setDirty: true });\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType !== 'series') {\r\n var componentView = _this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = _this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\r\n });\r\n performPostUpdateFuncs(ecModel, this._api);\r\n },\r\n updateLayout: function (payload) {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n doConvertPixel = function (ecIns, methodName, finder, value) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n var ecModel = ecIns._model;\r\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n var result;\r\n var parsedFinder = parseFinder(ecModel, finder);\r\n for (var i = 0; i < coordSysList.length; i++) {\r\n var coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\r\n return result;\r\n }\r\n }\r\n if (__DEV__) {\r\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\r\n }\r\n };\r\n updateStreamModes = function (ecIns, ecModel) {\r\n var chartsMap = ecIns._chartsMap;\r\n var scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n doDispatchAction = function (payload, silent) {\r\n var _this = this;\r\n var ecModel = this.getModel();\r\n var payloadType = payload.type;\r\n var escapeConnect = payload.escapeConnect;\r\n var actionWrap = actions[payloadType];\r\n var actionInfo = actionWrap.actionInfo;\r\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n var updateMethod = cptTypeTmp.pop();\r\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n var payloads = [payload];\r\n var batched = false;\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item;\r\n });\r\n }\r\n var eventObjBatch = [];\r\n var eventObj;\r\n var isSelectChange = isSelectChangePayload(payload);\r\n var isStatusChange = isHighDownPayload(payload) || isSelectChange;\r\n each$3(payloads, function (batchItem) {\r\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\r\n eventObj = eventObj || extend({}, batchItem);\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n if (isStatusChange) {\r\n updateDirectly(_this, updateMethod, batchItem, 'series');\r\n markStatusToUpdate(_this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\r\n }\r\n });\r\n if (updateMethod !== 'none' && !isStatusChange && !cptType) {\r\n if (this[OPTION_UPDATED_KEY]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[OPTION_UPDATED_KEY] = false;\r\n }\r\n else {\r\n updateMethods[updateMethod].call(this, payload);\r\n }\r\n }\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0];\r\n }\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n if (!silent) {\r\n var messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n if (isSelectChange) {\r\n var newObj = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type,\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n flushPendingActions = function (silent) {\r\n var pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n var payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n triggerUpdatedEvent = function (silent) {\r\n !silent && this.trigger('updated');\r\n };\r\n bindRenderedEvent = function (zr, ecIns) {\r\n zr.on('rendered', function (params) {\r\n ecIns.trigger('rendered', params);\r\n if (zr.animation.isFinished()\r\n && !ecIns[OPTION_UPDATED_KEY]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n bindMouseEvent = function (zr, ecIns) {\r\n zr.on('mouseover', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, true);\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n var ecData = getECData(dispatcher);\r\n toggleSeriesBlurState(ecData.seriesIndex, ecData.focus, ecData.blurScope, ecIns._api, false);\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n var el = e.target;\r\n var dispatcher = findEventDispatcher(el, function (target) { return getECData(target).dataIndex != null; }, true);\r\n if (dispatcher) {\r\n var actionType = dispatcher.selected ? 'unselect' : 'select';\r\n var ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n clearColorPalette = function (ecModel) {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n render = function (ecIns, ecModel, api, payload) {\r\n renderComponents(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n chart.__alive = false;\r\n });\r\n renderSeries(ecIns, ecModel, api, payload);\r\n each$3(ecIns._chartsViews, function (chart) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n renderComponents = function (ecIns, ecModel, api, payload, dirtyList) {\r\n each$3(dirtyList || ecIns._componentsViews, function (componentView) {\r\n var componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n componentView.render(componentModel, ecModel, api, payload);\r\n updateZ(componentModel, componentView);\r\n updateStates(componentModel, componentView);\r\n });\r\n };\r\n renderSeries = function (ecIns, ecModel, api, payload, dirtyMap) {\r\n var scheduler = ecIns._scheduler;\r\n var labelManager = ecIns._labelManager;\r\n labelManager.clearLabels();\r\n var unfinished = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n var renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n clearStates(seriesModel, chartView);\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n seriesModel.__transientTransitionOpt = null;\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n updateBlend(seriesModel, chartView);\r\n updateSeriesElementSelection(seriesModel);\r\n labelManager.addLabelsOfSeries(chartView);\r\n });\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n ecModel.eachSeries(function (seriesModel) {\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n updateZ(seriesModel, chartView);\r\n updateStates(seriesModel, chartView);\r\n });\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n };\r\n performPostUpdateFuncs = function (ecModel, api) {\r\n each$3(postUpdateFuncs, function (func) {\r\n func(ecModel, api);\r\n });\r\n };\r\n markStatusToUpdate = function (ecIns) {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n ecIns.getZr().wakeUp();\r\n };\r\n applyChangedStates = function (ecIns) {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n ecIns.getZr().storage.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n function applyElementStates(el) {\r\n var newStates = [];\r\n var oldStates = el.currentStates;\r\n for (var i = 0; i < oldStates.length; i++) {\r\n var stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n function updateHoverLayerStatus(ecIns, ecModel) {\r\n var zr = ecIns._zr;\r\n var storage = zr.storage;\r\n var elCount = 0;\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.group.traverse(function (el) {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function updateBlend(seriesModel, chartView) {\r\n var blendMode = seriesModel.get('blendMode') || null;\r\n if (__DEV__) {\r\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\r\n console.warn('Only canvas support blendMode');\r\n }\r\n }\r\n chartView.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n el.style.blend = blendMode;\r\n }\r\n if (el.eachPendingDisplayable) {\r\n el.eachPendingDisplayable(function (displayable) {\r\n displayable.style.blend = blendMode;\r\n });\r\n }\r\n });\r\n }\r\n function updateZ(model, view) {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n var z = model.get('z');\r\n var zlevel = model.get('zlevel');\r\n view.group.traverse(function (el) {\r\n if (!el.isGroup) {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n var label = el.getTextContent();\r\n var labelLine = el.getTextGuideLine();\r\n if (label) {\r\n label.z = el.z;\r\n label.zlevel = el.zlevel;\r\n label.z2 = el.z2 + 2;\r\n }\r\n if (labelLine) {\r\n var showAbove = el.textGuideLineConfig && el.textGuideLineConfig.showAbove;\r\n labelLine.z = el.z;\r\n labelLine.zlevel = el.zlevel;\r\n labelLine.z2 = el.z2 + (showAbove ? 1 : -1);\r\n }\r\n }\r\n });\r\n }\r\n function clearStates(model, view) {\r\n view.group.traverse(function (el) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n function updateStates(model, view) {\r\n var stateAnimationModel = model.getModel('stateAnimation');\r\n var enableAnimation = model.isAnimationEnabled();\r\n var duration = stateAnimationModel.get('duration');\r\n var stateTransition = duration > 0 ? {\r\n duration: duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n } : null;\r\n view.group.traverse(function (el) {\r\n if (el.states && el.states.emphasis) {\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n if (el instanceof Path) {\r\n savePathStates(el);\r\n }\r\n if (el.__dirty) {\r\n var prevStates = el.prevStates;\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n var textContent = el.getTextContent();\r\n var textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n }\r\n createExtensionAPI = function (ecIns) {\r\n return new ((function (_super) {\r\n __extends(class_1, _super);\r\n function class_1() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n class_1.prototype.getCoordinateSystems = function () {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n };\r\n class_1.prototype.getComponentByElement = function (el) {\r\n while (el) {\r\n var modelInfo = el.__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n };\r\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterBlur = function (el) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveBlur = function (el) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.enterSelect = function (el) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.leaveSelect = function (el) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n };\r\n class_1.prototype.getModel = function () {\r\n return ecIns.getModel();\r\n };\r\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n };\r\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n };\r\n return class_1;\r\n }(ExtensionAPI)))(ecIns);\r\n };\r\n enableConnect = function (chart) {\r\n function updateConnectedChartsStatus(charts, status) {\r\n for (var i = 0; i < charts.length; i++) {\r\n var otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n each$3(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n var action_1 = chart.makeActionFromEvent(event);\r\n var otherCharts_1 = [];\r\n each$3(instances, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts_1.push(otherChart);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\r\n each$3(otherCharts_1, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action_1);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n setTransitionOpt = function (chart, transitionOpt) {\r\n var ecModel = chart._model;\r\n each(normalizeToArray(transitionOpt), function (transOpt) {\r\n var errMsg;\r\n var fromOpt = transOpt.from;\r\n var toOpt = transOpt.to;\r\n if (toOpt == null) {\r\n if (__DEV__) {\r\n errMsg = '`transition.to` must be specified.';\r\n }\r\n throwError(errMsg);\r\n }\r\n var finderOpt = {\r\n includeMainTypes: ['series'],\r\n enableAll: false,\r\n enableNone: false\r\n };\r\n var fromResult = fromOpt ? parseFinder(ecModel, fromOpt, finderOpt) : null;\r\n var toResult = parseFinder(ecModel, toOpt, finderOpt);\r\n var toSeries = toResult.seriesModel;\r\n if (toSeries == null) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition` is only supported on series.';\r\n }\r\n }\r\n if (fromResult && fromResult.seriesModel !== toSeries) {\r\n errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`transition.from` and `transition.to` must be specified to the same series.';\r\n }\r\n }\r\n if (errMsg != null) {\r\n throwError(errMsg);\r\n }\r\n toSeries.__transientTransitionOpt = {\r\n from: fromOpt ? fromOpt.dimension : null,\r\n to: toOpt.dimension,\r\n dividingMethod: transOpt.dividingMethod\r\n };\r\n });\r\n };\r\n })();\r\n return ECharts;\r\n }(Eventful));\r\n var echartsProto = ECharts.prototype;\r\n echartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\n echartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n echartsProto.one = function (eventName, cb, ctx) {\r\n var self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped() {\r\n var args2 = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args2[_i] = arguments[_i];\r\n }\r\n cb && cb.apply && cb.apply(this, args2);\r\n self.off(eventName, wrapped);\r\n }\r\n this.on.call(this, eventName, wrapped, ctx);\r\n };\r\n var MOUSE_EVENT_NAMES = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n ];\r\n function disposedWarning(id) {\r\n if (__DEV__) {\r\n console.warn('Instance ' + id + ' has been disposed');\r\n }\r\n }\r\n var actions = {};\r\n var eventActionMap = {};\r\n var dataProcessorFuncs = [];\r\n var optionPreprocessorFuncs = [];\r\n var postInitFuncs = [];\r\n var postUpdateFuncs = [];\r\n var visualFuncs = [];\r\n var themeStorage = {};\r\n var loadingEffects = {};\r\n var instances = {};\r\n var connectedGroups = {};\r\n var idBase = +(new Date()) - 0;\r\n var groupIdBase = +(new Date()) - 0;\r\n var DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n function init$1(dom, theme, opts) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n var existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n console.warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && ((!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null)))) {\r\n console.warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n var chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances[chart.id] = chart;\r\n setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n enableConnect(chart);\r\n each$3(postInitFuncs, function (postInitFunc) {\r\n postInitFunc(chart);\r\n });\r\n return chart;\r\n }\r\n function connect(groupId) {\r\n if (isArray(groupId)) {\r\n var charts = groupId;\r\n groupId = null;\r\n each$3(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each$3(charts, function (chart) {\r\n chart.group = groupId;\r\n });\r\n }\r\n connectedGroups[groupId] = true;\r\n return groupId;\r\n }\r\n function disConnect(groupId) {\r\n connectedGroups[groupId] = false;\r\n }\r\n var disconnect = disConnect;\r\n function dispose(chart) {\r\n if (typeof chart === 'string') {\r\n chart = instances[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n }\r\n function getInstanceByDom(dom) {\r\n return instances[getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n }\r\n function getInstanceById(key) {\r\n return instances[key];\r\n }\r\n function registerTheme(name, theme) {\r\n themeStorage[name] = theme;\r\n }\r\n function registerPreprocessor(preprocessorFunc) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n function registerProcessor(priority, processor) {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n }\r\n function registerPostInit(postInitFunc) {\r\n postInitFunc && postInitFuncs.push(postInitFunc);\r\n }\r\n function registerPostUpdate(postUpdateFunc) {\r\n postUpdateFunc && postUpdateFuncs.push(postUpdateFunc);\r\n }\r\n function registerAction(actionInfo, eventName, action) {\r\n if (typeof eventName === 'function') {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n var actionType = isObject$2(actionInfo)\r\n ? actionInfo.type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n }][0]);\r\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\r\n eventName = actionInfo.event;\r\n assert$1(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\r\n if (!actions[actionType]) {\r\n actions[actionType] = { action: action, actionInfo: actionInfo };\r\n }\r\n eventActionMap[eventName] = actionType;\r\n }\r\n function registerCoordinateSystem(type, coordSysCreator) {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n }\r\n function getCoordinateSystemDimensions(type) {\r\n var coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n }\r\n function registerLayout(priority, layoutTask) {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n }\r\n function registerVisual(priority, visualTask) {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n }\r\n function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\r\n if (isFunction$1(priority) || isObject$2(priority)) {\r\n fn = priority;\r\n priority = defaultPriority;\r\n }\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n each$3(targetList, function (wrap) {\r\n assert$1(wrap.__raw !== fn);\r\n });\r\n }\r\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n }\r\n function registerLoading(name, loadingFx) {\r\n loadingEffects[name] = loadingFx;\r\n }\r\n function extendComponentModel(proto) {\r\n return ComponentModel.extend(proto);\r\n }\r\n function extendComponentView(proto) {\r\n return ComponentView.extend(proto);\r\n }\r\n function extendSeriesModel(proto) {\r\n return SeriesModel.extend(proto);\r\n }\r\n function extendChartView(proto) {\r\n return ChartView.extend(proto);\r\n }\r\n function setCanvasCreator(creator) {\r\n $override('createCanvas', creator);\r\n }\r\n function registerMap(mapName, geoJson, specialAreas) {\r\n mapDataStorage.registerMap(mapName, geoJson, specialAreas);\r\n }\r\n function getMap(mapName) {\r\n var records = mapDataStorage.retrieveMap(mapName);\r\n return records && records[0] && {\r\n geoJson: records[0].geoJSON,\r\n specialAreas: records[0].specialAreas\r\n };\r\n }\r\n var registerTransform = registerExternalTransform;\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);\r\n registerPreprocessor(globalBackwardCompat);\r\n registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\n registerLoading('default', defaultLoading);\r\n registerAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n }, noop);\r\n registerAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n }, noop);\r\n registerTheme('light', lightTheme);\r\n registerTheme('dark', theme);\r\n var dataTool = {};\n\n function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : (valNumOrArrLengthMoreThan2.length || 1);\r\n }\r\n function defaultKeyGetter(item) {\r\n return item;\r\n }\r\n var DataDiffer = (function () {\r\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n this.context = context;\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n DataDiffer.prototype.add = function (func) {\r\n this._add = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.update = function (func) {\r\n this._update = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateManyToOne = function (func) {\r\n this._updateManyToOne = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.updateOneToMany = function (func) {\r\n this._updateOneToMany = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.remove = function (func) {\r\n this._remove = func;\r\n return this;\r\n };\r\n DataDiffer.prototype.execute = function () {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n };\r\n DataDiffer.prototype._executeOneToOne = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = new Array(oldArr.length);\r\n var newDataKeyArr = new Array(newArr.length);\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (newIdxMapValLen > 1) {\r\n var newIdx = newIdxMapVal.shift();\r\n if (newIdxMapVal.length === 1) {\r\n newDataIndexMap[oldKey] = newIdxMapVal[0];\r\n }\r\n this._update && this._update(newIdx, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._executeMultiple = function () {\r\n var oldArr = this._old;\r\n var newArr = this._new;\r\n var oldDataIndexMap = {};\r\n var newDataIndexMap = {};\r\n var oldDataKeyArr = [];\r\n var newDataKeyArr = [];\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n for (var i = 0; i < oldDataKeyArr.length; i++) {\r\n var oldKey = oldDataKeyArr[i];\r\n var oldIdxMapVal = oldDataIndexMap[oldKey];\r\n var newIdxMapVal = newDataIndexMap[oldKey];\r\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\r\n this._remove && this._remove(oldIdxMapVal[i_1]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal);\r\n }\r\n }\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n };\r\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\r\n for (var i = 0; i < newDataKeyArr.length; i++) {\r\n var newKey = newDataKeyArr[i];\r\n var newIdxMapVal = newDataIndexMap[newKey];\r\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (var j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add(newIdxMapVal[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal);\r\n }\r\n newDataIndexMap[newKey] = null;\r\n }\r\n };\r\n DataDiffer.prototype._initIndexMap = function (arr, map, keyArr, keyGetterName) {\r\n var cbModeMultiple = this._diffModeMultiple;\r\n for (var i = 0; i < arr.length; i++) {\r\n var key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n var idxMapVal = map[key];\r\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n if (idxMapValLen === 0) {\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal, i];\r\n }\r\n else {\r\n idxMapVal.push(i);\r\n }\r\n }\r\n };\r\n return DataDiffer;\r\n }());\n\n function summarizeDimensions(data) {\r\n var summary = {};\r\n var encode = summary.encode = {};\r\n var notExtraCoordDimMap = createHashMap();\r\n var defaultedLabel = [];\r\n var defaultedTooltip = [];\r\n var userOutput = summary.userOutput = {\r\n dimensionNames: data.dimensions.slice(),\r\n encode: {}\r\n };\r\n each(data.dimensions, function (dimName) {\r\n var dimItem = data.getDimensionInfo(dimName);\r\n var coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\r\n }\r\n var coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n getOrCreateEncodeArr(userOutput.encode, coordDim)[coordDimIndex] = dimItem.index;\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n var dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n var dataDimsOnCoord = [];\r\n var encodeFirstDimNotExtra = {};\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n var dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n var encodeLabel = encode.label;\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n var encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n return summary;\r\n }\r\n function getOrCreateEncodeArr(encode, dim) {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n }\r\n function getDimensionTypeByAxis(axisType) {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n }\r\n function mayLabelDimType(dimType) {\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n }\n\n var DataDimensionInfo = (function () {\r\n function DataDimensionInfo(opt) {\r\n this.otherDims = {};\r\n if (opt != null) {\r\n extend(this, opt);\r\n }\r\n }\r\n return DataDimensionInfo;\r\n }());\n\n var mathFloor = Math.floor;\r\n var isObject$3 = isObject;\r\n var map$1 = map;\r\n var UNDEFINED = 'undefined';\r\n var INDEX_NOT_FOUND = -1;\r\n var ID_PREFIX = 'e\\0\\0';\r\n var dataCtors = {\r\n 'float': typeof Float64Array === UNDEFINED\r\n ? Array : Float64Array,\r\n 'int': typeof Int32Array === UNDEFINED\r\n ? Array : Int32Array,\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': Array\r\n };\r\n var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\n var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\n var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\n var TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_rawData', '_dimValueGetter',\r\n '_count', '_rawCount', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n ];\r\n var CLONE_PROPERTIES = [\r\n '_extent', '_approximateExtent', '_rawExtent'\r\n ];\r\n var defaultDimValueGetters;\r\n var prepareInvertedIndex;\r\n var getIndicesCtor;\r\n var prepareStorage;\r\n var getRawIndexWithoutIndices;\r\n var getRawIndexWithIndices;\r\n var getId;\r\n var getIdNameFromStore;\r\n var makeIdFromName;\r\n var normalizeDimensions;\r\n var validateDimensions;\r\n var cloneListForMapAndSample;\r\n var getInitialExtent;\r\n var setItemDataAndSeriesIndex;\r\n var transferProperties;\r\n var List = (function () {\r\n function List(dimensions, hostModel) {\r\n this.type = 'list';\r\n this._count = 0;\r\n this._rawCount = 0;\r\n this._storage = {};\r\n this._storageArr = [];\r\n this._nameList = [];\r\n this._idList = [];\r\n this._visual = {};\r\n this._layout = {};\r\n this._itemVisuals = [];\r\n this._itemLayouts = [];\r\n this._graphicEls = [];\r\n this._rawExtent = {};\r\n this._extent = {};\r\n this._approximateExtent = {};\r\n this._calculationInfo = {};\r\n this.hasItemOption = true;\r\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\r\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\r\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\r\n this.getRawIndex = getRawIndexWithoutIndices;\r\n dimensions = dimensions || ['x', 'y'];\r\n var dimensionInfos = {};\r\n var dimensionNames = [];\r\n var invertedIndicesMap = {};\r\n for (var i = 0; i < dimensions.length; i++) {\r\n var dimInfoInput = dimensions[i];\r\n var dimensionInfo = isString(dimInfoInput)\r\n ? new DataDimensionInfo({ name: dimInfoInput })\r\n : !(dimInfoInput instanceof DataDimensionInfo)\r\n ? new DataDimensionInfo(dimInfoInput)\r\n : dimInfoInput;\r\n var dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n dimensionInfo.index = i;\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n this._nameOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n this._idOrdinalMeta = dimensionInfo.ordinalMeta;\r\n }\r\n }\r\n this.dimensions = dimensionNames;\r\n this._dimensionInfos = dimensionInfos;\r\n this.hostModel = hostModel;\r\n this._dimensionsSummary = summarizeDimensions(this);\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n this.userOutput = this._dimensionsSummary.userOutput;\r\n }\r\n List.prototype.getDimension = function (dim) {\r\n if (typeof dim === 'number'\r\n || (!isNaN(dim) && !this._dimensionInfos.hasOwnProperty(dim))) {\r\n dim = this.dimensions[dim];\r\n }\r\n return dim;\r\n };\r\n List.prototype.getDimensionInfo = function (dim) {\r\n return this._dimensionInfos[this.getDimension(dim)];\r\n };\r\n List.prototype.getDimensionsOnCoord = function () {\r\n return this._dimensionsSummary.dataDimsOnCoord.slice();\r\n };\r\n List.prototype.mapDimension = function (coordDim, idx) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\r\n }\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx] : null;\r\n };\r\n List.prototype.mapDimensionsAll = function (coordDim) {\r\n var dimensionsSummary = this._dimensionsSummary;\r\n var dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n };\r\n List.prototype.initData = function (data, nameList, dimValueGetter) {\r\n var notProvider = isSourceInstance(data) || isArrayLike(data);\r\n var provider = notProvider\r\n ? new DefaultDataProvider(data, this.dimensions.length)\r\n : data;\r\n if (__DEV__) {\r\n assert(notProvider || (isFunction(provider.getItem)\r\n && isFunction(provider.count)), 'Inavlid data provider.');\r\n }\r\n this._rawData = provider;\r\n var sourceFormat = provider.getSource().sourceFormat;\r\n this._storage = {};\r\n this._indices = null;\r\n this._dontMakeIdFromName =\r\n this._idDimIdx != null\r\n || sourceFormat === SOURCE_FORMAT_TYPED_ARRAY\r\n || !!provider.fillStorage;\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n if (!dimValueGetter) {\r\n this.hasItemOption = false;\r\n }\r\n this.defaultDimValueGetter = defaultDimValueGetters[sourceFormat];\r\n this._dimValueGetter = dimValueGetter = dimValueGetter\r\n || this.defaultDimValueGetter;\r\n this._dimValueGetterArrayRows = defaultDimValueGetters.arrayRows;\r\n this._rawExtent = {};\r\n this._initDataFromProvider(0, provider.count());\r\n if (provider.pure) {\r\n this.hasItemOption = false;\r\n }\r\n };\r\n List.prototype.getProvider = function () {\r\n return this._rawData;\r\n };\r\n List.prototype.appendData = function (data) {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n var rawData = this._rawData;\r\n var start = this.count();\r\n rawData.appendData(data);\r\n var end = rawData.count();\r\n if (!rawData.persistent) {\r\n end += start;\r\n }\r\n this._initDataFromProvider(start, end, true);\r\n };\r\n List.prototype.appendValues = function (values, names) {\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var rawExtent = this._rawExtent;\r\n var start = this.count();\r\n var end = start + Math.max(values.length, names ? names.length : 0);\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, this._dimensionInfos[dim], end, true);\r\n }\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var emptyDataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n var sourceIdx = idx - start;\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var val = this._dimValueGetterArrayRows(values[sourceIdx] || emptyDataItem, dim, sourceIdx, dimIdx);\r\n storageArr[dimIdx][idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (names) {\r\n this._nameList[idx] = names[sourceIdx];\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype._initDataFromProvider = function (start, end, append) {\r\n if (start >= end) {\r\n return;\r\n }\r\n var rawData = this._rawData;\r\n var storage = this._storage;\r\n var dimensions = this.dimensions;\r\n var dimLen = dimensions.length;\r\n var dimensionInfoMap = this._dimensionInfos;\r\n var nameList = this._nameList;\r\n var idList = this._idList;\r\n var rawExtent = this._rawExtent;\r\n var sourceFormat = rawData.getSource().sourceFormat;\r\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n for (var i = 0; i < dimLen; i++) {\r\n var dim = dimensions[i];\r\n if (!rawExtent[dim]) {\r\n rawExtent[dim] = getInitialExtent();\r\n }\r\n prepareStorage(storage, dimensionInfoMap[dim], end, append);\r\n }\r\n var storageArr = this._storageArr = map$1(dimensions, function (dim) {\r\n return storage[dim];\r\n });\r\n var rawExtentArr = map$1(dimensions, function (dim) {\r\n return rawExtent[dim];\r\n });\r\n if (rawData.fillStorage) {\r\n rawData.fillStorage(start, end, storageArr, rawExtentArr);\r\n }\r\n else {\r\n var dataItem = [];\r\n for (var idx = start; idx < end; idx++) {\r\n dataItem = rawData.getItem(idx, dataItem);\r\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n var dim = dimensions[dimIdx];\r\n var dimStorage = storageArr[dimIdx];\r\n var val = this._dimValueGetter(dataItem, dim, idx, dimIdx);\r\n dimStorage[idx] = val;\r\n var dimRawExtent = rawExtentArr[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n if (isFormatOriginal && !rawData.pure && dataItem) {\r\n var itemName = dataItem.name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n var itemId = dataItem.id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n if (!this._dontMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n if (!rawData.persistent && rawData.clean) {\r\n rawData.clean();\r\n }\r\n this._rawCount = this._count = end;\r\n this._extent = {};\r\n prepareInvertedIndex(this);\r\n };\r\n List.prototype.count = function () {\r\n return this._count;\r\n };\r\n List.prototype.getIndices = function () {\r\n var newIndices;\r\n var indices = this._indices;\r\n if (indices) {\r\n var Ctor = indices.constructor;\r\n var thisCount = this._count;\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new Ctor(indices.buffer, 0, thisCount);\r\n }\r\n }\r\n else {\r\n var Ctor = getIndicesCtor(this);\r\n newIndices = new Ctor(this.count());\r\n for (var i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n return newIndices;\r\n };\r\n List.prototype.getByDimIdx = function (dimIdx, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storageArr[dimIdx];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.get = function (dim, idx) {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n };\r\n List.prototype.getByRawIndex = function (dim, rawIdx) {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n var dimStore = this._storage[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n };\r\n List.prototype.getValues = function (dimensions, idx) {\r\n var values = [];\r\n if (!isArray(dimensions)) {\r\n idx = dimensions;\r\n dimensions = this.dimensions;\r\n }\r\n for (var i = 0, len = dimensions.length; i < len; i++) {\r\n values.push(this.get(dimensions[i], idx));\r\n }\r\n return values;\r\n };\r\n List.prototype.hasValue = function (idx) {\r\n var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord;\r\n for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) {\r\n if (isNaN(this.get(dataDimsOnCoord[i], idx))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n List.prototype.getDataExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n var dimData = this._storage[dim];\r\n var initialExtent = getInitialExtent();\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n var currEnd = this.count();\r\n var useRaw = !this._indices;\r\n var dimExtent;\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice();\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice();\r\n }\r\n dimExtent = initialExtent;\r\n var min = dimExtent[0];\r\n var max = dimExtent[1];\r\n for (var i = 0; i < currEnd; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n var value = dimData[rawIdx];\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n dimExtent = [min, max];\r\n this._extent[dim] = dimExtent;\r\n return dimExtent;\r\n };\r\n List.prototype.getApproximateExtent = function (dim) {\r\n dim = this.getDimension(dim);\r\n return this._approximateExtent[dim] || this.getDataExtent(dim);\r\n };\r\n List.prototype.setApproximateExtent = function (extent, dim) {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice();\r\n };\r\n List.prototype.getCalculationInfo = function (key) {\r\n return this._calculationInfo[key];\r\n };\r\n List.prototype.setCalculationInfo = function (key, value) {\r\n isObject$3(key)\r\n ? extend(this._calculationInfo, key)\r\n : (this._calculationInfo[key] = value);\r\n };\r\n List.prototype.getSum = function (dim) {\r\n var dimData = this._storage[dim];\r\n var sum = 0;\r\n if (dimData) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var value = this.get(dim, i);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n };\r\n List.prototype.getMedian = function (dim) {\r\n var dimDataArray = [];\r\n this.each(dim, function (val) {\r\n if (!isNaN(val)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var len = this.count();\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n };\r\n List.prototype.rawIndexOf = function (dim, value) {\r\n var invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n var rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n };\r\n List.prototype.indexOfName = function (name) {\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indexOfRawIndex = function (rawIndex) {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n var indices = this._indices;\r\n var rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n var left = 0;\r\n var right = this._count - 1;\r\n while (left <= right) {\r\n var mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n };\r\n List.prototype.indicesOfNearest = function (dim, value, maxDistance) {\r\n var storage = this._storage;\r\n var dimData = storage[dim];\r\n var nearestIndices = [];\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n var minDist = Infinity;\r\n var minDiff = -1;\r\n var nearestIndicesLen = 0;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var dataIndex = this.getRawIndex(i);\r\n var diff = value - dimData[dataIndex];\r\n var dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n return nearestIndices;\r\n };\r\n List.prototype.getRawDataItem = function (idx) {\r\n if (!this._rawData.persistent) {\r\n var val = [];\r\n for (var i = 0; i < this.dimensions.length; i++) {\r\n var dim = this.dimensions[i];\r\n val.push(this.get(dim, idx));\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._rawData.getItem(this.getRawIndex(idx));\r\n }\r\n };\r\n List.prototype.getName = function (idx) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, this._nameOrdinalMeta, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n };\r\n List.prototype.getId = function (idx) {\r\n return getId(this, this.getRawIndex(idx));\r\n };\r\n List.prototype.each = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var dimSize = dimNames.length;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var storageArr = this._storageArr;\r\n for (var i = 0, len = this.count(); i < len; i++) {\r\n var rawIdx = this.getRawIndex(i);\r\n switch (dimSize) {\r\n case 0:\r\n cb.call(fCtx, i);\r\n break;\r\n case 1:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n cb.call(fCtx, storageArr[dimIndices[0]][rawIdx], storageArr[dimIndices[1]][rawIdx], i);\r\n break;\r\n default:\r\n var k = 0;\r\n var value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n cb.apply(fCtx, value);\r\n }\r\n }\r\n };\r\n List.prototype.filterSelf = function (dims, cb, ctx, ctxCompat) {\r\n var _this = this;\r\n if (!this._count) {\r\n return;\r\n }\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var count = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(count);\r\n var value = [];\r\n var dimSize = dimNames.length;\r\n var offset = 0;\r\n var dimIndices = map$1(dimNames, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var dim0 = dimIndices[0];\r\n var storageArr = this._storageArr;\r\n for (var i = 0; i < count; i++) {\r\n var keep = void 0;\r\n var rawIdx = this.getRawIndex(i);\r\n if (dimSize === 0) {\r\n keep = cb.call(fCtx, i);\r\n }\r\n else if (dimSize === 1) {\r\n var val = storageArr[dim0][rawIdx];\r\n keep = cb.call(fCtx, val, i);\r\n }\r\n else {\r\n var k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = storageArr[dimIndices[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = cb.apply(fCtx, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n if (offset < count) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.selectRange = function (range) {\r\n var _this = this;\r\n var len = this._count;\r\n if (!len) {\r\n return;\r\n }\r\n var dimensions = [];\r\n for (var dim in range) {\r\n if (range.hasOwnProperty(dim)) {\r\n dimensions.push(dim);\r\n }\r\n }\r\n if (__DEV__) {\r\n validateDimensions(this, dimensions);\r\n }\r\n var dimSize = dimensions.length;\r\n if (!dimSize) {\r\n return;\r\n }\r\n var originalCount = this.count();\r\n var Ctor = getIndicesCtor(this);\r\n var newIndices = new Ctor(originalCount);\r\n var offset = 0;\r\n var dim0 = dimensions[0];\r\n var dimIndices = map$1(dimensions, function (dimName) {\r\n return _this._dimensionInfos[dimName].index;\r\n });\r\n var min = range[dim0][0];\r\n var max = range[dim0][1];\r\n var storageArr = this._storageArr;\r\n var quickFinished = false;\r\n if (!this._indices) {\r\n var idx = 0;\r\n if (dimSize === 1) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n var dimStorage = storageArr[dimIndices[0]];\r\n var dimStorage2 = storageArr[dimIndices[1]];\r\n var min2 = range[dimensions[1]][0];\r\n var max2 = range[dimensions[1]][1];\r\n for (var i = 0; i < len; i++) {\r\n var val = dimStorage[i];\r\n var val2 = dimStorage2[i];\r\n if (((val >= min && val <= max) || isNaN(val))\r\n && ((val2 >= min2 && val2 <= max2) || isNaN(val2))) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (var i = 0; i < originalCount; i++) {\r\n var rawIndex = this.getRawIndex(i);\r\n var val = storageArr[dimIndices[0]][rawIndex];\r\n if ((val >= min && val <= max) || isNaN(val)) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < originalCount; i++) {\r\n var keep = true;\r\n var rawIndex = this.getRawIndex(i);\r\n for (var k = 0; k < dimSize; k++) {\r\n var dimk = dimensions[k];\r\n var val = storageArr[dimIndices[k]][rawIndex];\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = this.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n if (offset < originalCount) {\r\n this._indices = newIndices;\r\n }\r\n this._count = offset;\r\n this._extent = {};\r\n this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return this;\r\n };\r\n List.prototype.mapArray = function (dims, cb, ctx, ctxCompat) {\r\n if (typeof dims === 'function') {\r\n ctxCompat = ctx;\r\n ctx = cb;\r\n cb = dims;\r\n dims = [];\r\n }\r\n ctx = (ctx || ctxCompat || this);\r\n var result = [];\r\n this.each(dims, function () {\r\n result.push(cb && cb.apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n };\r\n List.prototype.map = function (dims, cb, ctx, ctxCompat) {\r\n var fCtx = (ctx || ctxCompat || this);\r\n var dimNames = map$1(normalizeDimensions(dims), this.getDimension, this);\r\n if (__DEV__) {\r\n validateDimensions(this, dimNames);\r\n }\r\n var list = cloneListForMapAndSample(this, dimNames);\r\n var storage = list._storage;\r\n list._indices = this._indices;\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n var tmpRetValue = [];\r\n var dimSize = dimNames.length;\r\n var dataCount = this.count();\r\n var values = [];\r\n var rawExtent = list._rawExtent;\r\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {\r\n values[dimIndex] = this.get(dimNames[dimIndex], dataIndex);\r\n }\r\n values[dimSize] = dataIndex;\r\n var retValue = cb && cb.apply(fCtx, values);\r\n if (retValue != null) {\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n var rawIndex = this.getRawIndex(dataIndex);\r\n for (var i = 0; i < retValue.length; i++) {\r\n var dim = dimNames[i];\r\n var val = retValue[i];\r\n var rawExtentOnDim = rawExtent[dim];\r\n var dimStore = storage[dim];\r\n if (dimStore) {\r\n dimStore[rawIndex] = val;\r\n }\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val;\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n List.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\r\n var list = cloneListForMapAndSample(this, [dimension]);\r\n var targetStorage = list._storage;\r\n var frameValues = [];\r\n var frameSize = mathFloor(1 / rate);\r\n var dimStore = targetStorage[dimension];\r\n var len = this.count();\r\n var rawExtentOnDim = list._rawExtent[dimension];\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var offset = 0;\r\n for (var i = 0; i < len; i += frameSize) {\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (var k = 0; k < frameSize; k++) {\r\n var dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n var value = sampleValue(frameValues);\r\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\r\n dimStore[sampleFrameIdx] = value;\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n list._count = offset;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.lttbDownSample = function (valueDimension, rate) {\r\n var list = cloneListForMapAndSample(this, []);\r\n var targetStorage = list._storage;\r\n var dimStore = targetStorage[valueDimension];\r\n var len = this.count();\r\n var newIndices = new (getIndicesCtor(this))(len);\r\n var sampledIndex = 0;\r\n var frameSize = mathFloor(1 / rate);\r\n var currentRawIndex = this.getRawIndex(0);\r\n var maxArea;\r\n var area;\r\n var nextRawIndex;\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (var i = 1; i < len - 1; i += frameSize) {\r\n var nextFrameStart = Math.min(i + frameSize, len - 1);\r\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n var avgY = 0;\r\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n var frameStart = i;\r\n var frameEnd = Math.min(i + frameSize, len);\r\n var pointAX = i - 1;\r\n var pointAY = dimStore[currentRawIndex];\r\n maxArea = -1;\r\n nextRawIndex = frameStart;\r\n for (var idx = frameStart; idx < frameEnd; idx++) {\r\n var rawIndex = this.getRawIndex(idx);\r\n var y = dimStore[rawIndex];\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY));\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex;\r\n }\r\n }\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n currentRawIndex = nextRawIndex;\r\n }\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n list._count = sampledIndex;\r\n list._indices = newIndices;\r\n list.getRawIndex = getRawIndexWithIndices;\r\n return list;\r\n };\r\n List.prototype.getItemModel = function (idx) {\r\n var hostModel = this.hostModel;\r\n var dataItem = this.getRawDataItem(idx);\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n };\r\n List.prototype.diff = function (otherList) {\r\n var thisList = this;\r\n return new DataDiffer(otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) {\r\n return getId(otherList, idx);\r\n }, function (idx) {\r\n return getId(thisList, idx);\r\n });\r\n };\r\n List.prototype.getVisual = function (key) {\r\n var visual = this._visual;\r\n return visual && visual[key];\r\n };\r\n List.prototype.setVisual = function (kvObj, val) {\r\n this._visual = this._visual || {};\r\n if (isObject$3(kvObj)) {\r\n extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj] = val;\r\n }\r\n };\r\n List.prototype.getItemVisual = function (idx, key) {\r\n var itemVisual = this._itemVisuals[idx];\r\n var val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n };\r\n List.prototype.hasItemVisual = function () {\r\n return this._itemVisuals.length > 0;\r\n };\r\n List.prototype.ensureUniqueItemVisual = function (idx, key) {\r\n var itemVisuals = this._itemVisuals;\r\n var itemVisual = itemVisuals[idx];\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {};\r\n }\r\n var val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n if (isArray(val)) {\r\n val = val.slice();\r\n }\r\n else if (isObject$3(val)) {\r\n val = extend({}, val);\r\n }\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n };\r\n List.prototype.setItemVisual = function (idx, key, value) {\r\n var itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n if (isObject$3(key)) {\r\n extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key] = value;\r\n }\r\n };\r\n List.prototype.clearAllVisual = function () {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n };\r\n List.prototype.setLayout = function (key, val) {\r\n if (isObject$3(key)) {\r\n for (var name_1 in key) {\r\n if (key.hasOwnProperty(name_1)) {\r\n this.setLayout(name_1, key[name_1]);\r\n }\r\n }\r\n return;\r\n }\r\n this._layout[key] = val;\r\n };\r\n List.prototype.getLayout = function (key) {\r\n return this._layout[key];\r\n };\r\n List.prototype.getItemLayout = function (idx) {\r\n return this._itemLayouts[idx];\r\n };\r\n List.prototype.setItemLayout = function (idx, layout, merge) {\r\n this._itemLayouts[idx] = merge\r\n ? extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n };\r\n List.prototype.clearItemLayouts = function () {\r\n this._itemLayouts.length = 0;\r\n };\r\n List.prototype.setItemGraphicEl = function (idx, el) {\r\n var hostModel = this.hostModel;\r\n if (el) {\r\n var ecData = getECData(el);\r\n ecData.dataIndex = idx;\r\n ecData.dataType = this.dataType;\r\n ecData.seriesIndex = hostModel && hostModel.seriesIndex;\r\n if (el.type === 'group') {\r\n el.traverse(setItemDataAndSeriesIndex, el);\r\n }\r\n }\r\n this._graphicEls[idx] = el;\r\n };\r\n List.prototype.getItemGraphicEl = function (idx) {\r\n return this._graphicEls[idx];\r\n };\r\n List.prototype.eachItemGraphicEl = function (cb, context) {\r\n each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n };\r\n List.prototype.cloneShallow = function (list) {\r\n if (!list) {\r\n var dimensionInfoList = map$1(this.dimensions, this.getDimensionInfo, this);\r\n list = new List(dimensionInfoList, this.hostModel);\r\n }\r\n list._storage = this._storage;\r\n list._storageArr = this._storageArr;\r\n transferProperties(list, this);\r\n if (this._indices) {\r\n var Ctor = this._indices.constructor;\r\n if (Ctor === Array) {\r\n var thisCount = this._indices.length;\r\n list._indices = new Ctor(thisCount);\r\n for (var i = 0; i < thisCount; i++) {\r\n list._indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n list._indices = new Ctor(this._indices);\r\n }\r\n }\r\n else {\r\n list._indices = null;\r\n }\r\n list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;\r\n return list;\r\n };\r\n List.prototype.wrapMethod = function (methodName, injectFunction) {\r\n var originalMethod = this[methodName];\r\n if (typeof originalMethod !== 'function') {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n var res = originalMethod.apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(slice(arguments)));\r\n };\r\n };\r\n List.internalField = (function () {\r\n defaultDimValueGetters = {\r\n arrayRows: getDimValueSimply,\r\n objectRows: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimName], this._dimensionInfos[dimName]);\r\n },\r\n keyedColumns: getDimValueSimply,\r\n original: function (dataItem, dimName, dataIndex, dimIndex) {\r\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n if (!this._rawData.pure && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n return parseDataValue((value instanceof Array)\r\n ? value[dimIndex]\r\n : value, this._dimensionInfos[dimName]);\r\n },\r\n typedArray: function (dataItem, dimName, dataIndex, dimIndex) {\r\n return dataItem[dimIndex];\r\n }\r\n };\r\n function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]);\r\n }\r\n prepareInvertedIndex = function (list) {\r\n var invertedIndicesMap = list._invertedIndicesMap;\r\n each(invertedIndicesMap, function (invertedIndices, dim) {\r\n var dimInfo = list._dimensionInfos[dim];\r\n var ordinalMeta = dimInfo.ordinalMeta;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\r\n for (var i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (var i = 0; i < list._count; i++) {\r\n invertedIndices[list.get(dim, i)] = i;\r\n }\r\n }\r\n });\r\n };\r\n getIdNameFromStore = function (list, dimIdx, ordinalMeta, rawIndex) {\r\n var val;\r\n var chunk = list._storageArr[dimIdx];\r\n if (chunk) {\r\n val = chunk[rawIndex];\r\n if (ordinalMeta && ordinalMeta.categories.length) {\r\n val = ordinalMeta.categories[val];\r\n }\r\n }\r\n return convertOptionIdName(val, null);\r\n };\r\n getIndicesCtor = function (list) {\r\n return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n };\r\n prepareStorage = function (storage, dimInfo, end, append) {\r\n var DataCtor = dataCtors[dimInfo.type];\r\n var dim = dimInfo.name;\r\n if (append) {\r\n var oldStore = storage[dim];\r\n var oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n var newStore = new DataCtor(end);\r\n for (var j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n storage[dim] = newStore;\r\n }\r\n }\r\n else {\r\n storage[dim] = new DataCtor(end);\r\n }\r\n };\r\n getRawIndexWithoutIndices = function (idx) {\r\n return idx;\r\n };\r\n getRawIndexWithIndices = function (idx) {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n };\r\n getId = function (list, rawIndex) {\r\n var id = list._idList[rawIndex];\r\n if (id == null && list._idDimIdx != null) {\r\n id = getIdNameFromStore(list, list._idDimIdx, list._idOrdinalMeta, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n normalizeDimensions = function (dimensions) {\r\n if (!isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n validateDimensions = function (list, dims) {\r\n for (var i = 0; i < dims.length; i++) {\r\n if (!list._dimensionInfos[dims[i]]) {\r\n console.error('Unkown dimension ' + dims[i]);\r\n }\r\n }\r\n };\r\n cloneListForMapAndSample = function (original, excludeDimensions) {\r\n var allDimensions = original.dimensions;\r\n var list = new List(map$1(allDimensions, original.getDimensionInfo, original), original.hostModel);\r\n transferProperties(list, original);\r\n var storage = list._storage = {};\r\n var originalStorage = original._storage;\r\n var storageArr = list._storageArr = [];\r\n for (var i = 0; i < allDimensions.length; i++) {\r\n var dim = allDimensions[i];\r\n if (originalStorage[dim]) {\r\n if (indexOf(excludeDimensions, dim) >= 0) {\r\n storage[dim] = cloneChunk(originalStorage[dim]);\r\n list._rawExtent[dim] = getInitialExtent();\r\n list._extent[dim] = null;\r\n }\r\n else {\r\n storage[dim] = originalStorage[dim];\r\n }\r\n storageArr.push(storage[dim]);\r\n }\r\n }\r\n return list;\r\n };\r\n function cloneChunk(originalChunk) {\r\n var Ctor = originalChunk.constructor;\r\n return Ctor === Array\r\n ? originalChunk.slice()\r\n : new Ctor(originalChunk);\r\n }\r\n getInitialExtent = function () {\r\n return [Infinity, -Infinity];\r\n };\r\n setItemDataAndSeriesIndex = function (child) {\r\n var childECData = getECData(child);\r\n var thisECData = getECData(this);\r\n childECData.seriesIndex = thisECData.seriesIndex;\r\n childECData.dataIndex = thisECData.dataIndex;\r\n childECData.dataType = thisECData.dataType;\r\n };\r\n transferProperties = function (target, source) {\r\n each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n target[propName] = source[propName];\r\n }\r\n });\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n each(CLONE_PROPERTIES, function (propName) {\r\n target[propName] = clone(source[propName]);\r\n });\r\n target._calculationInfo = extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (list, idx) {\r\n var nameList = list._nameList;\r\n var idList = list._idList;\r\n var nameDimIdx = list._nameDimIdx;\r\n var idDimIdx = list._idDimIdx;\r\n var name = nameList[idx];\r\n var id = idList[idx];\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(list, nameDimIdx, list._nameOrdinalMeta, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(list, idDimIdx, list._idOrdinalMeta, idx);\r\n }\r\n if (id == null && name != null) {\r\n var nameRepeatCount = list._nameRepeatCount;\r\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n return List;\r\n }());\n\n function completeDimensions(sysDims, source, opt) {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n opt = opt || {};\r\n sysDims = (sysDims || []).slice();\r\n var dimsDef = (opt.dimsDef || []).slice();\r\n var dataDimNameMap = createHashMap();\r\n var coordDimNameMap = createHashMap();\r\n var result = [];\r\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);\r\n for (var i = 0; i < dimCount; i++) {\r\n var dimDefItemRaw = dimsDef[i];\r\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw });\r\n var userDimName = dimDefItem.name;\r\n var resultItem = result[i] = new DataDimensionInfo();\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n resultItem.name = resultItem.displayName = userDimName;\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n }\r\n var encodeDef = opt.encodeDef;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n var encodeDefMap = createHashMap(encodeDef);\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n var dataDims = normalizeToArray(dataDimsRaw).slice();\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n var validDataDims = encodeDefMap.set(coordDim, []);\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n var resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(result[resultDimIdx], coordDim, idx);\r\n }\r\n });\r\n });\r\n var availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n var coordDim;\r\n var sysDimItemDimsDef;\r\n var sysDimItemOtherDims;\r\n var sysDimItem;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {};\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n var ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = clone(sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n var dataDims = encodeDefMap.get(coordDim);\r\n if (dataDims === false) {\r\n return;\r\n }\r\n dataDims = normalizeToArray(dataDims);\r\n if (!dataDims.length) {\r\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < result.length && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n var resultItem = result[resultDimIdx];\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n function applyDim(resultItem, coordDim, coordDimIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\r\n resultItem.otherDims[coordDim] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n var generateCoord = opt.generateCoord;\r\n var generateCoordCount = opt.generateCoordCount;\r\n var fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n var extra = generateCoord || 'value';\r\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || new DataDimensionInfo();\r\n var coordDim = resultItem.coordDim;\r\n if (coordDim == null) {\r\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\r\n resultItem.coordDimIndex = 0;\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap, false));\r\n if (resultItem.type == null\r\n && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null)))) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n return result;\r\n }\r\n function getDimCount(source, sysDims, dimsDef, optDimCount) {\r\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\r\n each(sysDims, function (sysDimItem) {\r\n var sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n }\r\n function genName(name, map, fromZero) {\r\n if (fromZero || map.get(name) != null) {\r\n var i = 0;\r\n while (map.get(name + i) != null) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n }\n\n function createDimensions(source, opt) {\r\n opt = opt || {};\r\n return completeDimensions(opt.coordDimensions || [], source, {\r\n dimsDef: opt.dimensionsDefine || source.dimensionsDefine,\r\n encodeDef: opt.encodeDefine || source.encodeDefine,\r\n dimCount: opt.dimensionsCount,\r\n encodeDefaulter: opt.encodeDefaulter,\r\n generateCoord: opt.generateCoord,\r\n generateCoordCount: opt.generateCoordCount\r\n });\r\n }\n\n var CoordSysInfo = (function () {\r\n function CoordSysInfo(coordSysName) {\r\n this.coordSysDims = [];\r\n this.axisMap = createHashMap();\r\n this.categoryAxisMap = createHashMap();\r\n this.coordSysName = coordSysName;\r\n }\r\n return CoordSysInfo;\r\n }());\r\n function getCoordSysInfoBySeries(seriesModel) {\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var result = new CoordSysInfo(coordSysName);\r\n var fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n }\r\n var fetchers = {\r\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\r\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\r\n }\r\n }\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n var ecModel = seriesModel.ecModel;\r\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\r\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\r\n var axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n function isCategory(axisModel) {\r\n return axisModel.get('type') === 'category';\r\n }\n\n function enableDataStack(seriesModel, dimensionInfoList, opt) {\r\n opt = opt || {};\r\n var byIndex = opt.byIndex;\r\n var stackedCoordDimension = opt.stackedCoordDimension;\r\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n var stackedByDimInfo;\r\n var stackedDimInfo;\r\n var stackResultDimension;\r\n var stackedOverDimension;\r\n each(dimensionInfoList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionInfoList[index] = dimensionInfo = {\r\n name: dimensionInfo\r\n };\r\n }\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n byIndex = true;\r\n }\r\n if (stackedDimInfo) {\r\n stackResultDimension = '__\\0ecstackresult';\r\n stackedOverDimension = '__\\0ecstackedover';\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\r\n var stackedDimType = stackedDimInfo.type;\r\n var stackedDimCoordIndex_1 = 0;\r\n each(dimensionInfoList, function (dimensionInfo) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\r\n stackedDimCoordIndex_1++;\r\n }\r\n });\r\n dimensionInfoList.push({\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim_1,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n stackedDimCoordIndex_1++;\r\n dimensionInfoList.push({\r\n name: stackedOverDimension,\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex_1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true\r\n });\r\n }\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n }\r\n function isDimensionStacked(data, stackedDim) {\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n }\r\n function getStackedDimension(data, targetDim) {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n }\n\n function createListFromArray(source, seriesModel, opt) {\r\n opt = opt || {};\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source);\r\n }\r\n var coordSysName = seriesModel.get('coordinateSystem');\r\n var registeredCoordSys = CoordinateSystemManager.get(coordSysName);\r\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n var coordSysDimDefs;\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) {\r\n var dimInfo = {\r\n name: dim\r\n };\r\n var axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n var axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n if (!coordSysDimDefs) {\r\n coordSysDimDefs = (registeredCoordSys && (registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice())) || ['x', 'y'];\r\n }\r\n var useEncodeDefaulter = opt.useEncodeDefaulter;\r\n var dimInfoList = createDimensions(source, {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefaulter: isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null\r\n });\r\n var firstCategoryDimIndex;\r\n var hasNameEncode;\r\n coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) {\r\n var coordDim = dimInfo.coordDim;\r\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\r\n var list = new List(dimInfoList, seriesModel);\r\n list.setCalculationInfo(stackCalculationInfo);\r\n var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source))\r\n ? function (itemOpt, dimName, dataIndex, dimIndex) {\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n list.hasItemOption = false;\r\n list.initData(source, null, dimValueGetter);\r\n return list;\r\n }\r\n function isNeedCompleteOrdinalData(source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n var sampleItem = firstDataNotNull(source.data || []);\r\n return sampleItem != null\r\n && !isArray(getDataItemValue(sampleItem));\r\n }\r\n }\r\n function firstDataNotNull(data) {\r\n var i = 0;\r\n while (i < data.length && data[i] == null) {\r\n i++;\r\n }\r\n return data[i];\r\n }\n\n var LineSeriesModel = (function (_super) {\r\n __extends(LineSeriesModel, _super);\r\n function LineSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = LineSeriesModel.type;\r\n _this.hasSymbolVisual = true;\r\n _this.legendSymbol = 'line';\r\n return _this;\r\n }\r\n LineSeriesModel.prototype.getInitialData = function (option) {\r\n if (__DEV__) {\r\n var coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createListFromArray(this.getSource(), this, {\r\n useEncodeDefaulter: true\r\n });\r\n };\r\n LineSeriesModel.type = 'series.line';\r\n LineSeriesModel.dependencies = ['grid', 'polar'];\r\n LineSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n clip: true,\r\n label: {\r\n position: 'top'\r\n },\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n scale: true,\r\n lineStyle: {\r\n width: 'bolder'\r\n }\r\n },\r\n step: false,\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n showSymbol: true,\r\n showAllSymbol: 'auto',\r\n connectNulls: false,\r\n sampling: 'none',\r\n animationEasing: 'linear',\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity\r\n };\r\n return LineSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(LineSeriesModel);\n\n function getDefaultLabel(data, dataIndex) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n var len = labelDims.length;\r\n if (len === 1) {\r\n return retrieveRawValue(data, dataIndex, labelDims[0]);\r\n }\r\n else if (len) {\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n }\r\n function getDefaultInterpolatedLabel(data, interpolatedValue) {\r\n var labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n var vals = [];\r\n for (var i = 0; i < labelDims.length; i++) {\r\n var dimInfo = data.getDimensionInfo(labelDims[i]);\r\n if (dimInfo) {\r\n vals.push(interpolatedValue[dimInfo.index]);\r\n }\r\n }\r\n return vals.join(' ');\r\n }\n\n var Symbol = (function (_super) {\r\n __extends(Symbol, _super);\r\n function Symbol(data, idx, seriesScope, opts) {\r\n var _this = _super.call(this) || this;\r\n _this.updateData(data, idx, seriesScope, opts);\r\n return _this;\r\n }\r\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\r\n this.removeAll();\r\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n symbolPath.drift = driftSymbol;\r\n this._symbolType = symbolType;\r\n this.add(symbolPath);\r\n };\r\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n };\r\n Symbol.prototype.getSymbolPath = function () {\r\n return this.childAt(0);\r\n };\r\n Symbol.prototype.highlight = function () {\r\n enterEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.downplay = function () {\r\n leaveEmphasis(this.childAt(0));\r\n };\r\n Symbol.prototype.setZ = function (zlevel, z) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n };\r\n Symbol.prototype.setDraggable = function (draggable) {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;\r\n };\r\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\r\n this.silent = false;\r\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n var seriesModel = data.hostModel;\r\n var symbolSize = Symbol.getSymbolSize(data, idx);\r\n var isInit = symbolType !== this._symbolType;\r\n var disableAnimation = opts && opts.disableAnimation;\r\n if (isInit) {\r\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n var symbolPath = this.childAt(0);\r\n symbolPath.silent = false;\r\n var target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : updateProps(symbolPath, target, seriesModel, idx);\r\n }\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n if (isInit) {\r\n var symbolPath = this.childAt(0);\r\n if (!disableAnimation) {\r\n var target = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n if (disableAnimation) {\r\n this.childAt(0).stopAnimation('remove');\r\n }\r\n this._seriesModel = seriesModel;\r\n };\r\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = data.hostModel;\r\n var emphasisItemStyle;\r\n var blurItemStyle;\r\n var selectItemStyle;\r\n var focus;\r\n var blurScope;\r\n var symbolOffset;\r\n var labelStatesModels;\r\n var hoverScale;\r\n var cursorStyle;\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n symbolOffset = seriesScope.symbolOffset;\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n }\r\n if (!seriesScope || data.hasItemOption) {\r\n var itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n symbolOffset = itemModel.getShallow('symbolOffset');\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n if (symbolOffset) {\r\n symbolPath.x = parsePercent$2(symbolOffset[0], symbolSize[0]);\r\n symbolPath.y = parsePercent$2(symbolOffset[1], symbolSize[1]);\r\n }\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n var symbolStyle = data.getItemVisual(idx, 'style');\r\n var visualColor = symbolStyle.fill;\r\n if (symbolPath instanceof ZRImage) {\r\n var pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n var liftZ = data.getItemVisual(idx, 'liftZ');\r\n var z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n var useNameLabel = opts && opts.useNameLabel;\r\n setLabelStyle(symbolPath, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor,\r\n defaultOpacity: symbolStyle.opacity\r\n });\r\n function getLabelDefaultText(idx) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n var emphasisState = symbolPath.ensureState('emphasis');\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n if (hoverScale) {\r\n var scaleRatio = Math.max(1.1, 3 / this._sizeY);\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n }\r\n this.setSymbolScale(1);\r\n enableHoverEmphasis(this, focus, blurScope);\r\n };\r\n Symbol.prototype.setSymbolScale = function (scale) {\r\n this.scaleX = this.scaleY = scale;\r\n };\r\n Symbol.prototype.fadeOut = function (cb, opt) {\r\n var symbolPath = this.childAt(0);\r\n var seriesModel = this._seriesModel;\r\n var dataIndex = getECData(this).dataIndex;\r\n var animationOpt = opt && opt.animation;\r\n this.silent = symbolPath.silent = true;\r\n if (opt && opt.fadeLabel) {\r\n var textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex: dataIndex,\r\n removeOpt: animationOpt,\r\n cb: function () {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n removeElement(symbolPath, {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: dataIndex, cb: cb, removeOpt: animationOpt });\r\n };\r\n Symbol.getSymbolSize = function (data, idx) {\r\n var symbolSize = data.getItemVisual(idx, 'symbolSize');\r\n return symbolSize instanceof Array\r\n ? symbolSize.slice()\r\n : [+symbolSize, +symbolSize];\r\n };\r\n return Symbol;\r\n }(Group));\r\n function driftSymbol(dx, dy) {\r\n this.parent.drift(dx, dy);\r\n }\n\n function symbolNeedsDraw(data, point, idx, opt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n }\r\n function normalizeUpdateOpt(opt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = { isIgnore: opt };\r\n }\r\n return opt || {};\r\n }\r\n function makeSeriesScope(data) {\r\n var seriesModel = data.hostModel;\r\n var emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n symbolRotate: seriesModel.get('symbolRotate'),\r\n symbolOffset: seriesModel.get('symbolOffset'),\r\n hoverScale: emphasisModel.get('scale'),\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n }\r\n var SymbolDraw = (function () {\r\n function SymbolDraw(SymbolCtor) {\r\n this.group = new Group();\r\n this._SymbolCtor = SymbolCtor || Symbol;\r\n }\r\n SymbolDraw.prototype.updateData = function (data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n var group = this.group;\r\n var seriesModel = data.hostModel;\r\n var oldData = this._data;\r\n var SymbolCtor = this._SymbolCtor;\r\n var disableAnimation = opt.disableAnimation;\r\n var seriesScope = makeSeriesScope(data);\r\n var symbolUpdateOpt = { disableAnimation: disableAnimation };\r\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\r\n return data.getItemLayout(idx);\r\n };\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n var point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\r\n var point = getSymbolPoint(newIdx);\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n if (!symbolEl) {\r\n symbolEl = new SymbolCtor(data, newIdx);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n var target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : updateProps(symbolEl, target, seriesModel);\r\n }\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n var el = oldData.getItemGraphicEl(oldIdx);\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n })\r\n .execute();\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n SymbolDraw.prototype.isPersistent = function () {\r\n return true;\r\n };\r\n SymbolDraw.prototype.updateLayout = function () {\r\n var _this = this;\r\n var data = this._data;\r\n if (data) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n var point = _this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\r\n opt = normalizeUpdateOpt(opt);\r\n function updateIncrementalAndHover(el) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\r\n var point = data.getItemLayout(idx);\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n }\r\n }\r\n };\r\n SymbolDraw.prototype.remove = function (enableAnimation) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n });\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n return SymbolDraw;\r\n }());\n\n function prepareDataCoordInfo(coordSys, data, valueOrigin) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var valueStart = getValueStart(valueAxis, valueOrigin);\r\n var baseAxisDim = baseAxis.dim;\r\n var valueAxisDim = valueAxis.dim;\r\n var valueDim = data.mapDimension(valueAxisDim);\r\n var baseDim = data.mapDimension(baseAxisDim);\r\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n var dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n var stacked = false;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n }\r\n function getValueStart(valueAxis, valueOrigin) {\r\n var valueStart = 0;\r\n var extent = valueAxis.scale.getExtent();\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n else {\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n }\r\n return valueStart;\r\n }\r\n function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\r\n var value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n var baseDataOffset = dataCoordInfo.baseDataOffset;\r\n var stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n return coordSys.dataToPoint(stackedData);\r\n }\n\n var supportFloat32Array = typeof Float32Array !== 'undefined';\r\n var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n function createFloat32Array(arg) {\r\n if (isArray(arg)) {\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n return new Float32ArrayCtor(arg);\r\n }\n\n function diffData(oldData, newData) {\r\n var diffResult = [];\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({ cmd: '+', idx: idx });\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({ cmd: '=', idx: oldIdx, idx1: newIdx });\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({ cmd: '-', idx: idx });\r\n })\r\n .execute();\r\n return diffResult;\r\n }\r\n function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\r\n var diff = diffData(oldData, newData);\r\n var currPoints = [];\r\n var nextPoints = [];\r\n var currStackedPoints = [];\r\n var nextStackedPoints = [];\r\n var status = [];\r\n var sortedIndices = [];\r\n var rawIndices = [];\r\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n var oldPoints = oldData.getLayout('points') || [];\r\n var newPoints = newData.getLayout('points') || [];\r\n for (var i = 0; i < diff.length; i++) {\r\n var diffItem = diff[i];\r\n var pointAdded = true;\r\n var oldIdx2 = void 0;\r\n var newIdx2 = void 0;\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n var currentX = oldPoints[oldIdx2];\r\n var currentY = oldPoints[oldIdx2 + 1];\r\n var nextX = newPoints[newIdx2];\r\n var nextY = newPoints[newIdx2 + 1];\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n var newIdx = diffItem.idx;\r\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n var oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n var oldIdx = diffItem.idx;\r\n var rawIndex = oldData.getRawIndex(oldIdx);\r\n var oldDataDimsForPoint = oldDataNewCoordInfo.dataDimsForPoint;\r\n oldIdx2 = oldIdx * 2;\r\n if (rawIndex !== oldIdx) {\r\n var newPt = newCoordSys.dataToPoint([\r\n oldData.get(oldDataDimsForPoint[0], oldIdx),\r\n oldData.get(oldDataDimsForPoint[1], oldIdx)\r\n ]);\r\n var newStackedOnPt = getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, oldIdx);\r\n currPoints.push(oldPoints[oldIdx2], oldPoints[oldIdx2 + 1]);\r\n nextPoints.push(newPt[0], newPt[1]);\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPt[0], newStackedOnPt[1]);\r\n rawIndices.push(rawIndex);\r\n }\r\n else {\r\n pointAdded = false;\r\n }\r\n }\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n var len = currPoints.length;\r\n var sortedCurrPoints = createFloat32Array(len);\r\n var sortedNextPoints = createFloat32Array(len);\r\n var sortedCurrStackedPoints = createFloat32Array(len);\r\n var sortedNextStackedPoints = createFloat32Array(len);\r\n var sortedStatus = [];\r\n for (var i = 0; i < sortedIndices.length; i++) {\r\n var idx = sortedIndices[i];\r\n var i2 = i * 2;\r\n var idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n sortedStatus[i] = status[idx];\r\n }\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n status: sortedStatus\r\n };\r\n }\n\n var mathMin$4 = Math.min;\r\n var mathMax$4 = Math.max;\r\n function isPointNull(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\r\n var prevX;\r\n var prevY;\r\n var cpx0;\r\n var cpy0;\r\n var cpx1;\r\n var cpy1;\r\n var idx = start;\r\n var k = 0;\r\n for (; k < segLen; k++) {\r\n var x = points[idx * 2];\r\n var y = points[idx * 2 + 1];\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n var dx = x - prevX;\r\n var dy = y - prevY;\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n if (smooth > 0) {\r\n var nextIdx = idx + dir;\r\n var nextX = points[nextIdx * 2];\r\n var nextY = points[nextIdx * 2 + 1];\r\n var tmpK = k + 1;\r\n if (connectNulls) {\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n var ratioNextSeg = 0.5;\r\n var vx = 0;\r\n var vy = 0;\r\n var nextCpx0 = void 0;\r\n var nextCpy0 = void 0;\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n var dx0 = x - prevX;\r\n var dx1 = nextX - x;\r\n var dy0 = y - prevY;\r\n var dy1 = nextY - y;\r\n var lenPrevSeg = void 0;\r\n var lenNextSeg = void 0;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n cpx1 = x - lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + lenPrevSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n cpx1 = x;\r\n cpy1 = y - lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + lenPrevSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n nextCpx0 = mathMin$4(nextCpx0, mathMax$4(nextX, x));\r\n nextCpy0 = mathMin$4(nextCpy0, mathMax$4(nextY, y));\r\n nextCpx0 = mathMax$4(nextCpx0, mathMin$4(nextX, x));\r\n nextCpy0 = mathMax$4(nextCpy0, mathMin$4(nextY, y));\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n cpx1 = mathMin$4(cpx1, mathMax$4(prevX, x));\r\n cpy1 = mathMin$4(cpy1, mathMax$4(prevY, y));\r\n cpx1 = mathMax$4(cpx1, mathMin$4(prevX, x));\r\n cpy1 = mathMax$4(cpy1, mathMin$4(prevY, y));\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n return k;\r\n }\r\n var ECPolylineShape = (function () {\r\n function ECPolylineShape() {\r\n this.smooth = 0;\r\n this.smoothConstraint = true;\r\n }\r\n return ECPolylineShape;\r\n }());\r\n var ECPolyline = (function (_super) {\r\n __extends(ECPolyline, _super);\r\n function ECPolyline(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polyline';\r\n return _this;\r\n }\r\n ECPolyline.prototype.getDefaultStyle = function () {\r\n return {\r\n stroke: '#000',\r\n fill: null\r\n };\r\n };\r\n ECPolyline.prototype.getDefaultShape = function () {\r\n return new ECPolylineShape();\r\n };\r\n ECPolyline.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var i = 0;\r\n var len = points.length / 2;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\r\n }\r\n };\r\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n var path = this.path;\r\n var data = path.data;\r\n var CMD = PathProxy.CMD;\r\n var x0;\r\n var y0;\r\n var isDimX = dim === 'x';\r\n var roots = [];\r\n for (var i = 0; i < data.length;) {\r\n var cmd = data[i++];\r\n var x = void 0;\r\n var y = void 0;\r\n var x2 = void 0;\r\n var y2 = void 0;\r\n var x3 = void 0;\r\n var y3 = void 0;\r\n var t = void 0;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n var val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\r\n var t_1 = roots[i_1];\r\n if (t_1 <= 1 && t_1 >= 0) {\r\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1)\r\n : cubicAt(x0, x, x2, x3, t_1);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n };\r\n return ECPolyline;\r\n }(Path));\r\n var ECPolygonShape = (function (_super) {\r\n __extends(ECPolygonShape, _super);\r\n function ECPolygonShape() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ECPolygonShape;\r\n }(ECPolylineShape));\r\n var ECPolygon = (function (_super) {\r\n __extends(ECPolygon, _super);\r\n function ECPolygon(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'ec-polygon';\r\n return _this;\r\n }\r\n ECPolygon.prototype.getDefaultShape = function () {\r\n return new ECPolygonShape();\r\n };\r\n ECPolygon.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var stackedOnPoints = shape.stackedOnPoints;\r\n var i = 0;\r\n var len = points.length / 2;\r\n var smoothMonotone = shape.smoothMonotone;\r\n if (shape.connectNulls) {\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\r\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\r\n i += k + 1;\r\n ctx.closePath();\r\n }\r\n };\r\n return ECPolygon;\r\n }(Path));\n\n function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\r\n var rect = cartesian.getArea();\r\n var x = rect.x;\r\n var y = rect.y;\r\n var width = rect.width;\r\n var height = rect.height;\r\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n x = Math.floor(x);\r\n width = Math.round(width);\r\n var clipPath = new Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n if (hasAnimation) {\r\n var baseAxis = cartesian.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isAxisInversed = baseAxis.inverse;\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n var duringCb = typeof during === 'function'\r\n ? function (percent) {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n return clipPath;\r\n }\r\n function createPolarClipPath(polar, hasAnimation, seriesModel) {\r\n var sectorArea = polar.getArea();\r\n var r0 = round$1(sectorArea.r0, 1);\r\n var r = round$1(sectorArea.r, 1);\r\n var clipPath = new Sector({\r\n shape: {\r\n cx: round$1(polar.cx, 1),\r\n cy: round$1(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n if (hasAnimation) {\r\n var isRadial = polar.getBaseAxis().dim === 'angle';\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n }\r\n function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n }\n\n function isCoordinateSystemType(coordSys, type) {\r\n return coordSys.type === type;\r\n }\n\n function isPointsSame(points1, points2) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (var i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n }\r\n function bboxFromPoints(points) {\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -Infinity;\r\n var maxY = -Infinity;\r\n for (var i = 0; i < points.length;) {\r\n var x = points[i++];\r\n var y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n }\r\n function getBoundingDiff(points1, points2) {\r\n var _a = bboxFromPoints(points1), min1 = _a[0], max1 = _a[1];\r\n var _b = bboxFromPoints(points2), min2 = _b[0], max2 = _b[1];\r\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\r\n }\r\n function getSmooth(smooth) {\r\n return typeof smooth === 'number' ? smooth : (smooth ? 0.5 : 0);\r\n }\r\n function getStackedOnPoints(coordSys, data, dataCoordInfo) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n var len = data.count();\r\n var points = createFloat32Array(len * 2);\r\n for (var idx = 0; idx < len; idx++) {\r\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n return points;\r\n }\r\n function turnPointsIntoStep(points, coordSys, stepTurnAt) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n var stepPoints = [];\r\n var i = 0;\r\n var stepPt = [];\r\n var pt = [];\r\n var nextPt = [];\r\n for (; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n var stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n }\r\n function getVisualGradient(data, coordSys) {\r\n var visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n return;\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n var coordDim;\r\n var visualMeta;\r\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\r\n var dimIndex = visualMetaList[i].dimension;\r\n var dimName = data.dimensions[dimIndex];\r\n var dimInfo = data.getDimensionInfo(dimName);\r\n coordDim = (dimInfo && dimInfo.coordDim);\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n var axis = coordSys.getAxis(coordDim);\r\n var colorStops = map(visualMeta.stops, function (stop) {\r\n return {\r\n offset: 0,\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n };\r\n });\r\n var stopLen = colorStops.length;\r\n var outerColors = visualMeta.outerColors.slice();\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n var tinyExtent = 10;\r\n var minCoord = colorStops[0].coord - tinyExtent;\r\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\r\n var coordSpan = maxCoord - minCoord;\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n each(colorStops, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStops.push({\r\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStops.unshift({\r\n offset: stopLen ? colorStops[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2'] = maxCoord;\r\n return gradient;\r\n }\r\n function getIsIgnoreFunc(seriesModel, data, coordSys) {\r\n var showAllSymbol = seriesModel.get('showAllSymbol');\r\n var isAuto = showAllSymbol === 'auto';\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n if (isAuto\r\n && canShowAllSymbolForCategory(categoryAxis, data)) {\r\n return;\r\n }\r\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n var labelMap = {};\r\n each(categoryAxis.getViewLabels(), function (labelItem) {\r\n labelMap[labelItem.tickValue] = 1;\r\n });\r\n return function (dataIndex) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n }\r\n function canShowAllSymbolForCategory(categoryAxis, data) {\r\n var axisExtent = categoryAxis.getExtent();\r\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\r\n isNaN(availSize) && (availSize = 0);\r\n var dataLen = data.count();\r\n var step = Math.max(1, Math.round(dataLen / 5));\r\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (Symbol.getSymbolSize(data, dataIndex)[categoryAxis.isHorizontal() ? 1 : 0]\r\n * 1.5 > availSize) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function isPointNull$1(x, y) {\r\n return isNaN(x) || isNaN(y);\r\n }\r\n function getLastIndexNotNull(points) {\r\n var len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n return len - 1;\r\n }\r\n function getPointAtIndex(points, idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n function getIndexRange(points, xOrY, dim) {\r\n var len = points.length / 2;\r\n var dimIdx = dim === 'x' ? 0 : 1;\r\n var a;\r\n var b;\r\n var prevIndex = 0;\r\n var nextIndex = -1;\r\n for (var i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n prevIndex = i;\r\n a = b;\r\n }\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n }\r\n function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n var endLabelModel_1 = seriesModel.getModel('endLabel');\r\n var showEndLabel = endLabelModel_1.get('show');\r\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\r\n var data_1 = seriesModel.getData();\r\n var labelAnimationRecord_1 = { lastFrameIndex: 0 };\r\n var during = showEndLabel\r\n ? function (percent, clipRect) {\r\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\r\n }\r\n : null;\r\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\r\n var endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord_1.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord_1.originalX,\r\n y: labelAnimationRecord_1.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n if (!seriesModel.get('clip', true)) {\r\n var rectShape = clipPath.shape;\r\n var expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n }\r\n function getEndLabelStateSpecified(endLabelModel, coordSys) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var align = isHorizontal\r\n ? isBaseInversed ? 'right' : 'left'\r\n : 'center';\r\n var verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign,\r\n padding: endLabelModel.get('distance') || 0\r\n }\r\n };\r\n }\r\n var LineView = (function (_super) {\r\n __extends(LineView, _super);\r\n function LineView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n LineView.prototype.init = function () {\r\n var lineGroup = new Group();\r\n var symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n };\r\n LineView.prototype.render = function (seriesModel, ecModel, api) {\r\n var _this = this;\r\n var coordSys = seriesModel.coordinateSystem;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var lineStyleModel = seriesModel.getModel('lineStyle');\r\n var areaStyleModel = seriesModel.getModel('areaStyle');\r\n var points = data.getLayout('points') || [];\r\n var isCoordSysPolar = coordSys.type === 'polar';\r\n var prevCoordSys = this._coordSys;\r\n var symbolDraw = this._symbolDraw;\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var lineGroup = this._lineGroup;\r\n var hasAnimation = seriesModel.get('animation');\r\n var isAreaChart = !areaStyleModel.isEmpty();\r\n var valueOrigin = areaStyleModel.get('origin');\r\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n var showSymbol = seriesModel.get('showSymbol');\r\n var isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys);\r\n var oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n group.add(lineGroup);\r\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n var clipShapeForSymbol;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n if (clipShapeForSymbol.width != null) {\r\n clipShapeForSymbol.x -= 0.1;\r\n clipShapeForSymbol.y -= 0.1;\r\n clipShapeForSymbol.width += 0.2;\r\n clipShapeForSymbol.height += 0.2;\r\n }\r\n else if (clipShapeForSymbol.r0) {\r\n clipShapeForSymbol.r0 -= 0.5;\r\n clipShapeForSymbol.r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n polygon = this._newPolygon(points, stackedOnPoints);\r\n }\r\n else if (polygon && !isAreaChart) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys);\r\n }\r\n lineGroup.setClipPath(createLineClipPath(this, coordSys, false, seriesModel));\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint: function (idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\r\n }\r\n else {\r\n if (step) {\r\n points = turnPointsIntoStep(points, coordSys, step);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\r\n }\r\n }\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n var visualColor = getVisualGradient(data, coordSys)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n var focus = seriesModel.get(['emphasis', 'focus']);\r\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n polyline.useStyle(defaults(lineStyleModel.getLineStyle(), {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel'\r\n }));\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n var emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = polyline.style.lineWidth + 1;\r\n }\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polyline, focus, blurScope);\r\n var smooth = getSmooth(seriesModel.get('smooth'));\r\n var smoothMonotone = seriesModel.get('smoothMonotone');\r\n var connectNulls = seriesModel.get('connectNulls');\r\n polyline.setShape({\r\n smooth: smooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n if (polygon) {\r\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n var stackedOnSmooth = 0;\r\n polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel',\r\n decal: data.getVisual('style').decal\r\n }));\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n polygon.setShape({\r\n smooth: smooth,\r\n stackedOnSmooth: stackedOnSmooth,\r\n smoothMonotone: smoothMonotone,\r\n connectNulls: connectNulls\r\n });\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n enableHoverEmphasis(polygon, focus, blurScope);\r\n }\r\n var changePolyState = function (toState) {\r\n _this._changePolyState(toState);\r\n };\r\n data.eachItemGraphicEl(function (el) {\r\n el && (el.onHoverStateChange = changePolyState);\r\n });\r\n this._polyline.onHoverStateChange = changePolyState;\r\n this._data = data;\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n };\r\n LineView.prototype.dispose = function () { };\r\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('emphasis');\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n var points = data.getLayout('points');\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (!symbol) {\r\n var x = points[dataIndex * 2];\r\n var y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n return;\r\n }\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n symbol = new Symbol(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\r\n symbol.__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n symbol.stopSymbolAnimation(true);\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var dataIndex = queryDataIndex(data, payload);\r\n this._changePolyState('normal');\r\n if (dataIndex != null && dataIndex >= 0) {\r\n var symbol = data.getItemGraphicEl(dataIndex);\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\r\n }\r\n };\r\n LineView.prototype._changePolyState = function (toState) {\r\n var polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n };\r\n LineView.prototype._newPolyline = function (points) {\r\n var polyline = this._polyline;\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n polyline = new ECPolyline({\r\n shape: {\r\n points: points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n this._lineGroup.add(polyline);\r\n this._polyline = polyline;\r\n return polyline;\r\n };\r\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\r\n var polygon = this._polygon;\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n this._lineGroup.add(polygon);\r\n this._polygon = polygon;\r\n return polygon;\r\n };\r\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\r\n var isHorizontalOrRadial;\r\n var isCoordSysPolar;\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n var seriesModel = data.hostModel;\r\n var seriesDuration = seriesModel.get('animationDuration');\r\n if (typeof seriesDuration === 'function') {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n var seriesDalay = seriesModel.get('animationDelay') || 0;\r\n var seriesDalayValue = typeof seriesDalay === 'function'\r\n ? seriesDalay(null)\r\n : seriesDalay;\r\n data.eachItemGraphicEl(function (symbol, idx) {\r\n var el = symbol;\r\n if (el) {\r\n var point = [symbol.x, symbol.y];\r\n var start = void 0;\r\n var end = void 0;\r\n var current = void 0;\r\n if (isCoordSysPolar) {\r\n var polarClip = clipShape;\r\n var coord = coordSys.pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n var gridClip = clipShape;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n var ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n var delay = typeof seriesDalay === 'function' ? seriesDalay(idx)\r\n : (seriesDuration * ratio) + seriesDalayValue;\r\n var symbolPath = el.getSymbolPath();\r\n var text = symbolPath.getTextContent();\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n delay: delay\r\n });\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n symbolPath.disableLabelAnimation = true;\r\n }\r\n });\r\n };\r\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys) {\r\n var endLabelModel = seriesModel.getModel('endLabel');\r\n if (endLabelModel.get('show')) {\r\n var data_2 = seriesModel.getData();\r\n var polyline = this._polyline;\r\n var endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new ZRText({\r\n z2: 200\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n polyline.disableLabelAnimation = true;\r\n }\r\n var dataIndex = getLastIndexNotNull(data_2.getLayout('points'));\r\n if (dataIndex >= 0) {\r\n setLabelStyle(endLabel, getLabelStatesModels(seriesModel, 'endLabel'), {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: function (dataIndex, opt, overrideValue) {\r\n return overrideValue ? getDefaultInterpolatedLabel(data_2, overrideValue)\r\n : getDefaultLabel(data_2, dataIndex);\r\n },\r\n enableTextSetter: true\r\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n };\r\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\r\n var endLabel = this._endLabel;\r\n var polyline = this._polyline;\r\n if (endLabel) {\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n var points = data.getLayout('points');\r\n var seriesModel = data.hostModel;\r\n var connectNulls = seriesModel.get('connectNulls');\r\n var precision = endLabelModel.get('precision');\r\n var baseAxis = coordSys.getBaseAxis();\r\n var isHorizontal = baseAxis.isHorizontal();\r\n var isBaseInversed = baseAxis.inverse;\r\n var clipShape = clipRect.shape;\r\n var xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n var dim = isHorizontal ? 'x' : 'y';\r\n var dataIndexRange = getIndexRange(points, xOrY, dim);\r\n var indices = dataIndexRange.range;\r\n var diff = indices[1] - indices[0];\r\n var value = void 0;\r\n if (diff >= 1) {\r\n if (diff > 1 && !connectNulls) {\r\n var pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\r\n }\r\n else {\r\n var pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({ x: pt[0], y: pt[1] });\r\n var startValue = seriesModel.getRawValue(indices[0]);\r\n var endValue = seriesModel.getRawValue(indices[1]);\r\n valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n var idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n var pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx));\r\n endLabel.attr({ x: pt[0], y: pt[1] });\r\n }\r\n if (valueAnimation) {\r\n labelInner(endLabel).setLabelText(value);\r\n }\r\n }\r\n };\r\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\r\n var polyline = this._polyline;\r\n var polygon = this._polygon;\r\n var seriesModel = data.hostModel;\r\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\r\n var current = diff.current;\r\n var stackedOnCurrent = diff.stackedOnCurrent;\r\n var next = diff.next;\r\n var stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n current = turnPointsIntoStep(diff.current, coordSys, step);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\r\n next = turnPointsIntoStep(diff.next, coordSys, step);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\r\n }\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)) {\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n polyline.shape.__points = diff.current;\r\n polyline.shape.points = current;\r\n var target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n if (diff.current !== current) {\r\n target.shape.__points = diff.next;\r\n }\r\n polyline.stopAnimation();\r\n updateProps(polyline, target, seriesModel);\r\n if (polygon) {\r\n polygon.setShape({\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n var updatedDataInfo = [];\r\n var diffStatus = diff.status;\r\n for (var i = 0; i < diffStatus.length; i++) {\r\n var cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n var points = polyline.shape.__points;\r\n for (var i = 0; i < updatedDataInfo.length; i++) {\r\n var el = updatedDataInfo[i].el;\r\n var offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n };\r\n LineView.prototype.remove = function (ecModel) {\r\n var group = this.group;\r\n var oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n };\r\n LineView.type = 'line';\r\n return LineView;\r\n }(ChartView));\r\n ChartView.registerClass(LineView);\n\n function pointsLayout(seriesType, forceStoreInTypedArray) {\r\n return {\r\n seriesType: seriesType,\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var coordSys = seriesModel.coordinateSystem;\r\n var pipelineContext = seriesModel.pipelineContext;\r\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n if (!coordSys) {\r\n return;\r\n }\r\n var dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n var dimLen = dims.length;\r\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n var dimInfo0 = data.getDimensionInfo(dims[0]);\r\n var dimInfo1 = data.getDimensionInfo(dims[1]);\r\n var dimIdx0 = dimInfo0 && dimInfo0.index;\r\n var dimIdx1 = dimInfo1 && dimInfo1.index;\r\n return dimLen && {\r\n progress: function (params, data) {\r\n var segCount = params.end - params.start;\r\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n var tmpIn = [];\r\n var tmpOut = [];\r\n for (var i = params.start, offset = 0; i < params.end; i++) {\r\n var point = void 0;\r\n if (dimLen === 1) {\r\n var x = data.getByDimIdx(dimIdx0, i);\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = data.getByDimIdx(dimIdx0, i);\r\n tmpIn[1] = data.getByDimIdx(dimIdx1, i);\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n }\n\n var samplers = {\r\n average: function (frame) {\r\n var sum = 0;\r\n var count = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n var sum = 0;\r\n for (var i = 0; i < frame.length; i++) {\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n var max = -Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n var min = Infinity;\r\n for (var i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n return isFinite(min) ? min : NaN;\r\n },\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n };\r\n var indexSampler = function (frame) {\r\n return Math.round(frame.length / 2);\r\n };\r\n function dataSample(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel, api) {\r\n var data = seriesModel.getData();\r\n var sampling = seriesModel.get('sampling');\r\n var coordSys = seriesModel.coordinateSystem;\r\n var count = data.count();\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n var baseAxis = coordSys.getBaseAxis();\r\n var valueAxis = coordSys.getOtherAxis(baseAxis);\r\n var extent = baseAxis.getExtent();\r\n var dpr = api.getDevicePixelRatio();\r\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n var rate = Math.round(count / size);\r\n if (rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n var sampler = void 0;\r\n if (typeof sampling === 'string') {\r\n sampler = samplers[sampling];\r\n }\r\n else if (typeof sampling === 'function') {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n }\n\n var defaultOption = {\r\n show: true,\r\n zlevel: 0,\r\n z: 0,\r\n inverse: false,\r\n name: '',\r\n nameLocation: 'end',\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n nameTextStyle: {},\r\n nameGap: 15,\r\n silent: false,\r\n triggerEvent: false,\r\n tooltip: {\r\n show: false\r\n },\r\n axisPointer: {},\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n inside: false,\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n inside: false,\r\n rotate: 0,\r\n showMinLabel: null,\r\n showMaxLabel: null,\r\n margin: 8,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n };\r\n var categoryAxis = merge({\r\n boundaryGap: true,\r\n deduplication: null,\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n }, defaultOption);\r\n var valueAxis = merge({\r\n boundaryGap: [0, 0],\r\n axisLine: {\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n show: 'auto'\r\n },\r\n splitNumber: 5,\r\n minorTick: {\r\n show: false,\r\n splitNumber: 5,\r\n length: 3,\r\n lineStyle: {}\r\n },\r\n minorSplitLine: {\r\n show: false,\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n }, defaultOption);\r\n var timeAxis = merge({\r\n scale: true,\r\n splitNumber: 6,\r\n axisLabel: {\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n }, valueAxis);\r\n var logAxis = defaults({\r\n scale: true,\r\n logBase: 10\r\n }, valueAxis);\r\n var axisDefault = {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n };\n\n var OrdinalMeta = (function () {\r\n function OrdinalMeta(opt) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n }\r\n OrdinalMeta.createByAxisModel = function (axisModel) {\r\n var option = axisModel.option;\r\n var data = option.data;\r\n var categories = data && map(data, getName);\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n OrdinalMeta.prototype.getOrdinal = function (category) {\r\n return this._getOrCreateMap().get(category);\r\n };\r\n OrdinalMeta.prototype.parseAndCollect = function (category) {\r\n var index;\r\n var needCollect = this._needCollect;\r\n if (typeof category !== 'string' && !needCollect) {\r\n return category;\r\n }\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n var map = this._getOrCreateMap();\r\n index = map.get(category);\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n return index;\r\n };\r\n OrdinalMeta.prototype._getOrCreateMap = function () {\r\n return this._map || (this._map = createHashMap(this.categories));\r\n };\r\n return OrdinalMeta;\r\n }());\r\n function getName(obj) {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n }\n\n var AXIS_TYPES = { value: 1, category: 1, time: 1, log: 1 };\n\n function axisModelCreator(axisName, BaseAxisModelClass, extraDefaultOption) {\r\n each(AXIS_TYPES, function (v, axisType) {\r\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\r\n var AxisModel = (function (_super) {\r\n __extends(AxisModel, _super);\r\n function AxisModel() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n _this.type = axisName + 'Axis.' + axisType;\r\n return _this;\r\n }\r\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\r\n var layoutMode = fetchLayoutMode(this);\r\n var inputPositionParams = layoutMode\r\n ? getLayoutParams(option) : {};\r\n var themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n option.type = getAxisType(option);\r\n if (layoutMode) {\r\n mergeLayoutParam(option, inputPositionParams, layoutMode);\r\n }\r\n };\r\n AxisModel.prototype.optionUpdated = function () {\r\n var thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n };\r\n AxisModel.prototype.getCategories = function (rawData) {\r\n var option = this.option;\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return option.data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n };\r\n AxisModel.prototype.getOrdinalMeta = function () {\r\n return this.__ordinalMeta;\r\n };\r\n AxisModel.type = axisName + 'Axis.' + axisType;\r\n AxisModel.defaultOption = defaultOption;\r\n return AxisModel;\r\n }(BaseAxisModelClass));\r\n ComponentModel.registerClass(AxisModel);\r\n });\r\n ComponentModel.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\r\n }\r\n function getAxisType(option) {\r\n return option.type || (option.data ? 'category' : 'value');\r\n }\n\n var AxisModelCommonMixin = (function () {\r\n function AxisModelCommonMixin() {\r\n }\r\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\r\n var option = this.option;\r\n return !option.scale;\r\n };\r\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\r\n return;\r\n };\r\n return AxisModelCommonMixin;\r\n }());\n\n var CartesianAxisModel = (function (_super) {\r\n __extends(CartesianAxisModel, _super);\r\n function CartesianAxisModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CartesianAxisModel.prototype.getCoordSysModel = function () {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n };\r\n CartesianAxisModel.type = 'cartesian2dAxis';\r\n return CartesianAxisModel;\r\n }(ComponentModel));\r\n mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n var extraOption = {\r\n offset: 0,\r\n categorySortInfo: []\r\n };\r\n axisModelCreator('x', CartesianAxisModel, extraOption);\r\n axisModelCreator('y', CartesianAxisModel, extraOption);\n\n var Scale = (function () {\r\n function Scale(setting) {\r\n this._setting = setting || {};\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n Scale.prototype.getSetting = function (name) {\r\n return this._setting[name];\r\n };\r\n Scale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n };\r\n Scale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n Scale.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Scale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n };\r\n Scale.prototype.isInExtentRange = function (value) {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n Scale.prototype.isBlank = function () {\r\n return this._isBlank;\r\n };\r\n Scale.prototype.setBlank = function (isBlank) {\r\n this._isBlank = isBlank;\r\n };\r\n return Scale;\r\n }());\r\n enableClassManagement(Scale, {\r\n registerWhenExtend: true\r\n });\n\n var roundNumber = round$1;\r\n function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\r\n var result = {};\r\n var span = extent[1] - extent[0];\r\n var interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n var niceTickExtent = result.niceTickExtent = [\r\n roundNumber(Math.ceil(extent[0] / interval) * interval, precision),\r\n roundNumber(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n fixExtent(niceTickExtent, extent);\r\n return result;\r\n }\r\n function getIntervalPrecision(interval) {\r\n return getPrecisionSafe(interval) + 2;\r\n }\r\n function clamp(niceTickExtent, idx, extent) {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n }\r\n function fixExtent(niceTickExtent, extent) {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n }\r\n function contain$1(val, extent) {\r\n return val >= extent[0] && val <= extent[1];\r\n }\r\n function normalize$1(val, extent) {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n }\r\n function scale$2(val, extent) {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n }\n\n var OrdinalScale = (function (_super) {\r\n __extends(OrdinalScale, _super);\r\n function OrdinalScale(setting) {\r\n var _this = _super.call(this, setting) || this;\r\n _this.type = 'ordinal';\r\n var ordinalMeta = _this.getSetting('ordinalMeta');\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, function (item) { return (isObject(item) ? item.value : item); })\r\n });\r\n }\r\n _this._ordinalMeta = ordinalMeta;\r\n _this._categorySortInfo = [];\r\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n return _this;\r\n }\r\n OrdinalScale.prototype.parse = function (val) {\r\n return typeof val === 'string'\r\n ? this._ordinalMeta.getOrdinal(val)\r\n : Math.round(val);\r\n };\r\n OrdinalScale.prototype.contain = function (rank) {\r\n rank = this.parse(rank);\r\n return contain$1(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n };\r\n OrdinalScale.prototype.normalize = function (val) {\r\n val = this.getCategoryIndex(this.parse(val));\r\n return normalize$1(val, this._extent);\r\n };\r\n OrdinalScale.prototype.scale = function (val) {\r\n val = this.getCategoryIndex(val);\r\n return Math.round(scale$2(val, this._extent));\r\n };\r\n OrdinalScale.prototype.getTicks = function () {\r\n var ticks = [];\r\n var extent = this._extent;\r\n var rank = extent[0];\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: this.getCategoryIndex(rank)\r\n });\r\n rank++;\r\n }\r\n return ticks;\r\n };\r\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\r\n return;\r\n };\r\n OrdinalScale.prototype.setCategorySortInfo = function (info) {\r\n this._categorySortInfo = info;\r\n };\r\n OrdinalScale.prototype.getCategorySortInfo = function () {\r\n return this._categorySortInfo;\r\n };\r\n OrdinalScale.prototype.getCategoryIndex = function (n) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[n].beforeSortIndex;\r\n }\r\n else {\r\n return n;\r\n }\r\n };\r\n OrdinalScale.prototype.getRawIndex = function (displayIndex) {\r\n if (this._categorySortInfo.length) {\r\n return this._categorySortInfo[displayIndex].ordinalNumber;\r\n }\r\n else {\r\n return displayIndex;\r\n }\r\n };\r\n OrdinalScale.prototype.getLabel = function (tick) {\r\n if (!this.isBlank()) {\r\n var rawIndex = this.getRawIndex(tick.value);\r\n var cateogry = this._ordinalMeta.categories[rawIndex];\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n };\r\n OrdinalScale.prototype.count = function () {\r\n return this._extent[1] - this._extent[0] + 1;\r\n };\r\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n OrdinalScale.prototype.isInExtentRange = function (value) {\r\n value = this.getCategoryIndex(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n };\r\n OrdinalScale.prototype.getOrdinalMeta = function () {\r\n return this._ordinalMeta;\r\n };\r\n OrdinalScale.prototype.niceTicks = function () { };\r\n OrdinalScale.prototype.niceExtent = function () { };\r\n OrdinalScale.type = 'ordinal';\r\n return OrdinalScale;\r\n }(Scale));\r\n Scale.registerClass(OrdinalScale);\n\n var roundNumber$1 = round$1;\r\n var IntervalScale = (function (_super) {\r\n __extends(IntervalScale, _super);\r\n function IntervalScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'interval';\r\n _this._interval = 0;\r\n _this._intervalPrecision = 2;\r\n return _this;\r\n }\r\n IntervalScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n IntervalScale.prototype.contain = function (val) {\r\n return contain$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.normalize = function (val) {\r\n return normalize$1(val, this._extent);\r\n };\r\n IntervalScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n IntervalScale.prototype.setExtent = function (start, end) {\r\n var thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = parseFloat(start);\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = parseFloat(end);\r\n }\r\n };\r\n IntervalScale.prototype.unionExtent = function (other) {\r\n var extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n this.setExtent(extent[0], extent[1]);\r\n };\r\n IntervalScale.prototype.getInterval = function () {\r\n return this._interval;\r\n };\r\n IntervalScale.prototype.setInterval = function (interval) {\r\n this._interval = interval;\r\n this._niceExtent = this._extent.slice();\r\n this._intervalPrecision = getIntervalPrecision(interval);\r\n };\r\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var niceTickExtent = this._niceExtent;\r\n var intervalPrecision = this._intervalPrecision;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n var safeLimit = 10000;\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n var tick = niceTickExtent[0];\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n tick = roundNumber$1(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber$1(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n return ticks;\r\n };\r\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\r\n var ticks = this.getTicks(true);\r\n var minorTicks = [];\r\n var extent = this.getExtent();\r\n for (var i = 1; i < ticks.length; i++) {\r\n var nextTick = ticks[i];\r\n var prevTick = ticks[i - 1];\r\n var count = 0;\r\n var minorTicksGroup = [];\r\n var interval = nextTick.value - prevTick.value;\r\n var minorInterval = interval / splitNumber;\r\n while (count < splitNumber - 1) {\r\n var minorTick = roundNumber$1(prevTick.value + (count + 1) * minorInterval);\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n return minorTicks;\r\n };\r\n IntervalScale.prototype.getLabel = function (data, opt) {\r\n if (data == null) {\r\n return '';\r\n }\r\n var precision = opt && opt.precision;\r\n if (precision == null) {\r\n precision = getPrecisionSafe(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n precision = this._intervalPrecision;\r\n }\r\n var dataNum = roundNumber$1(data.value, precision, true);\r\n return addCommas(dataNum);\r\n };\r\n IntervalScale.prototype.niceTicks = function (splitNumber, minInterval, maxInterval) {\r\n splitNumber = splitNumber || 5;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n };\r\n IntervalScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n var expandSize = extent[0];\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n var span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n var interval = this._interval;\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber$1(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber$1(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n };\r\n IntervalScale.type = 'interval';\r\n return IntervalScale;\r\n }(Scale));\r\n Scale.registerClass(IntervalScale);\n\n var STACK_PREFIX = '__ec_stack_';\r\n var LARGE_BAR_MIN_WIDTH = 0.5;\r\n var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\r\n function getSeriesStackId(seriesModel) {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n }\r\n function getAxisKey(axis) {\r\n return axis.dim + axis.index;\r\n }\r\n function prepareLayoutBarSeries(seriesType, ecModel) {\r\n var seriesModels = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n }\r\n function getValueAxesMinGaps(barSeries) {\r\n var axisValues = {};\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var dim = data.mapDimension(baseAxis.dim);\r\n for (var i = 0, cnt = data.count(); i < cnt; ++i) {\r\n var value = data.get(dim, i);\r\n if (!axisValues[key]) {\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n axisValues[key].push(value);\r\n }\r\n }\r\n });\r\n var axisMinGaps = {};\r\n for (var key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n var valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var min = null;\r\n for (var j = 1; j < valuesInAxis.length; ++j) {\r\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n }\r\n function makeColumnLayout(barSeries) {\r\n var axisMinGaps = getValueAxesMinGaps(barSeries);\r\n var seriesInfoList = [];\r\n each(barSeries, function (seriesModel) {\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var axisExtent = baseAxis.getExtent();\r\n var bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n var key = baseAxis.dim + '_' + baseAxis.index;\r\n var minGap = axisMinGaps[key];\r\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n var scale = baseAxis.scale.getExtent();\r\n var scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan;\r\n }\r\n else {\r\n var data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n var barWidth = parsePercent$2(seriesModel.get('barWidth'), bandWidth);\r\n var barMaxWidth = parsePercent$2(seriesModel.get('barMaxWidth'), bandWidth);\r\n var barMinWidth = parsePercent$2(seriesModel.get('barMinWidth') || 1, bandWidth);\r\n var barGap = seriesModel.get('barGap');\r\n var barCategoryGap = seriesModel.get('barCategoryGap');\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n }\r\n function doCalBarWidthAndOffset(seriesInfoList) {\r\n var columnsMap = {};\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n var axisKey = seriesInfo.axisKey;\r\n var bandWidth = seriesInfo.bandWidth;\r\n var columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n var stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n var stackId = seriesInfo.stackId;\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n var barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n var barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n var barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n var barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n var barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n var result = {};\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n result[coordSysName] = {};\r\n var stacks = columnsOnAxis.stacks;\r\n var bandWidth = columnsOnAxis.bandWidth;\r\n var categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n var columnCount = keys(stacks).length;\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n var categoryGap = parsePercent$2(categoryGapPercent, bandWidth);\r\n var barGapPercent = parsePercent$2(columnsOnAxis.gap, 1);\r\n var remainedWidth = columnsOnAxis.remainedWidth;\r\n var autoWidthCount = columnsOnAxis.autoWidthCount;\r\n var autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n each(stacks, function (column) {\r\n var maxWidth = column.maxWidth;\r\n var minWidth = column.minWidth;\r\n if (!column.width) {\r\n var finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n var finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n var widthSum = 0;\r\n var lastColumn;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n var offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n };\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n return result;\r\n }\r\n function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\r\n if (barWidthAndOffset && axis) {\r\n var result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n }\r\n function layout(seriesType, ecModel) {\r\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n var barWidthAndOffset = makeColumnLayout(seriesModels);\r\n var lastStackCoords = {};\r\n each(seriesModels, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var baseAxis = cartesian.getBaseAxis();\r\n var stackId = getSeriesStackId(seriesModel);\r\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n var columnOffset = columnLayoutInfo.offset;\r\n var columnWidth = columnLayoutInfo.width;\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var stacked = isDimensionStacked(data, valueDim);\r\n var isValueAxisH = valueAxis.isHorizontal();\r\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n for (var idx = 0, len = data.count(); idx < len; idx++) {\r\n var value = data.get(valueDim, idx);\r\n var baseValue = data.get(baseDim, idx);\r\n var sign = value >= 0 ? 'p' : 'n';\r\n var baseCoord = valueAxisStart;\r\n if (stacked) {\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart,\r\n n: valueAxisStart\r\n };\r\n }\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (isValueAxisH) {\r\n var coord = cartesian.dataToPoint([value, baseValue]);\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - valueAxisStart;\r\n height = columnWidth;\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(width)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += width);\r\n }\r\n }\r\n else {\r\n var coord = cartesian.dataToPoint([baseValue, value]);\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - valueAxisStart;\r\n if (Math.abs(height) < barMinHeight) {\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n if (!isNaN(height)) {\r\n stacked && (lastStackCoords[stackId][baseValue][sign] += height);\r\n }\r\n }\r\n data.setItemLayout(idx, {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n });\r\n }\r\n var largeLayout = {\r\n seriesType: 'bar',\r\n plan: createRenderPlanner(),\r\n reset: function (seriesModel) {\r\n if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n var cartesian = seriesModel.coordinateSystem;\r\n var coordLayout = cartesian.master.getRect();\r\n var baseAxis = cartesian.getBaseAxis();\r\n var valueAxis = cartesian.getOtherAxis(baseAxis);\r\n var valueDim = data.mapDimension(valueAxis.dim);\r\n var baseDim = data.mapDimension(baseAxis.dim);\r\n var valueAxisHorizontal = valueAxis.isHorizontal();\r\n var valueDimIdx = valueAxisHorizontal ? 0 : 1;\r\n var barWidth = retrieveColumnLayout(makeColumnLayout([seriesModel]), baseAxis, seriesModel).width;\r\n if (!(barWidth > LARGE_BAR_MIN_WIDTH)) {\r\n barWidth = LARGE_BAR_MIN_WIDTH;\r\n }\r\n return {\r\n progress: function (params, data) {\r\n var count = params.count;\r\n var largePoints = new LargeArr(count * 2);\r\n var largeBackgroundPoints = new LargeArr(count * 2);\r\n var largeDataIndices = new LargeArr(count);\r\n var dataIndex;\r\n var coord = [];\r\n var valuePair = [];\r\n var pointsOffset = 0;\r\n var idxOffset = 0;\r\n while ((dataIndex = params.next()) != null) {\r\n valuePair[valueDimIdx] = data.get(valueDim, dataIndex);\r\n valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);\r\n coord = cartesian.dataToPoint(valuePair, null, coord);\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];\r\n largePoints[pointsOffset++] = coord[0];\r\n largeBackgroundPoints[pointsOffset] =\r\n valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;\r\n largePoints[pointsOffset++] = coord[1];\r\n largeDataIndices[idxOffset++] = dataIndex;\r\n }\r\n data.setLayout({\r\n largePoints: largePoints,\r\n largeDataIndices: largeDataIndices,\r\n largeBackgroundPoints: largeBackgroundPoints,\r\n barWidth: barWidth,\r\n valueAxisStart: getValueAxisStart(baseAxis, valueAxis),\r\n backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,\r\n valueAxisHorizontal: valueAxisHorizontal\r\n });\r\n }\r\n };\r\n }\r\n };\r\n function isOnCartesian(seriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n }\r\n function isInLargeMode(seriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n }\r\n function getValueAxisStart(baseAxis, valueAxis, stacked) {\r\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\r\n }\n\n var bisect = function (a, x, lo, hi) {\r\n while (lo < hi) {\r\n var mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n };\r\n var TimeScale = (function (_super) {\r\n __extends(TimeScale, _super);\r\n function TimeScale(settings) {\r\n var _this = _super.call(this, settings) || this;\r\n _this.type = 'time';\r\n return _this;\r\n }\r\n TimeScale.prototype.getLabel = function (tick) {\r\n var useUTC = this.getSetting('useUTC');\r\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\r\n };\r\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\r\n var isUTC = this.getSetting('useUTC');\r\n var lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n };\r\n TimeScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var interval = this._interval;\r\n var extent = this._extent;\r\n var ticks = [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n var useUTC = this.getSetting('useUTC');\r\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\r\n ticks = ticks.concat(innerTicks);\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n return ticks;\r\n };\r\n TimeScale.prototype.niceExtent = function (opt) {\r\n var extent = this._extent;\r\n if (extent[0] === extent[1]) {\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n var d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n };\r\n TimeScale.prototype.niceTicks = function (approxTickNum, minInterval, maxInterval) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n var scaleIntervalsLen = scaleIntervals.length;\r\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\r\n this._interval = scaleIntervals[idx][1];\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n };\r\n TimeScale.prototype.parse = function (val) {\r\n return typeof val === 'number' ? val : +parseDate(val);\r\n };\r\n TimeScale.prototype.contain = function (val) {\r\n return contain$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.normalize = function (val) {\r\n return normalize$1(this.parse(val), this._extent);\r\n };\r\n TimeScale.prototype.scale = function (val) {\r\n return scale$2(val, this._extent);\r\n };\r\n TimeScale.type = 'time';\r\n return TimeScale;\r\n }(IntervalScale));\r\n var scaleIntervals = [\r\n ['second', ONE_SECOND],\r\n ['minute', ONE_MINUTE],\r\n ['hour', ONE_HOUR],\r\n ['quarter-day', ONE_HOUR * 6],\r\n ['half-day', ONE_HOUR * 12],\r\n ['day', ONE_DAY * 1.2],\r\n ['half-week', ONE_DAY * 3.5],\r\n ['week', ONE_DAY * 7],\r\n ['month', ONE_DAY * 31],\r\n ['quarter', ONE_DAY * 95],\r\n ['half-year', ONE_YEAR / 2],\r\n ['year', ONE_YEAR]\r\n ];\r\n function isUnitValueSame(unit, valueA, valueB, isUTC) {\r\n var dateA = parseDate(valueA);\r\n var dateB = parseDate(valueB);\r\n var isSame = function (unit) {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n var isSameYear = function () { return isSame('year'); };\r\n var isSameMonth = function () { return isSameYear() && isSame('month'); };\r\n var isSameDay = function () { return isSameMonth() && isSame('day'); };\r\n var isSameHour = function () { return isSameDay() && isSame('hour'); };\r\n var isSameMinute = function () { return isSameHour() && isSame('minute'); };\r\n var isSameSecond = function () { return isSameMinute() && isSame('second'); };\r\n var isSameMilliSecond = function () { return isSameSecond() && isSame('millisecond'); };\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n }\r\n function getDateInterval(approxInterval, daysInMonth) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n : approxInterval > 7.5 ? 7\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n }\r\n function getMonthInterval(approxInterval) {\r\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getHourInterval(approxInterval) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMinutesAndSecondsInterval(approxInterval, isMinutes) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n }\r\n function getMillisecondsInterval(approxInterval) {\r\n return nice(approxInterval, true);\r\n }\r\n function getFirstTimestampOfUnit(date, unitName, isUTC) {\r\n var outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n }\r\n function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\r\n var safeLimit = 10000;\r\n var unitNames = timeUnits;\r\n var iter = 0;\r\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\r\n var date = new Date(minTimestamp);\r\n var dateTime = minTimestamp;\r\n var d = date[getMethodName]();\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\r\n var newAddedTicks = [];\r\n var isFirstLevel = !lastLevelTicks.length;\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\r\n var startTick = lastLevelTicks[i].value;\r\n var endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n var interval = void 0;\r\n var getterName = void 0;\r\n var setterName = void 0;\r\n var isDate = false;\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week':\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval);\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n for (var i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n return newAddedTicks;\r\n }\r\n var levelsTicks = [];\r\n var currentLevelTicks = [];\r\n var tickCount = 0;\r\n var lastLevelTickCount = 0;\r\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) {\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n currentLevelTicks.sort(function (a, b) { return a.value - b.value; });\r\n var levelTicksRemoveDuplicated = [];\r\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\r\n var tickValue = currentLevelTicks[i_1].value;\r\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n }\r\n currentLevelTicks = [];\r\n }\r\n }\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\r\n return filter(levelTicks, function (tick) { return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; });\r\n }), function (levelTicks) { return levelTicks.length > 0; });\r\n var ticks = [];\r\n var maxLevel = levelsTicksInExtent.length - 1;\r\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\r\n var levelTicks = levelsTicksInExtent[i];\r\n for (var k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n ticks.sort(function (a, b) { return a.value - b.value; });\r\n var result = [];\r\n for (var i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n Scale.registerClass(TimeScale);\n\n var scaleProto = Scale.prototype;\r\n var intervalScaleProto = IntervalScale.prototype;\r\n var getPrecisionSafe$1 = getPrecisionSafe;\r\n var roundingErrorFix = round$1;\r\n var mathFloor$1 = Math.floor;\r\n var mathCeil = Math.ceil;\r\n var mathPow$1 = Math.pow;\r\n var mathLog = Math.log;\r\n var LogScale = (function (_super) {\r\n __extends(LogScale, _super);\r\n function LogScale() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'log';\r\n _this.base = 10;\r\n _this._originalScale = new IntervalScale();\r\n _this._interval = 0;\r\n return _this;\r\n }\r\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\r\n var originalScale = this._originalScale;\r\n var extent = this._extent;\r\n var originalExtent = originalScale.getExtent();\r\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n return map(ticks, function (tick) {\r\n var val = tick.value;\r\n var powVal = round$1(mathPow$1(this.base, val));\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n };\r\n LogScale.prototype.setExtent = function (start, end) {\r\n var base = this.base;\r\n start = mathLog(start) / mathLog(base);\r\n end = mathLog(end) / mathLog(base);\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n };\r\n LogScale.prototype.getExtent = function () {\r\n var base = this.base;\r\n var extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow$1(base, extent[0]);\r\n extent[1] = mathPow$1(base, extent[1]);\r\n var originalScale = this._originalScale;\r\n var originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n return extent;\r\n };\r\n LogScale.prototype.unionExtent = function (extent) {\r\n this._originalScale.unionExtent(extent);\r\n var base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n };\r\n LogScale.prototype.unionExtentFromData = function (data, dim) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n };\r\n LogScale.prototype.niceTicks = function (approxTickNum) {\r\n approxTickNum = approxTickNum || 10;\r\n var extent = this._extent;\r\n var span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n var interval = quantity(span);\r\n var err = approxTickNum / span * interval;\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n var niceExtent = [\r\n round$1(mathCeil(extent[0] / interval) * interval),\r\n round$1(mathFloor$1(extent[1] / interval) * interval)\r\n ];\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n };\r\n LogScale.prototype.niceExtent = function (opt) {\r\n intervalScaleProto.niceExtent.call(this, opt);\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n };\r\n LogScale.prototype.parse = function (val) {\r\n return val;\r\n };\r\n LogScale.prototype.contain = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return contain$1(val, this._extent);\r\n };\r\n LogScale.prototype.normalize = function (val) {\r\n val = mathLog(val) / mathLog(this.base);\r\n return normalize$1(val, this._extent);\r\n };\r\n LogScale.prototype.scale = function (val) {\r\n val = scale$2(val, this._extent);\r\n return mathPow$1(this.base, val);\r\n };\r\n LogScale.type = 'log';\r\n return LogScale;\r\n }(Scale));\r\n var proto = LogScale.prototype;\r\n proto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\n proto.getLabel = intervalScaleProto.getLabel;\r\n function fixRoundingError(val, originalVal) {\r\n return roundingErrorFix(val, getPrecisionSafe$1(originalVal));\r\n }\r\n Scale.registerClass(LogScale);\n\n var ScaleRawExtentInfo = (function () {\r\n function ScaleRawExtentInfo(scale, model, originalExtent) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, dataExtent) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\r\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\r\n if (isFunction(modelMinRaw)) {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n if (isOrdinal) {\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n var boundaryGap = model.get('boundaryGap');\r\n var boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n };\r\n ScaleRawExtentInfo.prototype.calculate = function () {\r\n var isOrdinal = this._isOrdinal;\r\n var dataMin = this._dataMin;\r\n var dataMax = this._dataMax;\r\n var axisDataLen = this._axisDataLen;\r\n var boundaryGapInner = this._boundaryGapInner;\r\n var span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n var minFixed = min != null;\r\n var maxFixed = max != null;\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n if (min > max) {\r\n min = NaN;\r\n max = NaN;\r\n }\r\n var isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n if (this._needCrossZero) {\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n }\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n }\r\n }\r\n var determinedMin = this._determinedMin;\r\n var determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n };\r\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\r\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(!this.frozen\r\n && (this[attr] == null));\r\n }\r\n this[attr] = val;\r\n };\r\n ScaleRawExtentInfo.prototype.freeze = function () {\r\n this.frozen = true;\r\n };\r\n return ScaleRawExtentInfo;\r\n }());\r\n var DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' };\r\n var DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' };\r\n function ensureScaleRawExtentInfo(scale, model, originalExtent) {\r\n var rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n scale.rawExtentInfo = rawExtentInfo;\r\n return rawExtentInfo;\r\n }\r\n function parseAxisModelMinMax(scale, minMax) {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n }\n\n function getScaleExtent(scale, model) {\r\n var scaleType = scale.type;\r\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n scale.setBlank(rawExtentResult.isBlank);\r\n var min = rawExtentResult.min;\r\n var max = rawExtentResult.max;\r\n var ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time')) {\r\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n var isBaseAxisAndHasBarSeries_1 = false;\r\n each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n if (isBaseAxisAndHasBarSeries_1) {\r\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n return {\r\n extent: [min, max],\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n }\r\n function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\r\n var axisExtent = model.axis.getExtent();\r\n var axisLength = axisExtent[1] - axisExtent[0];\r\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return { min: min, max: max };\r\n }\r\n var minOverflow = Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n var maxOverflow = -Infinity;\r\n each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n var totalOverFlow = minOverflow + maxOverflow;\r\n var oldRange = max - min;\r\n var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n return { min: min, max: max };\r\n }\r\n function niceScaleExtent(scale, model) {\r\n var extentInfo = getScaleExtent(scale, model);\r\n var extent = extentInfo.extent;\r\n var splitNumber = model.get('splitNumber');\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n var scaleType = scale.type;\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.niceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('minInterval') : null,\r\n maxInterval: (scaleType === 'interval' || scaleType === 'time')\r\n ? model.get('maxInterval') : null\r\n });\r\n var interval = model.get('interval');\r\n if (interval != null) {\r\n scale.setInterval && scale.setInterval(interval);\r\n }\r\n }\r\n function createScaleByModel(model, axisType) {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n }\r\n function ifAxisCrossZero(axis) {\r\n var dataExtent = axis.scale.getExtent();\r\n var min = dataExtent[0];\r\n var max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n }\r\n function makeLabelFormatter(axis) {\r\n var labelFormatter = axis.getLabelModel().get('formatter');\r\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick, idx) {\r\n return axis.scale.getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'string') {\r\n return (function (tpl) {\r\n return function (tick) {\r\n var label = axis.scale.getLabel(tick);\r\n var text = tpl.replace('{value}', label != null ? label : '');\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (typeof labelFormatter === 'function') {\r\n return (function (cb) {\r\n return function (tick, idx) {\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\r\n level: tick.level\r\n } : null);\r\n };\r\n })(labelFormatter);\r\n }\r\n else {\r\n return function (tick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n }\r\n function getAxisRawValue(axis, tick) {\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n }\r\n function estimateLabelUnionRect(axis) {\r\n var axisModel = axis.model;\r\n var scale = axis.scale;\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n var realNumberScaleTicks;\r\n var tickCount;\r\n var categoryScaleExtent = scale.getExtent();\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n var axisLabelModel = axis.getLabelModel();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rect;\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (var i = 0; i < tickCount; i += step) {\r\n var tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n var label = labelFormatter(tick, i);\r\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n return rect;\r\n }\r\n function rotateTextRect(textRect, rotate) {\r\n var rotateRadians = rotate * Math.PI / 180;\r\n var beforeWidth = textRect.width;\r\n var beforeHeight = textRect.height;\r\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n return rotatedRect;\r\n }\r\n function getOptionCategoryInterval(model) {\r\n var interval = model.get('interval');\r\n return interval == null ? 'auto' : interval;\r\n }\r\n function shouldShowAllLabels(axis) {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n }\r\n function getDataDimensionsOnAxis(data, axisDim) {\r\n var dataDimMap = {};\r\n each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return keys(dataDimMap);\r\n }\r\n function unionAxisExtentFromData(dataExtent, data, axisDim) {\r\n if (data) {\r\n each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n var seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n }\n\n var PI$6 = Math.PI;\r\n var AxisBuilder = (function () {\r\n function AxisBuilder(axisModel, opt) {\r\n this.group = new Group();\r\n this.opt = opt;\r\n this.axisModel = axisModel;\r\n defaults(opt, {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: function () { return true; }\r\n });\r\n var transformGroup = new Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n transformGroup.updateTransform();\r\n this._transformGroup = transformGroup;\r\n }\r\n AxisBuilder.prototype.hasBuilder = function (name) {\r\n return !!builders[name];\r\n };\r\n AxisBuilder.prototype.add = function (name) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n };\r\n AxisBuilder.prototype.getGroup = function () {\r\n return this.group;\r\n };\r\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\r\n var rotationDiff = remRadian(textRotation - axisRotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n if (isRadianAroundZero(rotationDiff)) {\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6)) {\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff > 0 && rotationDiff < PI$6) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n };\r\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\r\n var eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n };\r\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\r\n return eventData;\r\n };\r\n AxisBuilder.isLabelSilent = function (axisModel) {\r\n var tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n || !(axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show));\r\n };\r\n return AxisBuilder;\r\n }());\r\n var builders = {\r\n axisLine: function (opt, axisModel, group, transformGroup) {\r\n var shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n var extent = axisModel.axis.getExtent();\r\n var matrix = transformGroup.transform;\r\n var pt1 = [extent[0], 0];\r\n var pt2 = [extent[1], 0];\r\n if (matrix) {\r\n applyTransform(pt1, pt1, matrix);\r\n applyTransform(pt2, pt2, matrix);\r\n }\r\n var lineStyle = extend({\r\n lineCap: 'round'\r\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\r\n var line = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n line.anid = 'line';\r\n group.add(line);\r\n var arrows = axisModel.get(['axisLine', 'symbol']);\r\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n var arrowOffset = axisModel.get(['axisLine', 'symbolOffset']) || 0;\r\n if (typeof arrowOffset === 'number') {\r\n arrowOffset = [arrowOffset, arrowOffset];\r\n }\r\n if (arrows != null) {\r\n if (typeof arrows === 'string') {\r\n arrows = [arrows, arrows];\r\n }\r\n if (typeof arrowSize === 'string'\r\n || typeof arrowSize === 'number') {\r\n arrowSize = [arrowSize, arrowSize];\r\n }\r\n var symbolWidth_1 = arrowSize[0];\r\n var symbolHeight_1 = arrowSize[1];\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\r\n var r = point.r + point.offset;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt1[0] + r * Math.cos(opt.rotation),\r\n y: pt1[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\r\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n },\r\n axisName: function (opt, axisModel, group, transformGroup) {\r\n var name = retrieve(opt.axisName, axisModel.get('name'));\r\n if (!name) {\r\n return;\r\n }\r\n var nameLocation = axisModel.get('nameLocation');\r\n var nameDirection = opt.nameDirection;\r\n var textStyleModel = axisModel.getModel('nameTextStyle');\r\n var gap = axisModel.get('nameGap') || 0;\r\n var extent = axisModel.axis.getExtent();\r\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n var pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2,\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n var labelLayout;\r\n var nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI$6 / 180;\r\n }\r\n var axisNameAvailableWidth;\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection);\r\n }\r\n else {\r\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n var textFont = textStyleModel.getFont();\r\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n var ellipsis = truncateOpt.ellipsis;\r\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\r\n var tooltipOpt = axisModel.get('tooltip', true);\r\n var mainType = axisModel.mainType;\r\n var formatterParams = {\r\n componentType: mainType,\r\n name: name,\r\n $vars: ['name']\r\n };\r\n formatterParams[mainType + 'Index'] = axisModel.componentIndex;\r\n var textEl = new ZRText({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis: ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']),\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n });\r\n textEl.tooltip = (tooltipOpt && tooltipOpt.show)\r\n ? extend({\r\n content: name,\r\n formatter: function () {\r\n return name;\r\n },\r\n formatterParams: formatterParams\r\n }, tooltipOpt)\r\n : null;\r\n textEl.__fullText = name;\r\n textEl.anid = 'name';\r\n if (axisModel.get('triggerEvent')) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n }\r\n };\r\n function endTextLayout(rotation, textPosition, textRotate, extent) {\r\n var rotationDiff = remRadian(textRotate - rotation);\r\n var textAlign;\r\n var textVerticalAlign;\r\n var inverse = extent[0] > extent[1];\r\n var onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n if (isRadianAroundZero(rotationDiff - PI$6 / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI$6 * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI$6 * 1.5 && rotationDiff > PI$6 / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n }\r\n function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n var firstLabel = labelEls[0];\r\n var nextLabel = labelEls[1];\r\n var lastLabel = labelEls[labelEls.length - 1];\r\n var prevLabel = labelEls[labelEls.length - 2];\r\n var firstTick = tickEls[0];\r\n var nextTick = tickEls[1];\r\n var lastTick = tickEls[tickEls.length - 1];\r\n var prevTick = tickEls[tickEls.length - 2];\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n }\r\n function ignoreEl(el) {\r\n el && (el.ignore = true);\r\n }\r\n function isTwoLabelOverlapped(current, next) {\r\n var firstRect = current && current.getBoundingRect().clone();\r\n var nextRect = next && next.getBoundingRect().clone();\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n var mRotationBack = identity([]);\r\n rotate(mRotationBack, mRotationBack, -current.rotation);\r\n firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));\r\n return firstRect.intersect(nextRect);\r\n }\r\n function isNameLocationCenter(nameLocation) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n }\r\n function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\r\n var tickEls = [];\r\n var pt1 = [];\r\n var pt2 = [];\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = ticksCoords[i].coord;\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n if (tickTransform) {\r\n applyTransform(pt1, pt1, tickTransform);\r\n applyTransform(pt2, pt2, tickTransform);\r\n }\r\n var tickEl = new Line({\r\n subPixelOptimize: true,\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n }\r\n function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var tickModel = axisModel.getModel('axisTick');\r\n var shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var lineStyleModel = tickModel.getModel('lineStyle');\r\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n var ticksCoords = axis.getTicksCoords();\r\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }), 'ticks');\r\n for (var i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n return ticksEls;\r\n }\r\n function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\r\n var axis = axisModel.axis;\r\n var minorTickModel = axisModel.getModel('minorTick');\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var lineStyleModel = minorTickModel.getModel('lineStyle');\r\n var tickEndCoord = tickDirection * minorTickModel.get('length');\r\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }));\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\r\n for (var k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n }\r\n function buildAxisLabel(group, transformGroup, axisModel, opt) {\r\n var axis = axisModel.axis;\r\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n var labelModel = axisModel.getModel('axisLabel');\r\n var labelMargin = labelModel.get('margin');\r\n var labels = axis.getViewLabels();\r\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$6 / 180;\r\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n var labelEls = [];\r\n var silent = AxisBuilder.isLabelSilent(axisModel);\r\n var triggerEvent = axisModel.get('triggerEvent');\r\n each(labels, function (labelItem, index) {\r\n var tickValue = axis.scale.type === 'ordinal'\r\n ? axis.scale.getRawIndex(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n var formattedLabel = labelItem.formattedLabel;\r\n var rawLabel = labelItem.rawLabel;\r\n var itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n var rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\r\n }\r\n }\r\n var textColor = itemLabelModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n var tickCoord = axis.dataToCoord(tickValue);\r\n var textEl = new ZRText({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10,\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign,\r\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign,\r\n fill: typeof textColor === 'function'\r\n ? textColor(axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue, index)\r\n : textColor\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n if (triggerEvent) {\r\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n textEl.decomposeTransform();\r\n });\r\n return labelEls;\r\n }\n\n function fixValue(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n var axisPointerModel = axisInfo.axisPointerModel;\r\n var scale = axisInfo.axis.scale;\r\n var option = axisPointerModel.option;\r\n var status = axisPointerModel.get('status');\r\n var value = axisPointerModel.get('value');\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n var useHandle = isHandleTrigger(axisPointerModel);\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n var extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n if (value == null\r\n || value > extent[1]) {\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n option.value = value;\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n }\r\n function getAxisInfo(axisModel) {\r\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {})\r\n .coordSysAxesInfo;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n }\r\n function getAxisPointerModel(axisModel) {\r\n var axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n }\r\n function isHandleTrigger(axisPointerModel) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n }\r\n function makeKey(model) {\r\n return model.type + '||' + model.id;\r\n }\n\n var axisPointerClazz = {};\r\n var AxisView = (function (_super) {\r\n __extends(AxisView, _super);\r\n function AxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = AxisView.type;\r\n return _this;\r\n }\r\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.axisPointerClass && fixValue(axisModel);\r\n _super.prototype.render.apply(this, arguments);\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n };\r\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n };\r\n AxisView.prototype.remove = function (ecModel, api) {\r\n var axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n };\r\n AxisView.prototype.dispose = function (ecModel, api) {\r\n this._disposeAxisPointer(api);\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\r\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n var axisPointerModel = getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n };\r\n AxisView.prototype._disposeAxisPointer = function (api) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n };\r\n AxisView.registerAxisPointerClass = function (type, clazz) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n AxisView.getAxisPointerClass = function (type) {\r\n return type && axisPointerClazz[type];\r\n };\r\n AxisView.type = 'axis';\r\n return AxisView;\r\n }(ComponentView));\n\n function layout$1(gridModel, axisModel, opt) {\r\n opt = opt || {};\r\n var grid = gridModel.coordinateSystem;\r\n var axis = axisModel.axis;\r\n var layout = {};\r\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n var rawAxisPosition = axis.position;\r\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n var axisDim = axis.dim;\r\n var rect = grid.getRect();\r\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n var idx = { left: 0, right: 1, top: 0, bottom: 1, onZero: 2 };\r\n var axisOffset = axisModel.get('offset') || 0;\r\n var posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n if (otherAxisOnZeroOf) {\r\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n var dirMap = { top: -1, bottom: 1, left: -1, right: 1 };\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n layout.z2 = 1;\r\n return layout;\r\n }\r\n function isCartesian2DSeries(seriesModel) {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n }\r\n function findAxisModels(seriesModel) {\r\n var axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n };\r\n each(axisModelMap, function (v, key) {\r\n var axisType = key.replace(/Model$/, '');\r\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\r\n }\r\n }\r\n axisModelMap[key] = axisModel;\r\n });\r\n return axisModelMap;\r\n }\n\n var inner$4 = makeInner();\r\n function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitAreaModel = axisModel.getModel('splitArea');\r\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n var areaColors = areaStyleModel.get('color');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n var areaColorsLen = areaColors.length;\r\n var lastSplitAreaColors = inner$4(axisView).splitAreaColors;\r\n var newSplitAreaColors = createHashMap();\r\n var colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n var areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = isArray(areaColors) ? areaColors : [areaColors];\r\n for (var i = 1; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n var x = void 0;\r\n var y = void 0;\r\n var width = void 0;\r\n var height = void 0;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n var tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n axisGroup.add(new Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n inner$4(axisView).splitAreaColors = newSplitAreaColors;\r\n }\r\n function rectCoordAxisHandleRemove(axisView) {\r\n inner$4(axisView).splitAreaColors = null;\r\n }\n\n var axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n ];\r\n var selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n ];\r\n var CartesianAxisView = (function (_super) {\r\n __extends(CartesianAxisView, _super);\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new Group();\r\n this.group.add(this._axisGroup);\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = layout$1(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (var i = 0; i < cartesians.length; i++) {\r\n var otherAxisType = cartesians[i].getOtherAxis(axisModel.axis).type;\r\n if (otherAxisType === 'value' || otherAxisType === 'log') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n }, layout));\r\n each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n }(AxisView));\r\n var axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n var colorIndex = (lineCount++) % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n axisGroup.add(new Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n };\r\n var CartesianXAxisView = (function (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n }(CartesianAxisView));\r\n var CartesianYAxisView = (function (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n }(CartesianAxisView));\r\n ComponentView.registerClass(CartesianXAxisView);\r\n ComponentView.registerClass(CartesianYAxisView);\n\n registerProcessor(PRIORITY.PROCESSOR.FILTER + 10, {\r\n getTargetSeries: function (ecModel) {\r\n var seriesModelMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n isCartesian2DSeries(seriesModel) && seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n return seriesModelMap;\r\n },\r\n overallReset: function (ecModel, api) {\r\n var seriesRecords = [];\r\n var axisRecordMap = createHashMap();\r\n prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords);\r\n calculateFilteredExtent(axisRecordMap, seriesRecords);\r\n shrinkAxisExtent(axisRecordMap);\r\n }\r\n });\r\n function prepareDataExtentOnAxis(ecModel, axisRecordMap, seriesRecords) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xRawExtentInfo = xAxis.scale.rawExtentInfo;\r\n var yRawExtentInfo = yAxis.scale.rawExtentInfo;\r\n var data = seriesModel.getData();\r\n if ((xRawExtentInfo && xRawExtentInfo.frozen)\r\n || (yRawExtentInfo && yRawExtentInfo.frozen)) {\r\n return;\r\n }\r\n seriesRecords.push({\r\n seriesModel: seriesModel,\r\n xAxisModel: xAxisModel,\r\n yAxisModel: yAxisModel\r\n });\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, xAxisModel).condExtent, data, xAxis.dim);\r\n unionAxisExtentFromData(prepareAxisRecord(axisRecordMap, yAxisModel).condExtent, data, yAxis.dim);\r\n });\r\n }\r\n function calculateFilteredExtent(axisRecordMap, seriesRecords) {\r\n each(seriesRecords, function (seriesRecord) {\r\n var xAxisModel = seriesRecord.xAxisModel;\r\n var yAxisModel = seriesRecord.yAxisModel;\r\n var xAxis = xAxisModel.axis;\r\n var yAxis = yAxisModel.axis;\r\n var xAxisRecord = prepareAxisRecord(axisRecordMap, xAxisModel);\r\n var yAxisRecord = prepareAxisRecord(axisRecordMap, yAxisModel);\r\n xAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(xAxis.scale, xAxisModel, xAxisRecord.condExtent);\r\n yAxisRecord.rawExtentInfo = ensureScaleRawExtentInfo(yAxis.scale, yAxisModel, yAxisRecord.condExtent);\r\n xAxisRecord.rawExtentResult = xAxisRecord.rawExtentInfo.calculate();\r\n yAxisRecord.rawExtentResult = yAxisRecord.rawExtentInfo.calculate();\r\n var data = seriesRecord.seriesModel.getData();\r\n var condDimMap = {};\r\n var tarDimMap = {};\r\n var condAxis;\r\n var tarAxisRecord;\r\n function addCondition(axis, axisRecord) {\r\n var condExtent = axisRecord.condExtent;\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type === 'category'\r\n && (condExtent[0] < rawExtentResult.min || rawExtentResult.max < condExtent[1])) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim)) {\r\n condDimMap[dataDim] = true;\r\n condAxis = axis;\r\n }\r\n });\r\n }\r\n }\r\n function addTarget(axis, axisRecord) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n if (axis.type !== 'category'\r\n && (!rawExtentResult.minFixed || !rawExtentResult.maxFixed)) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dataDim) {\r\n if (!hasOwn(condDimMap, dataDim) && !hasOwn(tarDimMap, dataDim)) {\r\n tarDimMap[dataDim] = true;\r\n tarAxisRecord = axisRecord;\r\n }\r\n });\r\n }\r\n }\r\n addCondition(xAxis, xAxisRecord);\r\n addCondition(yAxis, yAxisRecord);\r\n addTarget(xAxis, xAxisRecord);\r\n addTarget(yAxis, yAxisRecord);\r\n var condDims = keys(condDimMap);\r\n var tarDims = keys(tarDimMap);\r\n var tarDimExtents = map(tarDims, function () {\r\n return initExtent();\r\n });\r\n var condDimsLen = condDims.length;\r\n var tarDimsLen = tarDims.length;\r\n if (!condDimsLen || !tarDimsLen) {\r\n return;\r\n }\r\n var singleCondDim = condDimsLen === 1 ? condDims[0] : null;\r\n var singleTarDim = tarDimsLen === 1 ? tarDims[0] : null;\r\n var dataLen = data.count();\r\n if (singleCondDim && singleTarDim) {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n var condVal = data.get(singleCondDim, dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n unionExtent(tarDimExtents[0], data.get(singleTarDim, dataIdx));\r\n }\r\n }\r\n }\r\n else {\r\n for (var dataIdx = 0; dataIdx < dataLen; dataIdx++) {\r\n for (var j = 0; j < condDimsLen; j++) {\r\n var condVal = data.get(condDims[j], dataIdx);\r\n if (condAxis.scale.isInExtentRange(condVal)) {\r\n for (var k = 0; k < tarDimsLen; k++) {\r\n unionExtent(tarDimExtents[k], data.get(tarDims[k], dataIdx));\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n each(tarDimExtents, function (tarDimExtent, i) {\r\n var dim = tarDims[i];\r\n data.setApproximateExtent(tarDimExtent, dim);\r\n var tarAxisExtent = tarAxisRecord.tarExtent = tarAxisRecord.tarExtent || initExtent();\r\n unionExtent(tarAxisExtent, tarDimExtent[0]);\r\n unionExtent(tarAxisExtent, tarDimExtent[1]);\r\n });\r\n });\r\n }\r\n function shrinkAxisExtent(axisRecordMap) {\r\n axisRecordMap.each(function (axisRecord) {\r\n var tarAxisExtent = axisRecord.tarExtent;\r\n if (tarAxisExtent) {\r\n var rawExtentResult = axisRecord.rawExtentResult;\r\n var rawExtentInfo = axisRecord.rawExtentInfo;\r\n if (!rawExtentResult.minFixed && tarAxisExtent[0] > rawExtentResult.min) {\r\n rawExtentInfo.modifyDataMinMax('min', tarAxisExtent[0]);\r\n }\r\n if (!rawExtentResult.maxFixed && tarAxisExtent[1] < rawExtentResult.max) {\r\n rawExtentInfo.modifyDataMinMax('max', tarAxisExtent[1]);\r\n }\r\n }\r\n });\r\n }\r\n function prepareAxisRecord(axisRecordMap, axisModel) {\r\n return axisRecordMap.get(axisModel.uid)\r\n || axisRecordMap.set(axisModel.uid, { condExtent: initExtent() });\r\n }\r\n function initExtent() {\r\n return [Infinity, -Infinity];\r\n }\r\n function unionExtent(extent, val) {\r\n val < extent[0] && (extent[0] = val);\r\n val > extent[1] && (extent[1] = val);\r\n }\n\n var GridModel = (function (_super) {\r\n __extends(GridModel, _super);\r\n function GridModel() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n GridModel.type = 'grid';\r\n GridModel.dependencies = ['xAxis', 'yAxis'];\r\n GridModel.layoutMode = 'box';\r\n GridModel.defaultOption = {\r\n show: false,\r\n zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n containLabel: false,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n return GridModel;\r\n }(ComponentModel));\n\n var GridView = (function (_super) {\r\n __extends(GridView, _super);\r\n function GridView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'grid';\r\n return _this;\r\n }\r\n GridView.prototype.render = function (gridModel, ecModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n };\r\n GridView.type = 'grid';\r\n return GridView;\r\n }(ComponentView));\r\n ComponentView.registerClass(GridView);\r\n ComponentModel.registerClass(GridModel);\r\n registerPreprocessor(function (option) {\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\n\n registerLayout(pointsLayout('line', true));\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n\n var Cartesian = (function () {\r\n function Cartesian(name) {\r\n this.type = 'cartesian';\r\n this._dimList = [];\r\n this._axes = {};\r\n this.name = name || '';\r\n }\r\n Cartesian.prototype.getAxis = function (dim) {\r\n return this._axes[dim];\r\n };\r\n Cartesian.prototype.getAxes = function () {\r\n return map(this._dimList, function (dim) {\r\n return this._axes[dim];\r\n }, this);\r\n };\r\n Cartesian.prototype.getAxesByScale = function (scaleType) {\r\n scaleType = scaleType.toLowerCase();\r\n return filter(this.getAxes(), function (axis) {\r\n return axis.scale.type === scaleType;\r\n });\r\n };\r\n Cartesian.prototype.addAxis = function (axis) {\r\n var dim = axis.dim;\r\n this._axes[dim] = axis;\r\n this._dimList.push(dim);\r\n };\r\n return Cartesian;\r\n }());\n\n var cartesian2DDimensions = ['x', 'y'];\r\n function canCalculateAffineTransform(scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n }\r\n var Cartesian2D = (function (_super) {\r\n __extends(Cartesian2D, _super);\r\n function Cartesian2D() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = 'cartesian2d';\r\n _this.dimensions = cartesian2DDimensions;\r\n return _this;\r\n }\r\n Cartesian2D.prototype.calcAffineTransform = function () {\r\n this._transform = this._invTransform = null;\r\n var xAxisScale = this.getAxis('x').scale;\r\n var yAxisScale = this.getAxis('y').scale;\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n var xScaleExtent = xAxisScale.getExtent();\r\n var yScaleExtent = yAxisScale.getExtent();\r\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n var scaleX = (end[0] - start[0]) / xScaleSpan;\r\n var scaleY = (end[1] - start[1]) / yScaleSpan;\r\n var translateX = start[0] - xScaleExtent[0] * scaleX;\r\n var translateY = start[1] - yScaleExtent[0] * scaleY;\r\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n };\r\n Cartesian2D.prototype.getBaseAxis = function () {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n };\r\n Cartesian2D.prototype.containPoint = function (point) {\r\n var axisX = this.getAxis('x');\r\n var axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n };\r\n Cartesian2D.prototype.containData = function (data) {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n };\r\n Cartesian2D.prototype.dataToPoint = function (data, reserved, out) {\r\n out = out || [];\r\n var xVal = data[0];\r\n var yVal = data[1];\r\n if (this._transform\r\n && xVal != null\r\n && isFinite(xVal)\r\n && yVal != null\r\n && isFinite(yVal)) {\r\n return applyTransform(out, data, this._transform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\r\n return out;\r\n };\r\n Cartesian2D.prototype.clampData = function (data, out) {\r\n var xScale = this.getAxis('x').scale;\r\n var yScale = this.getAxis('y').scale;\r\n var xAxisExtent = xScale.getExtent();\r\n var yAxisExtent = yScale.getExtent();\r\n var x = xScale.parse(data[0]);\r\n var y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\r\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.pointToData = function (point, out) {\r\n out = out || [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n var xAxis = this.getAxis('x');\r\n var yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]));\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\r\n return out;\r\n };\r\n Cartesian2D.prototype.getOtherAxis = function (axis) {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n };\r\n Cartesian2D.prototype.getArea = function () {\r\n var xExtent = this.getAxis('x').getGlobalExtent();\r\n var yExtent = this.getAxis('y').getGlobalExtent();\r\n var x = Math.min(xExtent[0], xExtent[1]);\r\n var y = Math.min(yExtent[0], yExtent[1]);\r\n var width = Math.max(xExtent[0], xExtent[1]) - x;\r\n var height = Math.max(yExtent[0], yExtent[1]) - y;\r\n return new BoundingRect(x, y, width, height);\r\n };\r\n return Cartesian2D;\r\n }(Cartesian));\n\n var inner$5 = makeInner();\r\n function createAxisLabels(axis) {\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n }\r\n function createAxisTicks(axis, tickModel) {\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : { ticks: map(axis.scale.getTicks(), function (tick) { return tick.value; }) };\r\n }\r\n function makeCategoryLabels(axis) {\r\n var labelModel = axis.getLabelModel();\r\n var result = makeCategoryLabelsActually(axis, labelModel);\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? { labels: [], labelCategoryInterval: result.labelCategoryInterval }\r\n : result;\r\n }\r\n function makeCategoryLabelsActually(axis, labelModel) {\r\n var labelsCache = getListCache(axis, 'labels');\r\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n var result = listCacheGet(labelsCache, optionLabelInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var labels;\r\n var numericLabelInterval;\r\n if (isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n return listCacheSet(labelsCache, optionLabelInterval, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n }\r\n function makeCategoryTicks(axis, tickModel) {\r\n var ticksCache = getListCache(axis, 'ticks');\r\n var optionTickInterval = getOptionCategoryInterval(tickModel);\r\n var result = listCacheGet(ticksCache, optionTickInterval);\r\n if (result) {\r\n return result;\r\n }\r\n var ticks;\r\n var tickCategoryInterval;\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n if (isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n else if (optionTickInterval === 'auto') {\r\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n return listCacheSet(ticksCache, optionTickInterval, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n }\r\n function makeRealNumberLabels(axis) {\r\n var ticks = axis.scale.getTicks();\r\n var labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: map(ticks, function (tick, idx) {\r\n return {\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n }\r\n function getListCache(axis, prop) {\r\n return inner$5(axis)[prop] || (inner$5(axis)[prop] = []);\r\n }\r\n function listCacheGet(cache, key) {\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n }\r\n function listCacheSet(cache, key, value) {\r\n cache.push({ key: key, value: value });\r\n return value;\r\n }\r\n function makeAutoCategoryInterval(axis) {\r\n var result = inner$5(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner$5(axis).autoInterval = axis.calculateCategoryInterval());\r\n }\r\n function calculateCategoryInterval(axis) {\r\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var tickCount = ordinalScale.count();\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n var step = 1;\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n var tickValue = ordinalExtent[0];\r\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n var maxW = 0;\r\n var maxH = 0;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n var width = 0;\r\n var height = 0;\r\n var rect = getBoundingRect(labelFormatter({ value: tickValue }), params.font, 'center', 'top');\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n var dw = maxW / unitW;\r\n var dh = maxH / unitH;\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n var cache = inner$5(axis.model);\r\n var axisExtent = axis.getExtent();\r\n var lastAutoInterval = cache.lastAutoInterval;\r\n var lastTickCount = cache.lastTickCount;\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n && lastAutoInterval > interval\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]) {\r\n interval = lastAutoInterval;\r\n }\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n return interval;\r\n }\r\n function fetchAutoCategoryIntervalCalculationParams(axis) {\r\n var labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : (axis.isHorizontal && !axis.isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n }\r\n function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var ordinalScale = axis.scale;\r\n var ordinalExtent = ordinalScale.getExtent();\r\n var labelModel = axis.getLabelModel();\r\n var result = [];\r\n var step = Math.max((categoryInterval || 0) + 1, 1);\r\n var startTick = ordinalExtent[0];\r\n var tickCount = ordinalScale.count();\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n var showAllLabel = shouldShowAllLabels(axis);\r\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n var tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n function addItem(tickValue) {\r\n var tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n });\r\n }\r\n return result;\r\n }\r\n function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\r\n var ordinalScale = axis.scale;\r\n var labelFormatter = makeLabelFormatter(axis);\r\n var result = [];\r\n each(ordinalScale.getTicks(), function (tick) {\r\n var rawLabel = ordinalScale.getLabel(tick);\r\n var tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n });\r\n }\r\n });\r\n return result;\r\n }\n\n var NORMALIZED_EXTENT = [0, 1];\r\n var Axis = (function () {\r\n function Axis(dim, scale, extent) {\r\n this.onBand = false;\r\n this.inverse = false;\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n Axis.prototype.contain = function (coord) {\r\n var extent = this._extent;\r\n var min = Math.min(extent[0], extent[1]);\r\n var max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n };\r\n Axis.prototype.containData = function (data) {\r\n return this.scale.contain(data);\r\n };\r\n Axis.prototype.getExtent = function () {\r\n return this._extent.slice();\r\n };\r\n Axis.prototype.getPixelPrecision = function (dataExtent) {\r\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\r\n };\r\n Axis.prototype.setExtent = function (start, end) {\r\n var extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n };\r\n Axis.prototype.dataToCoord = function (data, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n data = scale.normalize(data);\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n };\r\n Axis.prototype.coordToData = function (coord, clamp) {\r\n var extent = this._extent;\r\n var scale = this.scale;\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice();\r\n fixExtentWithBands(extent, scale.count());\r\n }\r\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n return this.scale.scale(t);\r\n };\r\n Axis.prototype.pointToData = function (point, clamp) {\r\n return;\r\n };\r\n Axis.prototype.getTicksCoords = function (opt) {\r\n opt = opt || {};\r\n var tickModel = opt.tickModel || this.getTickModel();\r\n var result = createAxisTicks(this, tickModel);\r\n var ticks = result.ticks;\r\n var ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(this.scale.type === 'ordinal'\r\n ? this.scale.getRawIndex(tickVal)\r\n : tickVal),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n var alignWithLabel = tickModel.get('alignWithLabel');\r\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\r\n return ticksCoords;\r\n };\r\n Axis.prototype.getMinorTicksCoords = function () {\r\n if (this.scale.type === 'ordinal') {\r\n return [];\r\n }\r\n var minorTickModel = this.model.getModel('minorTick');\r\n var splitNumber = minorTickModel.get('splitNumber');\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n var minorTicks = this.scale.getMinorTicks(splitNumber);\r\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n };\r\n Axis.prototype.getViewLabels = function () {\r\n return createAxisLabels(this).labels;\r\n };\r\n Axis.prototype.getLabelModel = function () {\r\n return this.model.getModel('axisLabel');\r\n };\r\n Axis.prototype.getTickModel = function () {\r\n return this.model.getModel('axisTick');\r\n };\r\n Axis.prototype.getBandWidth = function () {\r\n var axisExtent = this._extent;\r\n var dataExtent = this.scale.getExtent();\r\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n len === 0 && (len = 1);\r\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n return Math.abs(size) / len;\r\n };\r\n Axis.prototype.calculateCategoryInterval = function () {\r\n return calculateCategoryInterval(this);\r\n };\r\n return Axis;\r\n }());\r\n function fixExtentWithBands(extent, nTick) {\r\n var size = extent[1] - extent[0];\r\n var len = nTick;\r\n var margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n }\r\n function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\r\n var ticksLen = ticksCoords.length;\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n var axisExtent = axis.getExtent();\r\n var last;\r\n var diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = { coord: axisExtent[0] };\r\n }\r\n else {\r\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift_1 / 2;\r\n });\r\n var dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n last = { coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize };\r\n ticksCoords.push(last);\r\n }\r\n var inverse = axisExtent[0] > axisExtent[1];\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({ coord: axisExtent[0] });\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({ coord: axisExtent[1] });\r\n }\r\n function littleThan(a, b) {\r\n a = round$1(a);\r\n b = round$1(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n }\n\n var Axis2D = (function (_super) {\r\n __extends(Axis2D, _super);\r\n function Axis2D(dim, scale, coordExtent, axisType, position) {\r\n var _this = _super.call(this, dim, scale, coordExtent) || this;\r\n _this.index = 0;\r\n _this.type = axisType || 'value';\r\n _this.position = position || 'bottom';\r\n return _this;\r\n }\r\n Axis2D.prototype.isHorizontal = function () {\r\n var position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n };\r\n Axis2D.prototype.getGlobalExtent = function (asc) {\r\n var ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n };\r\n Axis2D.prototype.pointToData = function (point, clamp) {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n };\r\n Axis2D.prototype.setCategorySortInfo = function (info) {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n this.model.option.categorySortInfo = info;\r\n this.scale.setCategorySortInfo(info);\r\n };\r\n return Axis2D;\r\n }(Axis));\n\n var Grid = (function () {\r\n function Grid(gridModel, ecModel, api) {\r\n this.type = 'grid';\r\n this._coordsMap = {};\r\n this._coordsList = [];\r\n this._axesMap = {};\r\n this._axesList = [];\r\n this.axisPointerEnabled = true;\r\n this.dimensions = cartesian2DDimensions;\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n Grid.prototype.getRect = function () {\r\n return this._rect;\r\n };\r\n Grid.prototype.update = function (ecModel, api) {\r\n var axesMap = this._axesMap;\r\n this._updateScale(ecModel, this.model);\r\n each(axesMap.x, function (xAxis) {\r\n niceScaleExtent(xAxis.scale, xAxis.model);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n niceScaleExtent(yAxis.scale, yAxis.model);\r\n });\r\n var onZeroRecords = {};\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n this.resize(this.model, api);\r\n };\r\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\r\n var boxLayoutParams = gridModel.getBoxLayoutParams();\r\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n var gridRect = getLayoutRect(boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n this._rect = gridRect;\r\n var axesList = this._axesList;\r\n adjustAxes();\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n var labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n var dim = axis.isHorizontal() ? 'height' : 'width';\r\n var margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n adjustAxes();\r\n }\r\n each(this._coordsList, function (coord) {\r\n coord.calcAffineTransform();\r\n });\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n var isHorizontal = axis.isHorizontal();\r\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n var idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n };\r\n Grid.prototype.getAxis = function (dim, axisIndex) {\r\n var axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n };\r\n Grid.prototype.getAxes = function () {\r\n return this._axesList.slice();\r\n };\r\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = xAxisIndex.yAxisIndex;\r\n xAxisIndex = xAxisIndex.xAxisIndex;\r\n }\r\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex) {\r\n return coordList[i];\r\n }\r\n }\r\n };\r\n Grid.prototype.getCartesians = function () {\r\n return this._coordsList.slice();\r\n };\r\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value)\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value))\r\n : null;\r\n };\r\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\r\n var target = this._findConvertTarget(finder);\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value)\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value))\r\n : null;\r\n };\r\n Grid.prototype._findConvertTarget = function (finder) {\r\n var seriesModel = finder.seriesModel;\r\n var xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n var yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n var gridModel = finder.gridModel;\r\n var coordsList = this._coordsList;\r\n var cartesian;\r\n var axis;\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n else if (gridModel) {\r\n var grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n return { cartesian: cartesian, axis: axis };\r\n };\r\n Grid.prototype.containPoint = function (point) {\r\n var coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n };\r\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\r\n var _this = this;\r\n var grid = this;\r\n var axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n var axesMap = {\r\n x: {},\r\n y: {}\r\n };\r\n var axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n if (!axesCount.x || !axesCount.y) {\r\n this._axesMap = {};\r\n this._axesList = [];\r\n return;\r\n }\r\n this._axesMap = axesMap;\r\n each(axesMap.x, function (xAxis, xAxisIndex) {\r\n each(axesMap.y, function (yAxis, yAxisIndex) {\r\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n var cartesian = new Cartesian2D(key);\r\n cartesian.master = _this;\r\n cartesian.model = gridModel;\r\n _this._coordsMap[key] = cartesian;\r\n _this._coordsList.push(cartesian);\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n function createAxisCreator(dimName) {\r\n return function (axisModel, idx) {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n var axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\r\n var isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && axisModel.get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.grid = grid;\r\n axis.index = idx;\r\n grid._axesList.push(axis);\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n };\r\n Grid.prototype._updateScale = function (ecModel, gridModel) {\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n var categorySortInfo = axis.model.get('categorySortInfo');\r\n axis.scale.setCategorySortInfo(categorySortInfo);\r\n }\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\r\n return;\r\n }\r\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n var data = seriesModel.getData();\r\n var xAxis = cartesian.getAxis('x');\r\n var yAxis = cartesian.getAxis('y');\r\n if (data.type === 'list') {\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }\r\n }, this);\r\n function unionExtent(data, axis) {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n };\r\n Grid.prototype.getTooltipAxes = function (dim) {\r\n var baseAxes = [];\r\n var otherAxes = [];\r\n each(this.getCartesians(), function (cartesian) {\r\n var baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n var otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n return { baseAxes: baseAxes, otherAxes: otherAxes };\r\n };\r\n Grid.create = function (ecModel, api) {\r\n var grids = [];\r\n ecModel.eachComponent('grid', function (gridModel, idx) {\r\n var grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n grid.resize(gridModel, api, true);\r\n gridModel.coordinateSystem = grid;\r\n grids.push(grid);\r\n });\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n var axesModelMap = findAxisModels(seriesModel);\r\n var xAxisModel = axesModelMap.xAxisModel;\r\n var yAxisModel = axesModelMap.yAxisModel;\r\n var gridModel = xAxisModel.getCoordSysModel();\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n var grid = gridModel.coordinateSystem;\r\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n });\r\n return grids;\r\n };\r\n Grid.dimensions = cartesian2DDimensions;\r\n return Grid;\r\n }());\r\n function isAxisUsedInTheGrid(axisModel, gridModel) {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n }\r\n function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {\r\n axis.getAxesOnZeroOf = function () {\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n var otherAxes = axesMap[otherAxisDim];\r\n var otherAxisOnZeroOf;\r\n var axisModel = axis.model;\r\n var onZero = axisModel.get(['axisLine', 'onZero']);\r\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n if (!onZero) {\r\n return;\r\n }\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n for (var idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n function getOnZeroRecordKey(axis) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n }\r\n function canOnZeroToAxis(axis) {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n }\r\n function updateAxisTransform(axis, coordBase) {\r\n var axisExtent = axis.getExtent();\r\n var axisExtentSum = axisExtent[0] + axisExtent[1];\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n }\r\n CoordinateSystemManager.register('cartesian2d', Grid);\n\n var BaseBarSeriesModel = (function (_super) {\r\n __extends(BaseBarSeriesModel, _super);\r\n function BaseBarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BaseBarSeriesModel.type;\r\n return _this;\r\n }\r\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\r\n return createListFromArray(this.getSource(), this, { useEncodeDefaulter: true });\r\n };\r\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value) {\r\n var coordSys = this.coordinateSystem;\r\n if (coordSys) {\r\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\r\n var data = this.getData();\r\n var offset = data.getLayout('offset');\r\n var size = data.getLayout('size');\r\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n };\r\n BaseBarSeriesModel.type = 'series.__base_bar__';\r\n BaseBarSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n return BaseBarSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(BaseBarSeriesModel);\n\n var BarSeriesModel = (function (_super) {\r\n __extends(BarSeriesModel, _super);\r\n function BarSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.type = BarSeriesModel.type;\r\n return _this;\r\n }\r\n BarSeriesModel.prototype.getProgressive = function () {\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n };\r\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\r\n var progressiveThreshold = this.get('progressiveThreshold');\r\n var largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n };\r\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n };\r\n BarSeriesModel.type = 'series.bar';\r\n BarSeriesModel.dependencies = ['grid', 'polar'];\r\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n clip: true,\r\n roundCap: false,\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n realtimeSort: false\r\n });\r\n return BarSeriesModel;\r\n }(BaseBarSeriesModel));\r\n SeriesModel.registerClass(BarSeriesModel);\n\n var SausageShape = (function () {\r\n function SausageShape() {\r\n this.cx = 0;\r\n this.cy = 0;\r\n this.r0 = 0;\r\n this.r = 0;\r\n this.startAngle = 0;\r\n this.endAngle = Math.PI * 2;\r\n this.clockwise = true;\r\n }\r\n return SausageShape;\r\n }());\r\n var SausagePath = (function (_super) {\r\n __extends(SausagePath, _super);\r\n function SausagePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'sausage';\r\n return _this;\r\n }\r\n SausagePath.prototype.getDefaultShape = function () {\r\n return new SausageShape();\r\n };\r\n SausagePath.prototype.buildPath = function (ctx, shape) {\r\n var x = shape.cx;\r\n var y = shape.cy;\r\n var r0 = Math.max(shape.r0 || 0, 0);\r\n var r = Math.max(shape.r, 0);\r\n var dr = (r - r0) * 0.5;\r\n var rCenter = r0 + dr;\r\n var startAngle = shape.startAngle;\r\n var endAngle = shape.endAngle;\r\n var clockwise = shape.clockwise;\r\n var unitStartX = Math.cos(startAngle);\r\n var unitStartY = Math.sin(startAngle);\r\n var unitEndX = Math.cos(endAngle);\r\n var unitEndY = Math.sin(endAngle);\r\n var lessThanCircle = clockwise\r\n ? endAngle - startAngle < Math.PI * 2\r\n : startAngle - endAngle < Math.PI * 2;\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + x, unitStartY * r0 + y);\r\n ctx.arc(unitStartX * rCenter + x, unitStartY * rCenter + y, dr, -Math.PI + startAngle, startAngle, !clockwise);\r\n }\r\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\r\n ctx.moveTo(unitEndX * r + x, unitEndY * r + y);\r\n ctx.arc(unitEndX * rCenter + x, unitEndY * rCenter + y, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\r\n if (r0 !== 0) {\r\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\r\n ctx.moveTo(unitStartX * r0 + x, unitEndY * r0 + y);\r\n }\r\n ctx.closePath();\r\n };\r\n return SausagePath;\r\n }(Path));\n\n var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\r\n var BAR_BORDER_RADIUS_QUERY = ['itemStyle', 'borderRadius'];\r\n var _eventPos = [0, 0];\r\n var mathMax$5 = Math.max;\r\n var mathMin$5 = Math.min;\r\n function getClipArea(coord, data) {\r\n var coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var baseAxis = coord.getBaseAxis();\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n var expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n coordSysClipArea.x -= expandWidth;\r\n coordSysClipArea.width += expandWidth * 2;\r\n }\r\n else {\r\n coordSysClipArea.y -= expandWidth;\r\n coordSysClipArea.height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n return coordSysClipArea;\r\n }\r\n var BarView = (function (_super) {\r\n __extends(BarView, _super);\r\n function BarView() {\r\n var _this = _super.call(this) || this;\r\n _this.type = BarView.type;\r\n _this._isFirstFrame = true;\r\n return _this;\r\n }\r\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n this._model = seriesModel;\r\n this.removeOnRenderedListener(api);\r\n this._updateDrawMode(seriesModel);\r\n var coordinateSystemType = seriesModel.get('coordinateSystem');\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar') {\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n console.warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n };\r\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype.incrementalRender = function (params, seriesModel) {\r\n this._incrementalRenderLarge(params, seriesModel);\r\n };\r\n BarView.prototype._updateDrawMode = function (seriesModel) {\r\n var isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n };\r\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\r\n var _this = this;\r\n var group = this.group;\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var coord = seriesModel.coordinateSystem;\r\n var baseAxis = coord.getBaseAxis();\r\n var isHorizontalOrRadial;\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = baseAxis.isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n var axis2DModel = baseAxis.model;\r\n var realtimeSort = seriesModel.get('realtimeSort');\r\n if (realtimeSort && data.count()) {\r\n if (this._isFirstFrame) {\r\n this._initSort(data, isHorizontalOrRadial, baseAxis, api);\r\n this._isFirstFrame = false;\r\n return;\r\n }\r\n else {\r\n this._onRendered = function () {\r\n var orderMap = function (idx) {\r\n var el = data.getItemGraphicEl(idx);\r\n if (el) {\r\n var shape = el.shape;\r\n return (isHorizontalOrRadial ? shape.y + shape.height : shape.x + shape.width) || 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n _this._updateSort(data, orderMap, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n var needsClip = seriesModel.get('clip', true) || realtimeSort;\r\n var coordSysClipArea = getClipArea(coord, data);\r\n group.removeClipPath();\r\n var roundCap = seriesModel.get('roundCap', true);\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n var bgEls = [];\r\n var oldBgEls = this._backgroundEls;\r\n var isInitSort = payload && payload.isInitSort;\r\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n function createBackground(dataIndex) {\r\n var bgLayout = getLayout[coord.type](data, dataIndex);\r\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n }\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n var itemModel = data.getItemModel(dataIndex);\r\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\r\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\r\n }\r\n else {\r\n initProps(el, { shape: layout }, seriesModel, dataIndex);\r\n }\r\n data.setItemGraphicEl(dataIndex, el);\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n var itemModel = data.getItemModel(newIndex);\r\n var layout = getLayout[coord.type](data, newIndex, itemModel);\r\n if (drawBackground) {\r\n var bgEl = void 0;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n if (coord.type === 'cartesian2d') {\r\n bgEl.setShape('r', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n var bgLayout = getLayout[coord.type](data, newIndex);\r\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape: shape }, animationModel, newIndex);\r\n }\r\n var el = oldData.getItemGraphicEl(oldIndex);\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(el);\r\n el = null;\r\n return;\r\n }\r\n var isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n if (!el) {\r\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\r\n }\r\n if (!isChangeOrder) {\r\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\r\n }\r\n if (isInitSort) {\r\n el.attr({ shape: layout });\r\n }\r\n else if (realtimeSort) {\r\n updateRealtimeAnimation(seriesModel, axis2DModel, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n }, seriesModel, newIndex, null);\r\n }\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n var el = oldData.getItemGraphicEl(dataIndex);\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n for (var i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n this._data = data;\r\n };\r\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n };\r\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, true);\r\n };\r\n BarView.prototype._updateLargeClip = function (seriesModel) {\r\n var clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n };\r\n BarView.prototype._dataSort = function (data, idxMap) {\r\n var info = [];\r\n data.each(function (idx) {\r\n info.push({\r\n mappedValue: idxMap(idx),\r\n ordinalNumber: idx,\r\n beforeSortIndex: null\r\n });\r\n });\r\n info.sort(function (a, b) {\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n for (var i = 0; i < info.length; ++i) {\r\n info[info[i].ordinalNumber].beforeSortIndex = i;\r\n }\r\n return map(info, function (item) {\r\n return {\r\n ordinalNumber: item.ordinalNumber,\r\n beforeSortIndex: item.beforeSortIndex\r\n };\r\n });\r\n };\r\n BarView.prototype._isDataOrderChanged = function (data, orderMap, oldOrder) {\r\n var oldCount = oldOrder ? oldOrder.length : 0;\r\n if (oldCount !== data.count()) {\r\n return true;\r\n }\r\n var lastValue = Number.MAX_VALUE;\r\n for (var i = 0; i < oldOrder.length; ++i) {\r\n var value = orderMap(oldOrder[i].ordinalNumber);\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n };\r\n BarView.prototype._updateSort = function (data, orderMap, baseAxis, api) {\r\n var oldOrder = baseAxis.scale.getCategorySortInfo();\r\n var isOrderChanged = this._isDataOrderChanged(data, orderMap, oldOrder);\r\n if (isOrderChanged) {\r\n var newOrder = this._dataSort(data, orderMap);\r\n var extent = baseAxis.scale.getExtent();\r\n for (var i = extent[0]; i < extent[1]; ++i) {\r\n if (!oldOrder[i] || oldOrder[i].ordinalNumber !== newOrder[i].ordinalNumber) {\r\n this.removeOnRenderedListener(api);\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: newOrder\r\n };\r\n api.dispatchAction(action);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n BarView.prototype._initSort = function (data, isHorizontal, baseAxis, api) {\r\n var action = {\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: this._dataSort(data, function (idx) { return parseFloat(data.get(isHorizontal ? 'y' : 'x', idx)) || 0; })\r\n };\r\n api.dispatchAction(action);\r\n };\r\n BarView.prototype.remove = function (ecModel, api) {\r\n this._clear(this._model);\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.dispose = function (ecModel, api) {\r\n this.removeOnRenderedListener(api);\r\n };\r\n BarView.prototype.removeOnRenderedListener = function (api) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n };\r\n BarView.prototype._clear = function (model) {\r\n var group = this.group;\r\n var data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n data.eachItemGraphicEl(function (el) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n };\r\n BarView.prototype._removeBackground = function () {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n };\r\n BarView.type = 'bar';\r\n return BarView;\r\n }(ChartView));\r\n var clip = {\r\n cartesian2d: function (coordSysBoundingRect, layout) {\r\n var signWidth = layout.width < 0 ? -1 : 1;\r\n var signHeight = layout.height < 0 ? -1 : 1;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n var x = mathMax$5(layout.x, coordSysBoundingRect.x);\r\n var x2 = mathMin$5(layout.x + layout.width, coordSysBoundingRect.x + coordSysBoundingRect.width);\r\n var y = mathMax$5(layout.y, coordSysBoundingRect.y);\r\n var y2 = mathMin$5(layout.y + layout.height, coordSysBoundingRect.y + coordSysBoundingRect.height);\r\n layout.x = x;\r\n layout.y = y;\r\n layout.width = x2 - x;\r\n layout.height = y2 - y;\r\n var clipped = layout.width < 0 || layout.height < 0;\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n return clipped;\r\n },\r\n polar: function (coordSysClipArea, layout) {\r\n var signR = layout.r0 <= layout.r ? 1 : -1;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n var r = mathMin$5(layout.r, coordSysClipArea.r);\r\n var r0 = mathMax$5(layout.r0, coordSysClipArea.r0);\r\n layout.r = r;\r\n layout.r0 = r0;\r\n var clipped = r - r0 < 0;\r\n if (signR < 0) {\r\n var tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n return clipped;\r\n }\r\n };\r\n var elementCreator = {\r\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\r\n var rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n rect.__dataIndex = newIndex;\r\n rect.name = 'item';\r\n if (animationModel) {\r\n var rectShape = rect.shape;\r\n var animateProperty = isHorizontal ? 'height' : 'width';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\r\n var clockwise = layout.startAngle < layout.endAngle;\r\n var ShapeClass = (!isRadial && roundCap) ? SausagePath : Sector;\r\n var sector = new ShapeClass({\r\n shape: defaults({ clockwise: clockwise }, layout),\r\n z2: 1\r\n });\r\n sector.name = 'item';\r\n if (animationModel) {\r\n var sectorShape = sector.shape;\r\n var animateProperty = isRadial ? 'r' : 'endAngle';\r\n var animateTarget = {};\r\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n }, animationModel);\r\n }\r\n return sector;\r\n }\r\n };\r\n function updateRealtimeAnimation(seriesModel, axisModel, animationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\r\n if (animationModel || axisModel) {\r\n var seriesTarget = void 0;\r\n var axisTarget = void 0;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n if (!isChangeOrder) {\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesModel, newIndex, null);\r\n }\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisModel, newIndex);\r\n }\r\n }\r\n var getLayout = {\r\n cartesian2d: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n var signX = layout.width > 0 ? 1 : -1;\r\n var signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n polar: function (data, dataIndex, itemModel) {\r\n var layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n };\r\n }\r\n };\r\n function isZeroOnPolar(layout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n }\r\n function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\r\n var style = data.getItemVisual(dataIndex, 'style');\r\n if (!isPolar) {\r\n el.setShape('r', itemModel.get(BAR_BORDER_RADIUS_QUERY) || 0);\r\n }\r\n el.useStyle(style);\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && el.attr('cursor', cursorStyle);\r\n if (!isPolar) {\r\n var labelPositionOutside = isHorizontal\r\n ? (layout.height > 0 ? 'bottom' : 'top')\r\n : (layout.width > 0 ? 'left' : 'right');\r\n var labelStatesModels = getLabelStatesModels(itemModel);\r\n setLabelStyle(el, labelStatesModels, {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside\r\n });\r\n var label = el.getTextContent();\r\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { return getDefaultInterpolatedLabel(data, value); });\r\n }\r\n var emphasisModel = itemModel.getModel(['emphasis']);\r\n enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n setStatesStylesFromModel(el, itemModel);\r\n if (isZeroOnPolar(layout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, function (state) {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n }\r\n function getLineWidth(itemModel, rawLayout) {\r\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n }\r\n var LagePathShape = (function () {\r\n function LagePathShape() {\r\n }\r\n return LagePathShape;\r\n }());\r\n var LargePath = (function (_super) {\r\n __extends(LargePath, _super);\r\n function LargePath(opts) {\r\n var _this = _super.call(this, opts) || this;\r\n _this.type = 'largeBar';\r\n return _this;\r\n }\r\n LargePath.prototype.getDefaultShape = function () {\r\n return new LagePathShape();\r\n };\r\n LargePath.prototype.buildPath = function (ctx, shape) {\r\n var points = shape.points;\r\n var startPoint = this.__startPoint;\r\n var baseDimIdx = this.__baseDimIdx;\r\n for (var i = 0; i < points.length; i += 2) {\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n ctx.moveTo(startPoint[0], startPoint[1]);\r\n ctx.lineTo(points[i], points[i + 1]);\r\n }\r\n };\r\n return LargePath;\r\n }(Path));\r\n function createLarge(seriesModel, group, incremental) {\r\n var data = seriesModel.getData();\r\n var startPoint = [];\r\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');\r\n var largeDataIndices = data.getLayout('largeDataIndices');\r\n var barWidth = data.getLayout('barWidth');\r\n var backgroundModel = seriesModel.getModel('backgroundStyle');\r\n var drawBackground = seriesModel.get('showBackground', true);\r\n if (drawBackground) {\r\n var points = data.getLayout('largeBackgroundPoints');\r\n var backgroundStartPoint = [];\r\n backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');\r\n var bgEl = new LargePath({\r\n shape: { points: points },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.__startPoint = backgroundStartPoint;\r\n bgEl.__baseDimIdx = baseDimIdx;\r\n bgEl.__largeDataIndices = largeDataIndices;\r\n bgEl.__barWidth = barWidth;\r\n setLargeBackgroundStyle(bgEl, backgroundModel, data);\r\n group.add(bgEl);\r\n }\r\n var el = new LargePath({\r\n shape: { points: data.getLayout('largePoints') },\r\n incremental: !!incremental\r\n });\r\n el.__startPoint = startPoint;\r\n el.__baseDimIdx = baseDimIdx;\r\n el.__largeDataIndices = largeDataIndices;\r\n el.__barWidth = barWidth;\r\n group.add(el);\r\n setLargeStyle(el, seriesModel, data);\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n }\r\n var largePathUpdateDataIndex = throttle(function (event) {\r\n var largePath = this;\r\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n }, 30, false);\r\n function largePathFindDataIndex(largePath, x, y) {\r\n var baseDimIdx = largePath.__baseDimIdx;\r\n var valueDimIdx = 1 - baseDimIdx;\r\n var points = largePath.shape.points;\r\n var largeDataIndices = largePath.__largeDataIndices;\r\n var barWidthHalf = Math.abs(largePath.__barWidth / 2);\r\n var startValueVal = largePath.__startPoint[valueDimIdx];\r\n _eventPos[0] = x;\r\n _eventPos[1] = y;\r\n var pointerBaseVal = _eventPos[baseDimIdx];\r\n var pointerValueVal = _eventPos[1 - baseDimIdx];\r\n var baseLowerBound = pointerBaseVal - barWidthHalf;\r\n var baseUpperBound = pointerBaseVal + barWidthHalf;\r\n for (var i = 0, len = points.length / 2; i < len; i++) {\r\n var ii = i * 2;\r\n var barBaseVal = points[ii + baseDimIdx];\r\n var barValueVal = points[ii + valueDimIdx];\r\n if (barBaseVal >= baseLowerBound && barBaseVal <= baseUpperBound\r\n && (startValueVal <= barValueVal\r\n ? (pointerValueVal >= startValueVal && pointerValueVal <= barValueVal)\r\n : (pointerValueVal >= barValueVal && pointerValueVal <= startValueVal))) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n return -1;\r\n }\r\n function setLargeStyle(el, seriesModel, data) {\r\n var globalStyle = data.getVisual('style');\r\n el.useStyle(extend({}, globalStyle));\r\n el.style.fill = null;\r\n el.style.stroke = globalStyle.fill;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function setLargeBackgroundStyle(el, backgroundModel, data) {\r\n var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');\r\n var itemStyle = backgroundModel.getItemStyle();\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n el.style.lineWidth = data.getLayout('barWidth');\r\n }\r\n function createBackgroundShape(isHorizontalOrRadial, layout, coord) {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n var rectShape = layout;\r\n var coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n };\r\n }\r\n else {\r\n var coordLayout = coord.getArea();\r\n var sectorShape = layout;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n };\r\n }\r\n }\r\n function createBackgroundEl(coord, isHorizontalOrRadial, layout) {\r\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\r\n silent: true,\r\n z2: 0\r\n });\r\n }\r\n ChartView.registerClass(BarView);\n\n registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n var componentType = payload.componentType || 'series';\r\n ecModel.eachComponent({ mainType: componentType, query: payload }, function (componentModel) {\r\n if (payload.sortInfo) {\r\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n });\r\n });\n\n registerLayout(PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar'));\r\n registerLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);\r\n registerVisual({\r\n seriesType: 'bar',\r\n reset: function (seriesModel) {\r\n seriesModel.getData().setVisual('legendSymbol', 'roundRect');\r\n }\r\n });\r\n registerProcessor(PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n\n function createListSimply(seriesModel, opt, nameList) {\r\n opt = isArray(opt) && { coordDimensions: opt } || extend({}, opt);\r\n var source = seriesModel.getSource();\r\n var dimensionsInfo = createDimensions(source, opt);\r\n var list = new List(dimensionsInfo, seriesModel);\r\n list.initData(source, nameList);\r\n return list;\r\n }\n\n var LegendVisualProvider = (function () {\r\n function LegendVisualProvider(getDataWithEncodedVisual, getRawData) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n LegendVisualProvider.prototype.getAllNames = function () {\r\n var rawData = this._getRawData();\r\n return rawData.mapArray(rawData.getName);\r\n };\r\n LegendVisualProvider.prototype.containName = function (name) {\r\n var rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n };\r\n LegendVisualProvider.prototype.indexOfName = function (name) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n };\r\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\r\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\r\n };\r\n return LegendVisualProvider;\r\n }());\n\n var PieSeriesModel = (function (_super) {\r\n __extends(PieSeriesModel, _super);\r\n function PieSeriesModel() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.useColorPaletteOnData = true;\r\n return _this;\r\n }\r\n PieSeriesModel.prototype.init = function (option) {\r\n _super.prototype.init.apply(this, arguments);\r\n this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this));\r\n this._defaultLabelLine(option);\r\n };\r\n PieSeriesModel.prototype.mergeOption = function () {\r\n _super.prototype.mergeOption.apply(this, arguments);\r\n };\r\n PieSeriesModel.prototype.getInitialData = function () {\r\n return createListSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n };\r\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\r\n var data = this.getData();\r\n var params = _super.prototype.getDataParams.call(this, dataIndex);\r\n var valueList = [];\r\n data.each(data.mapDimension('value'), function (value) {\r\n valueList.push(value);\r\n });\r\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\r\n params.$vars.push('percent');\r\n return params;\r\n };\r\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n var labelLineNormalOpt = option.labelLine;\r\n var labelLineEmphasisOpt = option.emphasis.labelLine;\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n };\r\n PieSeriesModel.type = 'series.pie';\r\n PieSeriesModel.defaultOption = {\r\n zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n clockwise: true,\r\n startAngle: 90,\r\n minAngle: 0,\r\n minShowLabelAngle: 0,\r\n selectedOffset: 10,\r\n percentPrecision: 2,\r\n stillShowZeroSum: true,\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n label: {\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n position: 'outer',\r\n alignTo: 'none',\r\n edgeDistance: '25%',\r\n bleedMargin: 10,\r\n distanceToLabelLine: 5\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 15,\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1\r\n },\r\n labelLayout: {\r\n hideOverlap: true\r\n },\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n avoidLabelOverlap: true,\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationTypeUpdate: 'transition',\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n return PieSeriesModel;\r\n }(SeriesModel));\r\n SeriesModel.registerClass(PieSeriesModel);\n\n var RADIAN = Math.PI / 180;\r\n function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\r\n var rB = semi.rB;\r\n var rB2 = rB * rB;\r\n for (var i = 0; i < semi.list.length; i++) {\r\n var item = semi.list[i];\r\n var dy = Math.abs(item.label.y - cy);\r\n var rA = r + item.len;\r\n var rA2 = rA * rA;\r\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\r\n item.label.x = cx + (dx + item.len2) * dir;\r\n }\r\n }\r\n function recalculateX(items) {\r\n var topSemi = { list: [], maxY: 0 };\r\n var bottomSemi = { list: [], maxY: 0 };\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n var item = items[i];\r\n var semi = item.label.y > cy ? bottomSemi : topSemi;\r\n var dy = Math.abs(item.label.y - cy);\r\n if (dy > semi.maxY) {\r\n var dx = item.label.x - cx - item.len2 * dir;\r\n var rA = r + item.len;\r\n var rB = dx < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n var len = list.length;\r\n for (var i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n var dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n }\r\n function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\r\n var leftList = [];\r\n var rightList = [];\r\n var leftmostX = Number.MAX_VALUE;\r\n var rightmostX = -Number.MAX_VALUE;\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n if (isPositionCenter(layout)) {\r\n continue;\r\n }\r\n var linePoints = layout.linePoints;\r\n if (linePoints) {\r\n var isAlignToEdge = layout.labelAlignTo === 'edge';\r\n var realTextWidth = layout.rect.width;\r\n var targetTextWidth = void 0;\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n if (targetTextWidth < layout.rect.width) {\r\n layout.label.style.width = targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n realTextWidth = targetTextWidth;\r\n }\r\n }\r\n var dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n }\r\n function isPositionCenter(sectorShape) {\r\n return sectorShape.position === 'center';\r\n }\r\n function pieLabelLayout(seriesModel) {\r\n var data = seriesModel.getData();\r\n var labelLayoutList = [];\r\n var cx;\r\n var cy;\r\n var hasLabelRotate = false;\r\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n var viewRect = data.getLayout('viewRect');\r\n var r = data.getLayout('r');\r\n var viewWidth = viewRect.width;\r\n var viewLeft = viewRect.x;\r\n var viewTop = viewRect.y;\r\n var viewHeight = viewRect.height;\r\n function setNotShow(el) {\r\n el.ignore = true;\r\n }\r\n function isLabelShown(label) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (var key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n data.each(function (idx) {\r\n var sector = data.getItemGraphicEl(idx);\r\n var sectorShape = sector.shape;\r\n var label = sector.getTextContent();\r\n var labelLine = sector.getTextGuideLine();\r\n var itemModel = data.getItemModel(idx);\r\n var labelModel = itemModel.getModel('label');\r\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n var labelDistance = labelModel.get('distanceToLabelLine');\r\n var labelAlignTo = labelModel.get('alignTo');\r\n var edgeDistance = parsePercent$2(labelModel.get('edgeDistance'), viewWidth);\r\n var bleedMargin = labelModel.get('bleedMargin');\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent$2(labelLineLen, viewWidth);\r\n var labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent$2(labelLineLen2, viewWidth);\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n return;\r\n }\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n var nx = Math.cos(midAngle);\r\n var ny = Math.sin(midAngle);\r\n var textX;\r\n var textY;\r\n var linePoints;\r\n var textAlign;\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n if (!isLabelInside) {\r\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n var x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n var y3 = y2;\r\n if (labelAlignTo === 'edge') {\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n var labelRotate;\r\n var rotate = labelModel.get('rotate');\r\n if (typeof rotate === 'number') {\r\n labelRotate = rotate * (Math.PI / 180);\r\n }\r\n else {\r\n labelRotate = rotate\r\n ? (nx < 0 ? -midAngle + Math.PI : -midAngle)\r\n : 0;\r\n }\r\n hasLabelRotate = !!labelRotate;\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n if (!isLabelInside) {\r\n var textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n var margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n labelLayoutList.push({\r\n label: label,\r\n labelLine: labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n for (var i = 0; i < labelLayoutList.length; i++) {\r\n var layout = labelLayoutList[i];\r\n var label = layout.label;\r\n var labelLine = layout.labelLine;\r\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n var selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n var linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n labelLine.setShape({ points: linePoints });\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n }\n\n function getSectorCornerRadius(model, shape) {\r\n var cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius];\r\n }\r\n return {\r\n innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),\r\n cornerRadius: parsePercent(cornerRadius[1], shape.r)\r\n };\r\n }\n\n var PiePiece = (function (_super) {\r\n __extends(PiePiece, _super);\r\n function PiePiece(data, idx, startAngle) {\r\n var _this = _super.call(this) || this;\r\n _this.z2 = 2;\r\n var polyline = new Polyline();\r\n var text = new ZRText();\r\n _this.setTextGuideLine(polyline);\r\n _this.setTextContent(text);\r\n _this.updateData(data, idx, startAngle, true);\r\n return _this;\r\n }\r\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\r\n var sector = this;\r\n var seriesModel = data.hostModel;\r\n var itemModel = data.getItemModel(idx);\r\n var emphasisModel = itemModel.getModel('emphasis');\r\n var layout = data.getItemLayout(idx);\r\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout) || {}, layout);\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n var animationType = seriesModel.getShallow('animationType');\r\n if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle: startAngle, endAngle: startAngle });\r\n initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n setStatesStylesFromModel(sector, itemModel);\r\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n var offset = seriesModel.get('selectedOffset');\r\n var dx = Math.cos(midAngle) * offset;\r\n var dy = Math.sin(midAngle) * offset;\r\n var cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n this._updateLabel(seriesModel, data, idx);\r\n sector.ensureState('emphasis').shape = __assign({ r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0) }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n var labelLine = sector.getTextGuideLine();\r\n var labelText = sector.getTextContent();\r\n extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n enableHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'));\r\n };\r\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\r\n var sector = this;\r\n var itemModel = data.getItemModel(idx);\r\n var labelLineModel = itemModel.getModel('labelLine');\r\n var style = data.getItemVisual(idx, 'style');\r\n var visualColor = style && style.fill;\r\n var visualOpacity = style && style.opacity;\r\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n });\r\n var labelText = sector.getTextContent();\r\n sector.setTextConfig({\r\n position: null,\r\n rotation: null\r\n });\r\n labelText.attr({\r\n z2: 10\r\n });\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n };\r\n return PiePiece;\r\n }(Sector));\r\n var PieView = (function (_super) {\r\n __extends(PieView, _super);\r\n function PieView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.ignoreLabelLineUpdate = true;\r\n return _this;\r\n }\r\n PieView.prototype.init = function () {\r\n var sectorGroup = new Group();\r\n this._sectorGroup = sectorGroup;\r\n };\r\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\r\n var data = seriesModel.getData();\r\n var oldData = this._data;\r\n var group = this.group;\r\n var startAngle;\r\n if (!oldData && data.count() > 0) {\r\n var shape = data.getItemLayout(0);\r\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n var piePiece = new PiePiece(data, idx, startAngle);\r\n data.setItemGraphicEl(idx, piePiece);\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n var piePiece = oldData.getItemGraphicEl(oldIdx);\r\n piePiece.updateData(data, newIdx, startAngle);\r\n piePiece.off('click');\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n var piePiece = oldData.getItemGraphicEl(idx);\r\n removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n pieLabelLayout(seriesModel);\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n };\r\n PieView.prototype.dispose = function () { };\r\n PieView.prototype.containPoint = function (point, seriesModel) {\r\n var data = seriesModel.getData();\r\n var itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n var dx = point[0] - itemLayout.cx;\r\n var dy = point[1] - itemLayout.cy;\r\n var radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n };\r\n PieView.type = 'pie';\r\n return PieView;\r\n }(ChartView));\r\n ChartView.registerClass(PieView);\n\n var PI2$7 = Math.PI * 2;\r\n var RADIAN$1 = Math.PI / 180;\r\n function getViewRect(seriesModel, api) {\r\n return getLayoutRect(seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n }\r\n function pieLayout(seriesType, ecModel, api) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\r\n var data = seriesModel.getData();\r\n var valueDim = data.mapDimension('value');\r\n var viewRect = getViewRect(seriesModel, api);\r\n var center = seriesModel.get('center');\r\n var radius = seriesModel.get('radius');\r\n if (!isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!isArray(center)) {\r\n center = [center, center];\r\n }\r\n var width = parsePercent$2(viewRect.width, api.getWidth());\r\n var height = parsePercent$2(viewRect.height, api.getHeight());\r\n var size = Math.min(width, height);\r\n var cx = parsePercent$2(center[0], width) + viewRect.x;\r\n var cy = parsePercent$2(center[1], height) + viewRect.y;\r\n var r0 = parsePercent$2(radius[0], size / 2);\r\n var r = parsePercent$2(radius[1], size / 2);\r\n var startAngle = -seriesModel.get('startAngle') * RADIAN$1;\r\n var minAngle = seriesModel.get('minAngle') * RADIAN$1;\r\n var validDataCount = 0;\r\n data.each(valueDim, function (value) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n var sum = data.getSum(valueDim);\r\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n var clockwise = seriesModel.get('clockwise');\r\n var roseType = seriesModel.get('roseType');\r\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n var extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n var restAngle = PI2$7;\r\n var valueSumLargerThanMinAngle = 0;\r\n var currentAngle = startAngle;\r\n var dir = clockwise ? 1 : -1;\r\n data.setLayout({ viewRect: viewRect, r: r });\r\n data.each(valueDim, function (value, idx) {\r\n var angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = PI2$7 / validDataCount;\r\n }\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n restAngle -= minAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n var endAngle = currentAngle + dir * angle;\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: currentAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n currentAngle = endAngle;\r\n });\r\n if (restAngle < PI2$7 && validDataCount) {\r\n if (restAngle <= 1e-3) {\r\n var angle_1 = PI2$7 / validDataCount;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_1 = data.getItemLayout(idx);\r\n layout_1.angle = angle_1;\r\n layout_1.startAngle = startAngle + dir * idx * angle_1;\r\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value, idx) {\r\n if (!isNaN(value)) {\r\n var layout_2 = data.getItemLayout(idx);\r\n var angle = layout_2.angle === minAngle\r\n ? minAngle : value * unitRadian;\r\n layout_2.startAngle = currentAngle;\r\n layout_2.endAngle = currentAngle + dir * angle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\n\n function dataFilter(seriesType) {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n var legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n var name = data.getName(idx);\r\n for (var i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n }\n\n createLegacyDataSelectAction('pie', registerAction);\r\n registerLayout(curry(pieLayout, 'pie'));\r\n registerProcessor(dataFilter('pie'));\n\n var DEFAULT_OPTION = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n };\r\n var inner$6 = makeInner();\r\n var decalPaletteScope = {};\r\n function ariaVisual(ecModel, api) {\r\n var ariaModel = ecModel.getModel('aria');\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n var defaultOption = clone(DEFAULT_OPTION);\r\n merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n merge(ariaModel.option, defaultOption, false);\r\n setDecal();\r\n setLabel();\r\n function setDecal() {\r\n var decalModel = ariaModel.getModel('decal');\r\n var useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n var paletteScopeGroupByType_1 = createHashMap();\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!seriesModel.useColorPaletteOnData) {\r\n return;\r\n }\r\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\r\n }\r\n inner$6(seriesModel).scope = decalScope;\r\n });\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (typeof seriesModel.enableAriaDecal === 'function') {\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n var data = seriesModel.getData();\r\n if (seriesModel.useColorPaletteOnData) {\r\n var dataAll_1 = seriesModel.getRawData();\r\n var idxMap_1 = {};\r\n var decalScope_1 = inner$6(seriesModel).scope;\r\n data.each(function (idx) {\r\n var rawIdx = data.getRawIndex(idx);\r\n idxMap_1[rawIdx] = idx;\r\n });\r\n var dataCount_1 = dataAll_1.count();\r\n dataAll_1.each(function (rawIdx) {\r\n var idx = idxMap_1[rawIdx];\r\n var name = dataAll_1.getName(rawIdx) || (rawIdx + '');\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\r\n var specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\r\n var specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n function mergeDecal(specifiedDecal, paletteDecal) {\r\n var resultDecal = specifiedDecal\r\n ? extend(extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n resultDecal.dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n function setLabel() {\r\n var labelLocale = ecModel.getLocaleModel().get('aria');\r\n var labelModel = ariaModel.getModel('label');\r\n labelModel.option = defaults(labelModel.option, labelLocale);\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n var dom = api.getZr().dom;\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n var seriesCnt = ecModel.getSeriesCount();\r\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n var ariaLabel;\r\n if (seriesCnt < 1) {\r\n return;\r\n }\r\n else {\r\n var title = getTitle();\r\n if (title) {\r\n var withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n var seriesLabels_1 = [];\r\n var prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n var seriesLabel = void 0;\r\n var seriesName = seriesModel.get('name');\r\n var withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType)\r\n });\r\n var data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n var partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n var dataLabels = [];\r\n for (var i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n var name_1 = data.getName(i);\r\n var value = retrieveRawValue(data, i);\r\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\r\n dataLabels.push(replace(dataLabel, {\r\n name: name_1,\r\n value: value\r\n }));\r\n }\r\n }\r\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\r\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\r\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\r\n seriesLabels_1.push(seriesLabel);\r\n }\r\n });\r\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n var middleSeparator = separatorModel.get('middle');\r\n var endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n function replace(str, keyValues) {\r\n if (typeof str !== 'string') {\r\n return str;\r\n }\r\n var result = str;\r\n each(keyValues, function (value, key) {\r\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\r\n });\r\n return result;\r\n }\r\n function getTitle() {\r\n var title = ecModel.get('title');\r\n if (title && title.length) {\r\n title = title[0];\r\n }\r\n return title && title.text;\r\n }\r\n function getSeriesTypeName(type) {\r\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\r\n }\r\n }\n\n function ariaPreprocessor(option) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n var aria = option.aria;\r\n if (aria.show != null) {\r\n aria.enabled = aria.show;\r\n }\r\n aria.label = aria.label || {};\r\n each(['description', 'general', 'series', 'data'], function (name) {\r\n if (aria[name] != null) {\r\n aria.label[name] = aria[name];\r\n }\r\n });\r\n }\n\n var PRIORITY_VISUAL_ARIA$1 = PRIORITY.VISUAL.ARIA;\r\n registerPreprocessor(ariaPreprocessor);\r\n registerVisual(PRIORITY_VISUAL_ARIA$1, ariaVisual);\n\n exports.PRIORITY = PRIORITY;\n exports.connect = connect;\n exports.dataTool = dataTool;\n exports.dependencies = dependencies;\n exports.disConnect = disConnect;\n exports.disconnect = disconnect;\n exports.dispose = dispose;\n exports.extendChartView = extendChartView;\n exports.extendComponentModel = extendComponentModel;\n exports.extendComponentView = extendComponentView;\n exports.extendSeriesModel = extendSeriesModel;\n exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions;\n exports.getInstanceByDom = getInstanceByDom;\n exports.getInstanceById = getInstanceById;\n exports.getMap = getMap;\n exports.init = init$1;\n exports.registerAction = registerAction;\n exports.registerCoordinateSystem = registerCoordinateSystem;\n exports.registerLayout = registerLayout;\n exports.registerLoading = registerLoading;\n exports.registerLocale = registerLocale;\n exports.registerMap = registerMap;\n exports.registerPostInit = registerPostInit;\n exports.registerPostUpdate = registerPostUpdate;\n exports.registerPreprocessor = registerPreprocessor;\n exports.registerProcessor = registerProcessor;\n exports.registerTheme = registerTheme;\n exports.registerTransform = registerTransform;\n exports.registerVisual = registerVisual;\n exports.setCanvasCreator = setCanvasCreator;\n exports.version = version;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n"]} \ No newline at end of file diff --git a/dist/echarts.simple.min.js b/dist/echarts.simple.min.js index 5302e0cd9d..fad39fe878 100644 --- a/dist/echarts.simple.min.js +++ b/dist/echarts.simple.min.js @@ -19,4 +19,4 @@ */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).echarts={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function l(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),o,r);if(r)return r(t,n,i),1}}function It(t){return"CANVAS"===t.nodeName.toUpperCase()}var At="undefined"!=typeof window&&!!window.addEventListener,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Lt=[];function Pt(t,e,n,i){return n=n||{},i||!w.canvasSupported?Ot(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Ot(t,e,n),n}function Ot(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(It(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=r-e.top)}if(Dt(Lt,t,i,r))return n.zrX=Lt[0],void(n.zrY=Lt[1])}n.zrX=n.zrY=0}function Rt(t){return t||window.event}function Et(t,e,n){if(null!=(e=Rt(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Pt(t,i,e,n):(Pt(t,e,e,n),r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function Qt(){return[1,0,0,1,0,0]}function Jt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function te(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ee(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=e,t}function ne(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function ie(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=r*n+s*e,t[3]=-r*e+n*s,t[4]=n*o+e*l,t[5]=n*l-e*o,t}function re(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],e=n*a-o*i;return e?(e=1/e,t[0]=a*e,t[1]=-o*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*r)*e,t[5]=(o*r-n*s)*e,t):null}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){jt.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=$t(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),Le(t,e),e):void De(e,0,0,0,1):7===r||9===r?0<=(o=parseInt(i.slice(1,7),16))&&o<=16777215?(De(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),Le(t,e),e):void De(e,0,0,0,1):void 0;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===r){r=i.substr(0,n),o=i.substr(n+1,o-(n+1)).split(","),n=1;switch(r){case"rgba":if(4!==o.length)return 3===o.length?De(e,+o[0],+o[1],+o[2],1):De(e,0,0,0,1);n=Te(o.pop());case"rgb":return 3!==o.length?void De(e,0,0,0,1):(De(e,Me(o[0]),Me(o[1]),Me(o[2]),n),Le(t,e),e);case"hsla":return 4!==o.length?void De(e,0,0,0,1):(o[3]=Te(o[3]),Oe(o,e),Le(t,e),e);case"hsl":return 3!==o.length?void De(e,0,0,0,1):(Oe(o,e),Le(t,e),e);default:return}}De(e,0,0,0,1)}}function Oe(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Te(t[1]),r=Te(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return De(e=e||[],we(255*Ce(r,i,n+1/3)),we(255*Ce(r,i,n)),we(255*Ce(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Re(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Ee(t,e){t=Pe(t);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var Ne=Array.prototype.slice;function ze(t,e,n){return(e-t)*n+t}function Be(t,e,n,i){for(var r=e.length,o=0;o=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(P(e)){var r,o=P((o=e)&&o[0])?2:1;if(0e);u++);u=Math.min(u-1,o-2)}var h,c,p,d,f,g,y,m=r[u+1],v=r[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?Xe:t[a],(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},un.prototype.clone=function(){return new un(this.x,this.y,this.width,this.height)},un.prototype.copy=function(t){un.copy(this,t)},un.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},un.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},un.prototype.isZero=function(){return 0===this.width||0===this.height},un.create=function(t){return new un(t.x,t.y,t.width,t.height)},un.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},un.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function Gn(f,g){var o,a,y=Bn,s=0,m=(f.length,[]);function e(t){var e=o[t],n=a[t],i=o[t+1],r=a[t+1];a[t]=n+r,t===s-3&&(o[t+1]=o[t+2],a[t+1]=a[t+2]),s--;t=Wn(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(r=Hn(f[e+n-1],f,i,r,r-1,g))&&(n<=r?function(t,e,n,i){var r=0;for(r=0;ra[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=Fn(t,n,i,e))this._ux||xr(e-this._yi)>this._uy||this._len<5;return this.addData(lr.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},Ir.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this.addData(lr.C,t,e,n,i,r,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,o):this._ctx.bezierCurveTo(t,e,n,i,r,o)),this._xi=r,this._yi=o,this},Ir.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(lr.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},Ir.prototype.arc=function(t,e,n,i,r,o){Mr[0]=i,Mr[1]=r,Cr(Mr,o),i=Mr[0];var a=(r=Mr[1])-i;return this.addData(lr.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=mr(r)*n+t,this._yi=vr(r)*n+e,this},Ir.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},Ir.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(lr.R,t,e,n,i),this},Ir.prototype.closePath=function(){this.addData(lr.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},Ir.prototype.fill=function(t){t&&t.fill(),this.toStatic()},Ir.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},Ir.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||xr(y)>i||c===e-1)&&(f=Math.sqrt(C*C+y*y),r=g,o=_);break;case lr.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],b=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=Vi(t,n,r,a,f),y=Vi(e,i,o,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(r,o,m,v,g,_,x,b,10),r=x,o=b;break;case lr.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=Xi(t,n,r,p),f=Xi(e,i,o,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case lr.A:var w=t[c++],S=t[c++],M=t[c++],T=t[c++],p=t[c++],x=t[c++],b=x+p;c+=1;t[c++];d&&(a=mr(p)*M+w,s=vr(p)*T+S),f=yr(M,T)*gr(wr,Math.abs(x)),r=mr(b)*M+w,o=vr(b)*T+S;break;case lr.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case lr.Z:var C=a-r,y=s-o;f=Math.sqrt(C*C+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},Ir.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||xr(s-o)>p||m===d-1){if(f){if(u=zr[i=0]+t&&a<=zr[1]+t?l:0}rMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,_,x,x+b,f,g,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case Rr.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(Ar(c,p,w,p,e,i,r)||Ar(w,p,w,S,e,i,r)||Ar(w,S,c,S,e,i,r)||Ar(c,S,c,p,e,i,r))return!0}else l+=Or(w,p,w,S,i,r),l+=Or(c,S,c,p,i,r);break;case Rr.Z:if(n){if(Ar(u,h,c,p,e,i,r))return!0}else l+=Or(u,h,c,p,i,r);u=c,h=p}}return n||(o=h,t=p,Math.abs(o-t)=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,n,i){for(var r=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),p=!0),i.accumWidth=s):(s=Va(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,o=s.lines)):o=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},$s.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},$s.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},$s.prototype.addHover=function(t){},$s.prototype.removeHover=function(t){},$s.prototype.clearHover=function(){},$s.prototype.refreshHover=function(){this._needsRefreshHover=!0},$s.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},$s.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},$s.prototype.clearAnimation=function(){this.animation.clear()},$s.prototype.getWidth=function(){return this.painter.getWidth()},$s.prototype.getHeight=function(){return this.painter.getHeight()},$s.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},$s.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},$s.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},$s.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},$s.prototype.off=function(t,e){this.handler.off(t,e)},$s.prototype.trigger=function(t,e){this.handler.trigger(t,e)},$s.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function el(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function nl(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function il(t){var e=t.toString(),t=e.indexOf("e");if(0"'])/g,lc={"&":"&","<":"<",">":">",'"':""","'":"'"};function uc(t,e){return"{"+t+(null==e?"":e)+"}"}var hc=["a","b","c","d","e","f","g"];function cc(t,e,n){N(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;oe)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return r&&(o[r]=n),e.paletteIdx=(t+1)%a.length,n}}var ip,rp="\0_ec_inner",op=(l(ap,ip=wh),ap.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new wh(i),this._locale=new wh(r),this._optionManager=o},ap.prototype.setOption=function(t,e,n){K(!(rp in t),"please use chart.getOption()");e=up(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},ap.prototype.resetOption=function(t,e){return this._resetOption(t,up(e))},ap.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):Kc(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(r=r.getMediaOption(this)).length&&E(r,function(t){i=!0,this._mergeOption(t,e)},this),i},ap.prototype.mergeOption=function(t){this._mergeOption(t,null)},ap.prototype._mergeOption=function(i,t){var r=this.option,u=this._componentsMap,h=this._componentsCount,n=[],o=it(),c=t&&t.replaceMergeMainTypeMap;Hc(this).datasetMap=it(),E(i,function(t,e){null!=t&&(Tc.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?D(t):_(r[e],t,!0))}),c&&c.each(function(t,e){Tc.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),Tc.topologicalTravel(n,Tc.getAllClassMainTypes(),function(o){var t=function(t,e,n){return(e=qc.get(e))&&(t=e(t))?n.concat(t):n}(this,o,yl(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",n=xl(e,t,n);Cl(n,o,Tc),r[o]=null,u.set(o,null),h.set(o,0);var a=[],s=[],l=0;E(n,function(t,e){var n,i=t.existing,r=t.newOption;r?(n=Tc.getClass(o,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1)):(e=I({componentIndex:e},t.keyInfo),I(i=new n(r,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&Zc(this)},this),this._seriesIndices||Zc(this)},ap.prototype.getOption=function(){var a=D(this.option);return E(a,function(t,e){if(Tc.hasClass(e)){for(var n=yl(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!Tl(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[rp],a},ap.prototype.getTheme=function(){return this._theme},ap.prototype.getLocaleModel=function(){return this._locale},ap.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},ap.prototype.setUpdatePayload=function(t){this._payload=t},ap.prototype.getUpdatePayload=function(){return this._payload},ap.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;ithis.getShallow("animationThreshold")&&(t=!1),!!t},Fd.prototype.restoreData=function(){this.dataTask.dirty()},Fd.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return Jc.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Fd.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Fd.prototype.getProgressive=function(){return this.get("progressive")},Fd.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Fd.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Fd.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;re.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ud(e,n){E(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,T(Yd,n))})}function Yd(t,e){t=Xd(t);return t&&t.setOutputEnd((e||this).count()),e}function Xd(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}x(Bd,rd),x(Bd,Jc),Vl(Bd,Tc);var qd=(Zd.prototype.init=function(t,e){},Zd.prototype.render=function(t,e,n,i){},Zd.prototype.dispose=function(t,e){},Zd.prototype.updateView=function(t,e,n,i){},Zd.prototype.updateLayout=function(t,e,n,i){},Zd.prototype.updateVisual=function(t,e,n,i){},Zd.prototype.blurSeries=function(t,e){},Zd);function Zd(){this.group=new fo,this.uid=Th("viewComponent")}function jd(){var o=Il();return function(t){var e=o(t),n=t.pipelineContext,i=!!e.large,r=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&r==n)&&"reset"}}Fl(qd),Ul(qd,{registerWhenExtend:!0});var Kd=Il(),$d=jd(),Qd=(Jd.prototype.init=function(t,e){},Jd.prototype.render=function(t,e,n,i){},Jd.prototype.highlight=function(t,e,n,i){ef(t.getData(),i,"emphasis")},Jd.prototype.downplay=function(t,e,n,i){ef(t.getData(),i,"normal")},Jd.prototype.remove=function(t,e){this.group.removeAll()},Jd.prototype.dispose=function(t,e){},Jd.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},Jd.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},Jd.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Jd.markUpdateMethod=function(t,e){Kd(t).updateMethod=e},Jd.protoInitialize=void(Jd.prototype.type="chart"),Jd);function Jd(){this.group=new fo,this.uid=Th("viewChart"),this.renderTask=ad({plan:nf,reset:rf}),this.renderTask.context={view:this}}function tf(t,e,n){t&&("emphasis"===e?Du:Iu)(t,n)}function ef(e,t,n){var i,r=Dl(e,t),o=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=$l[i])&&Kl<=32&&(t=$l[i]=Kl++),t):null;null!=r?E(yl(r),function(t){tf(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){tf(t,n,o)})}function nf(t){return $d(t.model)}function rf(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,t=r&&Kd(r).updateMethod,t=o?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,r),of[t]}Fl(Qd),Ul(Qd,{registerWhenExtend:!0});var of={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function af(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},gf.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},gf.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:i,large:e}},gf.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=it();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},gf.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,r=this.api.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";K(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,r,o),t.overallReset&&this._createOverallStageTask(t,e,r,o)},this)},gf.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},gf.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},gf.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},gf.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}E(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(o=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=o.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},gf.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},gf.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},gf.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},gf.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=it(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||ad({plan:xf,reset:bf,count:Mf}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,r).each(l)},gf.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||ad({reset:yf});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=it(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,ad({reset:mf,onDirty:_f})));e.context={model:t,overallProgress:h},e.agent=o,e.__block=h,r._pipe(t,e)}K(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,E(n.getSeries(),p)),c&&o.dirty()},gf.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},gf.wrapStageHandler=function(t,e){return C(t)&&(t={overallReset:t,seriesType:function(t){Tf=null;try{t(Cf,Df)}catch(t){}return Tf}(t)}),t.uid=Th("stageHandler"),e&&(t.visualType=e),t},gf);function gf(t,e,n,i){this._stageTaskMap=it(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function yf(t){t.overallReset(t.ecModel,t.api,t.payload)}function mf(t){return t.overallProgress&&vf}function vf(){this.agent.dirty(),this.getDownstream().dirty()}function _f(){this.agent&&this.agent.dirty()}function xf(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function bf(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=yl(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else v("Layer of zlevel "+t+" is not valid")},qg.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new ko({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),ly(p,function(t){t=new _o({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},Yy.prototype.convertToPixel=function(t,e){return Cy(this,"convertToPixel",t,e)},Yy.prototype.convertFromPixel=function(t,e){return Cy(this,"convertFromPixel",t,e)},Yy.prototype.containPixel=function(t,r){var o;if(!this._disposed)return E(kl(this._model,t),function(t,i){0<=i.indexOf("Models")&&E(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?o=o||!!n.containPoint(r):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(o=o||e.containPoint(r,t))},this)},this),!!o;$y(this.id)},Yy.prototype.getVisual=function(t,e){var n=kl(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:0}}(t,n,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e);default:0}}(t,e)},Yy.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},Yy.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},Yy.prototype._initEvents=function(){var t,e,n,s=this;ly(Ky,function(a){function t(t){var n,e,i=s.getModel(),r=t.target,o="globalout"===a;o?n={}:r&&Zg(r,function(t){var e=jl(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=I({},e.eventData),1)},!0),n&&(e=n.componentType,o=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",o=n.seriesIndex),o=(e=e&&null!=o&&i.getComponent(e,o))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:e,view:o},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),ly(Jy,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),ly(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(mg("map","selectchanged",e,n,t),mg("pie","selectchanged",e,n,t)):"select"===t.fromAction?(mg("map","selected",e,n,t),mg("pie","selected",e,n,t)):"unselect"===t.fromAction&&(mg("map","unselected",e,n,t),mg("pie","unselected",e,n,t))})},Yy.prototype.isDisposed=function(){return this._disposed},Yy.prototype.clear=function(){this._disposed?$y(this.id):this.setOption({series:[]},!0)},Yy.prototype.dispose=function(){var e,n;this._disposed?$y(this.id):(this._disposed=!0,Ol(this.getDom(),cm,""),e=this._api,n=this._model,ly(this._componentsViews,function(t){t.dispose(n,e)}),ly(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete sm[this.id])},Yy.prototype.resize=function(t){var e;this._disposed?$y(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[cy]=!0,e&&wy(this),Ty.update.call(this,{type:"resize",animation:{duration:0}}),this[cy]=!1,Ay.call(this,t),ky.call(this,t)))},Yy.prototype.showLoading=function(t,e){this._disposed?$y(this.id):(hy(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),am[t]&&(t=am[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},Yy.prototype.hideLoading=function(){this._disposed?$y(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Yy.prototype.makeActionFromEvent=function(t){var e=I({},t);return e.type=Jy[t.type],e},Yy.prototype.dispatchAction=function(t,e){var n;this._disposed?$y(this.id):(hy(e)||(e={silent:!!e}),Qy[t.type]&&this._model&&(this[cy]?this._pendingActions.push(t):(n=e.silent,Iy.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),Ay.call(this,n),ky.call(this,n))))},Yy.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},Yy.prototype.appendData=function(t){var e;this._disposed?$y(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},Yy.internalField=(wy=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Sy(t,!0),Sy(t,!1),e.plan()},Sy=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},zy=function(e,n){ly(im,function(t){t(e,n)})},Hy=function(t){t[dy]=!0,t.getZr().wakeUp()},Wy=function(t){t[dy]&&(t.getZr().storage.traverse(function(t){Ku(t)||Xy(t)}),t[dy]=!1)},By=function(n){return l(t,e=hp),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){Du(t,e),Hy(n)},t.prototype.leaveEmphasis=function(t,e){Iu(t,e),Hy(n)},t.prototype.enterBlur=function(t){wu(t,mu),Hy(n)},t.prototype.leaveBlur=function(t){Au(t),Hy(n)},t.prototype.enterSelect=function(t){ku(t),Hy(n)},t.prototype.leaveSelect=function(t){Lu(t),Hy(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},Fy=function(i){function r(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||Nm(this,d))}this._rawCount=this._count=s,this._extent={},Am(this)},Jm.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,r=this._storage,o=this.dimensions,a=o.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===Pc,p=0;px[1]&&(x[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=Sl(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=Sl(v,null))),this._dontMakeIdFromName||Nm(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},Am(this)}},Jm.prototype.count=function(){return this._count},Jm.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},Jm.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[T][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return l_[1]&&(_[1]=v)}}}return t},Jm.prototype.downSample=function(t,e,n,i){for(var r=Bm(this,[t]),o=r._storage,a=[],s=Gm(1/e),l=o[t],u=this.count(),h=r._rawExtent[t],c=new(km(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r.getRawIndex=Om,r},Jm.prototype.lttbDownSample=function(t,e){var n,i=Bm(this,[]),r=i._storage[t],o=this.count(),a=new(km(this))(o),s=0,l=Gm(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;hi)return!1;return!0}(n,e))){var r=e.mapDimension(n.dim),o={};return E(n.getViewLabels(),function(t){o[t.tickValue]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}}function Kv(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";E(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Qo(0,0,0,0,l,!0);return l[o]=c,l[o+"2"]=e,l}}}(a,r)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(A(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Bu(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;ne[1]&&(e[1]=t[1])},g_.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},g_.prototype.getExtent=function(){return this._extent.slice()},g_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},g_.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},g_.prototype.isBlank=function(){return this._isBlank},g_.prototype.setBlank=function(t){this._isBlank=t},g_);function g_(t){this._setting=t||{},this._extent=[1/0,-1/0]}Ul(f_,{registerWhenExtend:!0});var y_=nl;function m_(t,e,n,i){var r={},o=t[1]-t[0],e=r.interval=ul(o/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),r}function v_(t){return il(t)+2}function __(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function x_(t,e){return t>=e[0]&&t<=e[1]}function b_(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function w_(t,e){return t*(e[1]-e[0])+e[0]}var S_,M_=(l(T_,S_=f_),T_.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},T_.prototype.contain=function(t){return x_(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},T_.prototype.normalize=function(t){return b_(t=this.getCategoryIndex(this.parse(t)),this._extent)},T_.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(w_(t,this._extent))},T_.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},T_.prototype.getMinorTicks=function(t){},T_.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},T_.prototype.getCategorySortInfo=function(){return this._categorySortInfo},T_.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},T_.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},T_.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},T_.prototype.count=function(){return this._extent[1]-this._extent[0]+1},T_.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},T_.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},T_.prototype.getOrdinalMeta=function(){return this._ordinalMeta},T_.prototype.niceTicks=function(){},T_.prototype.niceExtent=function(){},T_.type="ordinal",T_);function T_(t){var e=S_.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return N(t=t||new o_({}))&&(t=new o_({categories:O(t,function(t){return V(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}f_.registerClass(M_);var C_,D_=nl,I_=(l(A_,C_=f_),A_.prototype.parse=function(t){return t},A_.prototype.contain=function(t){return x_(t,this._extent)},A_.prototype.normalize=function(t){return b_(t,this._extent)},A_.prototype.scale=function(t){return w_(t,this._extent)},A_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},A_.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},A_.prototype.getInterval=function(){return this._interval},A_.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=v_(t)},A_.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]s&&(t?o.push({value:D_(s+e,r)}):o.push({value:n[1]})),o},A_.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=G_.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]e[1]&&(e[1]=t[1])})}var mx=Math.PI,vx=(_x.prototype.hasBuilder=function(t){return!!xx[t]},_x.prototype.add=function(t){xx[t](this.opt,this.axisModel,this.group,this._transformGroup)},_x.prototype.getGroup=function(){return this.group},_x.innerTextLayout=function(t,e,n){var i,t=rl(e-t),n=ol(t)?(i=0l[1]?-1:1,o=["start"===u?l[0]-o*s:"end"===u?l[1]+o*s:(l[0]+l[1])/2,Mx(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*mx/180),Mx(u)?c=vx.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var r,t=rl(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=ol(t-mx/2)?(r=i?"bottom":"top","center"):ol(t-1.5*mx)?(r=i?"top":"bottom","center"):(r="middle",t<1.5*mx&&mx/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),rt[1]&&(t[1]=e)}qd.registerClass(Fx),qd.registerClass(Sn),ym(ql.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=it();return t.eachSeries(function(t){kx(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,C,n=[],i=it();l=i,u=n,t.eachSeries(function(t){var e,n,i,r,o,a,s;kx(t)&&(e=(s=Lx(t)).xAxisModel,n=s.yAxisModel,i=e.axis,r=n.axis,o=i.scale.rawExtentInfo,a=r.scale.rawExtentInfo,s=t.getData(),o&&o.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),yx(Gx(l,e).condExtent,s,i.dim),yx(Gx(l,n).condExtent,s,r.dim)))}),C=i,E(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,r=n.axis,o=Gx(C,e),a=Gx(C,n);o.rawExtentInfo=sx(i.scale,e,o.condExtent),a.rawExtentInfo=sx(r.scale,n,a.condExtent),o.rawExtentResult=o.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]a[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],o.coord)&&(i?o.coord=a[1]:e.pop());i&&u(o.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=nl(t),e=nl(e),l?ee[1]&&e.reverse(),e},mb.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},mb.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},mb);function mb(t,e,n,i,r){n=gb.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=r||"bottom",n}vb.prototype.getRect=function(){return this._rect},vb.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),E(n.x,function(t){hx(t.scale,t.model)}),E(n.y,function(t){hx(t.scale,t.model)});var i={};E(n.x,function(t){xb(n,"y",t,i)}),E(n.y,function(t){xb(n,"x",t,i)}),this.resize(this.model,e)},vb.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=yc(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var r=this._axesList;function o(){E(r,function(t){var e,n,i=t.isHorizontal(),r=i?[0,a.width]:[0,a.height],o=t.inverse?1:0;t.setExtent(r[o],r[1-o]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}o(),t&&(E(r,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=px(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),o()),E(this._coordsList,function(t){t.calcAffineTransform()})},vb.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},vb.prototype.getAxes=function(){return this._axesList.slice()},vb.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}V(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;iu&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/r}(i,t,e.hostModel.get("percentPrecision")),n.$vars.push("percent"),n},tw.prototype._defaultLabelLine=function(t){ml(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},tw.type="series.pie",tw.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},tw);function tw(){var t=null!==Jb&&Jb.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}Bd.registerClass(Ac);var ew=Math.PI/180;function nw(t,u,h,c,p,e,n,i,r,o){if(!(t.length<2)){for(var a,s=t.length,l=0;lh?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(o=(r=e.label.x-u-e.len2*p)<(o=c+e.len)?Math.sqrt(i*i/(1-r*r/o/o)):o,n.rB=o,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},hw.type="pie",hw);function hw(){var t=null!==uw&&uw.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}Qd.registerClass(Ac);var cw,pw,dw=2*Math.PI,fw=Math.PI/180;pw=mm,E([[(cw="pie")+"ToggleSelect","toggleSelect"],[cw+"Select","select"],[cw+"UnSelect","unselect"]],function(r){pw(r[0],function(t,e,n){var i;t=I({},t),n.dispatchAction(I(t,{type:r[1],seriesIndex:(t=t,i=[],e.eachComponent({mainType:"series",subType:cw,query:t},function(t){i.push(t.seriesIndex)}),i)}))})}),vm(T(function(t,e,D){e.eachSeriesByType(t,function(t){var r=t.getData(),e=r.mapDimension("value"),n=(l=D,yc(t.getBoxLayoutParams(),{width:l.getWidth(),height:l.getHeight()})),i=t.get("center"),o=t.get("radius");N(o)||(o=[0,o]),N(i)||(i=[i,i]);var a=el(n.width,D.getWidth()),s=el(n.height,D.getHeight()),l=Math.min(a,s),u=el(i[0],a)+n.x,h=el(i[1],s)+n.y,c=el(o[0],l/2),p=el(o[1],l/2),d=-t.get("startAngle")*fw,f=t.get("minAngle")*fw,g=0;r.each(e,function(t){isNaN(t)||g++});var y=r.getSum(e),m=Math.PI/(y||g)*2,v=t.get("clockwise"),_=t.get("roseType"),x=t.get("stillShowZeroSum"),b=r.getDataExtent(e);b[0]=0;var w,S=dw,M=0,T=d,C=v?1:-1;r.setLayout({viewRect:n,r:p}),r.each(e,function(t,e){var n,i;isNaN(t)?r.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:u,cy:h,r0:c,r:_?NaN:p}):((n="area"!==_?0===y&&x?m:t*m:dw/g)c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var r,o,a,s=[],l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),o,r);if(r)return r(t,n,i),1}}function It(t){return"CANVAS"===t.nodeName.toUpperCase()}var At="undefined"!=typeof window&&!!window.addEventListener,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Lt=[];function Pt(t,e,n,i){return n=n||{},i||!w.canvasSupported?Ot(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Ot(t,e,n),n}function Ot(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(It(t)){e=t.getBoundingClientRect();return n.zrX=i-e.left,void(n.zrY=r-e.top)}if(Dt(Lt,t,i,r))return n.zrX=Lt[0],void(n.zrY=Lt[1])}n.zrX=n.zrY=0}function Rt(t){return t||window.event}function Et(t,e,n){if(null!=(e=Rt(e)).zrX)return e;var i=e.type;i&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Pt(t,i,e,n):(Pt(t,e,e,n),r=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0t.getWidth()||n<0||n>t.getHeight()}function Qt(){return[1,0,0,1,0,0]}function Jt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function te(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ee(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],e=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=e,t}function ne(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function ie(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],e=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*e,t[1]=-i*e+a*n,t[2]=r*n+s*e,t[3]=-r*e+n*s,t[4]=n*o+e*l,t[5]=n*l-e*o,t}function re(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],e=n*a-o*i;return e?(e=1/e,t[0]=a*e,t[1]=-o*e,t[2]=-i*e,t[3]=n*e,t[4]=(i*s-a*r)*e,t[5]=(o*r-n*s)*e,t):null}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){jt.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=$t(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),Le(t,e),e):void De(e,0,0,0,1):7===r||9===r?0<=(o=parseInt(i.slice(1,7),16))&&o<=16777215?(De(e,(16711680&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),Le(t,e),e):void De(e,0,0,0,1):void 0;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===r){r=i.substr(0,n),o=i.substr(n+1,o-(n+1)).split(","),n=1;switch(r){case"rgba":if(4!==o.length)return 3===o.length?De(e,+o[0],+o[1],+o[2],1):De(e,0,0,0,1);n=Te(o.pop());case"rgb":return 3!==o.length?void De(e,0,0,0,1):(De(e,Me(o[0]),Me(o[1]),Me(o[2]),n),Le(t,e),e);case"hsla":return 4!==o.length?void De(e,0,0,0,1):(o[3]=Te(o[3]),Oe(o,e),Le(t,e),e);case"hsl":return 3!==o.length?void De(e,0,0,0,1):(Oe(o,e),Le(t,e),e);default:return}}De(e,0,0,0,1)}}function Oe(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Te(t[1]),r=Te(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return De(e=e||[],we(255*Ce(r,i,n+1/3)),we(255*Ce(r,i,n)),we(255*Ce(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Re(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Ee(t,e){t=Pe(t);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var Ne=Array.prototype.slice;function ze(t,e,n){return(e-t)*n+t}function Be(t,e,n,i){for(var r=e.length,o=0;o=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(P(e)){var r,o=P((o=e)&&o[0])?2:1;if(0e);u++);u=Math.min(u-1,o-2)}var h,c,p,d,f,g,y,m=r[u+1],v=r[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(g=m.percent-v.percent)&&(h=(e-v.percent)/g,c=n?this._additiveValue:l?Xe:t[a],(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},un.prototype.clone=function(){return new un(this.x,this.y,this.width,this.height)},un.prototype.copy=function(t){un.copy(this,t)},un.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},un.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},un.prototype.isZero=function(){return 0===this.width||0===this.height},un.create=function(t){return new un(t.x,t.y,t.width,t.height)},un.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},un.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&-1e-5>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function Gn(f,g){var o,a,y=Bn,s=0,m=(f.length,[]);function e(t){var e=o[t],n=a[t],i=o[t+1],r=a[t+1];a[t]=n+r,t===s-3&&(o[t+1]=o[t+2],a[t+1]=a[t+2]),s--;t=Wn(f[i],f,e,n,0,g);e+=t,0!=(n-=t)&&0!==(r=Hn(f[e+n-1],f,i,r,r-1,g))&&(n<=r?function(t,e,n,i){var r=0;for(r=0;ra[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=Fn(t,n,i,e))this._ux||xr(e-this._yi)>this._uy||this._len<5;return this.addData(lr.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},Ir.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this.addData(lr.C,t,e,n,i,r,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,o):this._ctx.bezierCurveTo(t,e,n,i,r,o)),this._xi=r,this._yi=o,this},Ir.prototype.quadraticCurveTo=function(t,e,n,i){return this.addData(lr.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},Ir.prototype.arc=function(t,e,n,i,r,o){Mr[0]=i,Mr[1]=r,Cr(Mr,o),i=Mr[0];var a=(r=Mr[1])-i;return this.addData(lr.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=mr(r)*n+t,this._yi=vr(r)*n+e,this},Ir.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},Ir.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(lr.R,t,e,n,i),this},Ir.prototype.closePath=function(){this.addData(lr.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},Ir.prototype.fill=function(t){t&&t.fill(),this.toStatic()},Ir.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},Ir.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||xr(y)>i||c===e-1)&&(f=Math.sqrt(C*C+y*y),r=g,o=_);break;case lr.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],b=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=Vi(t,n,r,a,f),y=Vi(e,i,o,s,f),m=g-u,f=y-h;c+=Math.sqrt(m*m+f*f),u=g,h=y}return c}(r,o,m,v,g,_,x,b,10),r=x,o=b;break;case lr.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=Xi(t,n,r,p),f=Xi(e,i,o,p),g=d-s,p=f-l;u+=Math.sqrt(g*g+p*p),s=d,l=f}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case lr.A:var w=t[c++],S=t[c++],M=t[c++],T=t[c++],p=t[c++],x=t[c++],b=x+p;c+=1;t[c++];d&&(a=mr(p)*M+w,s=vr(p)*T+S),f=yr(M,T)*gr(wr,Math.abs(x)),r=mr(b)*M+w,o=vr(b)*T+S;break;case lr.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case lr.Z:var C=a-r,y=s-o;f=Math.sqrt(C*C+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},Ir.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,c=this._ux,p=this._uy,d=this._len,f=e<1,g=0,y=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var m=0;mc||xr(s-o)>p||m===d-1){if(f){if(u=zr[i=0]+t&&a<=zr[1]+t?l:0}rMath.PI/2&&c<1.5*Math.PI&&(l=-l),u+=l))}return u}(y,m,_,x,x+b,f,g,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case Rr.R:c=u=a[d++],p=h=a[d++];if(w=c+a[d++],S=p+a[d++],n){if(Ar(c,p,w,p,e,i,r)||Ar(w,p,w,S,e,i,r)||Ar(w,S,c,S,e,i,r)||Ar(c,S,c,p,e,i,r))return!0}else l+=Or(w,p,w,S,i,r),l+=Or(c,S,c,p,i,r);break;case Rr.Z:if(n){if(Ar(u,h,c,p,e,i,r))return!0}else l+=Or(u,h,c,p,i,r);u=c,h=p}}return n||(o=h,t=p,Math.abs(o-t)=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,n,i){for(var r=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),p=!0),i.accumWidth=s):(s=Va(e,c,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,o=s.lines)):o=e.split("\n");for(var d=0;di.len()&&(uthis._sleepAfterStill&&this.animation.stop())},$s.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},$s.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},$s.prototype.addHover=function(t){},$s.prototype.removeHover=function(t){},$s.prototype.clearHover=function(){},$s.prototype.refreshHover=function(){this._needsRefreshHover=!0},$s.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},$s.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},$s.prototype.clearAnimation=function(){this.animation.clear()},$s.prototype.getWidth=function(){return this.painter.getWidth()},$s.prototype.getHeight=function(){return this.painter.getHeight()},$s.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},$s.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},$s.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},$s.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},$s.prototype.off=function(t,e){this.handler.off(t,e)},$s.prototype.trigger=function(t,e){this.handler.trigger(t,e)},$s.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function el(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function nl(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function il(t){var e=t.toString(),t=e.indexOf("e");if(0"'])/g,lc={"&":"&","<":"<",">":">",'"':""","'":"'"};function uc(t,e){return"{"+t+(null==e?"":e)+"}"}var hc=["a","b","c","d","e","f","g"];function cc(t,e,n){N(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;oe)return t[i];return t[n-1]}(i,a):n;if((a=a||n)&&a.length){n=a[t];return r&&(o[r]=n),e.paletteIdx=(t+1)%a.length,n}}var ip,rp="\0_ec_inner",op=(l(ap,ip=wh),ap.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new wh(i),this._locale=new wh(r),this._optionManager=o},ap.prototype.setOption=function(t,e,n){K(!(rp in t),"please use chart.getOption()");e=up(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},ap.prototype.resetOption=function(t,e){return this._resetOption(t,up(e))},ap.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):Kc(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(r=r.getMediaOption(this)).length&&E(r,function(t){i=!0,this._mergeOption(t,e)},this),i},ap.prototype.mergeOption=function(t){this._mergeOption(t,null)},ap.prototype._mergeOption=function(i,t){var r=this.option,u=this._componentsMap,h=this._componentsCount,n=[],o=it(),c=t&&t.replaceMergeMainTypeMap;Hc(this).datasetMap=it(),E(i,function(t,e){null!=t&&(Tc.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?D(t):_(r[e],t,!0))}),c&&c.each(function(t,e){Tc.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),Tc.topologicalTravel(n,Tc.getAllClassMainTypes(),function(o){var t=function(t,e,n){return(e=qc.get(e))&&(t=e(t))?n.concat(t):n}(this,o,yl(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",n=xl(e,t,n);Cl(n,o,Tc),r[o]=null,u.set(o,null),h.set(o,0);var a=[],s=[],l=0;E(n,function(t,e){var n,i=t.existing,r=t.newOption;r?(n=Tc.getClass(o,t.keyInfo.subType,!0),i&&i.constructor===n?(i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1)):(e=I({componentIndex:e},t.keyInfo),I(i=new n(r,this,this,e),e),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0))):i&&(i.mergeOption({},this),i.optionUpdated({},!1)),i?(a.push(i.option),s.push(i),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&Zc(this)},this),this._seriesIndices||Zc(this)},ap.prototype.getOption=function(){var a=D(this.option);return E(a,function(t,e){if(Tc.hasClass(e)){for(var n=yl(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!Tl(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[rp],a},ap.prototype.getTheme=function(){return this._theme},ap.prototype.getLocaleModel=function(){return this._locale},ap.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},ap.prototype.setUpdatePayload=function(t){this._payload=t},ap.prototype.getUpdatePayload=function(){return this._payload},ap.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;ithis.getShallow("animationThreshold")&&(t=!1),!!t},Fd.prototype.restoreData=function(){this.dataTask.dirty()},Fd.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return Jc.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},Fd.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},Fd.prototype.getProgressive=function(){return this.get("progressive")},Fd.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},Fd.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},Fd.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;re.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ud(e,n){E(a(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,T(Yd,n))})}function Yd(t,e){t=Xd(t);return t&&t.setOutputEnd((e||this).count()),e}function Xd(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){e=n.currentTask;return!e||(n=e.agentStubMap)&&(e=n.get(t.uid)),e}}x(Bd,rd),x(Bd,Jc),Vl(Bd,Tc);var qd=(Zd.prototype.init=function(t,e){},Zd.prototype.render=function(t,e,n,i){},Zd.prototype.dispose=function(t,e){},Zd.prototype.updateView=function(t,e,n,i){},Zd.prototype.updateLayout=function(t,e,n,i){},Zd.prototype.updateVisual=function(t,e,n,i){},Zd.prototype.blurSeries=function(t,e){},Zd);function Zd(){this.group=new fo,this.uid=Th("viewComponent")}function jd(){var o=Il();return function(t){var e=o(t),n=t.pipelineContext,i=!!e.large,r=!!e.progressiveRender,t=e.large=!(!n||!n.large),n=e.progressiveRender=!(!n||!n.progressiveRender);return!(i==t&&r==n)&&"reset"}}Fl(qd),Ul(qd,{registerWhenExtend:!0});var Kd=Il(),$d=jd(),Qd=(Jd.prototype.init=function(t,e){},Jd.prototype.render=function(t,e,n,i){},Jd.prototype.highlight=function(t,e,n,i){ef(t.getData(),i,"emphasis")},Jd.prototype.downplay=function(t,e,n,i){ef(t.getData(),i,"normal")},Jd.prototype.remove=function(t,e){this.group.removeAll()},Jd.prototype.dispose=function(t,e){},Jd.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},Jd.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},Jd.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Jd.markUpdateMethod=function(t,e){Kd(t).updateMethod=e},Jd.protoInitialize=void(Jd.prototype.type="chart"),Jd);function Jd(){this.group=new fo,this.uid=Th("viewChart"),this.renderTask=ad({plan:nf,reset:rf}),this.renderTask.context={view:this}}function tf(t,e,n){t&&("emphasis"===e?Du:Iu)(t,n)}function ef(e,t,n){var i,r=Dl(e,t),o=t&&null!=t.highlightKey?(i=t.highlightKey,null==(t=$l[i])&&Kl<=32&&(t=$l[i]=Kl++),t):null;null!=r?E(yl(r),function(t){tf(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){tf(t,n,o)})}function nf(t){return $d(t.model)}function rf(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,t=r&&Kd(r).updateMethod,t=o?"incrementalPrepareRender":t&&a[t]?t:"render";return"render"!==t&&a[t](e,n,i,r),of[t]}Fl(Qd),Ul(Qd,{registerWhenExtend:!0});var of={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function af(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,i=i&&i.modDataCount;return{step:n,modBy:null!=i?Math.ceil(i/n):null,modDataCount:i}}},gf.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},gf.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,e=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:i,large:e}},gf.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=it();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},gf.prototype.prepareStageTasks=function(){var i=this._stageTaskMap,r=this.api.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,{}),n="";K(!(t.reset&&t.overallReset),n),t.reset&&this._createSeriesStageTask(t,e,r,o),t.overallReset&&this._createOverallStageTask(t,e,r,o)},this)},gf.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},gf.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},gf.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},gf.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}E(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(o=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=o.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},gf.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},gf.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},gf.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},gf.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=it(),e=n.seriesType,t=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||ad({plan:xf,reset:bf,count:Mf}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):e?i.eachRawSeriesByType(e,l):t&&t(i,r).each(l)},gf.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||ad({reset:yf});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=it(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,e="";function p(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(c=!0,ad({reset:mf,onDirty:_f})));e.context={model:t,overallProgress:h},e.agent=o,e.__block=h,r._pipe(t,e)}K(!t.createOnAllSeries,e),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,E(n.getSeries(),p)),c&&o.dirty()},gf.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},gf.wrapStageHandler=function(t,e){return C(t)&&(t={overallReset:t,seriesType:function(t){Tf=null;try{t(Cf,Df)}catch(t){}return Tf}(t)}),t.uid=Th("stageHandler"),e&&(t.visualType=e),t},gf);function gf(t,e,n,i){this._stageTaskMap=it(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function yf(t){t.overallReset(t.ecModel,t.api,t.payload)}function mf(t){return t.overallProgress&&vf}function vf(){this.agent.dirty(),this.getDownstream().dirty()}function _f(){this.agent&&this.agent.dirty()}function xf(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function bf(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=yl(t.reset(t.model,t.ecModel,t.api,t.payload));return 1=l}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(s=s.dom).nextSibling?a.insertBefore(e.dom,s.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else v("Layer of zlevel "+t+" is not valid")},qg.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()}return i.connectedBackgroundColor&&f.add(new ko({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),ly(p,function(t){t=new _o({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},Yy.prototype.convertToPixel=function(t,e){return Cy(this,"convertToPixel",t,e)},Yy.prototype.convertFromPixel=function(t,e){return Cy(this,"convertFromPixel",t,e)},Yy.prototype.containPixel=function(t,r){var o;if(!this._disposed)return E(kl(this._model,t),function(t,i){0<=i.indexOf("Models")&&E(t,function(t){var e,n=t.coordinateSystem;n&&n.containPoint?o=o||!!n.containPoint(r):"seriesModels"===i&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(o=o||e.containPoint(r,t))},this)},this),!!o;$y(this.id)},Yy.prototype.getVisual=function(t,e){var n=kl(this._model,t,{defaultMainType:"series"}),t=n.seriesModel;t=t.getData(),n=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?t.indexOfRawIndex(n.dataIndex):null;return null!=n?function(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:0}}(t,n,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e);default:0}}(t,e)},Yy.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},Yy.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},Yy.prototype._initEvents=function(){var t,e,n,s=this;ly(Ky,function(a){function t(t){var n,e,i=s.getModel(),r=t.target,o="globalout"===a;o?n={}:r&&Zg(r,function(t){var e=jl(t);if(e&&null!=e.dataIndex){t=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return n=t&&t.getDataParams(e.dataIndex,e.dataType)||{},1}return e.eventData&&(n=I({},e.eventData),1)},!0),n&&(e=n.componentType,o=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",o=n.seriesIndex),o=(e=e&&null!=o&&i.getComponent(e,o))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:e,view:o},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),ly(Jy,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),ly(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,n=(e=this)._model,t.on("selectchanged",function(t){t.isFromClick?(mg("map","selectchanged",e,n,t),mg("pie","selectchanged",e,n,t)):"select"===t.fromAction?(mg("map","selected",e,n,t),mg("pie","selected",e,n,t)):"unselect"===t.fromAction&&(mg("map","unselected",e,n,t),mg("pie","unselected",e,n,t))})},Yy.prototype.isDisposed=function(){return this._disposed},Yy.prototype.clear=function(){this._disposed?$y(this.id):this.setOption({series:[]},!0)},Yy.prototype.dispose=function(){var e,n;this._disposed?$y(this.id):(this._disposed=!0,Ol(this.getDom(),cm,""),e=this._api,n=this._model,ly(this._componentsViews,function(t){t.dispose(n,e)}),ly(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete sm[this.id])},Yy.prototype.resize=function(t){var e;this._disposed?$y(this.id):(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),t=t&&t.silent,this[cy]=!0,e&&wy(this),Ty.update.call(this,{type:"resize",animation:{duration:0}}),this[cy]=!1,Ay.call(this,t),ky.call(this,t)))},Yy.prototype.showLoading=function(t,e){this._disposed?$y(this.id):(hy(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),am[t]&&(t=am[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},Yy.prototype.hideLoading=function(){this._disposed?$y(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Yy.prototype.makeActionFromEvent=function(t){var e=I({},t);return e.type=Jy[t.type],e},Yy.prototype.dispatchAction=function(t,e){var n;this._disposed?$y(this.id):(hy(e)||(e={silent:!!e}),Qy[t.type]&&this._model&&(this[cy]?this._pendingActions.push(t):(n=e.silent,Iy.call(this,t,n),(e=e.flush)?this._zr.flush():!1!==e&&w.browser.weChat&&this._throttledZrFlush(),Ay.call(this,n),ky.call(this,n))))},Yy.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},Yy.prototype.appendData=function(t){var e;this._disposed?$y(this.id):(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},Yy.internalField=(wy=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Sy(t,!0),Sy(t,!1),e.plan()},Sy=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},zy=function(e,n){ly(im,function(t){t(e,n)})},Hy=function(t){t[dy]=!0,t.getZr().wakeUp()},Wy=function(t){t[dy]&&(t.getZr().storage.traverse(function(t){Ku(t)||Xy(t)}),t[dy]=!1)},By=function(n){return l(t,e=hp),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){Du(t,e),Hy(n)},t.prototype.leaveEmphasis=function(t,e){Iu(t,e),Hy(n)},t.prototype.enterBlur=function(t){wu(t,mu),Hy(n)},t.prototype.leaveBlur=function(t){Au(t),Hy(n)},t.prototype.enterSelect=function(t){ku(t),Hy(n)},t.prototype.leaveSelect=function(t){Lu(t),Hy(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},Fy=function(i){function r(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||Nm(this,d))}this._rawCount=this._count=s,this._extent={},Am(this)},Jm.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,r=this._storage,o=this.dimensions,a=o.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===Pc,p=0;px[1]&&(x[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=Sl(v,null)),v=y.id,null==u[m]&&null!=v&&(u[m]=Sl(v,null))),this._dontMakeIdFromName||Nm(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},Am(this)}},Jm.prototype.count=function(){return this._count},Jm.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},Jm.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[T][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return l_[1]&&(_[1]=v)}}}return t},Jm.prototype.downSample=function(t,e,n,i){for(var r=Bm(this,[t]),o=r._storage,a=[],s=Gm(1/e),l=o[t],u=this.count(),h=r._rawExtent[t],c=new(km(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r.getRawIndex=Om,r},Jm.prototype.lttbDownSample=function(t,e){var n,i=Bm(this,[]),r=i._storage[t],o=this.count(),a=new(km(this))(o),s=0,l=Gm(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;hi)return!1;return!0}(n,e))){var r=e.mapDimension(n.dim),o={};return E(n.getViewLabels(),function(t){o[t.tickValue]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}}function Kv(t){for(var e,n,i=t.length/2;0l[u-1].coord&&(l.reverse(),h.reverse());var c=l[0].coord-10,e=l[u-1].coord+10,p=e-c;if(p<.001)return"transparent";E(l,function(t){t.offset=(t.coord-c)/p}),l.push({offset:u?l[u-1].offset:.5,color:h[1]||"transparent"}),l.unshift({offset:u?l[0].offset:.5,color:h[0]||"transparent"});l=new Qo(0,0,0,0,l,!0);return l[o]=c,l[o+"2"]=e,l}}}(a,r)||a.getVisual("style")[a.getVisual("drawType")],y=t.get(["emphasis","focus"]),M=t.get(["emphasis","blurScope"]);d.useStyle(A(s.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"})),Bu(d,t,"lineStyle"),0e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;ne[1]&&(e[1]=t[1])},g_.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},g_.prototype.getExtent=function(){return this._extent.slice()},g_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},g_.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},g_.prototype.isBlank=function(){return this._isBlank},g_.prototype.setBlank=function(t){this._isBlank=t},g_);function g_(t){this._setting=t||{},this._extent=[1/0,-1/0]}Ul(f_,{registerWhenExtend:!0});var y_=nl;function m_(t,e,n,i){var r={},o=t[1]-t[0],e=r.interval=ul(o/e,!0);null!=n&&ei[1]&&(i[0]=i[1]),r}function v_(t){return il(t)+2}function __(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function x_(t,e){return t>=e[0]&&t<=e[1]}function b_(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function w_(t,e){return t*(e[1]-e[0])+e[0]}var S_,M_=(l(T_,S_=f_),T_.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},T_.prototype.contain=function(t){return x_(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},T_.prototype.normalize=function(t){return b_(t=this.getCategoryIndex(this.parse(t)),this._extent)},T_.prototype.scale=function(t){return t=this.getCategoryIndex(t),Math.round(w_(t,this._extent))},T_.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:this.getCategoryIndex(n)}),n++;return t},T_.prototype.getMinorTicks=function(t){},T_.prototype.setCategorySortInfo=function(t){this._categorySortInfo=t},T_.prototype.getCategorySortInfo=function(){return this._categorySortInfo},T_.prototype.getCategoryIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].beforeSortIndex:t},T_.prototype.getRawIndex=function(t){return this._categorySortInfo.length?this._categorySortInfo[t].ordinalNumber:t},T_.prototype.getLabel=function(t){if(!this.isBlank()){t=this.getRawIndex(t.value),t=this._ordinalMeta.categories[t];return null==t?"":t+""}},T_.prototype.count=function(){return this._extent[1]-this._extent[0]+1},T_.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},T_.prototype.isInExtentRange=function(t){return t=this.getCategoryIndex(t),this._extent[0]<=t&&this._extent[1]>=t},T_.prototype.getOrdinalMeta=function(){return this._ordinalMeta},T_.prototype.niceTicks=function(){},T_.prototype.niceExtent=function(){},T_.type="ordinal",T_);function T_(t){var e=S_.call(this,t)||this;e.type="ordinal";t=e.getSetting("ordinalMeta");return N(t=t||new o_({}))&&(t=new o_({categories:O(t,function(t){return V(t)?t.value:t})})),e._ordinalMeta=t,e._categorySortInfo=[],e._extent=e.getSetting("extent")||[0,t.categories.length-1],e}f_.registerClass(M_);var C_,D_=nl,I_=(l(A_,C_=f_),A_.prototype.parse=function(t){return t},A_.prototype.contain=function(t){return x_(t,this._extent)},A_.prototype.normalize=function(t){return b_(t,this._extent)},A_.prototype.scale=function(t){return w_(t,this._extent)},A_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},A_.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},A_.prototype.getInterval=function(){return this._interval},A_.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=v_(t)},A_.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]s&&(t?o.push({value:D_(s+e,r)}):o.push({value:n[1]})),o},A_.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h=g[0]&&y<=g[1]&&a++)}h=(g[1]-g[0])/d;if(1.5*h=g[0]&&t.value<=g[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n);n=G_.length,n=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]e[1]&&(e[1]=t[1])})}var mx=Math.PI,vx=(_x.prototype.hasBuilder=function(t){return!!xx[t]},_x.prototype.add=function(t){xx[t](this.opt,this.axisModel,this.group,this._transformGroup)},_x.prototype.getGroup=function(){return this.group},_x.innerTextLayout=function(t,e,n){var i,t=rl(e-t),n=ol(t)?(i=0l[1]?-1:1,o=["start"===u?l[0]-o*s:"end"===u?l[1]+o*s:(l[0]+l[1])/2,Mx(u)?t.labelOffset+a*s:0],null!=(s=e.get("nameRotate"))&&(s=s*mx/180),Mx(u)?c=vx.innerTextLayout(t.rotation,null!=s?s:t.rotation,a):(c=function(t,e,n,i){var r,t=rl(n-t),i=i[0]>i[1],i="start"===e&&!i||"start"!==e&&i;i=ol(t-mx/2)?(r=i?"bottom":"top","center"):ol(t-1.5*mx)?(r=i?"top":"bottom","center"):(r="middle",t<1.5*mx&&mx/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),rt[1]&&(t[1]=e)}qd.registerClass(Fx),qd.registerClass(Sn),ym(ql.PROCESSOR.FILTER+10,{getTargetSeries:function(t){var e=it();return t.eachSeries(function(t){kx(t)&&e.set(t.uid,t)}),e},overallReset:function(t,e){var l,u,C,n=[],i=it();l=i,u=n,t.eachSeries(function(t){var e,n,i,r,o,a,s;kx(t)&&(e=(s=Lx(t)).xAxisModel,n=s.yAxisModel,i=e.axis,r=n.axis,o=i.scale.rawExtentInfo,a=r.scale.rawExtentInfo,s=t.getData(),o&&o.frozen||a&&a.frozen||(u.push({seriesModel:t,xAxisModel:e,yAxisModel:n}),yx(Gx(l,e).condExtent,s,i.dim),yx(Gx(l,n).condExtent,s,r.dim)))}),C=i,E(n,function(t){var e=t.xAxisModel,n=t.yAxisModel,i=e.axis,r=n.axis,o=Gx(C,e),a=Gx(C,n);o.rawExtentInfo=sx(i.scale,e,o.condExtent),a.rawExtentInfo=sx(r.scale,n,a.condExtent),o.rawExtentResult=o.rawExtentInfo.calculate(),a.rawExtentResult=a.rawExtentInfo.calculate();var s,l,u=t.seriesModel.getData(),h={},c={};function p(e,t){var n=t.condExtent,t=t.rawExtentResult;"category"===e.type&&(n[0]e.min&&t.modifyDataMinMax("min",n[0]),!e.maxFixed&&n[1]a[1];u(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift());i&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],o.coord)&&(i?o.coord=a[1]:e.pop());i&&u(o.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=nl(t),e=nl(e),l?ee[1]&&e.reverse(),e},mb.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},mb.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setCategorySortInfo(t)},mb);function mb(t,e,n,i,r){n=gb.call(this,t,e,n)||this;return n.index=0,n.type=i||"value",n.position=r||"bottom",n}vb.prototype.getRect=function(){return this._rect},vb.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),E(n.x,function(t){hx(t.scale,t.model)}),E(n.y,function(t){hx(t.scale,t.model)});var i={};E(n.x,function(t){xb(n,"y",t,i)}),E(n.y,function(t){xb(n,"x",t,i)}),this.resize(this.model,e)},vb.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),t=!n&&t.get("containLabel"),a=yc(i,{width:e.getWidth(),height:e.getHeight()});this._rect=a;var r=this._axesList;function o(){E(r,function(t){var e,n,i=t.isHorizontal(),r=i?[0,a.width]:[0,a.height],o=t.inverse?1:0;t.setExtent(r[o],r[1-o]),t=t,e=i?a.x:a.y,i=t.getExtent(),n=i[0]+i[1],t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}})}o(),t&&(E(r,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=px(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),o()),E(this._coordsList,function(t){t.calcAffineTransform()})},vb.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},vb.prototype.getAxes=function(){return this._axesList.slice()},vb.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}V(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;iu&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/r}(i,t,e.hostModel.get("percentPrecision")),n.$vars.push("percent"),n},tw.prototype._defaultLabelLine=function(t){ml(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},tw.type="series.pie",tw.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},tw);function tw(){var t=null!==Jb&&Jb.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}Bd.registerClass(Ac);var ew=Math.PI/180;function nw(t,u,h,c,p,e,n,i,r,o){if(!(t.length<2)){for(var a,s=t.length,l=0;lh?s:a,(i=Math.abs(e.label.y-h))>n.maxY&&(o=(r=e.label.x-u-e.len2*p)<(o=c+e.len)?Math.sqrt(i*i/(1-r*r/o/o)):o,n.rB=o,n.maxY=i),n.list.push(e))}d(a),d(s)}(t)}function d(t){for(var e=t.rB,n=e*e,i=0;i=n.r0}},hw.type="pie",hw);function hw(){var t=null!==uw&&uw.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}Qd.registerClass(Ac);var cw,pw,dw=2*Math.PI,fw=Math.PI/180;pw=mm,E([[(cw="pie")+"ToggleSelect","toggleSelect"],[cw+"Select","select"],[cw+"UnSelect","unselect"]],function(r){pw(r[0],function(t,e,n){var i;t=I({},t),n.dispatchAction(I(t,{type:r[1],seriesIndex:(t=t,i=[],e.eachComponent({mainType:"series",subType:cw,query:t},function(t){i.push(t.seriesIndex)}),i)}))})}),vm(T(function(t,e,D){e.eachSeriesByType(t,function(t){var r=t.getData(),e=r.mapDimension("value"),n=(l=D,yc(t.getBoxLayoutParams(),{width:l.getWidth(),height:l.getHeight()})),i=t.get("center"),o=t.get("radius");N(o)||(o=[0,o]),N(i)||(i=[i,i]);var a=el(n.width,D.getWidth()),s=el(n.height,D.getHeight()),l=Math.min(a,s),u=el(i[0],a)+n.x,h=el(i[1],s)+n.y,c=el(o[0],l/2),p=el(o[1],l/2),d=-t.get("startAngle")*fw,f=t.get("minAngle")*fw,g=0;r.each(e,function(t){isNaN(t)||g++});var y=r.getSum(e),m=Math.PI/(y||g)*2,v=t.get("clockwise"),_=t.get("roseType"),x=t.get("stillShowZeroSum"),b=r.getDataExtent(e);b[0]=0;var w,S=dw,M=0,T=d,C=v?1:-1;r.setLayout({viewRect:n,r:p}),r.each(e,function(t,e){var n,i;isNaN(t)?r.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:u,cy:h,r0:c,r:_?NaN:p}):((n="area"!==_?0===y&&x?m:t*m:dw/g)c?n+=g(u.get(["data","partialData"]),{displayCnt:c}):n+=u.get(["data","allData"]);for(var r,o,a,s=[],l=0;l